/* Etsy Tax Summary: tool-specific styles. Shared system lives in /assets/tools.css. Accent: ledger plum #5b2d56. */
/* tools.css computes --accent-soft on :root from the default accent, so it is recomputed here from this tool’s accent. */
body { --accent-text: var(--accent); --accent-soft: color-mix(in oklab, var(--accent) 10%, var(--paper)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body { --accent-text: #d8a7cd; } }
:root[data-theme="dark"] body { --accent-text: #d8a7cd; }
.num, .etx td.num, .etx th.num { font-variant-numeric: tabular-nums; }

/* ---------- Hero ---------- */
.etx-hero { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 12px clamp(24px, 4vw, 64px); align-items: end; padding-bottom: 28px; }
.etx-hero h1 { font-size: clamp(31px, 3.6vw, 48px); text-wrap: balance; }
.etx-hero .lede { margin: 0; font-size: 17px; }
.etx-hero .facts { margin-top: 14px; }
@media (max-width: 860px) { .etx-hero { grid-template-columns: 1fr; align-items: start; } }

/* ---------- Tool shell ---------- */
.etx { border: 1px solid var(--line-2); border-radius: 14px; background: var(--card); overflow: clip; position: relative; }
.etx.is-over::after { content: ""; position: absolute; inset: 8px; border: 2px dashed var(--accent); border-radius: 10px; background: color-mix(in oklab, var(--accent-soft) 70%, transparent); pointer-events: none; }
.linklike { font: inherit; color: var(--accent-text); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; cursor: pointer; }
.linklike:hover { color: var(--ink); }

/* Empty state */
.etx-empty { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.etx-drop { min-height: 340px; margin: 18px; border-radius: 12px; gap: 10px; padding: 32px 22px; background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 22px 22px, var(--paper); }
.etx-drop strong { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.etx-drop .small { max-width: 38ch; }
.etx-drop-art { color: var(--ink-2); margin-bottom: 4px; }
.etx-drop .btn { margin-top: 6px; pointer-events: none; }
.etx-how { padding: 26px 26px 24px 8px; display: grid; align-content: start; gap: 6px; }
.etx-steps { margin-top: 10px; gap: 14px; }
.etx-steps li { font-size: 15px; color: var(--ink-2); }
.etx-sample { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink-2); }
@media (max-width: 860px) {
  .etx-empty { grid-template-columns: 1fr; }
  .etx-drop { min-height: 250px; margin: 14px; }
  .etx-how { padding: 4px 20px 22px; }
}

/* Settings bar */
.etx-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--paper); }
.etx-bar .field > span { font-size: 12.5px; }
.etx-f-period { min-width: 230px; }
.etx-f-currency, .etx-f-shop { min-width: 130px; }
.etx-bar .seg button { padding: 7px 12px; }
.etx-bar-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.etx-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.etx-march { flex-basis: 100%; font-size: 14px; }
.etx-sample-note { margin: 0; padding: 10px 20px; font-size: 14px; color: var(--ink-2); background: var(--accent-soft); border-bottom: 1px solid var(--line); }
@media (max-width: 700px) {
  .etx-bar { display: grid; grid-template-columns: 1fr 1fr; padding: 14px 16px; }
  .etx-f-period, .etx-f-region, .etx-bar-actions, .etx-march { grid-column: 1 / -1; min-width: 0; }
  .etx-f-region .seg { width: 100%; }
  .etx-bar-actions { margin-left: 0; }
  .etx-f-currency, .etx-f-shop { min-width: 0; }
}

/* ---------- Main: ledger + side ---------- */
.etx-main { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); border-bottom: 1px solid var(--line); }
@media (max-width: 960px) { .etx-main { grid-template-columns: 1fr; } }

.ledger { padding: 24px 28px 26px; border-right: 1px solid var(--line); min-width: 0; }
@media (max-width: 960px) { .ledger { border-right: 0; border-bottom: 1px solid var(--line); } }
.ledger-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 28px; align-items: end; padding-bottom: 18px; border-bottom: 1px solid var(--ink); }
.ledger-head .eyebrow { margin-bottom: 6px; }
.ledger-head h2 { font-size: clamp(24px, 2.4vw, 30px); }
.ledger-key { display: flex; gap: 28px; margin: 0; }
.ledger-key div { display: grid; gap: 2px; text-align: right; }
.ledger-key dt { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ledger-key dd { margin: 0; font-size: clamp(24px, 2.7vw, 34px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-key div:last-child dd { color: var(--accent-text); }

.ledger-table { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 4px; }
.ledger-table th, .ledger-table td { border: 0; padding: 6px 0; background: none; vertical-align: baseline; }
.ledger-table th { font-weight: 400; font-size: 15px; text-align: left; color: var(--ink); padding-right: 12px; }
.ledger-table td.num { font-family: var(--sans); text-align: right; white-space: nowrap; padding-left: 12px; }
.ledger-table .ln { width: 1%; white-space: nowrap; text-align: right; padding-left: 18px; }
.ledger-table thead th.num { padding-left: 12px; padding-right: 0; }
.ledger-table td.ln { font-family: var(--mono); font-size: 11.5px; color: var(--accent-text); }
.ledger-table thead th { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 0 4px; }
.ledger-table thead th.num, .ledger-table thead th.ln { text-align: right; white-space: nowrap; }
.ledger-empty { padding: 28px 0 8px !important; color: var(--ink-2); }
.ledger-empty p { margin: 0; max-width: 52ch; }
.ledger-table .group th { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 18px; padding-bottom: 2px; }
.ledger-table .sub th { padding-left: 16px; color: var(--muted); font-size: 14px; }
.ledger-table .sub td { color: var(--muted); font-size: 14px; }
.ledger-table .hint-cell { display: block; font-size: 13px; color: var(--muted); }
.ledger-table .subtotal th, .ledger-table .subtotal td { border-top: 1px solid var(--line-2); font-weight: 600; padding-top: 8px; }
.ledger-table .total th, .ledger-table .total td { border-top: 1px solid var(--ink); padding-top: 10px; font-weight: 600; font-size: 17px; }
.ledger-table .total td.num { border-bottom: 3px double var(--ink); }
.ledger-table .neg { color: var(--ink-2); }
.ledger-table .ln-inline { display: none; }
@media (hover: hover) { .ledger-table tbody tr:not(.group):not(.total):hover th, .ledger-table tbody tr:not(.group):not(.total):hover td { background: color-mix(in oklab, var(--paper-2) 60%, transparent); } }

.ledger-memo { margin-top: 24px; padding: 14px 16px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); }
.ledger-memo h3 { font-size: 13px; font-family: var(--mono); font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.ledger-memo dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; margin: 0; font-size: 14.5px; }
.ledger-memo dt { color: var(--ink-2); }
.ledger-memo dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-memo p { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }

@media (max-width: 560px) {
  .ledger { padding: 18px 16px 20px; }
  .ledger-head { grid-template-columns: 1fr; }
  .ledger-key { justify-content: space-between; gap: 12px; }
  .ledger-key div { text-align: left; }
  .ledger-key dd { font-size: 24px; }
  .ledger-table { font-size: 14.5px; }
  .ledger-table th { font-size: 14.5px; }
  .ledger-table td.ln, .ledger-table thead th.ln { display: none; }
  .ledger-table .ln-inline { display: inline-block; margin-left: 6px; font-family: var(--mono); font-size: 10.5px; color: var(--accent-text); white-space: nowrap; }
  .ledger-table .sub th { padding-left: 10px; }
}

/* Side */
.etx-side { padding: 8px 0; min-width: 0; display: grid; align-content: start; }
.side-block { padding: 16px 22px 18px; border-bottom: 1px solid var(--line); }
.side-block:last-child { border-bottom: 0; }
.side-block h3 { font-size: 15px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.side-block p { margin: 0; font-size: 14px; color: var(--ink-2); }
.side-block p + p { margin-top: 8px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checks li { display: grid; grid-template-columns: 14px 1fr; gap: 2px 10px; font-size: 14px; }
.checks li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--ok); grid-row: span 2; }
.checks li[data-state="check"]::before { background: var(--warn); }
.checks li[data-state="info"]::before { background: var(--accent); }
.checks strong { font-weight: 600; }
.checks span { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.k-figure { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.k-figure b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.k-status { margin-top: 10px !important; padding: 8px 10px; border-radius: 8px; background: var(--paper); font-size: 13.5px !important; }
.export-btns { display: grid; gap: 8px; }
.export-btns .btn-primary { width: 100%; }
.export-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side-export .hint { margin-top: 10px; }
.side-export[data-pro="false"] .btn { opacity: .92; }

/* ---------- Blocks below ---------- */
.etx-block { padding: 22px 24px 24px; border-bottom: 1px solid var(--line); min-width: 0; }
.etx-block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 18px; margin-bottom: 12px; }
.etx-block-head h3 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.etx-block-head .hint { max-width: 70ch; }
.etx-two { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.etx-two > .etx-block:first-child { border-right: 1px solid var(--line); }
@media (max-width: 960px) { .etx-two { grid-template-columns: 1fr; } .etx-two > .etx-block:first-child { border-right: 0; } }
@media (max-width: 560px) { .etx-block { padding: 18px 16px 20px; } }

/* Month table */
.etx-months-wrap { margin: 0; }
.etx-months { font-size: 14px; min-width: 820px; }
.etx-months th, .etx-months td { padding: 8px 12px; }
.etx-months thead th { font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: normal; vertical-align: bottom; line-height: 1.3; }
.etx-months td.num { font-family: var(--sans); }
.etx-months tbody th { font-weight: 500; white-space: nowrap; }
.etx-months th:first-child, .etx-months td:first-child { position: sticky; left: 0; background: var(--card); z-index: 1; box-shadow: 1px 0 0 var(--line); }
.etx-months thead th:first-child { background: var(--paper); }
.etx-months tbody tr:nth-child(even) th, .etx-months tbody tr:nth-child(even) td { background: color-mix(in oklab, var(--paper) 55%, var(--card)); }
.etx-months tr.is-empty th, .etx-months tr.is-empty td { color: var(--muted); }
.etx-months tfoot th, .etx-months tfoot td { font-weight: 600; border-top: 1px solid var(--ink); background: var(--paper); }
.etx-months .neg { color: var(--ink-2); }
.etx-months .col-net { font-weight: 600; }

/* Map */
.map-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.map-table td, .map-table th { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; background: none; }
.map-table th { font-weight: 400; text-align: left; padding-right: 14px; }
.map-table .code { font-family: var(--mono); font-size: 12px; color: var(--accent-text); white-space: nowrap; display: block; margin-bottom: 1px; }
.map-table .what { display: block; font-size: 13px; color: var(--muted); }
.map-table td.num { font-family: var(--sans); padding-left: 10px; font-weight: 600; }
.map-table tr.off .code { color: var(--muted); }
.map-table tr.off td.num { font-weight: 400; color: var(--ink-2); }
.map-table tr.total th, .map-table tr.total td { border-top: 1px solid var(--ink); font-weight: 600; }
.map-table tr.costs td.num:empty::after, .map-table td.dim { color: var(--muted); font-weight: 400; }
.map-table tbody tr:last-child th { border-bottom: 0; }
.map-off-h { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 18px !important; }

/* Files */
.etx-shopname { margin-bottom: 12px; max-width: 320px; }
.etx-files { list-style: none; margin: 0; padding: 0; display: grid; }
.etx-files li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.etx-files li:first-child { border-top: 1px solid var(--line); }
.etx-files .fname { font-family: var(--mono); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etx-files .fmeta { grid-column: 1; font-size: 13px; color: var(--muted); }
.etx-files .fwarn { grid-column: 1 / -1; font-size: 13px; color: var(--warn); }
.etx-files .factions { grid-row: 1 / span 2; grid-column: 2; display: flex; align-items: center; gap: 6px; }
.etx-files .factions select { font-size: 13px; padding: 5px 8px; width: auto; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); }
.etx-files-skipped { margin: 10px 0 0; font-size: 13px; color: var(--warn); }

/* Costs */
.cost-form { display: grid; grid-template-columns: 150px 190px minmax(0, 1fr) 130px auto; gap: 10px; align-items: end; }
.cost-form .btn { height: 41px; }
.cost-table { font-size: 14px; }
.cost-table td.num { font-family: var(--sans); }
.cost-table tfoot td, .cost-table tfoot th { font-weight: 600; border-top: 1px solid var(--ink); }
#cost-wrap { margin-top: 14px; }
.cost-lock { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; color: var(--ink-2); }
.cost-lock p { margin: 0; flex: 1 1 320px; }
.etx-costs[data-pro="false"] .cost-form { opacity: .55; }
@media (max-width: 860px) { .cost-form { grid-template-columns: 1fr 1fr; } .cost-form .cost-desc { grid-column: 1 / -1; } }
@media (max-width: 420px) { .cost-form { grid-template-columns: 1fr; } }

/* Details */
.etx-details { border-bottom: 1px solid var(--line); padding: 0 24px; }
.etx-details summary { cursor: pointer; padding: 16px 0; font-weight: 500; }
.etx-details[open] { padding-bottom: 18px; }
.etx-details .hint { margin: 0 0 8px; }
.etx-details:last-of-type { border-bottom: 0; }
@media (max-width: 560px) { .etx-details { padding: 0 16px; } }

.etx-privacy { margin: 12px 2px 0; }
.etx-legal { margin-top: 18px; }

/* Print the on-screen summary cleanly */
@media print {
  .etx-bar, .etx-side .side-export, .etx-costs, .etx-details, .etx-empty, .etx-privacy, #pro, #faq, #guides, .tool-hero .facts { display: none !important; }
  .etx { border: 0; }
  .etx-main { grid-template-columns: 1fr; }
  .etx-months { min-width: 0; font-size: 11px; }
}

/* ---------- Guide pages ---------- */
.g-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: clamp(24px, 4vw, 56px); align-items: start; }
.g-wrap > * { min-width: 0; }
.g-main > section + section { margin-top: 44px; }
.g-main h2 { margin: 0 0 12px; }
.g-main h3 { margin: 22px 0 8px; }
.g-main p, .g-main li { color: var(--ink-2); max-width: 70ch; }
.g-main .table-wrap { margin: 14px 0 6px; }
.g-main table { font-size: 14.5px; }
.g-main td.num, .g-main th.num { font-family: var(--sans); font-variant-numeric: tabular-nums; }
.g-main code { font-family: var(--mono); font-size: .88em; background: var(--paper-2); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.g-main .mono-cell { font-family: var(--mono); font-size: 12.5px; color: var(--ink); overflow-wrap: anywhere; }
.g-main .code-cell { font-family: var(--mono); font-size: 12.5px; color: var(--accent-text); white-space: nowrap; }
.g-aside { position: sticky; top: 84px; display: grid; gap: 14px; }
.g-box { border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); padding: 18px; display: grid; gap: 10px; font-size: 14.5px; }
.g-box h2 { font-size: 13px; font-family: var(--mono); font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; }
.g-box ol { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.g-box a { text-decoration: none; }
.g-box a:hover { text-decoration: underline; }
.g-cta { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.g-cta p { margin: 0; color: color-mix(in oklab, var(--paper) 78%, transparent); }
.g-cta strong { color: var(--paper); font-size: 16px; }
.g-cta .btn-primary { justify-self: start; }
.g-figure { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); overflow: hidden; margin: 18px 0; }
.g-figure div { padding: 16px 18px; border-right: 1px solid var(--line); }
.g-figure div:last-child { border-right: 0; }
.g-figure dt { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.g-figure dd { margin: 4px 0 0; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.g-figure dd small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.g-rows td:first-child { white-space: nowrap; }
@media (max-width: 900px) { .g-wrap { grid-template-columns: 1fr; } .g-aside { position: static; } }
@media (max-width: 560px) { .g-figure div { border-right: 0; border-bottom: 1px solid var(--line); } .g-figure div:last-child { border-bottom: 0; } }
@media (max-width: 640px) {
  .g-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .g-stack, .g-stack tbody, .g-stack tr, .g-stack td { display: block; width: 100%; }
  .g-stack tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .g-stack tbody tr:last-child { border-bottom: 0; }
  .g-stack td { border: 0; padding: 2px 0; }
  .g-stack td:first-child { font-weight: 600; color: var(--ink); white-space: normal; }
  .g-stack .code-cell { display: inline-block; margin: 2px 0; }
}
