/* =============================================================================
   StaffNote employee web app (docs/EMPLOYEE_WEB_APP.md) - mobile first, light + dark.
   Theme: follows the phone (prefers-color-scheme) unless <html data-theme="light|dark"> is set.
   ============================================================================= */

:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --border: #e5e9f0;
  --text: #111827;
  --muted: #6b7280;
  --brand: #2563eb;
  --brand-2: #7c3aed;
  --brand-rgb: 37, 99, 235;
  --mine-bg: #dbeafe;
  --mine-fg: #0f172a;
  --theirs-bg: #ffffff;
  --theirs-fg: #111827;
  --auto-bg: #ede9fe;
  --auto-fg: #3b0764;
  --system-bg: #fef3c7;
  --system-fg: #78350f;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --danger-fg: #991b1b;
  --ok: #16a34a;
  --ok-bg: #dcfce7;
  --ok-fg: #166534;
  --info-bg: #dbeafe;
  --info-fg: #1e3a8a;
  --warn-bg: #fef3c7;
  --warn-fg: #78350f;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f172a; --card: #16213a; --border: #263250; --text: #e2e8f0; --muted: #94a3b8;
    --mine-bg: #1e3a8a; --mine-fg: #e0e7ff; --theirs-bg: #1e293b; --theirs-fg: #e2e8f0;
    --auto-bg: #3b2a6b; --auto-fg: #ede9fe; --system-bg: #3f2d0c; --system-fg: #fde68a;
    --danger-bg: #450a0a; --danger-fg: #fecaca; --ok-bg: #052e16; --ok-fg: #bbf7d0;
    --info-bg: #172554; --info-fg: #bfdbfe; --warn-bg: #3f2d0c; --warn-fg: #fde68a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}
:root[data-theme="dark"] {
  --bg: #0f172a; --card: #16213a; --border: #263250; --text: #e2e8f0; --muted: #94a3b8;
  --mine-bg: #1e3a8a; --mine-fg: #e0e7ff; --theirs-bg: #1e293b; --theirs-fg: #e2e8f0;
  --auto-bg: #3b2a6b; --auto-fg: #ede9fe; --system-bg: #3f2d0c; --system-fg: #fde68a;
  --danger-bg: #450a0a; --danger-fg: #fecaca; --ok-bg: #052e16; --ok-fg: #bbf7d0;
  --info-bg: #172554; --info-fg: #bfdbfe; --warn-bg: #3f2d0c; --warn-fg: #fde68a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sn-app { min-height: 100%; }
.sn-noscript { padding: 24px; text-align: center; }

/* ------------------------------------------------------------------ boot */
.sn-boot { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.sn-boot img { width: 56px; height: 56px; }
.sn-boot-title { font-weight: 700; font-size: 1.2rem; color: var(--text); }
.sn-boot-sub { font-size: 0.9rem; }

/* ------------------------------------------------------------------ building blocks */
.sn-input, .sn-select, .sn-textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 16px; /* 16px: iOS does not zoom into the field */ background: var(--card); color: var(--text); outline: none;
}
.sn-input:focus, .sn-select:focus, .sn-textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.18); }
.sn-input.code { text-align: center; letter-spacing: 0.35em; text-transform: uppercase; font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 1.35rem; padding: 12px; }
.sn-label { display: block; font-size: 0.85rem; color: var(--muted); margin: 12px 0 5px; }
.sn-help { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px 16px; margin-top: 14px;
  border: 1px solid transparent; border-radius: 10px; font-weight: 600; font-size: 0.98rem; cursor: pointer; background: var(--card); color: var(--text);
  transition: filter 0.12s, opacity 0.12s;
}
.btn:hover { filter: brightness(0.96); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.ghost { border-color: var(--border); background: transparent; }
.btn.danger { background: var(--danger-bg); color: var(--danger-fg); }
.btn.small { width: auto; padding: 7px 12px; font-size: 0.85rem; margin-top: 0; }
.btn.link { width: auto; background: transparent; color: var(--brand); padding: 6px 4px; margin-top: 8px; font-weight: 500; }
.btn.link:hover { text-decoration: underline; filter: none; }
.sn-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; margin-top: 8px; font-size: 0.86rem; }
.alert { padding: 10px 12px; border-radius: 10px; font-size: 0.9rem; margin: 12px 0 0; line-height: 1.4; }
.alert.error { background: var(--danger-bg); color: var(--danger-fg); }
.alert.info { background: var(--info-bg); color: var(--info-fg); }
.alert.warn { background: var(--warn-bg); color: var(--warn-fg); }
.alert.ok { background: var(--ok-bg); color: var(--ok-fg); }
.alert .btn.link { margin: 4px 0 0; padding: 0; color: inherit; text-decoration: underline; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sn-spin 0.8s linear infinite; vertical-align: -3px; }
@keyframes sn-spin { to { transform: rotate(360deg); } }
.sn-muted { color: var(--muted); }
.sn-small { font-size: 0.85rem; }
.sn-center { text-align: center; }
.sn-mono { font-family: ui-monospace, Consolas, "Courier New", monospace; }

