:root {
  --bg: #ffffff;
  --ink: #0b1110;
  --ink-2: #1f2d27;
  --muted: #66746d;
  --line: #dfe7e2;
  --soft: #f6faf7;
  --dark: #07120d;
  --dark-2: #101c16;
  --green: #18a957;
  --green-2: #0f7a3a;
  --green-soft: #e9f8ee;
  --warn: #fff7df;
  --shadow-border: 0 0 0 1px rgba(7, 18, 13, 0.08), 0 1px 2px rgba(7, 18, 13, 0.04), 0 10px 28px rgba(7, 18, 13, 0.07);
  --shadow-hover: 0 0 0 1px rgba(24, 169, 87, 0.18), 0 2px 4px rgba(7, 18, 13, 0.06), 0 16px 34px rgba(7, 18, 13, 0.10);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: Inter, Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0;
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  min-height: 42px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 15px;
  background: var(--dark);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition-property: transform, background-color, color, box-shadow, opacity;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(7, 18, 13, 0.14);
}

button:active {
  transform: scale(0.96);
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(24, 169, 87, 0.26);
  outline-offset: 2px;
}

button.secondary {
  background: linear-gradient(135deg, var(--green), var(--green-2));
}

button.ghost {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(7, 18, 13, 0.10);
}

button.ghost:hover {
  box-shadow: 0 0 0 1px rgba(24, 169, 87, 0.35), 0 10px 22px rgba(24, 169, 87, 0.10);
}

button.link {
  background: transparent;
  color: var(--green-2);
  min-height: auto;
  padding: 0;
  border-radius: 6px;
  box-shadow: none;
  text-align: left;
  font-weight: 900;
}

button.link:hover {
  box-shadow: none;
  text-decoration: underline;
  transform: none;
}

button.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

button.danger {
  background: #fff;
  color: #9a2b20;
  box-shadow: 0 0 0 1px rgba(154, 43, 32, 0.18);
}

button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p,
li,
.need-card,
td {
  text-wrap: pretty;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(223, 231, 226, 0.92);
}

.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #fff;
  box-shadow: var(--shadow-border);
  overflow: hidden;
  flex: 0 0 auto;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  display: block;
  outline: 1px solid rgba(0, 0, 0, 0.10);
  outline-offset: -1px;
}

.logo-fallback {
  width: 100%;
  height: 100%;
  display: none;
  place-items: center;
  background: linear-gradient(135deg, #07120d, #173321 60%, #18a957);
  color: #f8fff9;
  font-weight: 950;
}

.eyebrow {
  margin: 0 0 3px;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  color: var(--green-2);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.05;
}

.topbar p {
  margin: 0;
  max-width: 620px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
  text-align: right;
}

.wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.workspace {
  min-width: 0;
}

.panel {
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-border);
}

.intro-panel {
  padding: 18px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  align-items: center;
}

.intro-panel h2 {
  margin: 0 0 7px;
  font-size: clamp(25px, 3vw, 42px);
  line-height: 1;
}

.intro-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  max-width: 760px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  border-radius: 14px;
  background: var(--soft);
  padding: 12px;
  min-height: 74px;
}

.stat b {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.search {
  width: 100%;
  min-height: 48px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  box-shadow: 0 1px 0 rgba(7, 18, 13, 0.03);
}

.section-title {
  margin: 20px 0 11px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.section-title h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.15;
}

.section-title h2:before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 99px;
  background: var(--green);
  vertical-align: 2px;
  box-shadow: 0 0 0 4px rgba(24, 169, 87, 0.12);
}

.section-title span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.type-section {
  margin: 12px 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-border);
  overflow: clip;
}

.type-summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  cursor: pointer;
  list-style: none;
  border-bottom: 1px solid transparent;
}

.type-section.open .type-summary {
  border-bottom-color: var(--line);
}

.summary-left {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.summary-left strong {
  font-size: 19px;
  line-height: 1.15;
}

.summary-caret {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  color: #fff;
  background: var(--green);
  font-weight: 950;
  transition-property: transform;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.type-section.open .summary-caret {
  transform: rotate(45deg);
}

.type-section:not(.open) .need-grid {
  display: none;
}

.summary-meta {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.need-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
}

.need-card {
  position: relative;
  width: 100%;
  min-height: 166px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-border);
  overflow: hidden;
  transition-property: transform, box-shadow, background-color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
  cursor: pointer;
}

.need-card:before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--green), rgba(24, 169, 87, 0));
  opacity: 0.78;
}

