/* Taxee — shared styles. Every color is a token; light on :root, dark below. */
:root {
  color-scheme: light;
  --bg: #f3f5f2; --surface: #ffffff; --surface-2: #eef2ef; --surface-3: #e3e9e5;
  --text: #17211d; --muted: #55625c; --border: #d3dbd6; --border-strong: #9aa8a1;
  --brand: #0f6b5c; --brand-hover: #0c5a4d; --brand-ink: #ffffff; --brand-soft: #def0ea; --brand-text: #0d5f52;
  --accent: #f2b33d; --accent-text: #7a4f00; --accent-soft: #fdf1d8;
  --danger: #b42318; --danger-ink: #ffffff; --danger-soft: #fce8e6; --danger-text: #a3241a;
  --warn-text: #7c5200; --warn-soft: #fff3d6; --ok-text: #16704a; --ok-soft: #e1f3e9;
  --focus: #1d5fd6; --shadow: 0 1px 2px rgba(16, 32, 26, .06), 0 4px 16px rgba(16, 32, 26, .06);
  --chart-1: #0f6b5c; --chart-2: #f2b33d; --chart-axis: #55625c;
  --radius: 14px; --radius-sm: 9px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111916; --surface: #18221e; --surface-2: #1f2b26; --surface-3: #283731;
    --text: #e6eeea; --muted: #a2b1aa; --border: #31413a; --border-strong: #5c6e66;
    --brand: #3db29a; --brand-hover: #52c4ac; --brand-ink: #08130f; --brand-soft: #173a31; --brand-text: #6fd2bc;
    --accent: #f2b33d; --accent-text: #f5c96e; --accent-soft: #3a2e13;
    --danger: #f0776a; --danger-ink: #1a0806; --danger-soft: #3b1d1a; --danger-text: #ff9d91;
    --warn-text: #f4c967; --warn-soft: #362b10; --ok-text: #6fd6a3; --ok-soft: #143128;
    --focus: #7aa7ff; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .25);
    --chart-1: #3db29a; --chart-2: #f2b33d; --chart-axis: #a2b1aa;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111916; --surface: #18221e; --surface-2: #1f2b26; --surface-3: #283731;
  --text: #e6eeea; --muted: #a2b1aa; --border: #31413a; --border-strong: #5c6e66;
  --brand: #3db29a; --brand-hover: #52c4ac; --brand-ink: #08130f; --brand-soft: #173a31; --brand-text: #6fd2bc;
  --accent: #f2b33d; --accent-text: #f5c96e; --accent-soft: #3a2e13;
  --danger: #f0776a; --danger-ink: #1a0806; --danger-soft: #3b1d1a; --danger-text: #ff9d91;
  --warn-text: #f4c967; --warn-soft: #362b10; --ok-text: #6fd6a3; --ok-soft: #143128;
  --focus: #7aa7ff; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .25);
  --chart-1: #3db29a; --chart-2: #f2b33d; --chart-axis: #a2b1aa;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 20px 16px 32px; }
main.bare { display: flex; align-items: flex-start; justify-content: center; padding-top: 6vh; }
a { color: var(--brand-text); text-underline-offset: 2px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .5em; }
h3 { font-size: 1rem; margin: 0 0 .5em; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .center { text-align: center; } .hint { color: var(--muted); font-weight: 400; font-size: .85em; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.danger-text { color: var(--danger-text); } .warn-text { color: var(--warn-text); } .ok-text { color: var(--ok-text); }

/* Header & footer */
.site-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 750; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.header-right { display: flex; align-items: center; gap: 8px; }
.site-footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.site-footer a { color: var(--muted); }
body.app .site-footer { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.footer-theme { display: flex; justify-content: center; padding-bottom: 18px; }
.banner { padding: 10px 16px; text-align: center; font-weight: 600; }
.banner.danger { background: var(--danger); color: var(--danger-ink); }

.theme-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.theme-switch button { border: 0; background: transparent; color: var(--muted); width: 32px; height: 30px; font-size: 15px; cursor: pointer; }
.theme-switch button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }

/* Account menu */
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; border-radius: 999px; }
.menu summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; z-index: 40; }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }
.menu-pop form { margin: 0; }
.menu-who { display: flex; gap: 10px; align-items: center; padding: 8px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-who span { display: block; color: var(--muted); font-size: .85rem; word-break: break-all; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand-text); font-weight: 700; font-size: .8rem; border: 1px solid var(--border); }
.avatar.lg { width: 46px; height: 46px; font-size: 1rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-hover); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.danger { background: var(--danger); color: var(--danger-ink); }
.btn.xl { min-height: 54px; font-size: 1.08rem; padding: 12px 24px; width: 100%; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn.tiny { min-height: 30px; padding: 4px 10px; font-size: .8rem; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.linklike { background: none; border: 0; color: var(--brand-text); font: inherit; text-decoration: underline; cursor: pointer; padding: 6px 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn-row form { margin: 0; }

/* Forms */
label { display: block; font-weight: 600; font-size: .92rem; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; min-height: 44px; padding: 10px 12px; font: inherit; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; }
textarea { min-height: 80px; resize: vertical; }
input:disabled { background: var(--surface-2); }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; margin: 0; display: inline-block; accent-color: var(--brand); flex: none; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.stack { display: grid; gap: 14px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 10px 0; }
.inline-form label { flex: 1 1 140px; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

/* Cards & alerts */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.highlight { border-color: var(--brand); background: var(--brand-soft); }
.card.warn { border-color: var(--warn-text); }
.card.danger-zone { border-color: var(--danger); }
.alert { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); margin: 0 0 14px; }
.alert.danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-text); }
.alert.ok { background: var(--ok-soft); border-color: var(--ok-text); color: var(--ok-text); }
.alert.warn { background: var(--warn-soft); border-color: var(--warn-text); color: var(--warn-text); }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text); }
.badge.accent { background: var(--brand-soft); color: var(--brand-text); }
.badge.danger { background: var(--danger-soft); color: var(--danger-text); }
.badge.warn { background: var(--warn-soft); color: var(--warn-text); }
.narrow { max-width: 720px; margin: 0 auto; }
details.sub { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
details.sub summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
details.sub form { margin-top: 10px; }
.identity { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.identity p { margin: 0; }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }

/* Auth */
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px 24px; box-shadow: var(--shadow); }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 750; font-size: 1.3rem; margin-bottom: 18px; }
.sso img { flex: none; }
.sso-benefit { text-align: center; font-size: .86rem; color: var(--muted); margin: 8px 0 0; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .82rem; margin: 22px 0 16px; text-align: center; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.qr { display: flex; justify-content: center; margin: 12px 0; }
.qr svg { background: #ffffff; border-radius: 8px; border: 1px solid var(--border); }
.secret { font-size: 1rem; letter-spacing: .05em; word-break: break-all; }
.codes { columns: 2; list-style: none; padding: 0; font-size: 1.05rem; }
.codes li { margin: 4px 0; }
.ref code { font-size: 1rem; }
.steps { padding-left: 1.2em; }

/* Home */
.hero { text-align: center; max-width: 720px; margin: 3vh auto 24px; }
.hero-icon { border-radius: 20px; box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(1.7rem, 5vw, 2.5rem); margin-top: .5em; }
.lead { font-size: 1.1rem; color: var(--muted); }
.cta { max-width: 380px; margin: 24px auto 0; }
.cta-secondary { margin-top: 12px; font-size: .95rem; }
.features { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 32px 0; }
.features article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.features p { color: var(--muted); margin: 0; }
.faq { max-width: 720px; margin: 0 auto; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 650; }
.legal { max-width: 760px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.legal h2 { margin-top: 1.4em; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
td.ua { max-width: 280px; color: var(--muted); font-size: .8rem; word-break: break-word; }
td.detail { max-width: 340px; word-break: break-word; font-size: .85rem; }
tr.hot td { background: var(--danger-soft); }
tr.muted-row td { opacity: .65; }
tr.denied-row td { background: var(--warn-soft); }
table.compact td { padding: 5px 4px; }

/* Admin */
.admin-wrap { max-width: 1200px; margin: 0 auto; }
.admin-title { display: flex; align-items: center; gap: 10px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--text); border-color: var(--brand); }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.tile span { display: block; color: var(--muted); font-size: .8rem; }
.tile strong { font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.grid3 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid3 .card { margin: 0; }
.chart { width: 100%; height: auto; }
.chart .bar-views { fill: var(--chart-1); opacity: .35; }
.chart .bar-visitors { fill: var(--chart-1); }
.chart .axis { fill: var(--chart-axis); font-size: 11px; }
.legend { font-size: .85rem; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--chart-1); }
.key.k1 { opacity: .35; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters label { flex: 1 1 150px; }
.who { display: flex; gap: 10px; align-items: center; }
td.actions { display: flex; flex-wrap: wrap; gap: 6px; }
td.actions form { margin: 0; }

/* ===== App ===== */
.app-main { flex: 1; width: 100%; max-width: 900px; margin: 0 auto; padding: 0 0 24px; }
.loading { padding: 40px 16px; color: var(--muted); text-align: center; }
.bizbar { display: flex; gap: 8px; align-items: center; padding: 12px 16px 6px; overflow-x: auto; scrollbar-width: none; }
.bizbar::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); flex: none; }
.view { padding: 8px 16px; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 10px; }
.view-head h1 { font-size: 1.35rem; margin: 0; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; margin-bottom: 12px; }
.summary div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.summary span { display: block; font-size: .78rem; color: var(--muted); }
.summary strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.filterbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.filterbar select, .filterbar input { width: auto; flex: 1 1 130px; margin: 0; min-height: 40px; padding: 7px 10px; font-size: .92rem; }
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list li { border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; width: 100%; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.row:hover { background: var(--surface-2); }
.row .sel { display: none; }
.selecting .row .sel { display: inline-block; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-amt { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.row-amt small { display: block; font-weight: 500; color: var(--muted); font-size: .76rem; }
.thumb { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; flex: none; font-size: 20px; border: 1px solid var(--border); }
.flag { font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--warn-soft); color: var(--warn-text); margin-left: 6px; vertical-align: 1px; }
.tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.tag { font-size: .74rem; padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty p { margin: 0 0 14px; }
.more { display: block; margin: 12px auto; }

/* Bottom nav & FAB */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: color-mix(in srgb, var(--surface) 95%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.bottomnav button { background: none; border: 0; color: var(--muted); font: inherit; font-size: .72rem; font-weight: 650; padding: 8px 2px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; min-height: 58px; }
.bottomnav button .ic { font-size: 1.3rem; line-height: 1; }
.bottomnav button[aria-current="page"] { color: var(--brand-text); }
.bottomnav .add .ic { width: 44px; height: 44px; margin-top: -18px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 1.6rem; box-shadow: var(--shadow); border: 3px solid var(--bg); }
@media (min-width: 900px) { .bottomnav { left: 50%; transform: translateX(-50%); bottom: 16px; width: 560px; border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); } }

/* Bulk bar */
.bulkbar { position: fixed; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 31; background: var(--text); color: var(--bg); display: flex; gap: 8px; align-items: center; padding: 10px 14px; overflow-x: auto; }
.bulkbar strong { white-space: nowrap; margin-right: 4px; }
.bulkbar button { flex: none; background: transparent; color: var(--bg); border: 1px solid color-mix(in srgb, var(--bg) 50%, transparent); border-radius: 8px; padding: 7px 11px; font: inherit; font-size: .86rem; font-weight: 650; cursor: pointer; }
@media (min-width: 900px) { .bulkbar { left: 50%; transform: translateX(-50%); width: 720px; bottom: 92px; border-radius: 14px; } }

/* Sheet (dialog) */
dialog.sheet { border: 0; padding: 0; width: 100%; max-width: 600px; max-height: 92vh; border-radius: 20px 20px 0 0; margin: auto auto 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
@media (min-width: 640px) { dialog.sheet { border-radius: 20px; margin: auto; } }
dialog.sheet::backdrop { background: rgba(8, 14, 12, .55); }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--border); }
.sheet-head h2 { margin: 0; font-size: 1.1rem; }
.sheet-body { padding: 16px 18px 20px; display: grid; gap: 14px; }
.sheet-foot { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
.sheet-foot .btn { flex: 1; }
.icon-btn { background: var(--surface-2); border: 0; width: 38px; height: 38px; border-radius: 50%; font-size: 1.1rem; color: var(--text); cursor: pointer; }
.choice-grid { display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.choice:hover { background: var(--surface-2); }
.choice .ic { font-size: 1.7rem; }
.choice strong { display: block; }
.choice span { color: var(--muted); font-size: .88rem; }
.files { display: flex; gap: 10px; flex-wrap: wrap; }
.file { position: relative; width: 92px; }
.file a { display: block; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); text-decoration: none; display: grid; place-items: center; font-size: 30px; }
.file img { width: 100%; height: 100%; object-fit: cover; }
.file .x { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); background: var(--danger); color: var(--danger-ink); cursor: pointer; font-weight: 700; }
.addfile { width: 92px; height: 92px; border-radius: 10px; border: 2px dashed var(--border-strong); display: grid; place-items: center; text-align: center; font-size: .78rem; font-weight: 650; color: var(--muted); cursor: pointer; padding: 4px; }
.addfile input { display: none; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; margin-top: 6px; }
.seg button { border: 0; background: var(--surface); color: var(--text); padding: 9px 14px; font: inherit; font-size: .9rem; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.calc { font-size: .88rem; color: var(--muted); margin-top: 4px; }
.err { color: var(--danger-text); background: var(--danger-soft); padding: 10px 12px; border-radius: 10px; margin: 0; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 60; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow); max-width: 90vw; }
.report-lines td:first-child { width: 48px; color: var(--muted); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.checklist li::before { content: "✓ "; color: var(--ok-text); font-weight: 700; }
.checklist li.bad::before { content: "! "; color: var(--warn-text); }
.biz-card { display: flex; align-items: center; gap: 12px; }
.biz-card .dot { width: 14px; height: 14px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--text); }
/* Keep long option labels from widening the page on phones */
.filterbar > * { min-width: 0; max-width: 100%; }
select { max-width: 100%; text-overflow: ellipsis; }
.view, .app-main { min-width: 0; overflow-x: clip; }

.files.drop { outline: 3px dashed var(--brand); outline-offset: 4px; border-radius: 12px; }
button.addfile { background: none; font: inherit; font-size: .78rem; font-weight: 650; color: var(--muted); }
.report-lines .line-row td { font-weight: 650; }
.report-lines .sub-row td { color: var(--muted); font-size: .86rem; border-bottom-style: dashed; padding-top: 4px; padding-bottom: 4px; }
.report-lines .sub-row td:nth-child(2) { padding-left: 22px; }
.report-lines .total-row td { border-top: 2px solid var(--border-strong); }
.send-with { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; display: grid; gap: 8px; margin: 0; }
.send-with legend { font-weight: 700; padding: 0 6px; }
.mail-head { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; }
.self-end { align-self: end; }
/* Line totals fit a phone: fixed columns, the category column wraps */
.report-lines { table-layout: fixed; width: 100%; }
.report-lines th:nth-child(1), .report-lines td:nth-child(1) { width: 44px; }
.report-lines th:nth-child(3), .report-lines td:nth-child(3) { width: 48px; }
.report-lines th:nth-child(4), .report-lines td:nth-child(4) { width: 96px; }
.report-lines td:nth-child(2) { overflow-wrap: anywhere; }
@media (max-width: 420px) { .report-lines th, .report-lines td { padding-left: 6px; padding-right: 6px; } }
