@font-face { font-family: Cabin; src: url(/fonts/Cabin-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Cabin; src: url(/fonts/Cabin-Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Cabin; src: url(/fonts/Cabin-SemiBold.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Cormorant; src: url(/fonts/Cormorant-Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Cormorant; src: url(/fonts/Cormorant-MediumItalic.woff2) format('woff2'); font-weight: 500; font-style: italic; font-display: swap; }

/* OA studio palette */
:root {
  --studio: #050506;
  --graphite: #121316;
  --graphite2: #191a1e;
  --steel: #2a2c31;
  --steel2: #3a3d44;
  --platinum: #eceef2;
  --smoke: #8b8e96;
  --ash: #5d6068;
  --chrome: linear-gradient(100deg, #8f939b 0%, #f7f8fa 18%, #b4b8c0 34%, #ffffff 50%, #9a9ea6 66%, #e9ebee 82%, #8a8e96 100%);
  --brushed: linear-gradient(180deg, #f4f5f7 0%, #cfd2d8 46%, #b3b7bf 54%, #e2e4e8 100%);
  --ok: #9ed7b4; --warn: #e8c987; --bad: #ef9a9a; --info: #a9bede;
  --ease: cubic-bezier(.2,.7,.1,1);
  --side: 252px;
}
* { box-sizing: border-box; margin: 0; }
html, body { background: var(--studio); color: var(--platinum); font: 400 15px/1.5 Cabin, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: #d5d8de; color: #050506; }
:focus-visible { outline: 1px solid #e9ebef; outline-offset: 2px; }

body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

.chrome { background: var(--chrome); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
.chrome.sweep { animation: sweep 2.6s .2s var(--ease) both; }
@keyframes sweep { from { background-position: 100% 0; } to { background-position: 0 0; } }

.boot { height: 100vh; display: grid; place-items: center; }
.boot img { width: 170px; opacity: .45; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .12; } }

/* ---------------- login / setup: the studio stage ---------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--studio); }
.stage { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 56px; border-right: 1px solid var(--steel); }
.stage::before { content: ""; position: absolute; left: 50%; top: -30%; width: 120%; height: 110%; transform: translateX(-50%);
  background: radial-gradient(ellipse 45% 55% at 50% 40%, rgba(235,238,245,.16), rgba(235,238,245,.04) 55%, transparent 72%);
  animation: lightup 2.2s var(--ease) both; }
.stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 38%;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.025) 30%, transparent),
              radial-gradient(ellipse 40% 30% at 50% 0%, rgba(230,233,240,.10), transparent 70%); }
@keyframes lightup { from { opacity: 0; } }
.stage .brand { position: relative; z-index: 1; }
.stage .brand img { height: 26px; }
.stage-paper { position: relative; z-index: 1; align-self: center; width: min(330px, 60%); aspect-ratio: 595 / 842; margin: 20px 0;
  background: #fff; transform: perspective(1400px) rotateX(9deg) rotateY(-14deg) rotateZ(2deg);
  box-shadow: 0 50px 80px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.05);
  animation: paperIn 1.6s .3s var(--ease) both; }
.stage-paper::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: -46px; height: 30px; background: radial-gradient(ellipse at center, rgba(0,0,0,.85), transparent 70%); filter: blur(6px); }
@keyframes paperIn { from { opacity: 0; transform: perspective(1400px) rotateX(18deg) rotateY(-22deg) rotateZ(4deg) translateY(30px); } }
.stage-paper .hd { height: 11.5%; background: #070708; display: flex; align-items: center; justify-content: space-between; padding: 0 8.5%; }
.stage-paper .hd img { height: 26%; }
.stage-paper .hd i { width: 18%; height: 7%; background: #d9dbe0; }
.stage-paper .bd { padding: 9% 8.5%; display: grid; gap: 9px; align-content: start; }
.stage-paper .bd b { display: block; height: 6px; background: #e9eaee; }
.stage-paper .bd b.t { height: 15px; width: 52%; background: #1a1a1c; margin-bottom: 4px; }
.stage-paper .bd b.s { width: 70%; } .stage-paper .bd b.x { width: 40%; }
.stage-paper .bd b.box { height: 24px; background: #f1f2f4; border-left: 3px solid #111; margin: 4px 0; }
.stage-paper .bd b.line { height: 1px; background: #222; margin-top: 6px; }
.stage .tagline { position: relative; z-index: 1; font: 500 italic 24px/1.3 Cormorant, serif; color: var(--smoke); max-width: 26ch; }

.gate { display: grid; place-items: center; padding: 40px 28px; position: relative; }
.gate-card { width: 100%; max-width: 380px; }
.gate-card > * { animation: rise .9s var(--ease) both; }
.gate-card > *:nth-child(2) { animation-delay: .1s; } .gate-card > *:nth-child(3) { animation-delay: .2s; } .gate-card > *:nth-child(4) { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.gate h1 { font: 500 56px/1 Cormorant, serif; letter-spacing: -.01em; margin-bottom: 10px; }
.gate p.sub { color: var(--smoke); margin-bottom: 34px; }
.gate .foot { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--steel); font-size: 12.5px; color: var(--ash); display: flex; gap: 10px; align-items: center; }
.gate .foot svg { width: 14px; height: 14px; flex: none; }
.step { animation: stepIn .5s var(--ease); }
@keyframes stepIn { from { opacity: 0; transform: translateX(16px); } }
.shake { animation: shake .42s; }
@keyframes shake { 20%,60% { transform: translateX(-7px); } 40%,80% { transform: translateX(7px); } }
.leaving .gate-card, .leaving .stage-paper { transition: opacity .5s, transform .6s var(--ease); opacity: 0; transform: translateY(-10px) scale(.98); }
.code-input { font: 500 32px/1 Cabin, sans-serif !important; letter-spacing: .55em; text-align: center; padding: 14px 0 14px .55em !important; }
.qrbox { background: #fff; padding: 14px; width: 214px; margin: 4px auto 12px; }
.qrbox svg { display: block; width: 186px; height: 186px; }
.secret { font: 500 13px/1.5 Cabin, sans-serif; letter-spacing: .12em; word-break: break-all; color: var(--smoke); text-align: center; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 18px; }
.codes span { border: 1px solid var(--steel2); padding: 11px; text-align: center; font: 500 15px Cabin, sans-serif; letter-spacing: .1em; }

/* ---------------- fields & buttons ---------------- */
label.f { display: block; margin-bottom: 16px; }
label.f > span { display: block; font-size: 13px; color: var(--smoke); margin-bottom: 7px; }
input, select, textarea { width: 100%; background: var(--graphite2); border: 1px solid var(--steel); border-bottom-color: var(--steel2); padding: 11px 13px; outline: none; border-radius: 0; transition: border-color .2s, background .2s, box-shadow .2s; }
input:hover, select:hover, textarea:hover { border-color: var(--steel2); }
input:focus, select:focus, textarea:focus { border-color: #c8cbd2; background: #1d1e23; box-shadow: 0 0 0 3px rgba(220,223,230,.06); }
input::placeholder, textarea::placeholder { color: var(--ash); }
input:disabled { color: var(--smoke); background: transparent; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8b8e96 50%), linear-gradient(135deg, #8b8e96 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type=date] { color-scheme: dark; }

/* buttons: same as oadesignmalta.com */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 12px; white-space: nowrap; padding: 15px 26px; border-radius: 6px; border: 1px solid rgba(213,216,221,.38); background: transparent; color: #d5d8dd; font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; cursor: pointer; line-height: 1.2;
  transition: transform .6s cubic-bezier(.22,.8,.24,1), background-position 1.2s cubic-bezier(.22,.8,.24,1), box-shadow .8s cubic-bezier(.22,.8,.24,1), color .4s, border-color .4s, background-color .4s; }
.btn:hover { color: #fff; border-color: #d5d8dd; background-color: rgba(255,255,255,.05); }
.btn:active { transform: scale(.98); }
.btn.primary { border-color: transparent; color: #0e0f11; background: linear-gradient(135deg, #f7f8fa 0%, #c9cdd3 50%, #f7f8fa 100%) 0% 0% / 220% 220%; box-shadow: 0 10px 30px -14px rgba(213,216,221,.35); }
.btn.primary::after { content: ""; position: absolute; top: 0; left: -80%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.6), transparent); transform: skewX(-20deg); transition: left 1.4s cubic-bezier(.22,.8,.24,1); }
.btn.primary:hover { color: #0e0f11; background-position: 100% 50%; box-shadow: 0 22px 46px -22px rgba(213,216,221,.6); }
.btn.primary:hover::after { left: 130%; }
.btn .arr { display: inline-block; transition: transform .6s cubic-bezier(.22,.8,.24,1); }
.btn:hover .arr { transform: translateX(4px); }
.btn.block { width: 100%; padding: 18px 32px; }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); background-color: rgba(239,154,154,.06); }
.btn.ghost { border-color: transparent; color: var(--smoke); padding-left: 14px; padding-right: 14px; }
.btn.ghost:hover { color: #fff; border-color: rgba(213,216,221,.38); }
.btn.sm { padding: 10px 16px; font-size: 10px; letter-spacing: .18em; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 14px; height: 14px; flex: none; }
.linkbtn { background: none; border: 0; color: var(--smoke); cursor: pointer; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--steel2); padding: 0; }
.linkbtn:hover { color: var(--platinum); }
.err { color: var(--bad); font-size: 13.5px; min-height: 20px; margin: -4px 0 12px; }
.spin { width: 14px; height: 14px; border: 1.5px solid rgba(0,0,0,.2); border-top-color: #050506; border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------------- shell: sidebar + stage ---------------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 30px 22px 22px; border-right: 1px solid var(--steel); background: linear-gradient(180deg, #0b0c0e, #070708 60%); }
.side .logo { width: 150px; cursor: pointer; margin: 0 0 6px 4px; }
.side .who { font: 500 italic 17px Cormorant, serif; color: var(--smoke); margin: 0 0 34px 5px; }
.side .create { display: grid; gap: 8px; margin-bottom: 30px; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: var(--smoke); text-decoration: none; font-size: 14px; border-left: 1px solid transparent; transition: color .2s, background .2s; }
.side nav a svg { width: 17px; height: 17px; opacity: .8; }
.side nav a:hover { color: var(--platinum); }
.side nav a.on { color: var(--platinum); background: linear-gradient(90deg, rgba(236,238,242,.07), transparent); border-left-color: #e9ebef; }
.side .install { margin-top: auto; margin-bottom: 14px; }
.side .install[hidden] { display: none; }
.side .install + .bottom { margin-top: 0; }
.side .bottom { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--steel); display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--ash); }
.side .bottom .lock { display: flex; align-items: center; gap: 8px; }
.side .bottom svg { width: 14px; height: 14px; }

.content { position: relative; min-width: 0; }
.content::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 520px; pointer-events: none;
  background: radial-gradient(ellipse 55% 70% at 62% -10%, rgba(230,233,240,.085), transparent 70%); }
main { position: relative; max-width: 1360px; padding: 40px 44px 110px; animation: fadeIn .45s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } }

.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 34px; flex-wrap: wrap; }
.pagehead h1 { font: 500 58px/1.02 Cormorant, serif; letter-spacing: -.012em; padding-bottom: 4px; }
.pagehead .lede { color: var(--smoke); margin-top: 10px; max-width: 60ch; }

/* dashboard */
.dash-top { display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px; margin-bottom: 40px; }
.figures { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--steel); border-left: 1px solid var(--steel); align-self: start; }
.fig { padding: 22px 24px 20px; border-right: 1px solid var(--steel); border-bottom: 1px solid var(--steel); background: linear-gradient(180deg, rgba(255,255,255,.018), transparent); }
.fig .k { font-size: 13px; color: var(--smoke); }
.fig .v { font: 500 46px/1.05 Cormorant, serif; margin-top: 8px; font-variant-numeric: lining-nums; }
.fig .v small { font-size: 26px; color: var(--smoke); margin-right: 3px; }
.fig.warn .v { color: var(--warn); }
.spot { position: relative; min-height: 330px; border: 1px solid var(--steel); overflow: hidden; display: grid; place-items: center; cursor: pointer;
  background: radial-gradient(ellipse 50% 60% at 50% 18%, rgba(232,235,242,.14), transparent 70%), linear-gradient(180deg, #0c0d0f, #050506); }
.spot::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.035)); border-top: 1px solid rgba(255,255,255,.04); }
.spot img { position: relative; z-index: 1; height: 246px; width: auto; margin: 0 0 46px 34%; transform: perspective(1200px) rotateX(8deg) rotateY(-12deg) rotateZ(1.5deg); box-shadow: 0 40px 60px -26px #000, 0 0 0 1px rgba(255,255,255,.06); transition: transform .8s var(--ease); }
.spot:hover img { transform: perspective(1200px) rotateX(4deg) rotateY(-5deg) rotateZ(.5deg) translateY(-6px); }
.spot .cap { position: absolute; left: 22px; bottom: 16px; z-index: 2; font-size: 13px; color: var(--smoke); }
.spot .cap b { display: block; color: var(--platinum); font: 500 24px Cormorant, serif; }
.spot .none { position: relative; z-index: 1; text-align: center; color: var(--smoke); padding: 20px; }
.spot .none b { display: block; font: 500 30px Cormorant, serif; color: var(--platinum); margin-bottom: 4px; }

.section-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.section-title h2 { font: 500 32px Cormorant, serif; }
.section-title a { font-size: 13px; color: var(--smoke); }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input { max-width: 340px; }
.toolbar select { width: auto; min-width: 160px; }

table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-weight: 400; font-size: 12.5px; color: var(--ash); padding: 10px 14px; border-bottom: 1px solid var(--steel2); }
table.list td { padding: 16px 14px; border-bottom: 1px solid var(--steel); vertical-align: middle; }
table.list tr.row { cursor: pointer; transition: background .15s; }
table.list tr.row:hover { background: linear-gradient(90deg, rgba(236,238,242,.05), transparent 70%); }
table.list .num { font-weight: 500; letter-spacing: .02em; white-space: nowrap; }
table.list .kind { display: block; font-size: 12.5px; color: var(--smoke); margin-top: 2px; }
table.list .r { text-align: right; font-variant-numeric: tabular-nums; }
table.list .muted { color: var(--smoke); font-size: 13px; }
table.list .amt { font: 500 21px Cormorant, serif; }
.empty { padding: 64px 20px; text-align: center; color: var(--smoke); border: 1px solid var(--steel); background: radial-gradient(ellipse 50% 80% at 50% 0%, rgba(232,235,242,.06), transparent 70%); }
.empty h3 { font: 500 32px Cormorant, serif; color: var(--platinum); margin-bottom: 6px; }

.st { font-size: 13px; display: inline-flex; align-items: center; gap: 8px; color: var(--smoke); }
.st::before { content: ""; width: 6px; height: 6px; background: var(--ash); transform: rotate(45deg); }
.st.sent::before { background: var(--info); } .st.accepted::before, .st.paid::before { background: var(--ok); }
.st.accepted, .st.paid { color: var(--ok); }
.st.declined::before, .st.cancelled::before { background: var(--bad); }
.st.overdue { color: var(--warn); } .st.overdue::before { background: var(--warn); }

/* ---------------- editor ---------------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 540px); gap: 34px; align-items: start; }
.panel { background: linear-gradient(180deg, #131417, #0f1012); border: 1px solid var(--steel); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); padding: 24px 26px 10px; margin-bottom: 20px; }
.panel > h2 { font: 500 28px/1.1 Cormorant, serif; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.panel > h2 small { font: 400 13px Cabin, sans-serif; color: var(--smoke); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
.docnum { text-align: right; }
.docnum small { display: block; font-size: 13px; color: var(--smoke); margin-bottom: 4px; }
.docnum b { font: 500 36px/1 Cormorant, serif; letter-spacing: .01em; }

.client-search { position: relative; margin-bottom: 18px; }
.client-search svg { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--ash); pointer-events: none; }
.client-search input { padding-left: 38px; }
.suggest { position: absolute; z-index: 15; left: 0; right: 0; top: 100%; background: #17181b; border: 1px solid var(--steel2); border-top: 0; max-height: 280px; overflow: auto; box-shadow: 0 20px 40px -10px #000; }
.suggest button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 11px 13px; cursor: pointer; border-bottom: 1px solid var(--steel); }
.suggest button:hover { background: #202126; }
.suggest small { color: var(--smoke); margin-left: 8px; }

.item { border: 1px solid var(--steel); background: #0d0e10; padding: 16px 16px 2px; margin-bottom: 12px; position: relative; }
.item.added { animation: rise .4s var(--ease); }
.item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.item-head .n { font: 500 italic 20px Cormorant, serif; color: var(--smoke); }
.item-head .tools { display: flex; gap: 2px; }
.item-head .tools button { background: none; border: 1px solid transparent; border-radius: 4px; color: var(--ash); width: 30px; height: 28px; cursor: pointer; display: grid; place-items: center; }
.item-head .tools button svg { width: 15px; height: 15px; }
.item-head .tools button:hover { border-color: var(--steel2); color: var(--platinum); }
.item .row1 { display: grid; grid-template-columns: 1fr 1.6fr; gap: 0 14px; }
.item .row2 { display: grid; grid-template-columns: 1.3fr .7fr .9fr 1fr; gap: 0 14px; align-items: end; }
.item .lt { padding: 8px 0 12px; text-align: right; font: 500 26px Cormorant, serif; margin-bottom: 16px; }
.seg { display: flex; border: 1px solid rgba(213,216,221,.25); border-radius: 6px; padding: 3px; gap: 3px; }
.seg button { flex: 1; background: transparent; border: 0; border-radius: 4px; padding: 10px 6px; color: var(--smoke); cursor: pointer; font-size: 10px; font-weight: 600; letter-spacing: .1em; white-space: nowrap; text-transform: uppercase; transition: color .3s, background .3s; }
.seg button:hover { color: var(--platinum); }
.seg button.on { background: linear-gradient(135deg, #f7f8fa 0%, #c9cdd3 50%, #f7f8fa 100%); color: #0e0f11; box-shadow: 0 8px 22px -12px rgba(213,216,221,.5); }

.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.sumbox { border-top: 1px solid var(--steel2); margin: 2px 0 16px; padding-top: 12px; }
.sumbox div { display: flex; justify-content: space-between; padding: 4px 0; color: var(--smoke); font-variant-numeric: tabular-nums; }
.sumbox div b { color: var(--platinum); font-weight: 500; }
.sumbox .big { align-items: baseline; color: var(--platinum); border-top: 1px solid var(--steel2); margin-top: 8px; padding-top: 12px; }
.sumbox .big span:first-child { font: 500 26px Cormorant, serif; }
.sumbox .big span:last-child { font: 500 42px/1 Cormorant, serif; }

.preview-wrap { position: sticky; top: 24px; }
.preview { position: relative; padding: 30px 34px 40px; max-height: calc(100vh - 110px); overflow: auto; border: 1px solid var(--steel);
  background: radial-gradient(ellipse 70% 40% at 50% 0%, rgba(232,235,242,.14), transparent 75%), linear-gradient(180deg, #0e0f11, #060607); }
.preview canvas { width: 100%; display: block; background: #fff; box-shadow: 0 34px 60px -24px #000, 0 0 0 1px rgba(255,255,255,.05); margin-bottom: 22px; }
.preview canvas:last-child { margin-bottom: 0; }
.preview-bar { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.preview-bar b { font: 500 24px Cormorant, serif; }
.preview-bar span { font-size: 12.5px; color: var(--smoke); }
.updating canvas { opacity: .7; transition: opacity .2s; }

.savebar { position: sticky; bottom: 0; z-index: 18; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 16px 0 18px; margin-top: 4px;
  background: linear-gradient(180deg, transparent, var(--studio) 32%); }
.savebar .spacer { flex: 1; }
.dirty-dot { font-size: 13px; color: var(--warn); }
.mobile-tabs { display: none; }
.tabs { display: flex; border: 1px solid rgba(213,216,221,.25); border-radius: 6px; padding: 3px; gap: 3px; }
.tabs button { background: none; border: 0; border-radius: 4px; padding: 10px 16px; color: var(--smoke); cursor: pointer; font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.tabs button.on { background: linear-gradient(135deg, #f7f8fa 0%, #c9cdd3 50%, #f7f8fa 100%); color: #0e0f11; }

/* ---------------- modal / toast ---------------- */
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.72); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 20px; animation: fadeIn .2s; }
.modal { background: linear-gradient(180deg, #16171a, #101113); border: 1px solid var(--steel2); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 40px 80px -20px #000; width: 100%; max-width: 540px; padding: 30px; animation: rise .35s var(--ease); max-height: 90vh; overflow: auto; }
.modal h3 { font: 500 36px/1.1 Cormorant, serif; margin-bottom: 10px; }
.modal p { color: var(--smoke); margin-bottom: 20px; }
.modal .btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
#toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px); opacity: 0; z-index: 60; border-radius: 6px; background: linear-gradient(135deg, #f7f8fa 0%, #c9cdd3 50%, #f7f8fa 100%); color: #08080a; padding: 13px 22px; font-size: 14px; font-weight: 500; transition: all .35s var(--ease); pointer-events: none; max-width: calc(100vw - 40px); box-shadow: 0 16px 40px -10px #000; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: #f0a3a3; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.loglist { font-size: 13px; }
.loglist div { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--steel); color: var(--smoke); }
.loglist .ok { color: var(--ok); } .loglist .no { color: var(--bad); }
.hint { color: var(--ash); font-size: 13px; margin: -8px 0 16px; }

/* ---------------- responsive ---------------- */
@media (max-width: 1180px) {
  .editor { grid-template-columns: 1fr; }
  .preview-wrap { position: static; display: none; }
  .editor.show-preview .preview-wrap { display: block; }
  .editor.show-preview .form-col { display: none; }
  .mobile-tabs { display: flex; margin-bottom: 18px; }
  .mobile-tabs button { flex: 1; }
  .preview { max-height: none; }
  .dash-top { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .stage { min-height: 300px; border-right: 0; border-bottom: 1px solid var(--steel); padding: 26px 24px; }
  .stage-paper { width: 150px; margin: 18px 0 6px; }
  .stage-paper .bd { gap: 5px; } .stage-paper .bd b { height: 4px; } .stage-paper .bd b.t { height: 9px; } .stage-paper .bd b.box { height: 14px; }
  .stage .tagline { display: none; }
  .gate { padding: 34px 22px 50px; align-items: start; }
  .gate h1 { font-size: 46px; }
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; align-items: center; padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--steel); background: var(--studio); }
  .side .logo { width: 108px; margin: 0; }
  .side .who, .side .bottom .lock { display: none; }
  .side .install { margin: 0 6px 0 0; order: 3; padding: 9px 11px; }
  .side .install svg { display: none; }
  .side .create { display: flex; margin: 0 0 0 auto; gap: 6px; }
  .side .create .btn { padding: 9px 13px; font-size: 9.5px; letter-spacing: .14em; }
  .side .create .btn svg { display: none; }
  .side nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; background: rgba(5,5,6,.97); border-top: 1px solid var(--steel); padding: 4px 2px calc(4px + env(safe-area-inset-bottom)); }
  .side nav a { flex-direction: column; gap: 3px; font-size: 11px; padding: 7px 4px; border-left: 0; flex: 1; text-align: center; }
  .side nav a.on { background: none; box-shadow: inset 0 1px 0 #e9ebef; }
  .side .bottom { margin: 0 0 0 4px; padding: 0; border: 0; }
  main { padding: 26px 18px 130px; }
  .pagehead { margin-bottom: 24px; }
  .pagehead h1 { font-size: 44px; }
  .fig { padding: 16px; } .fig .v { font-size: 34px; }
  .spot { min-height: 250px; } .spot img { height: 180px; margin-left: 40%; }
  .grid2, .grid3, .settings-grid, .totals { grid-template-columns: 1fr; }
  .item .row1 { grid-template-columns: 1fr; }
  .item .row2 { grid-template-columns: 1fr 1fr; }
  .seg { flex-wrap: wrap; } .seg button { flex: 1 1 45%; }
  table.list .hide-m { display: none; }
  table.list td, table.list th { padding: 13px 8px; }
  .savebar { bottom: 62px; }
  .panel { padding: 18px 16px 6px; }
  .docnum b { font-size: 26px; }
}
/* phones: compact, app-sized */
@media (max-width: 600px) {
  html, body { font-size: 14px; }
  .stage { min-height: 0; padding: 18px 20px; border-bottom: 1px solid var(--steel); }
  .stage::after, .stage-paper { display: none; }
  .stage .brand img { height: 18px; }
  .gate { padding: 26px 20px 40px; }
  .gate h1 { font-size: 34px; margin-bottom: 6px; }
  .gate p.sub { margin-bottom: 22px; font-size: 13.5px; }
  .code-input { font-size: 24px !important; }
  .qrbox { width: 180px; padding: 10px; } .qrbox svg { width: 160px; height: 160px; }
  label.f { margin-bottom: 12px; }
  label.f > span { font-size: 12px; margin-bottom: 5px; }
  input, select, textarea { padding: 10px 11px; font-size: 16px; }
  .btn { padding: 12px 18px; font-size: 10.5px; letter-spacing: .16em; }
  .btn.block { padding: 14px 20px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { padding: 10px 12px; gap: 6px; min-width: 0; }
  .side .create { gap: 5px; min-width: 0; }
  .hide-s { display: none; }
  .side .bottom .btn.ghost { padding: 0 4px; }
  .content, main { min-width: 0; }
  .side .logo { width: 92px; }
  .side .create .btn, .side .install { padding: 8px 10px; font-size: 9px; letter-spacing: .1em; }
  .side nav a { font-size: 10.5px; padding: 6px 2px; }
  .side nav a svg { width: 18px; height: 18px; }
  main { padding: 18px 14px 120px; }
  .pagehead { margin-bottom: 18px; gap: 10px; }
  .pagehead h1 { font-size: 30px; }
  .pagehead .lede { font-size: 13px; margin-top: 6px; }
  .dash-top { gap: 16px; margin-bottom: 26px; }
  .fig { padding: 12px 14px; } .fig .k { font-size: 12px; } .fig .v { font-size: 26px; margin-top: 4px; } .fig .v small { font-size: 17px; }
  .spot { min-height: 190px; } .spot img { height: 138px; margin: 0 0 30px 44%; } .spot .cap b { font-size: 19px; } .spot .cap { left: 14px; bottom: 10px; font-size: 12px; }
  .section-title h2 { font-size: 24px; }
  table.list td, table.list th { padding: 11px 6px; font-size: 13px; }
  table.list .amt { font-size: 17px; }
  .panel { padding: 14px 12px 4px; margin-bottom: 14px; }
  .panel > h2 { font-size: 21px; margin-bottom: 12px; }
  .docnum b { font-size: 20px; } .docnum small { font-size: 11.5px; }
  .item { padding: 12px 10px 0; } .item-head .n { font-size: 17px; } .item .lt { font-size: 20px; }
  .seg button { font-size: 9px; padding: 9px 4px; letter-spacing: .06em; }
  .sumbox .big span:first-child { font-size: 20px; } .sumbox .big span:last-child { font-size: 30px; }
  .preview { padding: 14px; }
  .modal { padding: 20px; } .modal h3 { font-size: 26px; }
  .savebar { padding: 10px 0 12px; gap: 6px; }
  .savebar .btn { padding: 11px 13px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