.need-card:hover {
  box-shadow: var(--shadow-hover);
}

.need-card:focus-visible {
  outline: 3px solid rgba(24, 169, 87, 0.26);
  outline-offset: 2px;
}

.need-card.selected {
  background: linear-gradient(180deg, #f3fbf5, #ffffff 70%);
  box-shadow: 0 0 0 2px rgba(24, 169, 87, 0.42), 0 14px 28px rgba(7, 18, 13, 0.08);
}

.need-card .check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  background: var(--dark);
  color: #fff;
  opacity: 0;
  transform: scale(0.25);
  filter: blur(4px);
  transition-property: opacity, transform, filter;
  transition-duration: 180ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.need-card.selected .check {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

.type-pill {
  display: inline-flex;
  width: max-content;
  max-width: calc(100% - 34px);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-2);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  padding: 5px 8px;
}

.need-text {
  margin: 13px 0 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.3;
  font-weight: 750;
}

.offer-title {
  color: var(--ink);
  font-size: 21px;
  line-height: 1.08;
  font-weight: 950;
}

.card-bottom {
  margin-top: auto;
  padding-top: 12px;
  display: grid;
  gap: 8px;
}

.price-chip {
  border-radius: 12px;
  background: var(--soft);
  padding: 9px 10px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.3;
  font-weight: 800;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.card-action {
  min-height: 34px;
  padding: 0;
  background: transparent;
  color: var(--green-2);
  box-shadow: none;
  font-size: 13px;
  font-weight: 900;
}

.card-action:hover {
  box-shadow: none;
  transform: none;
}

.inline-detail {
  text-decoration: underline;
}

.package-panel {
  position: sticky;
  top: 88px;
  padding: 16px;
  max-height: calc(100vh - 108px);
  overflow: auto;
}

.package-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.package-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.package-count {
  min-width: 34px;
  height: 34px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green-2);
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.empty-state {
  border-radius: 14px;
  background: var(--soft);
  padding: 14px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.summary-list {
  display: grid;
  gap: 7px;
  margin: 12px 0;
}

.summary-list div {
  display: flex;
  gap: 8px;
  align-items: start;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.35;
}

.summary-list div:before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--green);
  margin-top: 6px;
  flex: 0 0 auto;
}

.totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.total-box {
  border-radius: 14px;
  background: var(--dark);
  color: #fff;
  padding: 12px;
  min-height: 82px;
}

.total-box.light {
  background: var(--soft);
  color: var(--ink);
}

.total-box span {
  display: block;
  font-size: 12px;
  color: #c9d8cf;
  line-height: 1.25;
}

.total-box.light span {
  color: var(--muted);
}

.total-box b {
  display: block;
  margin-top: 7px;
  font-size: 20px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.pass-note {
  border-radius: 14px;
  background: var(--warn);
  padding: 11px 12px;
  color: #5d4818;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 750;
}

.selected-offers {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.offer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.offer-row strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}

.offer-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.offer-row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.package-actions {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.table-panel {
  padding: 16px;
}

.table-wrap {
  overflow: auto;
  border-radius: 16px;
  box-shadow: var(--shadow-border);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
  background: #fff;
  font-size: 14px;
}

th {
  position: sticky;
  top: 79px;
  z-index: 5;
  background: var(--dark);
  color: #fff;
  text-align: left;
  padding: 12px;
  font-size: 12px;
  text-transform: uppercase;
}

td {
  border-top: 1px solid var(--line);
  padding: 12px;
  vertical-align: top;
  line-height: 1.4;
}

tr:nth-child(even) td {
  background: #f8fbf9;
}

.services-cell {
  max-width: 420px;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  background: rgba(7, 18, 13, 0.54);
  padding: 22px;
  overflow: auto;
}

.modal.open {
  display: grid;
  place-items: start center;
}

.modal-card {
  width: min(1120px, 100%);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.modal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  background: linear-gradient(135deg, var(--dark), var(--dark-2));
  color: #fff;
}

.modal-copy {
  padding: 26px;
}

.modal-copy h2 {
  margin: 15px 0 11px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 0.98;
}

.modal-copy p {
  margin: 0;
  color: #dbe7df;
  font-size: 15px;
  line-height: 1.5;
  max-width: 720px;
}

.modal-money {
  background: rgba(255, 255, 255, 0.08);
  padding: 22px;
  display: grid;
  align-content: center;
  gap: 13px;
}

.modal-money h3 {
  margin: 0 0 5px;
  color: #b9c9c0;
  font-size: 11px;
  text-transform: uppercase;
}

.modal-money b {
  display: block;
  font-size: 18px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.modal-body {
  padding: 20px 26px 26px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin-top: 15px;
}

.service-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.service-item {
  border-radius: 15px;
  background: var(--soft);
  padding: 13px;
}

.service-item b {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.service-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.stripe-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.stripe-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(7, 18, 13, 0.08);
  padding: 11px;
}

.stripe-row strong {
  display: block;
  font-size: 14px;
}

.stripe-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .package-panel {
    position: relative;
    top: auto;
    max-height: none;
    order: -1;
  }

  .need-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 15px;
  }

  .topbar p {
    text-align: left;
  }

  .wrap {
    padding: 15px;
  }

  .intro-panel {
    grid-template-columns: 1fr;
  }

  .stat-grid,
  .totals,
  .service-list,
  .modal-hero {
    grid-template-columns: 1fr;
  }

  .need-grid {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 10px;
  }

  .modal-copy,
  .modal-body {
    padding: 18px;
  }
}

@media (max-width: 640px) {
  button {
    min-height: 44px;
  }

  .topbar {
    position: relative;
  }

  .topbar-inner {
    gap: 10px;
  }

  .brand-row {
    width: 100%;
  }

  .logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .topbar p {
    display: none;
  }

  .wrap {
    padding: 12px 12px calc(40vh + 28px);
  }

  .nav {
    position: sticky;
    top: 0;
    z-index: 24;
    padding: 8px 0;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .nav button {
    flex: 1 1 auto;
    padding: 9px 10px;
    font-size: 12px;
  }

  .intro-panel {
    padding: 13px;
    margin-bottom: 12px;
  }

  .intro-panel h2 {
    font-size: 24px;
  }

  .intro-panel p {
    font-size: 13px;
  }

  .stat {
    min-height: 58px;
    padding: 10px;
  }

  .stat b {
    font-size: 18px;
  }

  .search {
    min-height: 44px;
    font-size: 14px;
  }

  .type-summary {
    min-height: 48px;
    padding: 11px 12px;
  }

  .summary-left strong {
    font-size: 17px;
  }

  .need-grid {
    gap: 9px;
    padding: 9px;
  }

  .need-card {
    min-height: 152px;
    padding: 13px;
    border-radius: 15px;
  }

  .need-text {
    font-size: 13px;
    margin: 10px 0 6px;
  }

  .offer-title {
    font-size: 18px;
  }

  .price-chip {
    font-size: 12px;
    padding: 8px;
  }

  .card-actions {
    gap: 6px;
  }

  .card-action {
    min-height: 38px;
    padding: 0 6px;
  }

  .package-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 0;
    top: auto;
    z-index: 50;
    max-height: 40vh;
    padding: 12px;
    overflow: auto;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 0 0 1px rgba(7, 18, 13, 0.10), 0 -16px 44px rgba(7, 18, 13, 0.18);
  }

  .package-head {
    position: sticky;
    top: -12px;
    z-index: 1;
    align-items: center;
    margin: -12px -12px 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }

  .package-head h2 {
    font-size: 18px;
  }

  .package-count {
    min-width: 32px;
    height: 32px;
  }

  .package-panel h3,
  .summary-list {
    display: none;
  }

  .totals {
    grid-template-columns: repeat(4, minmax(118px, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
    margin: 0 0 8px;
  }

  .total-box {
    min-height: 62px;
    padding: 9px;
  }

  .total-box b {
    font-size: 17px;
  }

  .pass-note {
    padding: 9px 10px;
    font-size: 12px;
  }

  .selected-offers {
    max-height: 118px;
    overflow: auto;
  }

  .offer-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .offer-row-actions {
    justify-content: stretch;
  }

  .offer-row-actions button {
    flex: 1;
  }

  .package-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .package-actions button {
    padding: 9px 10px;
    font-size: 12px;
  }

  .package-actions .danger {
    grid-column: 1 / -1;
  }

  .modal-copy h2 {
    font-size: 28px;
  }
}
