:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --side: #fafafa;
  --line: #ececec;
  --line-2: #f3f3f3;
  --text: #111111;
  --muted: #6b6b6b;
  --faint: #9a9a9a;
  --primary: #111111;
  --primary-hover: #2b2b2b;
  --accent: #5b5bd6;
  --green: #16a34a;
  --green-bg: #ecfdf3;
  --amber: #b45309;
  --amber-bg: #fff7ed;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16,16,16,.04), 0 1px 3px rgba(16,16,16,.06);
  --shadow-lg: 0 10px 30px rgba(16,16,16,.10), 0 2px 6px rgba(16,16,16,.06);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }

.ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ico svg { width: 100%; height: 100%; }

/* layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex: none; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 12px; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 20px; }
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { color: var(--muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: #3a3a3a; font-weight: 500; transition: background .12s; }
.nav a:hover { background: #f0f0f0; }
.nav a.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.nav a .ico { color: #7a7a7a; }
.nav a.active .ico { color: var(--text); }
.nav-sep { height: 1px; background: var(--line); margin: 10px 6px; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; font-size: 12px; color: var(--muted); }
.sidebar-foot .stat { display: flex; justify-content: space-between; padding: 3px 0; }
.sidebar-foot b { color: var(--text); font-weight: 600; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 14px 32px; background: rgba(255,255,255,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 18px; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap .ico { position: absolute; left: 10px; color: var(--faint); width: 16px; height: 16px; }
.search-wrap input { width: 300px; padding: 8px 12px 8px 34px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fafafa; outline: none; transition: border .12s, background .12s; }
.search-wrap input:focus { background: #fff; border-color: #cfcfcf; }
.content { padding: 28px 32px 60px; max-width: 1280px; width: 100%; }
.icon-btn.menu-btn { display: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; font-weight: 500; cursor: pointer; transition: background .12s, border .12s, transform .05s; white-space: nowrap; }
.btn:hover { background: #f7f7f7; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .ico { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-bg); border-color: #f5c2c2; }
.btn-lg { padding: 11px 20px; font-size: 15px; border-radius: 10px; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid transparent; background: transparent; border-radius: var(--radius-sm); cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: #f3f3f3; color: var(--text); }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { font-size: 14px; font-weight: 600; }
.card-head .sub { color: var(--muted); font-size: 12px; }
.card-body { padding: 16px 20px; }

.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
.nav a { position: relative; }
.nav-badge { margin-left: auto; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; padding: 4px 8px; border-radius: 999px; }
.nav-badge[hidden] { display: none; }
.two { grid-template-columns: 2fr 1fr; }
.half { grid-template-columns: 1fr 1fr; }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 24px; }

.kpi { padding: 16px 18px; }
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 24px; font-weight: 600; margin-top: 6px; letter-spacing: -0.02em; }
.kpi-note { color: var(--faint); font-size: 12px; margin-top: 2px; }

/* toolbar / filters */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }
.select, .input { padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; outline: none; }
.select:focus, .input:focus, textarea:focus { border-color: #bdbdbd; }
.select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 500; font-size: 13px; color: #444; transition: all .12s; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { background: #f6f6f6; }
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.seg { display: inline-flex; background: #f3f3f3; border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; cursor: pointer; font-weight: 500; font-size: 13px; color: #555; }
.seg button.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }

/* tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line); background: #fcfcfc; white-space: nowrap; position: sticky; top: 0; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr.clickable { cursor: pointer; transition: background .1s; }
.table tr.clickable:hover td { background: #fafafa; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .muted { color: var(--muted); }
.cell-title { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-strong { font-weight: 500; }
.cell-sub { color: var(--muted); font-size: 12px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: #f3f3f3; color: #444; white-space: nowrap; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-violet { background: #f1f0ff; color: var(--accent); }

.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 13px; }

/* lists inside cards */
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.rank-list li:last-child { border-bottom: 0; }
.rank-n { width: 22px; height: 22px; border-radius: 6px; background: #f3f3f3; color: #555; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.rank-main { flex: 1; min-width: 0; }
.rank-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.rank-sub { color: var(--muted); font-size: 12px; }
.rank-val { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-track { height: 6px; border-radius: 99px; background: #f1f1f1; margin-top: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--text); }

/* chart */
.chart { width: 100%; height: 260px; position: relative; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .bar { fill: #111; transition: opacity .12s; }
.chart .bar:hover { opacity: .75; }
.chart .gridline { stroke: #f0f0f0; }
.chart .axis { fill: #9a9a9a; font-size: 11px; }
.chart-tip { position: absolute; pointer-events: none; background: #111; color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; }
.chart-tip.show { opacity: 1; }

/* upload */
.steps { display: flex; gap: 8px; margin-bottom: 20px; }
.step { display: flex; align-items: center; gap: 8px; color: var(--faint); font-weight: 500; font-size: 13px; }
.step .n { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #d6d6d6; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.step.active { color: var(--text); }
.step.active .n { border-color: var(--text); background: var(--text); color: #fff; }
.step.done .n { border-color: var(--green); background: var(--green); color: #fff; }
.step-line { flex: 0 0 32px; height: 1.5px; background: #e2e2e2; align-self: center; }
.dropzone { border: 1.5px dashed #d4d4d4; border-radius: var(--radius); padding: 44px 20px; text-align: center; cursor: pointer; transition: all .15s; background: #fcfcfc; }
.dropzone:hover, .dropzone.drag { border-color: var(--text); background: #f7f7f7; }
.dropzone .dz-icon { width: 44px; height: 44px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow); margin-bottom: 12px; }
.dropzone .dz-title { font-weight: 600; font-size: 15px; }
.dropzone .dz-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.dropzone.small { padding: 22px 16px; }
.shop-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.shop-opt { border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; display: flex; align-items: center; gap: 10px; font-weight: 500; transition: all .12s; background: #fff; }
.shop-opt:hover { border-color: #cfcfcf; }
.shop-opt.active { border-color: var(--text); box-shadow: 0 0 0 3px rgba(17,17,17,.06); }
.label { font-weight: 600; font-size: 13px; margin-bottom: 8px; display: block; }
.help { color: var(--muted); font-size: 13px; }
.help ol { margin: 6px 0 0; padding-left: 18px; }
.help li { margin: 3px 0; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--amber-bg); color: #7c3f06; font-size: 13px; }
.notice.ok { background: var(--green-bg); color: #14532d; }
.notice.info { background: #f5f5ff; color: #3730a3; }
.notice .ico { width: 16px; height: 16px; margin-top: 2px; }
.summary-row { display: flex; gap: 24px; flex-wrap: wrap; }
.summary-row .s { min-width: 110px; }
.summary-row .s-n { font-size: 22px; font-weight: 600; }
.summary-row .s-l { color: var(--muted); font-size: 12px; }

/* file rows */
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; background: #fff; }
.file-ico { width: 34px; height: 34px; border-radius: 8px; background: var(--red-bg); color: var(--red); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex: none; }
.file-main { flex: 1; min-width: 0; }
.file-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-sub { color: var(--muted); font-size: 12px; }
.file-row .input { width: 380px; max-width: 45%; }

/* drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.18); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; }
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 520px; max-width: 100vw; background: #fff; box-shadow: none; transform: translateX(100%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; z-index: 21; display: flex; flex-direction: column; }
.drawer.show { transform: translateX(0); visibility: visible; box-shadow: var(--shadow-lg); transition: transform .22s ease; }
.drawer-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; }
.drawer-head h2 { font-size: 17px; font-weight: 600; }
.drawer-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 13.5px; }
.kv .k { color: var(--muted); }
.section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 22px 0 10px; }
textarea.notes { width: 100%; min-height: 110px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; outline: none; line-height: 1.5; }
.saved-hint { font-size: 12px; color: var(--green); height: 16px; margin-top: 4px; }
.item-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.item-row:last-child { border-bottom: 0; }

/* empty */
.empty { text-align: center; padding: 60px 20px; }
.empty .e-icon { width: 56px; height: 56px; border-radius: 16px; background: #f5f5f5; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; color: #555; }
.empty h2 { font-size: 20px; font-weight: 600; }
.empty p { color: var(--muted); max-width: 440px; margin: 8px auto 20px; }
.welcome-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; text-align: left; margin-top: 28px; }
.welcome-steps .card { padding: 18px; }
.welcome-steps .n { width: 28px; height: 28px; border-radius: 8px; background: #111; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; margin-bottom: 10px; }
.welcome-steps h4 { margin: 0 0 4px; font-size: 14px; }
.welcome-steps p { margin: 0; color: var(--muted); font-size: 13px; }

/* toasts */
.toasts { pointer-events: none; position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: #111; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; gap: 8px; align-items: center; animation: tin .2s ease; max-width: 380px; }
.toast.err { background: var(--red); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; z-index: 30; padding: 20px; }
.modal { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: 440px; max-width: 100%; padding: 22px; }
.modal h3 { font-size: 16px; margin-bottom: 6px; }
.modal p { color: var(--muted); margin: 0 0 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }

/* responsive */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 25; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .sidebar:not(.open) { box-shadow: none; }
  .icon-btn.menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .search-wrap input { width: 160px; }
  .content { padding: 20px 16px 60px; }
  .kpis, .half, .three, .welcome-steps { grid-template-columns: 1fr 1fr; }
  .hide-sm { display: none; }
  .kv { grid-template-columns: 110px 1fr; }
}
@media (max-width: 520px) {
  .kpis, .half, .three, .welcome-steps { grid-template-columns: 1fr; }
  .topbar .search-wrap { display: none; }
}
.sync-status { cursor: default; }
.sync-status.ok { color: var(--green); }
.sync-status.err { color: var(--red); cursor: pointer; }
.sync-status .ico { width: 14px; height: 14px; }
.section-sub { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- phones ---------- */
.grid > *, .row > .input, .input { min-width: 0; }
.tabbar, .m-list { display: none; }
.m-item { padding: 12px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.m-item:active { background: #f7f7f7; }
.m-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.m-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-title { font-size: 13px; color: #444; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 6px; }
.m-meta .badge { font-size: 11px; padding: 1px 7px; }
@media (max-width: 820px) {
  .sidebar, .icon-btn.menu-btn { display: none !important; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 19; background: rgba(255,255,255,.97); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--muted); padding: 4px 0; border-radius: 8px; }
  .tabbar a .ico { width: 20px; height: 20px; }
  .tabbar a.active { color: var(--text); }
  .content { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); left: 16px; right: 16px; align-items: center; }
}
@media (max-width: 640px) {
  html, body { overflow-x: hidden; }
  .topbar { padding: 10px 14px; }
  .topbar h1 { font-size: 18px; }
  .content { padding-left: 12px; padding-right: 12px; padding-top: 14px; }
  .toolbar { gap: 8px; margin-bottom: 12px; }
  .toolbar > * { max-width: 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; max-width: 100%; padding-bottom: 2px; }
  .chips::-webkit-scrollbar, .seg::-webkit-scrollbar { display: none; }
  .chip { white-space: nowrap; flex: none; }
  .seg { display: flex; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .seg button { white-space: nowrap; flex: none; }
  .toolbar .spacer { display: none; }
  .search-wrap { width: 100%; }
  .toolbar .search-wrap input { width: 100%; }
  .toolbar .select { flex: 1; min-width: 0; }
  .kpis { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .kpis > :first-child { grid-column: 1 / -1; }
  .card-head { padding: 14px 16px; flex-wrap: wrap; gap: 4px 10px; }
  .card-body, .card-pad { padding: 14px 16px; }
  .t-orders { display: none; }
  .m-list { display: block; }
  .table th, .table td { padding: 9px 10px; }
  .summary-row { gap: 14px 18px; }
  .summary-row .s { min-width: calc(50% - 10px); }
  .summary-row .s-n { font-size: 18px; }
  .steps .step:not(.active) { font-size: 0; gap: 0; }
  .step-line { flex: 1 1 16px; }
  .shop-pick { grid-template-columns: 1fr 1fr; gap: 8px; }
  .drawer { width: 100vw; height: 100dvh; }
  .drawer-head { padding: 14px 16px; position: sticky; top: 0; background: #fff; z-index: 1; }
  .drawer-body { padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); }
  .kv { grid-template-columns: 96px minmax(0, 1fr); }
  .item-row > * { min-width: 0; }
  .item-row > span:first-child { flex: 1; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1; justify-content: center; }
  .pager { padding: 10px 14px; }
}
@media (max-width: 640px) {
  .shop-opt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 10px 12px; }
}
@media (max-width: 640px) {
  .toolbar .select { flex: 1 1 40%; }
  #ordExport { flex: 1 1 100%; justify-content: center; }
  .shop-pick { grid-template-columns: 1fr; }
  .table-wrap .table td, .table-wrap .table th { white-space: nowrap; }
  .table-wrap .table .cell-title { max-width: 220px; }
}

/* Chat and files */
.chat-page { display: flex; flex-direction: column; height: min(740px, calc(100dvh - 140px)); min-height: 400px; overflow: hidden; }
.chat-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.chat-header h2 { font-size: 16px; }
.chat-header p { font-size: 12px; margin: 3px 0 0; color: var(--muted); }
.chat-list { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.chat-empty { margin: auto; text-align: center; color: var(--muted); max-width: 280px; }
.chat-message { align-self: flex-start; max-width: min(75%, 560px); min-width: 0; }
.chat-message.own { align-self: flex-end; }
.chat-bubble { padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px 14px 14px 3px; background: #f7f7f7; overflow-wrap: anywhere; }
.chat-message.own .chat-bubble { background: #ededfd; border-color: #dcdcfb; border-radius: 14px 14px 3px 14px; }
.chat-text { white-space: pre-wrap; }
.chat-time { font-size: 10px; color: var(--faint); margin: 3px 3px 0; }
.chat-message.own .chat-time { text-align: right; }
.chat-attachment { display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0; border: 1px solid #ddd; border-radius: 8px; background: #fff; text-align: left; padding: 8px 10px; margin-top: 6px; cursor: pointer; }
.chat-attachment:first-child { margin-top: 0; }
.chat-attachment span:not(.ico) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-attachment strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.chat-attachment small { font-size: 11px; color: var(--muted); }
.chat-footer { padding: 12px 18px; border-top: 1px solid var(--line); }
.chat-footer form { display: flex; align-items: flex-end; gap: 8px; }
.chat-footer textarea { resize: vertical; min-height: 42px; max-height: 140px; flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none; }
.chat-footer textarea:focus { border-color: #999; }
.chat-attach { position: relative; }
.chat-selected { font-size: 12px; overflow-wrap: anywhere; }
.chat-selected:not(:empty) { padding-bottom: 8px; }
.chat-selected button { border: 0; background: none; text-decoration: underline; cursor: pointer; }
.chat-hint, .chat-status { font-size: 11px; color: var(--muted); margin-top: 5px; }
.chat-status.chat-error { color: var(--red); }
@media (max-width: 820px) {
  .chat-page { height: calc(100dvh - 182px - env(safe-area-inset-bottom)); min-height: 300px; }
}
@media (max-width: 520px) {
  .chat-header { padding: 12px; align-items: flex-start; }
  .chat-header p { line-height: 1.25; }
  .chat-header .btn { padding: 6px; font-size: 0; }
  .chat-header .btn .ico { width: 18px; height: 18px; }
  .chat-list { padding: 12px; }
  .chat-message { max-width: 88%; }
  .chat-footer { padding: 9px 10px; }
  .chat-attach { padding: 9px; }
  .chat-attach span:not(.ico) { display: none; }
  .chat-hint { font-size: 10px; }
  .tabbar a { font-size: 10px; }
}
/* Client-side reading generator */
.reading-card { max-width: 920px; }
.reading-source { display: block; width: 100%; min-height: min(65vh, 600px); resize: vertical; margin-top: 8px; padding: 14px; line-height: 1.55; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
@media (max-width: 640px) { .reading-source { min-height: 58vh; } .reading-card .card-body { padding: 14px; } .reading-card #readingMake { width: 100%; justify-content: center; } }
@media (max-width: 820px) { .tabbar a { font-size: 10px; min-width: 0; } .tabbar a span:last-child { white-space: nowrap; } }


#clRepeat { display: inline-flex; align-items: center; gap: 6px; }
#clRepeat .ico { width: 14px; height: 14px; }

/* Sales Summary */
.sales-intro p { color: var(--muted); margin: 0 0 12px; }
.sales-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.sales-shop-list { display: grid; gap: 18px; }
.sales-shop-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.sales-shop-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.sales-shop-row .bar-track { margin-bottom: 4px; }
.sales-week-list { display: grid; gap: 11px; margin-top: 22px; }
.sales-week { display: grid; grid-template-columns: 54px minmax(0,1fr) 86px; align-items: center; gap: 8px; font-size: 12px; }
.sales-week-date { color: var(--muted); white-space: nowrap; }
.sales-week-bar { display: flex; height: 16px; min-width: 0; border-radius: 5px; background: #f4f4f4; overflow: hidden; }
.sales-segment { height: 100%; flex: none; min-width: 0; }
.sales-week-total { text-align: right; white-space: nowrap; font-size: 12px; }
.sales-week-detail { grid-column: 2 / 4; font-size: 11px; margin-top: -8px; }
.sales-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 20px; color: var(--muted); font-size: 12px; }
.sales-legend span { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 640px) {
  .sales-controls .seg { max-width: 100%; }
  .sales-week { grid-template-columns: 48px minmax(0,1fr) 75px; gap: 6px; }
  .sales-week-total { font-size: 11px; }
  .sales-week-detail { font-size: 10px; }
  .sales-shop-top strong { white-space: nowrap; }
  .tabbar { overflow-x: auto; scrollbar-width: none; }
  .tabbar a { min-width: 58px; }
}

/* Mobile navigation: four primary destinations and an overflow menu */
.more-menu { display: none; }
@media (max-width: 820px) {
  .tabbar { overflow: visible; }
  .tabbar a, .tabbar button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--muted); padding: 4px 0; border-radius: 8px; border: 0; background: none; cursor: pointer; }
  .tabbar button .ico { width: 20px; height: 20px; }
  .tabbar button.active { color: var(--text); }
  .more-menu:not([hidden]) { display: grid; position: fixed; z-index: 18; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); width: min(260px, calc(100vw - 24px)); max-height: calc(100dvh - 110px); overflow-y: auto; padding: 8px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); }
  .more-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-weight: 500; }
  .more-menu a.active, .more-menu a:hover { background: var(--side); }
}


/* Best sellers in Sales Summary */
.best-shops { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; margin-top: 14px; }
.best-shop { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; min-width: 0; }
.best-shop h4 { margin: 0 0 10px; display: flex; align-items: center; gap: 7px; font-size: 13px; }
.best-shop p { margin: 0; }
.best-list { list-style: none; padding: 0; margin: 0; counter-reset: best; }
.best-list li { counter-increment: best; display: grid; grid-template-columns: 22px minmax(0,1fr) auto; gap: 8px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line-2); font-size: 12px; }
.best-list li::before { content: counter(best) '.'; color: var(--faint); font-weight: 600; }
.best-name { overflow-wrap: anywhere; min-width: 0; }
.best-figures { display: flex; flex-direction: column; align-items: flex-end; text-align: right; white-space: nowrap; }
@media (max-width: 520px) { .best-shop { padding: 12px; } .best-list li { grid-template-columns: 18px minmax(0,1fr); } .best-figures { grid-column: 2; align-items: flex-start; text-align: left; margin-top: -5px; } }

/* Excel Cleaner uses the same card/input style as the rest of Order Book. */
.cleaner-card { max-width: 760px; min-width: 0; }
.cleaner-file { width: 100%; max-width: 100%; }
@media (max-width: 640px) { .cleaner-card .card-body { padding: 14px; } }

/* Site-wide Etsy attribution and legal pages */
.site-footer { margin-top: auto; padding: 20px 32px 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.site-footer p { margin: 0 0 8px; max-width: 920px; }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: baseline; }
.site-footer a { text-decoration: underline; text-underline-offset: 2px; color: var(--text); }
.site-footer a:hover { color: var(--accent); }
.legal-page .main { min-height: 100vh; }
.legal-content { max-width: 780px; }
.legal-content h2 { font-size: 24px; margin: 0 0 24px; }
.legal-content h3 { font-size: 15px; margin: 24px 0 6px; }
.legal-content p { margin: 0 0 14px; line-height: 1.7; }
@media (max-width: 820px) { .site-footer { padding: 20px 16px calc(92px + env(safe-area-inset-bottom)); } .legal-page .site-footer { padding-bottom: 26px; } .legal-page .topbar { padding: 14px 16px; } .legal-page .content { padding: 24px 16px 48px; } }

/* Plainly visible on the app landing page, including before connecting GitHub. */
.etsy-notice { padding: 10px 32px; border-bottom: 1px solid var(--line); color: var(--muted); background: var(--side); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
@media (max-width: 820px) { .etsy-notice { padding: 10px 16px; } }

/* Chart.js cards: corner format selector + fixed-height canvas */
.chart-box { position: relative; }
.chart-wrap { position: relative; margin-bottom: 16px; }
.chart-type { position: absolute; top: 0; right: 0; z-index: 2; font-family: inherit; font-size: 12px; padding: 5px 26px 5px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background-color: #fff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; appearance: none; cursor: pointer; color: var(--text); }
.chart-canvas { height: 260px; }
@media (max-width: 560px) { .chart-canvas { height: 220px; } }

/* Pending orders - Etsy dashboard-style order cards */
.pd-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; overflow: hidden; cursor: pointer; }
.pd-card:hover { border-color: #dcdcdc; }
.pd-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.pd-head-right { display: flex; align-items: center; gap: 10px; }
.pd-body { display: flex; gap: 24px; padding: 12px 16px; }
.pd-items { flex: 1.5; min-width: 0; }
.pd-side { flex: 1; min-width: 0; align-self: flex-start; }
.pd-item { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.pd-item:last-child { border-bottom: 0; }
.pd-thumb { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; flex: none; background: var(--line-2); }
.pd-thumb-empty { display: flex; align-items: center; justify-content: center; color: var(--faint); }
.pd-item-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; overflow-wrap: anywhere; }
.pd-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line-2); background: var(--side); }
@media (max-width: 700px) {
  .pd-body { flex-direction: column; gap: 6px; }
  .pd-side.kv { grid-template-columns: 110px minmax(0, 1fr); }
}
.pd-actions { display: flex; gap: 8px; align-items: center; }
.gen-reading { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 52vh; overflow-y: auto; font-size: 13.5px; line-height: 1.55; background: var(--side); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 4px; }
.gen-reading { white-space: normal; }
.gen-reading p { margin: 0 0 10px; }
.gen-reading .gr-title { font-weight: 700; font-size: 14.5px; margin-bottom: 6px; }
.gen-reading .gr-meta { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.gen-reading .gr-head { font-weight: 700; margin: 16px 0 8px; }
.gen-reading .gr-sub { text-align: center; font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; margin: 12px 0 8px; }
.gen-reading .gr-q { text-align: center; font-style: italic; color: #783b2e; }
.gen-reading .gr-li { position: relative; padding-left: 14px; margin-bottom: 6px; }
.gen-reading .gr-li::before { content: "\2022"; position: absolute; left: 0; }

/* External Reading: shared request rows across PCs - flat numbered rows, no boxed cards */
.ext-page { height: auto; min-height: 0; overflow: visible; }
.ext-compose { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.ext-compose form { display: flex; align-items: flex-end; gap: 8px; }
.ext-compose textarea { resize: vertical; min-height: 42px; max-height: 140px; flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none; }
.ext-compose textarea:focus { border-color: #999; }
.ext-list { padding: 4px 20px; }
.ext-list .chat-empty { padding: 26px 0; }
.ext-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.ext-row:last-child { border-bottom: 0; }
.ext-num { flex: none; width: 20px; padding-top: 2px; text-align: right; color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.ext-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ext-meta { margin-top: 3px; font-size: 11px; color: var(--faint); }
.ext-main .chat-attachment { max-width: 420px; margin-top: 8px; }
.ext-actions { flex: none; display: flex; align-items: center; align-content: flex-start; justify-content: flex-end; flex-wrap: wrap; gap: 6px; max-width: 250px; }
.ext-actions .ext-upload { cursor: pointer; }
.ext-statusbar { padding: 10px 20px 14px; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .ext-compose { padding: 10px 12px; }
  .ext-list { padding: 4px 12px; }
  .ext-row { flex-wrap: wrap; gap: 4px 10px; }
  .ext-num { width: 16px; }
  .ext-main { flex: none; width: calc(100% - 26px); }
  .ext-actions { width: 100%; max-width: none; justify-content: flex-end; }
}

/* External Reading: one request can hold several PDFs */
.ext-file-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.ext-file-row .chat-attachment { flex: 1; min-width: 0; max-width: 420px; margin-top: 0; }
.ext-file-row .icon-btn { flex: none; }

/* External Reading: per-row Understand in Gujarati / Hindi result */
.ext-u { margin-top: 8px; display: grid; gap: 6px; max-width: 560px; }
.ext-u-block { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper-2, #faf8f5); font-size: 13px; line-height: 1.5; }
.ext-u-tag { flex: none; margin-top: 2px; padding: 0 4px; border: 1px solid var(--line); border-radius: 4px; font-size: 10px; font-weight: 700; color: var(--faint); }
.ext-u-text { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ext-u-busy .ext-u-text { color: var(--muted); font-style: italic; animation: extPulse 1.2s ease-in-out infinite; }
@keyframes extPulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.ext-u-err { border-color: #f3c2c2; background: var(--red-bg); }
.ext-u-err .ext-u-text { color: var(--red); }
.ext-u-copy { flex: none; margin-left: auto; align-self: flex-start; white-space: nowrap; }
.ext-agenda-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.ext-agenda-row svg { flex: none; }
.ext-agenda-edit { margin-top: 8px; max-width: 560px; }
.ext-agenda-edit textarea { width: 100%; font-size: 13px; }
.ext-agenda-edit-btns { display: flex; gap: 6px; margin-top: 6px; }

/* Locked entry screen: nothing about the app shows before token / PIN */
body.locked .sidebar, body.locked .topbar, body.locked .etsy-notice, body.locked .site-footer, body.locked .tabbar, body.locked .more-menu { display: none !important; }
body.locked .layout { display: block; }
body.locked .content { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
body.locked .lock-box { width: 100%; max-width: 320px; }
body.locked .main { width: 100%; max-width: none; align-items: stretch; }
body.locked .content { width: 100%; max-width: none; margin: 0; justify-content: center; align-items: center; text-align: left; }
body.locked .lock-box { margin: 0 auto; }
body.locked .lock-title { font-size: 34px; font-weight: 700; text-align: center; margin: 0 0 28px; letter-spacing: -.02em; }
body.locked .lock-sub { font-size: 16px; font-weight: 600; margin: 26px 0 10px; }

/* External Reading: full-width flat layout (no enclosing card), rows use the whole content area */
body.ext-wide .content { max-width: none; }
.ext-full { background: none; border: 0; box-shadow: none; border-radius: 0; }
.ext-full .chat-header { padding-left: 0; padding-right: 0; }
.ext-full .ext-compose { padding-left: 0; padding-right: 0; }
.ext-full .ext-list { padding-left: 0; padding-right: 0; }
.ext-full .ext-statusbar { padding-left: 0; padding-right: 0; }

/* Dashboard sticky note */
.sticky-note { position: fixed; z-index: 40; flex-direction: column; min-width: 180px; min-height: 120px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); background: #fff3a8; border: 1px solid #e4d27a; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); resize: both; overflow: hidden; }
.sticky-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 12px; font-size: 12px; font-weight: 600; color: #6b5d12; background: #f7e57f; cursor: grab; touch-action: none; user-select: none; }
.sticky-head:active { cursor: grabbing; }
.sticky-x { border: 0; background: transparent; font-size: 18px; line-height: 1; cursor: pointer; color: #6b5d12; padding: 0 6px; }
.sticky-note textarea { flex: 1; width: 100%; border: 0; outline: 0; resize: none; background: transparent; padding: 10px 12px; font: 14px/1.45 inherit; font-family: inherit; color: #333; }

/* External Reading: repeat-client badge, client box, History shop filter */
.ext-repeat { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 10px; border-radius: 999px; border: 1px solid #cfe3cf; background: #eff7ef; color: #2f6b33; font-size: 12px; font-weight: 600; }
.ext-repeat .ico { width: 14px; height: 14px; }
.ext-client { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.ext-client svg { flex: none; }
.ext-hist-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 0 4px; }
.ext-hist-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ext-hist-count { margin-left: auto; font-size: 12px; color: var(--faint); }
.ext-hist-add { flex-basis: 100%; }
.ext-hist-add textarea { width: 100%; margin-top: 8px; }
.ext-client-edit { margin-top: 14px; display: grid; gap: 8px; }
.ext-agenda-warn { color: #8a6d1d; }
.ext-dob-pick { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; font-weight: 600; color: var(--text); }
.ext-cl-err { color: var(--red); }


/* History day headings (date-wise grouping) */
.ext-day-head { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #6b6b6b; padding: 14px 2px 6px; }
.ext-day-head:first-child { padding-top: 4px; }

/* Repeat buyer: keyboard/touch accessible, never a name-only match. */
.buyer-star{position:relative;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;border:0;border-radius:6px;background:#fff3c4;color:#805500;width:28px;height:28px;margin-left:6px;cursor:pointer;flex-shrink:0}
.buyer-star svg{width:16px;height:16px;fill:#e7b13b;stroke:currentColor}
.buyer-star:focus-visible{outline:2px solid #805500;outline-offset:2px}
.buyer-tooltip{display:none;position:fixed;width:300px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:auto;padding:9px 12px;box-sizing:border-box;border-radius:8px;background:#26231e;color:#fff;box-shadow:0 3px 14px #0002;font-size:12px;font-weight:400;line-height:1.5;white-space:normal;overflow-wrap:anywhere;z-index:10000;pointer-events:none}
.buyer-history-item{border-top:1px solid #eee;padding-top:12px;margin-top:12px;overflow-wrap:anywhere}
.buyer-history-order{overflow-wrap:anywhere}

.buyer-highlight{background:#fff3c4;color:#6d4900;border-radius:4px;padding:2px 4px;box-decoration-break:clone;-webkit-box-decoration-break:clone}

body.payments-view #stickyNote{display:none!important}

/* Payments: open ledger layout, no nested cards. */
.payments-page{max-width:1120px;margin:4px auto 32px}.pay-heading{padding:8px 0 24px}.pay-eyebrow{font-size:11px;font-weight:600;letter-spacing:.08em;color:#71716e}.pay-heading h2{font-size:28px;letter-spacing:-.03em;margin:8px 0}.pay-heading p{color:#737373;line-height:1.6;margin:0}.pay-controls{display:flex;align-items:flex-end;gap:16px;padding:20px 0;border-top:1px solid #e8e8e5;border-bottom:1px solid #e8e8e5}.pay-controls label{display:grid;gap:7px;font-size:12px;color:#686865}.pay-controls .input,.pay-controls .select{min-height:42px}.pay-controls select{min-width:220px}.pay-controls button{margin-left:auto;min-height:42px}.pay-summary{display:flex;justify-content:space-between;gap:24px;align-items:flex-end;padding:34px 0 30px}.pay-total{font-size:40px;line-height:1.2;font-weight:600;letter-spacing:-.04em;margin-top:10px}.pay-total span{display:block}.pay-total small{font-size:17px;font-weight:400;letter-spacing:0;color:#70706d}.pay-no-total{font-size:24px}.pay-summary-meta{font-size:12px;text-align:right;line-height:1.8;color:#71716e}.pay-summary-meta span{color:#969693}.pay-list-head,.pay-entry{display:grid;grid-template-columns:minmax(200px,1fr) minmax(140px,.7fr) minmax(180px,.9fr);gap:24px}.pay-list-head{padding:13px 0;color:#858581;font-size:11px;border-bottom:1px solid #deded9}.pay-entry{padding:22px 0;border-bottom:1px solid #e9e9e6;align-items:start}.pay-entry time{font-size:12px;color:#777774}.pay-shop{font-weight:600;margin-top:6px;overflow-wrap:anywhere}.pay-amount{font-size:17px;font-weight:600;padding-top:2px;overflow-wrap:anywhere}.pay-record{font-size:12px}.pay-sent{color:#397862}.pay-review{color:#a44a31}.pay-record details{color:#888880;margin-top:8px}.pay-record summary,.pay-source summary{cursor:pointer;min-height:28px}.pay-record p{line-height:1.7;overflow-wrap:anywhere}.pay-source{padding:24px 0;color:#858580;font-size:12px;line-height:1.7}.pay-source summary{font-weight:600}.pay-source p{max-width:760px}.pay-errors{padding:16px 0;color:#9b4f3b;border-top:1px solid #e6d5ce;font-size:12px}.pay-empty,.pay-loading{padding:30px 0;color:#777}.pay-errors p{margin:6px 0}
@media(max-width:700px){.pay-heading{padding:6px 0 20px}.pay-heading h2{font-size:25px}.pay-controls{flex-wrap:wrap;gap:14px}.pay-controls label:first-child{flex:1}.pay-controls label:nth-child(2){width:100%}.pay-controls select{width:100%;min-width:0}.pay-controls button{position:static;margin-left:0}.pay-summary{display:block;padding:28px 0}.pay-total{font-size:36px}.pay-summary-meta{text-align:left;margin-top:16px}.pay-list-head{display:none}.pay-entry{grid-template-columns:minmax(0,1fr) auto;gap:14px;padding:20px 0}.pay-record{grid-column:1/-1;display:flex;align-items:baseline;justify-content:space-between;gap:12px}.pay-record details{margin:0;max-width:60%;text-align:right}.pay-amount{font-size:16px}.pay-source{padding-bottom:30px}}
.pay-record summary,.pay-source summary{min-height:44px;display:flex;align-items:center;gap:6px}.pay-source summary:before,.pay-record summary:before{content:'▸';font-size:10px}.pay-source[open] summary:before,.pay-record details[open] summary:before{content:'▾'}
@media(max-width:700px){.pay-heading{padding-bottom:15px}.pay-controls{padding:15px 0;gap:10px}.pay-controls label:nth-child(2){width:100%}.pay-summary{padding:23px 0}.pay-summary-meta{margin-top:12px}.pay-record summary{justify-content:flex-end}}
.pay-bank{margin-top:10px;border-top:1px solid #ecece7;padding-top:12px}.pay-bank-summary{font-size:14px;font-weight:600}.pay-bank-summary span{display:block;font-size:11px;color:#83837c;font-weight:400;line-height:1.7}.pay-bank-edit summary{color:#333;font-weight:500;cursor:pointer;min-height:44px}.pay-bank form{display:grid;gap:10px;max-width:340px}.pay-bank form label{display:grid;gap:5px;color:#74746e;font-size:12px}.pay-bank-status{font-size:12px;line-height:1.5}.pay-overview{display:grid;grid-template-columns:1.1fr 1fr 1fr;gap:30px;padding:20px 0}.pay-overview .pay-total{font-size:34px;white-space:normal}.pay-metric{font-size:25px;font-weight:600;margin:12px 0}.pay-overview p,.pay-comparison-note{font-size:11px;line-height:1.6;color:#898981}.pay-period{text-align:left;margin-top:24px}.pay-comparison-note{margin:6px 0 20px;max-width:850px}.pay-controls{flex-wrap:wrap}.pay-controls select{min-width:170px}
@media(max-width:700px){.pay-overview{grid-template-columns:1fr;gap:22px;padding:25px 0}.pay-overview .pay-total{font-size:36px}.pay-metric{margin:8px 0}.pay-record{display:block}.pay-record details{max-width:none;text-align:left}.pay-record summary{justify-content:flex-start}.pay-bank form{max-width:none}.pay-controls label:nth-child(2){width:auto;flex:1}.pay-controls label:nth-child(3){flex:1}.pay-controls label:nth-child(4){width:100%}}

@media(max-width:700px){.pay-controls label:first-child{flex-basis:100%}.pay-controls label:nth-child(2),.pay-controls label:nth-child(3){flex:1;min-width:150px}.pay-controls input[type=date]{width:100%;min-width:0}}
/* Approved C design language, shared across existing app pages. */
:root{--bg:#f6f7f9;--panel:#fff;--side:#101216;--line:#e9ebef;--line-2:#f1f3f6;--text:#16181d;--muted:#6b7280;--faint:#9ca3af;--radius:16px;--radius-sm:9px;--shadow:none;--green:#219b65;--red:#e5484d}
.sidebar{width:232px;background:#101216;color:#9ca3af;border:0;padding:24px 14px}.brand{padding:0 8px 25px}.brand-name{color:#fff;font-size:14px}.brand-sub{color:#7b8390;font-size:11px}.brand-mark{width:30px;height:30px;border-radius:8px;background:#fff;color:#101216;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800}.brand-mark svg{display:none}.brand-mark:after{content:'OB'}.nav a{font-size:13px;color:#9ca3af;padding:9px 12px}.nav a:hover,.nav a.active{background:#1d2026;color:#fff;box-shadow:none}.nav a .ico{color:#626974;width:16px;height:16px}.nav a.active .ico{color:#7dd3a8}.nav-sep{background:#252932}.sidebar-foot{border-top:1px solid #252932;color:#858e9c}.sidebar-foot b{color:#aeb6c2}.sidebar .sync-status.ok{color:#7dd3a8}.nav-badge{background:#e5484d}
.topbar{background:#f6f7f9;border-bottom:0;padding:24px 36px;backdrop-filter:none}.topbar h1{font-size:21px;font-weight:700;letter-spacing:-.025em}.topbar .search-wrap input{background:#fff;border:1px solid #e5e7eb;border-radius:10px}.content{padding:10px 36px 60px;max-width:1450px}.card{border-radius:16px;border-color:#e9ebef;box-shadow:none;overflow:hidden}.card-head{padding:20px 22px}.card-head h3{font-size:14px;font-weight:650}.card-body{padding:20px 22px}.card-pad{padding:24px}.btn{border-radius:9px;font-size:12.5px;min-height:36px}.btn-primary{background:#111;color:#fff}.input,.select{border-color:#dfe3e9;border-radius:9px;background:#fff}.table th{font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#8d97a8;background:#fafbfc;padding:13px 17px}.table td{font-size:13px;padding:14px 17px;border-color:#f1f3f6}.table tr.clickable:hover td{background:#f9fbfc}.cell-strong{font-weight:600}.toolbar{gap:10px}.chip,.seg{border-color:#e5e7eb;background:#fff}.seg button.active{background:#111;color:white}.kpi{padding:22px;background:#fff;border-radius:16px}.kpi .value{letter-spacing:-.035em}.drawer{background:#fff}.drawer-head{border-color:#edf0f4}.section-title{color:#8b95a6;letter-spacing:.08em;font-size:10.5px}.badge{font-size:11px;border-radius:7px}.site-footer{background:transparent;color:#929aa7}.etsy-disclaimer{color:#8d95a2;background:transparent}
.payments-page{max-width:none}.pay-heading{padding:5px 0 22px}.pay-heading h2{font-size:24px;font-weight:700}.pay-heading p{font-size:13px;color:#717b8d}.pay-eyebrow{color:#929daf;font-size:10.5px;font-weight:700;letter-spacing:.08em}.pay-controls{border:0;padding:8px 0 20px;gap:10px}.pay-controls label{font-size:11px}.pay-controls .input,.pay-controls .select{min-height:36px}.pay-controls button,#payLoad{background:#111;color:white;min-height:36px}.pay-period{margin:4px 0 14px}.pay-overview{background:#fff;border:1px solid #e9ebef;border-radius:16px;gap:0;padding:0;margin:0 0 12px;overflow:hidden}.pay-overview>div{padding:22px 25px;border-right:1px solid #f0f1f4}.pay-overview>div:last-child{border:0}.pay-overview .pay-total,.pay-metric{font-size:29px;letter-spacing:-.035em}.pay-metric{margin:10px 0}.pay-comparison-note{font-size:11px;color:#929daf;margin-bottom:22px}.pay-list{background:#fff;border:1px solid #e9ebef;border-radius:16px;overflow:hidden}.pay-list-head{padding:13px 20px;background:#fafbfc;text-transform:uppercase;font-weight:700;color:#929daf;letter-spacing:.06em;border-color:#edf0f4}.pay-entry{padding:18px 20px;border-color:#f1f3f6}.pay-entry time{color:#374151}.pay-shop{font-size:13px;font-weight:500}.pay-amount{font-size:14px}.pay-bank{margin-top:8px;padding-top:8px}.pay-bank form{grid-template-columns:minmax(90px,1fr) auto;gap:7px;align-items:end}.pay-bank form label{font-size:10px;gap:4px}.pay-bank form .input{height:33px;min-height:33px;font-size:12px;width:100%}.pay-bank form button{background:#111;color:#fff;min-height:33px;padding:6px 10px;font-size:11px}.pay-bank-status{grid-column:1/-1;color:#219b65}.pay-sent{color:#219b65}.pay-source{color:#929daf;font-size:11px}.pay-record details{font-size:11px}
@media(max-width:820px){.sidebar{width:232px}.topbar{background:#101216;color:white;padding:17px 16px}.topbar .menu-btn{color:white}.topbar h1{font-size:19px}.content{padding:20px 16px 90px}.topbar-right .btn{min-height:34px}.card-head,.card-body{padding:17px}.tabbar{background:#fff;border-color:#e9ebef}}
@media(max-width:700px){.pay-overview{display:block}.pay-overview>div{border-right:0;border-bottom:1px solid #f0f1f4;padding:21px}.pay-overview>div:last-child{border:0}.pay-overview .pay-total,.pay-metric{font-size:30px}.pay-entry{padding:20px 16px;grid-template-columns:minmax(0,1fr) auto;gap:12px}.pay-controls{gap:9px}.pay-controls label:first-child{flex-basis:100%}.pay-controls label:nth-child(2),.pay-controls label:nth-child(3){min-width:140px;flex:1}.pay-record{grid-column:1/-1}.pay-bank form{max-width:100%;grid-template-columns:minmax(0,1fr) auto}.pay-bank form label{font-size:11px}.pay-bank-summary{font-size:13px}.pay-heading h2{font-size:24px}.pay-comparison-note{line-height:1.6}.pay-period{font-size:11px}}
.etsy-notice{background:transparent!important;color:#8d95a2;border-color:#e9ebef}

.pd-understand{padding:12px 16px;border-top:1px solid var(--line);cursor:default}.pd-understand .row{gap:8px}.pd-understand .btn[aria-pressed=true]{background:#111;color:#fff}.pd-understand-result:empty{display:none}.pd-understand-result{margin-top:10px}.pd-understand-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.85;font-size:14px;background:#f7f8fa;padding:16px;border-radius:10px;text-align:left}.pd-understand .notice{margin:8px 0 0}

.pd-understand-fold summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;background:#f7f8fa;border:1px solid #e9ebef;border-radius:8px;cursor:pointer;font-weight:600;list-style:none}.pd-understand-fold summary::-webkit-details-marker{display:none}.pd-understand-fold summary:after{content:'▸';font-size:18px;flex:none}.pd-understand-fold[open] summary:after{content:'▾'}.pd-understand-fold summary:focus-visible{outline:2px solid #7258f5;outline-offset:2px}.pd-understand-fold .muted{margin:10px 0}.pd-understand-fold:not([open])>:not(summary){display:none}
@media(max-width:600px){#pdfList .file-row{flex-wrap:wrap;gap:10px}#pdfList .file-main{flex:1 1 calc(100% - 54px);min-width:0}#pdfList .file-sub{white-space:normal}#pdfList .file-name{overflow-wrap:anywhere}}

/* Dashboard daily presets stay visible without horizontal overflow. */
#periodSeg{flex-wrap:wrap;gap:2px}
.dash-period-range{margin:-6px 0 18px}

.holders-page .hold-grid{display:grid;gap:14px;margin-bottom:22px}.hold-card{background:#fff;border:1px solid #e9ebef;border-radius:16px;padding:20px 22px}.hold-head{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:baseline;margin-bottom:10px}.hold-head h3{margin:0;font-size:18px}.hold-nums{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:8px 0}.hold-owed{color:#111}.hold-cash{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;margin-top:14px}.hold-cash label{display:grid;gap:4px;font-size:11px;color:#686865}.hold-cash .input{min-height:36px;width:130px}.hold-cash .hold-note .input{width:220px}.hold-cash button,.hold-add button{background:#111;color:#fff;min-height:36px}.hold-log{margin-top:12px;border-top:1px solid #f1f3f6}.hold-row{display:grid;grid-template-columns:100px 140px auto auto;justify-content:start;gap:12px;align-items:center;padding:9px 0;border-bottom:1px solid #f1f3f6;font-size:13px}.hold-setup{background:#fff;border:1px solid #e9ebef;border-radius:16px;padding:20px 22px}.hold-setup h3{margin:14px 0 8px;font-size:15px}.hold-add{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.hold-add .input{min-height:36px;width:240px}.hold-shops{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:10px}.hold-shop{display:grid;gap:4px;font-size:12px}
@media(max-width:640px){.hold-nums{grid-template-columns:1fr}.hold-row{grid-template-columns:1fr 1fr}.hold-cash .input,.hold-cash .hold-note .input{width:100%}.hold-cash label{flex:1 1 140px}}
.holders-page{padding-bottom:280px}
.hold-shoptable{margin:12px 0;border:1px solid #edf0f4;border-radius:12px;overflow:hidden;font-size:13px}.hold-sthead,.hold-strow{display:grid;grid-template-columns:1.2fr 1.4fr 1.2fr;gap:12px;padding:9px 14px}.hold-sthead{background:#fafbfc;color:#929daf;font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.06em}.hold-strow{border-top:1px solid #f1f3f6}.hold-sttotal{font-weight:700;background:#fafbfc}.hold-warn{color:#b45309}.hold-missing{margin:12px 0;padding:12px 14px;border:1px solid #f3d9a4;background:#fffaf0;border-radius:12px;font-size:13px}.hold-missing p{margin:4px 0 8px;color:#7a5a1c}.hold-mrow{display:grid;grid-template-columns:100px 1fr auto;gap:12px;padding:5px 0;border-top:1px solid #f6e8c8}
@media(max-width:640px){.hold-sthead,.hold-strow{grid-template-columns:1fr 1fr}.hold-sthead span:last-child,.hold-strow span:last-child{grid-column:1/-1}.hold-mrow{grid-template-columns:90px 1fr}.hold-mrow .muted{grid-column:1/-1}}
.hold-tabs{display:flex;gap:6px;overflow-x:auto;padding:2px 0 14px;margin-bottom:6px;border-bottom:1px solid #e9ebef;-webkit-overflow-scrolling:touch}.hold-tab{flex:0 0 auto;border:1px solid #e3e6ec;background:#fff;border-radius:999px;padding:8px 16px;font-size:13px;font-weight:600;color:#374151;cursor:pointer;min-height:38px}.hold-tab.active{background:#111;border-color:#111;color:#fff}.hold-tab-add{border-style:dashed}.hold-tab-add.active{border-style:solid}
.hold-grid{margin-top:14px}

/* Bank holders: flatter layout, coloured Still owed, clearer pending entries */
.hold-card{border:0;background:transparent;padding:6px 2px 0;border-radius:0}
.hold-head{padding-bottom:12px;border-bottom:1px solid #e9ebef}
.hold-nums{gap:0;margin:16px 0 8px;background:#fff;border:1px solid #e9ebef;border-radius:14px;overflow:hidden}
.hold-nums>div{padding:16px 20px;border-right:1px solid #f0f1f4}.hold-nums>div:last-child{border-right:0}
.hold-nums .pay-metric{margin:6px 0 0;font-size:26px}
.hold-owed.owed-pos,.hold-owed-note.owed-pos{color:#15803d}.hold-owed.owed-neg,.hold-owed-note.owed-neg{color:#b91c1c}.hold-owed.owed-zero,.hold-owed-note.owed-zero{color:#6b7280}
.hold-nums>div:last-child{background:#f8fafb}.hold-owed-note{font-size:12px;font-weight:700;margin-top:2px}
.hold-shoptable{border:0;border-radius:0;margin:18px 0 8px}.hold-sthead{background:transparent;padding-left:0;padding-right:0}.hold-strow{padding-left:0;padding-right:0}.hold-sttotal{background:transparent;border-top:2px solid #e3e6ec}
.hold-missing{border:0;border-left:4px solid #f59e0b;border-radius:0 10px 10px 0;background:#fffbeb;margin:18px 0}
.hold-missing strong{color:#92400e;font-size:14px}.hold-mrow{grid-template-columns:100px 1fr auto auto;align-items:center;border-top:1px solid #fde9bd}
.hold-mrow time{font-weight:700;color:#92400e}.hold-pend{background:#f59e0b;color:#fff;font-size:11px;font-weight:700;border-radius:999px;padding:3px 10px;white-space:nowrap}
.hold-cash{padding-top:14px;border-top:1px solid #e9ebef}.hold-log{border-top:0}
@media(max-width:900px){.hold-nums{grid-template-columns:1fr 1fr}.hold-nums>div{border-bottom:1px solid #f0f1f4}}
@media(max-width:640px){.hold-nums{grid-template-columns:1fr}.hold-mrow{grid-template-columns:90px 1fr}.hold-mrow .muted,.hold-pend{grid-column:1/-1;justify-self:start}}

/* Bank holders: flat forms + history dropdown */
.hold-forms{display:grid;grid-template-columns:1fr 1fr;gap:36px;margin-top:20px;padding-top:18px;border-top:1px solid #e9ebef}
.hold-forms .hold-cash{display:block;border:0;padding:0;margin:0}.hold-forms h4{margin:0 0 10px;font-size:13px;font-weight:700;color:#374151}
.hold-exp h4{color:#b91c1c}
.hold-fields{display:grid;grid-template-columns:1fr 70px 140px;gap:12px 14px}.hold-fields .hold-note{grid-column:1/-1}
.hold-forms label{display:grid;gap:2px;font-size:11px;color:#8a919e}
.hold-forms .input{width:100%;min-height:34px;border:0;border-bottom:1.5px solid #d6dae1;border-radius:0;background:transparent;padding:6px 2px;box-shadow:none;font-size:14px}
.hold-forms .input:focus{outline:0;border-bottom-color:#111}
.hold-act{display:flex;align-items:center;gap:12px;margin-top:12px}.hold-act .btn{min-height:34px;padding:6px 16px}
.hold-hist{margin-top:22px;border-top:1px solid #e9ebef;padding-top:6px}.hold-hist summary{cursor:pointer;font-weight:700;font-size:14px;padding:10px 0;list-style:none}
.hold-hist summary::after{content:' \25BE';color:#8a919e}.hold-hist[open] summary::after{content:' \25B4'}.hold-hist summary::-webkit-details-marker{display:none}
.hold-histbar{padding:2px 0 8px;font-size:12px;color:#8a919e}.hold-histbar .select{min-height:32px;margin-left:6px}
.hold-hist .hold-row{display:grid;grid-template-columns:78px 96px 150px 1fr auto;gap:12px;align-items:center;padding:10px 0;border-top:1px solid #f1f3f6;font-size:13px}
.hold-tag{font-size:11px;font-weight:700;border-radius:999px;padding:2px 10px;text-align:center}.hold-tag.cash{background:#e8f5ec;color:#15803d}.hold-tag.exp{background:#fdecec;color:#b91c1c}
.hold-rnote{color:#4b5563;overflow-wrap:anywhere}.hold-rm{background:none;border:0;color:#6b7280;text-decoration:underline;cursor:pointer;font-size:12px;padding:6px 4px}.hold-rm:hover{color:#b91c1c}
@media(max-width:820px){.hold-forms{grid-template-columns:1fr;gap:26px}}
@media(max-width:640px){.hold-hist .hold-row{grid-template-columns:70px 1fr auto;}.hold-hist .hold-rnote{grid-column:1/-1}.hold-fields{grid-template-columns:1fr 70px}.hold-fields label:nth-child(3){grid-column:1/-1}}

.wal-nums{grid-template-columns:repeat(3,1fr)}.wal-form{grid-template-columns:minmax(0,520px)}.wal-hist{border-top:1px solid #e9ebef;margin-top:24px;padding-top:10px}.wal-histhead{display:flex;justify-content:space-between;align-items:center;padding:8px 0;font-size:14px}.wal-histhead label{font-size:12px;color:#8a919e}.wal-histhead .select{min-height:32px;margin-left:6px}
.wal-row{grid-template-columns:78px 96px 170px 1fr auto}.wal-row .hold-rm{text-decoration:none;color:#9aa1ad;font-size:11px}
@media(max-width:640px){.wal-nums{grid-template-columns:1fr}.wal-row{grid-template-columns:78px 1fr auto}.wal-row .hold-rnote{grid-column:1/-1}}