/* ------------------------------------------------------------------ sign-in */
.sn-auth {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(16px + var(--safe-top)) 14px calc(20px + var(--safe-bottom));
  background: radial-gradient(900px 480px at 10% -10%, rgba(37, 99, 235, 0.22), transparent 60%), radial-gradient(700px 420px at 110% 110%, rgba(124, 58, 237, 0.2), transparent 60%), var(--bg);
}
/* the Android app download bar above the sign-in card (10.22): the card's width, its own corners */
.sn-auth .sn-banner { width: 100%; max-width: 430px; border-radius: 12px; margin-bottom: 10px; }
.sn-card { width: 100%; max-width: 430px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 24px 20px 18px; box-shadow: 0 10px 30px rgba(16, 24, 40, 0.12); }
.sn-logo { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 1.25rem; margin-bottom: 4px; }
.sn-logo img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.sn-step { font-size: 0.78rem; color: var(--muted); text-align: center; margin-bottom: 16px; }
.sn-card h2 { font-size: 1.15rem; margin: 0 0 4px; }
.sn-card p { margin: 0 0 6px; color: var(--muted); font-size: 0.92rem; }
.sn-company { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; background: var(--bg); }
.sn-company img, .sn-avatar { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; }
.sn-avatar { display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 700; font-size: 1.1rem; }
.sn-company .name { font-weight: 600; }
.sn-company .sub { font-size: 0.78rem; color: var(--muted); }
.choice { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; margin-top: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text); text-align: left; cursor: pointer; }
.choice:hover { border-color: var(--brand); }
.choice i { font-size: 1.35rem; color: var(--brand); flex: 0 0 auto; }
.choice .t { font-weight: 600; }
.choice .s { font-size: 0.8rem; color: var(--muted); }
.choice.selected { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(var(--brand-rgb), 0.18); }
.sn-status { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; margin-top: 12px; color: var(--muted); }
.sn-foot { text-align: center; font-size: 0.76rem; color: var(--muted); margin-top: 16px; }
.sn-foot a { color: var(--muted); }

