/* Client-facing look for proposals and invoices: the Mebarez quotation style. One dark look on purpose. */
:root {
  --bg: #09090b; --panel: #18181b; --line: #27272a; --line2: #3f3f46;
  --fg: #fafafa; --soft: #d4d4d8; --mute: #a1a1aa;
  --accent: #fb7185; --accent-strong: #be123c; --bar: #f43f5e; --ok: #4ade80;
  --display: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--display); font-size: 16px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 32px 140px; }
.wrap { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 36px; }
.label { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.label.a { color: var(--accent); }
h1, h2 { margin: 0; letter-spacing: -.03em; line-height: 1.05; text-wrap: balance; }
h2 { font-size: 24px; font-weight: 900; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Omani rial symbol, takes the text colour. */
.omr { display: inline-block; width: 1.3em; height: .68em; margin-right: .22em; background: currentColor; -webkit-mask: url(/brand/omr.svg) no-repeat 50% 100% / contain; mask: url(/brand/omr.svg) no-repeat 50% 100% / contain; }
a { color: var(--accent); }
p { margin: 0; }

header.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; gap: 10px; }
.brand b { font-size: 28px; font-weight: 900; letter-spacing: -.03em; line-height: 1.05; }
.logo-img { height: 44px; width: auto; display: block; }
.rule { width: 56px; height: 4px; border-radius: 2px; background: var(--bar); }
.doc-no { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.doc-no h1 { font-size: 44px; font-weight: 900; }
.doc-no span { font-family: var(--mono); font-size: 15px; color: var(--accent); }

.meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.meta div { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; padding-top: 24px; border-top: 1px solid var(--line2); }
.parties > div { display: flex; flex-direction: column; gap: 2px; color: var(--soft); min-width: 0; overflow-wrap: anywhere; }
.parties strong { font-size: 22px; font-weight: 900; letter-spacing: -.02em; color: var(--fg); margin: 6px 0; }

section.blk { display: flex; flex-direction: column; gap: 14px; }
.hero { font-size: clamp(30px, 6vw, 40px); font-weight: 900; }
.prose { color: var(--soft); max-width: 64ch; display: flex; flex-direction: column; gap: 8px; }
.prose ul { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; }
.prose strong { color: var(--fg); }
figure { margin: 0; } figure img { max-width: 100%; border-radius: 10px; display: block; }
figcaption { font-size: 13px; color: var(--mute); margin-top: 6px; }
.vid { position: relative; padding-top: 56.25%; border-radius: 10px; overflow: hidden; background: var(--panel); }
.vid iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* packages: pick one */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.tier { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; background: var(--panel); border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color .15s; }
.tier:hover { border-color: var(--line2); }
.tier input { position: absolute; opacity: 0; pointer-events: none; }
.tier:has(input:checked) { border-color: var(--accent); }
.tier:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.tier.locked { cursor: default; }
.t-name { font-size: 18px; font-weight: 700; line-height: 1.2; }
.t-price { font-size: 26px; font-weight: 900; letter-spacing: -.02em; }
.tier ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; font-size: 14px; color: var(--soft); }
.tier li { display: flex; gap: 8px; }
.tier li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 8px; border-radius: 50%; background: var(--mute); }
.pick { margin-top: auto; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.pick::after { content: "Select"; }
.tier:has(input:checked) .pick { color: var(--accent); }
.tier:has(input:checked) .pick::after { content: "Selected"; }
.tag { align-self: flex-start; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--accent-strong); color: var(--fg); }

/* pricing rows / add-ons */
.rows { display: flex; flex-direction: column; border-top: 1px solid var(--line2); }
.r { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 4px; border-bottom: 1px solid var(--line); }
.r.fixed { grid-template-columns: minmax(0, 1fr) auto; }
label.r { cursor: pointer; }
.r input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent-strong); margin: 0; cursor: pointer; }
.r-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.r-name { font-weight: 500; font-size: 17px; }
.r-desc { font-size: 14px; color: var(--mute); }
.r-price { text-align: right; font-weight: 500; white-space: nowrap; }
.r.off .r-price { color: var(--mute); }
.r.on .r-price { color: var(--accent); }
.stepper { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }
.stepper button { width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--line2); background: var(--panel); color: var(--fg); font-size: 18px; line-height: 1; cursor: pointer; }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper output { min-width: 24px; text-align: center; font-family: var(--mono); }

