:root {
  --ink:        #121116;
  --surface:    #1a191f;
  --surface-2:  #222128;
  --surface-3:  #2b2a31;
  --inset:      #100f14;
  --hairline:   rgba(230,207,143,.18);
  --hairline-2: rgba(244,239,230,.08);
  --teal-soft:  rgba(31,157,143,.14);
  --sky-soft:   rgba(59,130,196,.12);
  --r:    12px;
  --r-lg: 20px;
  --radius: 12px;
  --shadow: 0 18px 48px rgba(0,0,0,.45);
  --lift: 0 1px 2px rgba(0,0,0,.25), 0 10px 28px rgba(0,0,0,.28);
}
:root[data-theme="light"] {
  --ink:        #f3f1ec;
  --surface:    #ffffff;
  --surface-2:  #f6f3ed;
  --surface-3:  #ece7dd;
  --inset:      #faf8f4;
  --hairline:   rgba(138,107,35,.24);
  --hairline-2: rgba(26,24,21,.09);
  --teal-soft:  rgba(31,157,143,.10);
  --sky-soft:   rgba(59,130,196,.09);
  --shadow: 0 1px 2px rgba(25,20,10,.05), 0 14px 36px rgba(25,20,10,.10);
  --lift: 0 1px 2px rgba(25,20,10,.04), 0 10px 30px rgba(25,20,10,.07);
}

.marble {
  background-image:
    radial-gradient(55% 60% at 88% 8%, var(--gold-glow), transparent 70%),
    radial-gradient(40% 50% at 6% 96%, var(--teal-soft), transparent 70%),
    radial-gradient(30% 35% at 62% 70%, var(--sky-soft), transparent 70%);
}

.display, .page-head h1, .stat .value, .eng-stat .value, .empty h2, .modal-card h2,
.promo-price strong, .tour-pop h3, .step-n, .plan-price, .panel-empty h2, .stat-grid dd,
.panel-head h2, .headline-value, #estimate, .hp-value, .mc-title, .section-h, .cd-figure,
.acc-kpi .k-val, .mk-head strong, .mk-h, .team-name, .team-kpi .k-val {
  font-family: var(--sans); font-weight: 750; letter-spacing: -.022em;
  font-variant-numeric: lining-nums tabular-nums;
}
.display { line-height: 1.08; }
.page-head h1 { font-size: 30px; }

.nav-brand, .brand-mark {
  font-family: var(--sans); font-weight: 800; letter-spacing: .005em; text-transform: none;
}
.nav-brand { font-size: 19px; }

.eyebrow, .card-head h2, .stat .label, .eng-stat .label, .field > .label, .label,
.search-results .r-group, .search-results .r-ctx, .table th, .table.stacked td::before,
.country-badge, .plan-addons summary, .promo-tag, .preview-label, .compare-col h3, .ms-l,
.plan-badge, .brand-sub, .badge, .control-label, .legend-title, .stat-grid dt, .area-parent,
.block h3, .t-label, .estimate-label, .hp-label, .basis-note, .sub-h, .cost-group,
.acc-kpi .k-lab, .acc-h, .mk-tier-head, .mk-region, .auth-stats dt, .team-kpi .k-lab,
.ghost-btn, .report-btn, .pop-cta, .r-ctx {
  text-transform: none; letter-spacing: 0; font-weight: 600;
}
.card-head h2, .stat .label, .eng-stat .label, .field > .label, .label, .table th,
.preview-label, .ms-l, .control-label, .legend-title, .stat-grid dt, .block h3, .t-label,
.estimate-label, .hp-label, .sub-h, .acc-kpi .k-lab, .acc-h, .auth-stats dt, .team-kpi .k-lab {
  font-size: 12.5px;
}
.card-head h2 { font-size: 15px; font-weight: 700; color: var(--ivory); }
.table.stacked td::before { font-size: 12px; }
.search-results .r-group { font-size: 11.5px; }
.search-results .r-ctx, .r-ctx { font-size: 11.5px; }
.plan h3 { text-transform: none; letter-spacing: -.01em; font-size: 19px; font-weight: 750; }
.compare-col h3 { font-size: 14px; }