/* ------------------------------------------------------------------ app shell */
.sn-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.sn-header { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--safe-top)) 12px 6px; background: var(--card); border-bottom: 1px solid var(--border); }
.sn-header .brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.sn-header .brand img { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; }
.sn-header .title { font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-header .sub { font-size: 0.74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-header .sub.ok::before, .sn-header .sub.off::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: var(--ok); vertical-align: 1px; }
.sn-header .sub.off::before { background: #9ca3af; }
.sn-tabs { display: flex; gap: 4px; }
.sn-tabs button { position: relative; display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; font-size: 0.86rem; cursor: pointer; }
.sn-tabs button.active { background: rgba(var(--brand-rgb), 0.12); color: var(--brand); }
.sn-tabs button i { font-size: 1.1rem; }
.sn-tabs .badge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 0.68rem; line-height: 18px; text-align: center; }
.sn-banner { flex: 0 0 auto; padding: 8px 12px; font-size: 0.85rem; display: flex; align-items: center; gap: 10px; }
.sn-banner.info { background: var(--info-bg); color: var(--info-fg); }
.sn-banner.warn { background: var(--warn-bg); color: var(--warn-fg); }
.sn-banner.danger, .sn-banner.error { background: var(--danger-bg); color: var(--danger-fg); }
.sn-banner .grow { flex: 1; }
.sn-banner .btn.small { margin: 0; }
.sn-banner .x { background: transparent; border: 0; font-size: 1.1rem; padding: 0 2px; cursor: pointer; opacity: 0.7; }
.sn-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sn-tab { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ------------------------------------------------------------------ chat */
.sn-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px 6px; -webkit-overflow-scrolling: touch; }
.sn-older { display: block; margin: 0 auto 8px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--muted); font-size: 0.8rem; cursor: pointer; }
#msglist { display: flex; flex-direction: column; }
.day { align-self: center; font-size: 0.72rem; color: var(--muted); background: var(--card); border: 1px solid var(--border); padding: 2px 10px; border-radius: 999px; margin: 10px 0 6px; }
.msg { position: relative; max-width: 82%; padding: 8px 12px; margin: 3px 0; border-radius: 16px; font-size: 0.93rem; line-height: 1.42; overflow-wrap: anywhere; word-break: break-word; box-shadow: var(--shadow); }
.msg.mine { align-self: flex-end; background: var(--mine-bg); color: var(--mine-fg); border-bottom-right-radius: 4px; }
.msg.theirs { align-self: flex-start; background: var(--theirs-bg); color: var(--theirs-fg); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.theirs.auto { background: var(--auto-bg); color: var(--auto-fg); border-color: transparent; }
.msg.system { align-self: center; max-width: 92%; background: var(--system-bg); color: var(--system-fg); font-size: 0.86rem; text-align: center; border-radius: 10px; box-shadow: none; }
.msg .sender { font-size: 0.7rem; font-weight: 700; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 2px; }
.msg .body a { color: inherit; text-decoration: underline; }
.msg .meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; font-size: 0.68rem; opacity: 0.7; margin-top: 4px; }
.msg.theirs .meta { justify-content: flex-start; }
.msg .ticks { font-size: 0.78rem; letter-spacing: -2px; }
.msg .ticks.read { color: #2563eb; opacity: 1; }
.msg.mine.failed { outline: 2px solid var(--danger); }
.msg.mine.queued { opacity: 0.78; }
.msg .ticks.wait { letter-spacing: 0; font-style: italic; font-size: 0.68rem; }
.msg .retry { background: transparent; border: 0; color: var(--danger); font-size: 0.75rem; text-decoration: underline; cursor: pointer; padding: 0; }
.msg img.att { display: block; max-width: min(260px, 100%); max-height: 260px; border-radius: 8px; margin-top: 4px; cursor: zoom-in; background: rgba(0, 0, 0, 0.06); }
.msg video.att, .msg audio.att { display: block; max-width: min(300px, 100%); margin-top: 4px; border-radius: 8px; }
.msg a.file { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.06); color: inherit; text-decoration: none; font-size: 0.86rem; }
.msg a.file i { font-size: 1.3rem; }
.msg a.file .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.msg.flagged { outline: 2px solid #ef4444; }
.sn-empty { margin: auto; text-align: center; color: var(--muted); padding: 30px 20px; }
.sn-empty i { font-size: 2.2rem; display: block; margin-bottom: 6px; color: var(--brand); }
.sn-composer { flex: 0 0 auto; display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px calc(8px + var(--safe-bottom)); border-top: 1px solid var(--border); background: var(--card); }
.sn-composer .sn-textarea { flex: 1; resize: none; max-height: 120px; min-height: 44px; padding: 10px 12px; border-radius: 22px; line-height: 1.4; }
.sn-composer .icon { flex: 0 0 auto; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.35rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sn-composer .icon.send { background: var(--brand); color: #fff; font-size: 1.1rem; }
.sn-composer .icon:disabled { opacity: 0.5; cursor: default; }
.sn-preview { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); background: var(--card); font-size: 0.85rem; }
.sn-preview img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.sn-preview .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sn-preview .x { background: transparent; border: 0; font-size: 1.2rem; cursor: pointer; color: var(--muted); }
.sn-readonly { flex: 0 0 auto; padding: 10px 14px calc(10px + var(--safe-bottom)); border-top: 1px solid var(--border); background: var(--card); color: var(--muted); font-size: 0.86rem; text-align: center; }

/* ------------------------------------------------------------------ profile */
.sn-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 0 calc(16px + var(--safe-bottom)); -webkit-overflow-scrolling: touch; }
.sn-section { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin: 12px 12px 0; }
.sn-section h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); margin: 0 0 8px; }
.sn-section p { margin: 0 0 8px; font-size: 0.9rem; }
.sn-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 0.92rem; }
.sn-row:last-child { border-bottom: 0; }
.sn-row .k { color: var(--muted); font-size: 0.84rem; flex: 0 0 auto; }
.sn-row .v { text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.sn-me { display: flex; align-items: center; gap: 14px; margin: 14px 12px 0; padding: 16px; border-radius: 14px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.sn-me .sn-avatar { width: 52px; height: 52px; font-size: 1.4rem; background: rgba(255, 255, 255, 0.22); }
.sn-me .n { font-weight: 700; font-size: 1.1rem; }
.sn-me .c { font-size: 0.82rem; opacity: 0.9; }
.sn-section .btn { margin-top: 10px; }
.sn-section .btn + .btn { margin-top: 8px; }
.sn-section form .sn-label:first-child { margin-top: 4px; }
.sn-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.88rem; }
.sn-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; background: var(--info-bg); color: var(--info-fg); }
.sn-pill.ok { background: var(--ok-bg); color: var(--ok-fg); }
.sn-pill.off { background: var(--border); color: var(--muted); }
.sn-pill.warn { background: var(--warn-bg); color: var(--warn-fg); }

