@font-face { font-family: 'Inter'; src: url('assets/fonts/Inter.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Cormorant'; src: url('assets/fonts/CormorantGaramond-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Cormorant'; src: url('assets/fonts/CormorantGaramond-Italic.ttf') format('truetype'); font-style: italic; font-display: swap; }
@font-face { font-family: 'Krasumashi'; src: url('assets/fonts/Krasumashi-Regular.otf') format('opentype'); font-display: swap; }

/* Same two rooms as brands.krasumashi.com: Studio (dark, precise) and Ink (hand-drawn). */
:root, [data-skin="studio"] {
  --bg: #0a0a0b;
  --panel: #141416;
  --panel-2: #1b1b1e;
  --line: #26262a;
  --line-strong: #3a3a40;
  --text: #f3f3f4;
  --muted: #9a9aa2;
  --faint: #6c6c74;
  --action: #3d6bff;
  --action-text: #ffffff;
  --live: #3ccf7a;
  --warn: #f0b34a;
  --danger: #ff6b5e;
  --radius: 10px;
  --card-radius: 12px;
  --font: 'Inter', system-ui, sans-serif;
  --display: 'Cormorant', Georgia, serif;
  --hand: var(--font);
  --nav-case: none;
  --bw: 1px;
  color-scheme: dark;
}
[data-skin="ink"] {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #f6f6f4;
  --line: #111111;
  --line-strong: #111111;
  --text: #111111;
  --muted: #55555a;
  --faint: #8a8a8f;
  --action: #111111;
  --action-text: #ffffff;
  --live: #1c7a44;
  --warn: #8a5a00;
  --danger: #b3261e;
  --radius: 2px;
  --card-radius: 2px;
  --display: 'Krasumashi', var(--font);
  --hand: 'Krasumashi', var(--font);
  --nav-case: uppercase;
  --bw: 1.5px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[data-skin="studio"] .on-ink, [data-skin="ink"] .on-studio { display: none !important; }
.n, .num { font-variant-numeric: tabular-nums; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--radius); border: var(--bw) solid var(--line-strong); background: transparent; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, filter .15s; }
.btn:hover { background: var(--panel-2); }
.btn .ti { font-size: 16px; }
.btn-primary { background: var(--action); border-color: var(--action); color: var(--action-text); }
.btn-primary:hover { background: var(--action); filter: brightness(1.12); }
.btn-danger { color: var(--danger); }
.btn-quiet { border-color: var(--line); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
[data-skin="ink"] .btn { font-family: var(--hand); text-transform: uppercase; letter-spacing: .04em; font-weight: 400; font-size: 15px; }
[data-skin="ink"] .btn-sm { font-size: 13px; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: var(--radius); border: var(--bw) solid var(--line); background: transparent; cursor: pointer; font-size: 17px; color: var(--muted); flex: none; }
.icon-btn:hover, .icon-btn[aria-current="page"] { color: var(--text); background: var(--panel-2); }
.link { text-decoration: underline; text-underline-offset: 4px; cursor: pointer; background: none; border: 0; padding: 0; }

/* Top bar */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; height: 60px; padding: 0 28px; background: var(--bg); border-bottom: 1px solid var(--line); }
[data-skin="ink"] .bar { border-bottom: 0; height: 76px; }
.bar-mark { display: flex; align-items: center; gap: 10px; flex: none; }
.bar-mark img { height: 30px; width: auto; }
.bar-name { font: 400 22px/1 var(--display); letter-spacing: .01em; }
[data-skin="ink"] .bar-mark img { height: 40px; }
[data-skin="ink"] .bar-name { font-size: 26px; }
.bar-nav { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.bar-nav a { color: var(--muted); text-transform: var(--nav-case); }
.bar-nav a[aria-current="page"] { color: var(--text); font-weight: 500; }
.bar-nav .slash { display: none; }
[data-skin="ink"] .bar-nav { font-family: var(--hand); font-size: 19px; letter-spacing: .05em; gap: 10px; }
[data-skin="ink"] .bar-nav a { color: var(--text); }
[data-skin="ink"] .bar-nav a[aria-current="page"] { font-weight: 400; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
[data-skin="ink"] .bar-nav .slash { display: inline; font-size: 24px; }
.bar-search { flex: 1; max-width: 340px; margin-left: auto; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--radius); background: var(--panel); border: var(--bw) solid var(--line); color: var(--faint); }
.bar-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font-size: 13px; outline: none; }
.skin { display: inline-flex; padding: 3px; border-radius: var(--radius); border: var(--bw) solid var(--line); background: var(--panel); flex: none; }
.skin button { border: 0; background: transparent; padding: 5px 10px; border-radius: calc(var(--radius) - 3px); font-size: 12px; color: var(--muted); cursor: pointer; }
.skin button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }
[data-skin="ink"] .skin button { font-family: var(--hand); text-transform: uppercase; font-size: 14px; }
[data-skin="ink"] .skin button[aria-pressed="true"] { background: #111; color: #fff; }
.brush { display: none; height: 14px; margin: -10px 28px 0; background: url('assets/brush-line.png') center / 100% 100% no-repeat; }

.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--faint); white-space: nowrap; flex: none; }
.sync::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--live); }
.sync[data-state="saving"]::before { background: var(--warn); }
.sync[data-state="error"] { color: var(--danger); }
.sync[data-state="error"]::before { background: var(--danger); }
.sync[data-state="local"]::before { background: var(--faint); }