.eyebrow {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  background: var(--gold-glow); color: var(--gold-bright); font-size: 12.5px;
}

.btn { border-radius: 999px; font-weight: 600; letter-spacing: 0; transition: background .16s, border-color .16s, color .16s, transform .16s, box-shadow .16s; }
.btn-primary { box-shadow: 0 6px 18px rgba(200,169,81,.22); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(200,169,81,.3); }
.btn-ghost:hover { transform: translateY(-1px); }
.btn-lg { padding: 15px 28px; }

.nav { -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.nav-links a { border-radius: 999px; }
.nav-links a[aria-current="page"] { font-weight: 600; }

.card, .panel, .plan, .modal-card, .welcome-card {
  border-radius: var(--r-lg);
}
.card, .panel, .plan { box-shadow: var(--lift); }
.modal-card { padding: 30px 32px; }

.chip, .src {
  border-radius: 999px; text-transform: none; letter-spacing: 0; font-weight: 600;
  font-size: 11.5px; padding: 4px 10px;
}
.chip-gold { background: var(--gold-glow); }
.src-ine { background: rgba(126,168,122,.12); }
.src-assumido { background: var(--gold-glow); }
.src-indexado { background: rgba(126,168,122,.08); }
.src-declarado { background: var(--gold-glow); }

.options label { border-radius: 999px; padding: 9px 15px; font-size: 13px; }
.options label:has(input:checked) { font-weight: 600; }

.note {
  border-left: 0; border-radius: var(--r); padding: 12px 15px;
  background: var(--gold-glow); color: var(--ivory);
}
.note-warn { background: rgba(181,101,79,.12); }
.note strong { font-weight: 600; }

.table tbody tr:hover { background: var(--gold-glow); }
.table.stacked tr { border-radius: var(--r-lg); }

.search-results { border-radius: var(--r); padding: 6px; }
.search-results li { border-radius: 8px; border-bottom: 0; }

.toast { border-radius: 999px; padding: 12px 20px; }

.empty .rule { display: none; }
.empty h2 { font-size: 22px; }

.stat .value { font-size: 30px; }

@media (max-width: 720px) {
  .nav-drawer .nav-links a { border-radius: 0; }
  .page-head h1 { font-size: 25px; }
}

.num, .est-cell, .est-cell small {
  font-family: var(--sans); font-variant-numeric: lining-nums tabular-nums;
}
.country-badge { border-radius: 999px; }
.legend-nodata { text-transform: none; letter-spacing: 0; font-size: 11.5px; }

.page-head { align-items: center; row-gap: 14px; }
.page-head h1 { line-height: 1.12; }
.page-head .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0 0; }
.storage-note {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
  padding: 3px 11px 3px 9px; border-radius: 999px; border: 1px solid var(--hairline-2);
  font-size: 12px; letter-spacing: 0; line-height: 1.5;
}
.storage-note::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.t-center { text-align: center; }
.nowrap { white-space: nowrap; }
.study-table th, .study-table td { padding-right: 16px; }
.study-table th:last-child, .study-table td:last-child { padding-right: 0; }
.study-table tbody td { vertical-align: middle; }
.st-prop { display: flex; flex-direction: column; gap: 2px; min-width: 96px; }
.st-prop strong { font-size: 15px; font-weight: 700; color: var(--ivory); }
.st-prop span { font-size: 12.5px; color: var(--stone); }
.st-prop .chip { align-self: flex-start; margin-top: 4px; font-style: normal; }
.st-place { display: block; max-width: 260px; line-height: 1.45; }
.study-table .chip { white-space: nowrap; }
.row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.more { position: relative; }
.more-btn { min-width: 36px; font-size: 18px; line-height: 1; padding: 6px 10px; letter-spacing: .05em; }
.more-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 170px;
  display: flex; flex-direction: column; padding: 6px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--hairline); box-shadow: var(--shadow);
}
.more-menu[hidden] { display: none; }
.more-menu button {
  padding: 10px 12px; border: 0; border-radius: 8px; background: none; cursor: pointer;
  font: inherit; font-size: 13.5px; text-align: left; color: var(--ivory);
}
.more-menu button:hover { background: var(--gold-glow); }
.more-menu button.danger { color: var(--bad); }