/* ------------------------------------------------------------------ toast + misc */
.sn-toast { position: fixed; left: 50%; bottom: calc(76px + var(--safe-bottom)); transform: translateX(-50%); max-width: 92vw; padding: 10px 14px; border-radius: 10px; background: #111827; color: #fff; font-size: 0.86rem; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); z-index: 50; animation: sn-fade 0.2s ease-out; }
@keyframes sn-fade { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
.sn-lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.9); display: flex; align-items: center; justify-content: center; z-index: 60; cursor: zoom-out; }
.sn-lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 6px; }
.sn-lightbox a { position: absolute; right: 14px; top: calc(12px + var(--safe-top)); color: #fff; font-size: 1.6rem; }

@media (min-width: 720px) {
  .sn-shell { max-width: 760px; margin: 0 auto; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  .msg { max-width: 70%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* "Sending needs the server" policy (admin tick, default on): red status line, greyed composer while the server is unreachable */
.sn-composer .sn-field { flex: 1; min-width: 0; position: relative; display: flex; }
.sn-composer .sn-textarea { font-family: inherit; }
.sn-composer .sn-field.has-help .sn-textarea { padding-right: 42px; }
.sn-qbtn { position: absolute; right: 4px; bottom: 4px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.2rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sn-qbtn:hover, .sn-qbtn:focus-visible { color: var(--brand); background: rgba(var(--brand-rgb), 0.1); outline: none; }

/* Help popup and confirm dialog (CONTRACTS 10.17) */
.sn-sheet-backdrop { position: fixed; inset: 0; z-index: 55; display: flex; align-items: flex-end; justify-content: center; background: rgba(15, 23, 42, 0.45); animation: sn-fade-in 0.15s ease-out; }
.sn-sheet { width: 100%; max-width: 760px; max-height: 88vh; max-height: 88dvh; display: flex; flex-direction: column; background: var(--card); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25); padding-bottom: var(--safe-bottom); animation: sn-up 0.18s ease-out; }
.sn-sheet-head { position: relative; display: flex; align-items: center; gap: 8px; padding: 12px 8px 8px 16px; border-bottom: 1px solid var(--border); }
.sn-sheet-head .t { flex: 1; font-weight: 700; font-size: 1rem; }
.sn-sheet-head .x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.05rem; cursor: pointer; }
.sn-sheet-grip { position: absolute; top: 4px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--border); }
.sn-sheet-body { flex: 1; min-height: 120px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sn-confirm { align-items: center; padding: 16px; }
.sn-dialog { width: 100%; max-width: 380px; background: var(--card); color: var(--text); border-radius: 16px; padding: 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3); animation: sn-up 0.15s ease-out; }
.sn-dialog .t { font-weight: 700; margin-bottom: 8px; }
.sn-dialog-text { font-family: ui-monospace, "Roboto Mono", Menlo, Consolas, monospace; font-size: 0.92rem; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); overflow-wrap: anywhere; white-space: pre-wrap; }
.sn-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.sn-dialog-actions .btn { width: auto; margin: 0; padding: 9px 16px; }
/* the small form of a help entry with fields (server 10.17) */
.sn-form { max-height: 90vh; max-height: 90dvh; overflow-y: auto; }
.sn-form-sub { margin: -4px 0 2px; font-family: ui-monospace, "Roboto Mono", Menlo, Consolas, monospace; font-size: 0.82rem; color: var(--muted); }
.sn-form .sn-label { margin: 10px 0 4px; }
.sn-form .sn-input, .sn-form .sn-select { padding: 9px 10px; }
.sn-form-preview { margin-top: 14px; padding: 9px 12px; border-radius: 10px; background: var(--bg); border: 1px dashed var(--border); }
.sn-form-preview span { display: block; margin-bottom: 2px; font-size: 0.72rem; color: var(--muted); }
.sn-form-preview code { font-family: ui-monospace, "Roboto Mono", Menlo, Consolas, monospace; font-size: 1rem; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.sn-form-err { margin-top: 10px; color: var(--danger); font-size: 0.86rem; font-weight: 600; }
.sn-form-calc { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(var(--brand-rgb), 0.08); font-size: 0.9rem; }
.sn-form-calc b { font-size: 1.05rem; color: var(--brand); }
@keyframes sn-up { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@keyframes sn-fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 720px) { .sn-sheet-backdrop:not(.sn-confirm) { align-items: center; } .sn-sheet { max-width: 560px; max-height: 80vh; border-radius: 16px; } }

/* Message formats: labels and buttons on a message (CONTRACTS 10.17) */
.msg .chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 1px 0 4px; }
.msg .chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.2px; background: rgba(0, 0, 0, 0.07); }
.msg .chip.positive { background: var(--ok-bg); color: var(--ok-fg); }
.msg .chip.negative { background: var(--danger-bg); color: var(--danger-fg); }
.msg .chip.info { background: var(--info-bg); color: var(--info-fg); }
.msg .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg .act { min-width: 64px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-weight: 600; font-size: 0.84rem; cursor: pointer; }
.msg .act.positive { border-color: var(--ok); color: var(--ok); }
.msg .act.negative { border-color: var(--danger); color: var(--danger); }
.msg .act.info { border-color: var(--brand); color: var(--brand); }
.msg .act:disabled { opacity: 0.45; cursor: default; }
.msg .act.chosen { opacity: 1; color: #fff; border-color: transparent; background: var(--muted); }
.msg .act.chosen.positive { background: var(--ok); }
.msg .act.chosen.negative { background: var(--danger); }
.msg .act.chosen.info { background: var(--brand); }
.sn-header .sub.err, .sub.err { color: var(--danger) !important; font-weight: 600; }
.sn-composer.blocked { opacity: 0.6; }
.sn-composer.blocked .sn-textarea, .sn-composer.blocked .icon { cursor: not-allowed; }