.summary { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 20px; }
.row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--soft); }
.row:last-child { border-bottom: 0; }
.row.total { color: var(--fg); font-weight: 900; font-size: 22px; padding-top: 14px; }

.box { display: flex; flex-direction: column; gap: 14px; padding: 22px; border: 1px solid var(--line2); border-radius: 10px; }
.box.ok { border: 1.5px solid var(--ok); }
.box.no { border-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field input, .field textarea { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line2); border-radius: 8px; padding: 12px 14px; width: 100%; }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
#pad { width: 100%; aspect-ratio: 700 / 170; height: auto; border: 1px dashed var(--line2); border-radius: 8px; background: #fafafa; touch-action: none; cursor: crosshair; display: block; }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--soft); font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent-strong); flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 8px; border: 0; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent-strong); color: var(--fg); }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line2); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .linkbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.linkbtn { background: none; border: 0; color: var(--mute); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; padding: 8px 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.note { font-size: 14px; color: var(--mute); }
.sig-img { max-width: 240px; background: #fafafa; border-radius: 8px; display: block; }

.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.thread li { padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; color: var(--soft); }
.thread li.me { border-color: var(--line2); background: transparent; }
.thread b { color: var(--fg); }

.fine { display: flex; flex-direction: column; gap: 8px; padding-top: 20px; border-top: 1px solid var(--line2); font-size: 14px; color: var(--soft); }
.fine ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 5px; }
.fine li::marker { font-family: var(--mono); color: var(--mute); font-size: 12px; }
footer.doc-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--mute); }
footer.doc-foot span:last-child { font-family: var(--mono); color: var(--accent); }

.pv { background: #422006; color: #fde68a; text-align: center; padding: 8px 12px; font-size: 14px; border-radius: 8px; }
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: rgba(9, 9, 11, .94); backdrop-filter: blur(8px); border-top: 1px solid var(--line2);
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.bar-in { max-width: 780px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bar-total { display: flex; flex-direction: column; }
.bar-total b { font-size: 26px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.center { min-height: 70vh; display: grid; place-items: center; text-align: center; color: var(--mute); }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; display: grid; gap: 8px; z-index: 60; width: min(420px, calc(100% - 32px)); }
#toast div { background: var(--fg); color: var(--bg); padding: 12px 16px; border-radius: 8px; font-weight: 500; }
#toast div.bad { background: var(--accent-strong); color: var(--fg); }

/* invoice table */
.items { display: flex; flex-direction: column; }
.items .ih, .items .ir { display: grid; grid-template-columns: minmax(0, 1fr) 90px 50px 100px; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.items .ih { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); border-top: 1px solid var(--line2); border-bottom-color: var(--line2); padding: 12px 0; }
.items .ir > div:not(:first-child), .items .ih > div:not(:first-child) { text-align: right; }
.paid-stamp { align-self: flex-start; font-family: var(--mono); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--ok); border: 2px solid var(--ok); border-radius: 6px; padding: 6px 12px; }

@media (max-width: 640px) {
  .parties, .two { grid-template-columns: 1fr; }
  .meta { grid-template-columns: 1fr 1fr; }
  .meta div:last-child { grid-column: 1 / -1; }
  .doc-no { align-items: flex-start; }
  .doc-no h1 { font-size: 36px; }
  .parties { gap: 20px; }
  .items .ih { display: none; }
  .items .ir { grid-template-columns: minmax(0, 1fr) auto; }
  .items .ir .c-rate, .items .ir .c-qty { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  html, body { background: var(--bg); }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  body { padding: 0; }
  .bar, .no-print, #toast, .pv { display: none !important; }
  .wrap { gap: 24px; }
  section, .summary, .box { break-inside: avoid; }
}