@media (max-width: 1040px) {
  .table.stacked.study-table tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px;
    padding: 18px 18px 16px; margin-bottom: 14px;
  }
  .table.stacked.study-table td {
    display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
    gap: 4px; padding: 0; text-align: left;
  }
  .table.stacked.study-table td::before { font-size: 11.5px; }
  .table.stacked.study-table td:nth-child(1),
  .table.stacked.study-table td:nth-child(2),
  .table.stacked.study-table td:nth-child(3),
  .table.stacked.study-table td.actions { grid-column: 1 / -1; }
  .table.stacked.study-table td:nth-child(1)::before,
  .table.stacked.study-table td:nth-child(2)::before,
  .table.stacked.study-table td.actions::before { display: none; }
  .table.stacked.study-table td:nth-child(2) { margin-top: -10px; color: var(--stone); }
  .study-table .st-prop { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
  .study-table .st-prop strong { font-size: 18px; }
  .study-table .st-prop span { font-size: 14px; }
  .table.stacked.study-table .est-cell { align-items: flex-start; }
  .table.stacked.study-table .est-cell small { text-align: left; }
  .table.stacked.study-table td.num { font-size: 15px; }
  .st-place { max-width: none; }
  .table.stacked.study-table td.actions { padding-top: 12px; border-top: 1px solid var(--hairline-2); }
  .row-actions { display: flex; width: 100%; justify-content: stretch; gap: 8px; }
  .row-actions > .btn { flex: 1; min-height: 40px; }
  .row-actions > .btn-quiet { border-color: var(--hairline); }
  .row-actions .more { flex: 0 0 auto; }
}
@media (max-width: 720px) {
  .page-head { flex-direction: column; align-items: stretch; text-align: left; }
  .page-head .spacer { display: none; }
  .page-head > .btn { align-self: stretch; }
}

@media (max-width: 1040px) {
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .grid-4 > .card.stat { padding: 16px; }
  .grid-4 .stat .value { font-size: 26px; }
}

@media (max-width: 720px) {
  .steps-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; overflow: visible; }
  .steps-bar li {
    flex-direction: column; justify-content: center; gap: 6px; padding: 10px 4px;
    text-align: center; font-size: 11.5px; line-height: 1.2; min-width: 0;
  }
  .steps-bar li > span:last-child { overflow-wrap: anywhere; }
  #save-draft { align-self: flex-start; border: 1px solid var(--hairline); }
}

input[type=month], input[type=date], input[type=datetime-local], input[type=time] {
  width: 100%; min-height: 42px; padding: 10px 13px;
  background: var(--inset); border: 1px solid var(--hairline-2);
  border-radius: var(--r); color: var(--ivory);
  font-family: var(--sans); font-size: 14px;
}
:root { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="light"] input[type=month], :root[data-theme="light"] input[type=date],
:root[data-theme="light"] input[type=datetime-local], :root[data-theme="light"] input[type=time] {
  background: var(--surface); border-color: rgba(26,24,21,.18);
}

.data-notice { display: flex; gap: 16px; align-items: center; margin: 0 0 18px; }
.data-notice > div { flex: 1; min-width: 0; }
.data-notice p { margin: 4px 0 0; line-height: 1.55; }
.data-notice .btn { flex-shrink: 0; }
@media (max-width: 720px) {
  .data-notice { flex-direction: column; align-items: stretch; }
}