/* Page */
main { display: block; padding: 0 28px 60px; max-width: 1320px; margin: 0 auto; outline: none; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 30px 0 22px; flex-wrap: wrap; }
.kicker { margin: 0 0 4px; color: var(--faint); font-size: 11px; letter-spacing: .11em; text-transform: uppercase; }
.head h1 { margin: 0; font: 400 40px/1.05 var(--display); letter-spacing: -.01em; }
.head .sub { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
[data-skin="ink"] .kicker { font-family: var(--hand); font-size: 15px; color: var(--text); letter-spacing: .06em; }
[data-skin="ink"] .head h1 { font-size: 50px; letter-spacing: .02em; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.back:hover { color: var(--text); }

.panel { border: var(--bw) solid var(--line); border-radius: var(--card-radius); background: var(--panel); padding: 20px 22px; }
.panel + .panel { margin-top: 18px; }
.panel h2 { margin: 0 0 14px; font: 400 24px/1.15 var(--display); }
.panel h2 small { font: 400 12px var(--font); color: var(--faint); margin-left: 8px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
[data-skin="ink"] .panel h2 { font-size: 28px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.stack > * + * { margin-top: 18px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.empty { padding: 28px 10px; text-align: center; color: var(--muted); }
.empty .ti { display: block; font-size: 28px; margin: 0 auto 8px; color: var(--faint); }
.empty p { margin: 0 0 14px; }

/* Stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { border: var(--bw) solid var(--line); border-radius: var(--card-radius); background: var(--panel); padding: 16px 18px; display: block; }
a.tile:hover { border-color: var(--line-strong); }
.tile dt { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.tile dd { margin: 6px 0 0; font: 500 24px/1.15 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tile small { display: block; margin-top: 4px; color: var(--faint); font-size: 11.5px; }
.tile.is-danger dd { color: var(--danger); }
.tile.is-live dd { color: var(--live); }
[data-skin="ink"] .tile dd { font-family: var(--hand); font-weight: 400; font-size: 28px; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 32px; padding: 0 13px; border-radius: 999px; border: var(--bw) solid var(--line); background: var(--panel); color: var(--muted); font-size: 12.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip b { font-weight: 500; color: var(--faint); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip[aria-pressed="true"] b { color: inherit; opacity: .6; }
[data-skin="ink"] .chip { border-radius: 2px; color: #111; font-family: var(--hand); text-transform: uppercase; font-size: 14px; letter-spacing: .04em; }
[data-skin="ink"] .chip[aria-pressed="true"] { color: #fff; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }

/* Rows: lists that read as a table on desktop and stack on phones */
.rows { border: var(--bw) solid var(--line); border-radius: var(--card-radius); background: var(--panel); overflow: hidden; }
.rows-head, .row { display: grid; grid-template-columns: var(--cols); gap: 14px; align-items: center; padding: 12px 18px; }
.rows-head { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line); padding-top: 10px; padding-bottom: 10px; }
.row { border-top: 1px solid var(--line); font-size: 13.5px; }
.rows-head + .row { border-top: 0; }
a.row, button.row { cursor: pointer; transition: background .12s; width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; }
a.row:hover, button.row:hover { background: var(--panel-2); }
.row .n, .rows-head .n { text-align: right; }
.row strong { font-weight: 500; }
.row .sub { display: block; color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row > * { min-width: 0; }
.cell-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows-foot { display: grid; grid-template-columns: var(--cols); gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line-strong); font-weight: 500; font-size: 13.5px; }
.rows-foot .n { text-align: right; }
.in { color: var(--live); }
.out { color: var(--danger); }
[data-skin="ink"] .rows-head { font-family: var(--hand); font-size: 14px; color: var(--text); }

/* Status badges */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-draft { color: var(--faint); }
.badge-sent, .badge-accepted { color: var(--action); border-color: color-mix(in srgb, var(--action) 45%, transparent); }
[data-skin="studio"] .badge-sent, [data-skin="studio"] .badge-accepted { color: #7f9dff; }
.badge-partial { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.badge-overdue, .badge-declined, .badge-expired { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.badge-paid, .badge-invoiced { color: var(--live); border-color: color-mix(in srgb, var(--live) 45%, transparent); }
.badge-void { color: var(--faint); text-decoration: line-through; }
[data-skin="ink"] .badge { border-radius: 2px; font-family: var(--hand); text-transform: uppercase; font-weight: 400; font-size: 13px; letter-spacing: .04em; border-color: currentColor; }

/* Forms */
.form { display: grid; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); }
.field > small { font-size: 11.5px; color: var(--faint); }
.input, .field input, .field select, .field textarea { width: 100%; min-width: 0; height: 38px; padding: 0 11px; border-radius: var(--radius); border: var(--bw) solid var(--line-strong); background: var(--panel-2); color: var(--text); font-size: 14px; outline: none; transition: border-color .15s; }
.field textarea, textarea.input { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--action); }
[data-skin="ink"] .field input, [data-skin="ink"] .field select, [data-skin="ink"] .field textarea, [data-skin="ink"] .input { background: #fff; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--action); }
.seg { display: inline-flex; border: var(--bw) solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 0 11px; height: 30px; font-size: 12px; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.quick button { border: 1px solid var(--line); background: transparent; border-radius: 999px; height: 24px; padding: 0 9px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.quick button:hover { color: var(--text); border-color: var(--line-strong); }

/* Invoice editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 24px; align-items: start; }
.editor-preview { position: sticky; top: 80px; }
.editor-preview .paper { transform-origin: top left; }
.preview-frame { border-radius: var(--card-radius); overflow: hidden; border: var(--bw) solid var(--line); background: #e9e9e6; padding: 16px; }
.items { display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) 76px 120px 110px 32px; gap: 8px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.item .field input, .item .field textarea { background: var(--panel); }
.item textarea { min-height: 38px !important; height: 38px; resize: none; overflow: hidden; field-sizing: content; padding-top: 8px !important; }
.seg { flex: none; }
.seg button { white-space: nowrap; }
.item-amount { height: 38px; display: flex; align-items: center; justify-content: flex-end; font-variant-numeric: tabular-nums; font-weight: 500; }
.item-tools { display: grid; gap: 4px; }
.item-tools button { width: 32px; height: 28px; border: 0; background: transparent; color: var(--faint); cursor: pointer; border-radius: 6px; }
.item-tools button:hover { color: var(--text); background: var(--panel); }
.item-head { display: grid; grid-template-columns: minmax(0, 1fr) 76px 120px 110px 32px; gap: 8px; padding: 0 12px; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.item-head .n { text-align: right; }
.sum { display: grid; gap: 6px; margin-left: auto; width: min(100%, 320px); font-size: 13.5px; }
.sum div { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }
.sum .total { border-top: 1px solid var(--line-strong); padding-top: 8px; font-weight: 600; font-size: 16px; }
.taxes { display: flex; flex-wrap: wrap; gap: 14px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 8px; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 30%); }

/* Document view */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.doc-paper { border-radius: var(--card-radius); background: #e9e9e6; padding: 28px; border: var(--bw) solid var(--line); overflow-x: auto; }
.facts { display: grid; gap: 10px; margin: 0; font-size: 13.5px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.facts .big dd { font-size: 20px; font-weight: 600; }
.payline { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.payline:first-child { border-top: 0; }
.payline .sub { color: var(--faint); font-size: 12px; grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; }
.payline .sub .link { color: var(--muted); font-size: 12px; }
.sharebox { display: flex; gap: 6px; margin-top: 10px; }
.sharebox input { flex: 1; min-width: 0; height: 32px; padding: 0 9px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text); font-size: 12px; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 200px; padding: 6px; border-radius: var(--radius); border: var(--bw) solid var(--line-strong); background: var(--panel); box-shadow: 0 12px 40px rgba(0,0,0,.35); display: none; }
.menu.open .menu-list { display: block; }
.menu-list button { display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px 10px; border: 0; background: transparent; border-radius: 6px; text-align: left; cursor: pointer; font-size: 13px; }
.menu-list button:hover { background: var(--panel-2); }
.menu-list button.danger { color: var(--danger); }
.menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }

/* Chart */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar-in { fill: var(--live); }
.chart .bar-out { fill: var(--danger); opacity: .8; }
.chart text { fill: var(--faint); font: 10.5px var(--font); }
.chart .axis { stroke: var(--line); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* Settings */
.settings-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.list-edit { display: grid; gap: 8px; }
.list-edit .le-row { display: grid; grid-template-columns: var(--cols); gap: 8px; align-items: center; }
.list-edit .le-row input, .list-edit .le-row select { height: 34px; font-size: 13px; }
.logo-choice { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.logo-choice label { border: var(--bw) solid var(--line); border-radius: var(--radius); padding: 12px; cursor: pointer; display: grid; gap: 8px; font-size: 12.5px; }
.logo-choice label:has(input:checked) { border-color: var(--action); }
.logo-choice .sw { height: 54px; border-radius: 6px; background: #fff; display: grid; place-items: center; padding: 8px; color: #111; font: 400 20px var(--display); }
.logo-choice .sw img { max-height: 38px; width: auto; }
.logo-choice input { position: absolute; opacity: 0; pointer-events: none; }

/* Lock */
.lock { max-width: 420px; margin: 12vh auto 0; text-align: center; }
.lock img { height: 56px; width: auto; margin: 0 auto 18px; }
.lock h1 { font: 400 44px/1.05 var(--display); margin: 0 0 8px; }
.lock p { color: var(--muted); margin: 0 0 22px; }
.lock form { display: flex; gap: 8px; }
.lock .err { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 20px; }

/* Dialog */
.dlg { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border-radius: 14px; border: var(--bw) solid var(--line-strong); background: var(--panel); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.dlg::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(2px); }
.dlg form { padding: 22px; display: grid; gap: 14px; }
.dlg h2 { margin: 0; font: 400 28px/1.1 var(--display); }
.dlg .dlg-sub { margin: -8px 0 0; color: var(--muted); font-size: 13px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
[data-skin="ink"] .dlg { border-radius: 2px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60; padding: 10px 16px; border-radius: var(--radius); background: var(--text); color: var(--bg); font-size: 13px; font-weight: 500; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.banner { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; padding: 10px 14px; border-radius: var(--radius); border: 1px dashed var(--line-strong); color: var(--muted); font-size: 12.5px; }

.foot-note { margin-top: 30px; color: var(--faint); font-size: 12px; text-align: center; }

/* ---------- The paper (always light, it is what clients see) ---------- */
.paper { --ink: #111114; --ink-2: #55555c; --ink-3: #8b8b92; --rule: #e3e3df;
  position: relative; width: 794px; min-height: 1123px; margin: 0 auto; padding: 64px 64px 56px; background: #fff; color: var(--ink);
  font: 400 12.5px/1.55 'Inter', system-ui, sans-serif; display: flex; flex-direction: column; box-shadow: 0 2px 30px rgba(0,0,0,.12); overflow: hidden; }
.paper h3 { margin: 0 0 6px; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.paper p { margin: 0; }
.pp-muted { color: var(--ink-3); }
.pp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 30px; padding-bottom: 28px; border-bottom: 1px solid var(--ink); }
.pp-logo { height: 34px; width: auto; max-width: 260px; object-fit: contain; object-position: left; }
.pp-logo-name { font: 400 28px/1 'Cormorant', Georgia, serif; }
.pp-title { text-align: right; }
.pp-title h1 { margin: 0; font: 400 46px/.9 'Cormorant', Georgia, serif; letter-spacing: -.01em; }
.pp-title h1.pp-long { font-size: 34px; line-height: 1; max-width: 320px; margin-left: auto; }
.pp-tagline { margin-top: 10px !important; font: italic 400 14px/1.2 'Cormorant', Georgia, serif; color: var(--ink-2); }
.pp-title p { margin-top: 8px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pp-parties { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 28px; padding: 26px 0; }
.pp-parties strong { font-weight: 600; }
.pp-meta { margin: 0; display: grid; gap: 8px; align-content: start; }
.pp-meta div { display: flex; justify-content: space-between; gap: 10px; }
.pp-meta dt { color: var(--ink-3); }
.pp-meta dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.pp-meta-due { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--rule); }
.pp-meta-due dt { color: var(--ink); font-weight: 600; }
.pp-meta-due dd { font-weight: 700; font-size: 14px; }
.pp-subject { font: italic 400 19px/1.3 'Cormorant', Georgia, serif; margin: 0 0 18px !important; }
.pp-items { width: 100%; border-collapse: collapse; }
.pp-items th { font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); text-align: left; padding: 10px 0; border-bottom: 1px solid var(--ink); }
.pp-items td { padding: 13px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.pp-items td strong { font-weight: 500; }
.pp-items td small { display: block; margin-top: 3px; color: var(--ink-2); font-size: 11.5px; }
.pp-items .n { text-align: right; padding-left: 18px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pp-items th:first-child, .pp-items td:first-child { width: 55%; }
.pp-end { display: grid; grid-template-columns: 1fr 280px; gap: 34px; padding-top: 22px; }
.pp-side { display: grid; gap: 18px; align-content: start; }
.pp-pay { padding: 14px 16px; background: #f5f5f2; border-radius: 4px; }
.pp-totals { width: 100%; border-collapse: collapse; align-self: start; font-variant-numeric: tabular-nums; }
.pp-totals th { text-align: left; font-weight: 400; color: var(--ink-2); padding: 5px 0; }
.pp-totals td { text-align: right; padding: 5px 0; }
.pp-totals .pp-grand th, .pp-totals .pp-grand td { border-top: 1px solid var(--ink); padding-top: 10px; color: var(--ink); font-weight: 700; font-size: 15px; }
.pp-totals .pp-due th, .pp-totals .pp-due td { font-weight: 700; color: var(--ink); background: #f5f5f2; padding: 8px 8px; }
.pp-totals-wide { width: 320px; margin: 24px 0 0 auto; }
.pp-received { margin-top: 10px; padding: 26px; background: #f5f5f2; display: flex; justify-content: space-between; align-items: baseline; }
.pp-received span { color: var(--ink-2); }
.pp-received strong { font: 400 40px/1 'Cormorant', Georgia, serif; }
.pp-notes { margin-top: 0; }
.paper > .pp-notes { margin-top: 26px; }
.pp-foot { margin-top: auto; padding-top: 30px; display: flex; justify-content: space-between; gap: 20px; color: var(--ink-3); font-size: 11px; border-top: 1px solid var(--rule); }
.paper .pp-foot { margin-top: auto; }
.pp-stamp { position: absolute; top: 70px; left: 44%; transform: rotate(-8deg); padding: 6px 16px; border: 2.5px solid currentColor; border-radius: 6px; font: 700 22px/1 'Inter', sans-serif; letter-spacing: .14em; text-transform: uppercase; opacity: .55; pointer-events: none; }
.pp-stamp-paid, .pp-stamp-accepted { color: #1c7a44; }
.pp-stamp-void, .pp-stamp-declined { color: #b3261e; }

.print-root { display: none; }
.locked .bar-nav, .locked .bar-search, .locked .bar-new, .locked .bar .icon-btn, .locked .sync, .locked .tabbar { display: none !important; }
.fit .paper { zoom: var(--z, 1); }
.on-mobile { display: none; }
button.tile { font: inherit; width: 100%; }
[data-skin="ink"] .brush { display: block; }
.pp-waiver p { color: var(--ink-2); font-size: 11.5px; }
.pp-stamp-waived { color: #3d5afe; }

/* Client view page */
.view-page { min-height: 100vh; padding: 28px 16px 60px; }
.view-bar { max-width: 794px; margin: 0 auto 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.view-bar img { height: 28px; width: auto; }
.view-wrap { overflow-x: auto; }

/* Mobile tab bar */
.tabbar { display: none; }

@media (max-width: 1320px) {
  [data-skin="ink"] .bar-nav { font-size: 16px; gap: 9px; }
  [data-skin="ink"] .bar-nav .slash { display: none; }
}
@media (max-width: 1180px) {
  .bar { gap: 12px; }
  .bar-nav { gap: 10px; }
  .bar-new span { display: none; }
  .bar-new { padding: 0 10px; }
  .bar-search { min-width: 120px; }
  .bar-search { max-width: 220px; }
  .skin { display: none; }
  .editor { grid-template-columns: 1fr; }
  .editor-preview { position: static; }
}
@media (max-width: 1000px) {
  .doc-layout, .cols, .cols-2 { grid-template-columns: 1fr; }
  .bar-nav, .bar-new, .sync { display: none; }
  .bar-search { max-width: none; }
}
@media (max-width: 760px) {
  .bar { padding: 0 16px; gap: 10px; height: 56px; }
  main { padding: 0 16px 100px; }
  .head { margin: 20px 0 16px; }
  .head h1 { font-size: 32px; }
  [data-skin="ink"] .head h1 { font-size: 38px; }
  .bar-name { display: none; }
  .bar-search input, .field input, .field select, .field textarea, .input { font-size: 16px; }
  .rows-head { display: none; }
  .row { grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 14px; }
  .row > .hide-m { display: none; }
  .row > .n { text-align: right; }
  .rows-foot { grid-template-columns: 1fr auto; padding: 12px 14px; }
  .rows-foot > .hide-m { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .item, .item-head { grid-template-columns: 1fr 1fr; }
  .item-head { display: none; }
  .item > .field:first-child { grid-column: 1 / -1; }
  .item-amount { justify-content: flex-start; }
  .item-tools { display: flex; justify-content: flex-end; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 12px 14px; }
  .tile dd { font-size: 19px; }
  .doc-paper { padding: 10px; }
  .panel { padding: 16px; }
  .btn, .icon-btn { min-height: 40px; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 4px 0; min-height: 44px; font-size: 10.5px; color: var(--faint); }
  .tabbar a .ti { font-size: 21px; }
  .tabbar a[aria-current="page"] { color: var(--text); }
  .tabbar .tab-new { align-self: center; justify-self: center; width: 46px; height: 46px; min-height: 0; border-radius: 50%; background: var(--action); color: var(--action-text); place-items: center; padding: 0; }
  .tabbar .tab-new .ti { font-size: 22px; }
  .toast { bottom: 90px; }
  .sticky-actions { bottom: 64px; }
  .on-mobile { display: inline !important; }
}

/* Print: only the paper */
@page { size: A4; margin: 0; }
@media print {
  html, body { background: #fff !important; }
  body > *:not(.print-root) { display: none !important; }
  .print-root { display: block !important; }
  .print-root .paper { box-shadow: none; margin: 0; width: 210mm; min-height: 297mm; zoom: 1 !important; }
  .view-page { padding: 0; }
}
