/* Ring the Bell, compact window (2026-11-15, "Combined" design): one navy bar that doubles as the title bar when the
   installed app runs with the window-controls overlay, a light grey body with white inputs, and a white footer.
   Sized for a ~520 x 640 window; it also reads well in a normal browser tab. No inline styles or scripts (CSP). */
:root{--accent:#1E3A8A;--navy:#1E3A8A;--ink:#0F172A;--muted:#64748B;--line:#CBD5E1;--line-soft:#E2E8F0;--surface:#fff;--canvas:#F1F5F9;--danger:#C42B1C;--gap:8px;--control:32px;font-family:"Segoe UI Variable Text","Segoe UI",system-ui,sans-serif;color:var(--ink);background:var(--canvas);font-size:14px;line-height:1.4}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;display:flex;flex-direction:column;background:var(--canvas)}
[hidden]{display:none!important}
a{color:var(--accent)}
p{margin:0 0 10px}
h1,h2{font-size:18px;font-weight:600;letter-spacing:-.2px;margin:0 0 12px}
h3{margin:0}
button,input,textarea,select{font:inherit;color:inherit}
input:focus-visible,textarea:focus-visible,select:focus-visible,button:focus-visible,a:focus-visible,.segment:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:2px}

/* Header: a fixed navy (JS rewrites --accent per identity, so the bar does not use it). Full width and 48 px; with the
   overlay on, the content is inset into the title-bar area so it never sits under the window controls. */
.app-bar{flex:none;position:relative;height:48px;background:var(--navy);color:#fff;-webkit-app-region:drag;app-region:drag;user-select:none;z-index:20}
.app-bar-inner{position:absolute;top:0;bottom:0;left:env(titlebar-area-x,0px);width:env(titlebar-area-width,100%);display:flex;align-items:center;gap:12px;padding:0 12px 0 14px}
.app-bar a,.app-bar button,.account-menu{-webkit-app-region:no-drag;app-region:no-drag}
.brand{display:inline-flex;align-items:center;gap:10px;color:#fff;text-decoration:none;min-width:0}
.brand-tile{flex:none;width:30px;height:30px;border-radius:8px;background:#fff;display:grid;place-items:center}
.brand-icon{display:block;width:24px;height:24px;border-radius:6px}
.brand-name{font-size:17px;font-weight:600;letter-spacing:-.2px;white-space:nowrap}
.app-nav{margin-left:auto;display:flex;align-items:center;gap:14px}
.nav-link{color:#fff;text-decoration:none;font-size:14px;padding:4px 2px;border-bottom:1px solid transparent}
.nav-link:hover{border-bottom-color:#fff}
.app-bar a:focus-visible,.app-bar button:focus-visible{outline-color:#fff}
.account{position:relative}
.account-button{display:flex;align-items:center;gap:4px;background:none;border:0;padding:3px 4px;border-radius:16px;cursor:pointer;color:#fff}
.account-button:hover{background:#ffffff1f}
.account-avatar{width:26px;height:26px;fill:#DBEAFE}
.account-glyph{fill:#1E3A8A;opacity:.85}
.account-chevron{width:12px;height:12px;fill:none;stroke:#fff;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.account-menu{position:absolute;right:0;top:calc(100% + 6px);min-width:200px;background:#fff;color:var(--ink);border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 24px #0f172a2e;padding:6px;user-select:text}
.account-name{margin:0;padding:6px 10px 8px;font-size:13px;color:var(--muted);border-bottom:1px solid var(--line-soft);overflow-wrap:anywhere}
.menu-item{display:block;width:100%;text-align:left;background:none;border:0;border-radius:5px;padding:8px 10px;margin-top:4px;cursor:pointer;color:var(--ink)}
.menu-item:hover,.menu-item:focus-visible{background:var(--canvas)}

/* Page */
.page{flex:1;min-height:0;overflow:auto}
.page.compact>section{margin:12px 16px}
.panel{background:var(--surface);border:1px solid var(--line-soft);border-radius:8px;padding:16px}

/* Controls */
button,.button{display:inline-flex;align-items:center;justify-content:center;height:var(--control);padding:0 14px;border-radius:5px;border:1px solid transparent;cursor:pointer;text-decoration:none;font-size:14px;white-space:nowrap}
button:disabled{opacity:.45;cursor:not-allowed}
.primary{background:#0F6CBD;color:#fff;font-weight:600}
.primary:not(:disabled):hover{background:#115EA3}
.secondary{background:#fff;border-color:var(--line);color:var(--ink)}
.secondary:not(:disabled):hover{background:#F8FAFC}
input[type=text],input[type=url],input:not([type]),textarea,select{width:100%;height:var(--control);padding:0 10px;background:#fff;border:1px solid var(--line);border-radius:5px}
textarea{height:auto;padding:6px 10px;resize:vertical;line-height:20px}
select{padding-right:28px}
label,legend{font-size:13px;font-weight:400;color:#334155}
.field{min-width:0;margin:0 0 var(--gap);border:0;padding:0}
.field>label,.field>legend{display:block;margin:0 0 3px;padding:0}
.row{display:flex;gap:12px;align-items:flex-end}
.row.two>.field{flex:1}
.grow{flex:1}
.muted{color:var(--muted)}
.checkbox{display:inline-flex;align-items:center;gap:7px;white-space:nowrap;color:var(--ink);font-size:14px}
.checkbox input{width:16px;height:16px;margin:0;accent-color:var(--accent)}
.link-row .checkbox{height:var(--control);margin-bottom:var(--gap)}
.link-row .field{margin-bottom:var(--gap)}
.select-wrap{position:relative}
.select-wrap.with-icon select{padding-left:34px}
.identity-icon{position:absolute;left:8px;top:6px;width:20px;height:20px;pointer-events:none}
select:disabled,input:disabled,textarea:disabled{background:#F8FAFC;color:#475569}

/* Counters inside their fields */
.field-wrap{position:relative}
.field-wrap input{padding-right:70px}
.field-wrap.area textarea{line-height:18px;padding-bottom:16px;min-height:0}
.counter{position:absolute;right:9px;top:50%;transform:translateY(-50%);font-size:11.5px;color:var(--muted);pointer-events:none;font-variant-numeric:tabular-nums}
.field-wrap.area .counter{top:auto;bottom:5px;transform:none;right:18px}
.counter.over{color:var(--danger);font-weight:600}

/* Priority: a 3-way segmented control over the same radios */
.segmented{display:flex;border:1px solid var(--line);border-radius:5px;background:#fff;overflow:hidden;height:var(--control)}
.segment{flex:1;position:relative;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--ink);font-size:14px;border-left:1px solid var(--line-soft)}
.segment:first-child{border-left:0}
.segment input{position:absolute;opacity:0;width:1px;height:1px;margin:0}
.segment:hover{background:#F8FAFC}
.segment:has(input:checked){background:var(--accent);color:#fff;font-weight:600}
.segment-outage:has(input:checked){background:var(--danger)}

/* Compose window */
.compose{display:flex;flex-direction:column;min-height:100%}
.compose-body{flex:1;padding:10px 16px 6px}
.compose-footer{position:sticky;bottom:0;display:flex;justify-content:flex-end;gap:8px;padding:8px 16px;background:#fff;border-top:1px solid var(--line-soft);z-index:5}
.mode-note{font-size:13px;background:#EFF6FF;border:1px solid #BFDBFE;border-radius:5px;padding:6px 10px;color:#1E3A8A}
.error{color:#a1271b;background:#fff1ef;border:1px solid #f5c5bd;padding:8px 10px;border-radius:5px;overflow-wrap:anywhere;font-size:13px}
.error a{color:inherit}
.notice{font-size:13px;background:#ECFDF5;border:1px solid #A7F3D0;border-radius:5px;padding:8px 10px;color:#065F46}
.preview-divider{display:flex;align-items:center;gap:10px;margin:0 0 6px;color:var(--muted);font-size:12px}
.preview-divider:before,.preview-divider:after{content:"";flex:1;border-top:1px solid var(--line)}
.preview-wrap{display:flex;justify-content:center}
.preview-note{text-align:center;font-size:11.5px;margin:6px 0 0}

/* Live preview: a small Windows 11 toast (cube + sender name, the sender's bell tile, Segoe UI). It follows the
   viewer's light/dark setting, as the toast follows the PC's Windows mode. */
.toast{--t-bg:#232425;--t-line:#3a3b3c;--t-fg:#fff;--t-fg2:#cdcece;--t-btn:#2f3032;--t-btn-line:#414344;width:300px;max-width:100%;background:var(--t-bg);color:var(--t-fg);border:1px solid var(--t-line);border-radius:8px;padding:2px 12px 12px;box-shadow:0 6px 18px #0f172a33;font-family:"Segoe UI Variable Text","Segoe UI",system-ui,sans-serif}
@media (prefers-color-scheme:light){.toast{--t-bg:#ebedf0;--t-line:#c0c4c9;--t-fg:#171718;--t-fg2:#545454;--t-btn:#fafbfc;--t-btn-line:#e2e4e7}}
.toast-header{display:flex;gap:7px;align-items:center;font-size:11px;min-height:24px}
.toast-header img.toast-app-icon{width:14px;height:14px}
.toast-close{margin-left:auto;width:24px;text-align:center;font-size:10px;color:var(--t-fg2)}
.toast-content{display:grid;grid-template-columns:36px minmax(0,1fr);gap:10px;margin-top:6px}
.toast-icon{width:36px;height:36px}
.toast-content h3{font-size:12.5px;font-weight:600;line-height:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.toast-content p{font-size:12px;line-height:16px;margin:0;color:var(--t-fg2);white-space:pre-wrap;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
#preview-attribution{font-size:11px;margin-top:2px;-webkit-line-clamp:1}
.toast-actions{display:flex;gap:6px;margin-top:9px}
.toast-actions span{flex:1;height:26px;line-height:24px;text-align:center;background:var(--t-btn);border:1px solid var(--t-btn-line);border-radius:4px;font-size:12px;color:var(--t-fg)}

/* Sent. Un-Send bar: 10 seconds above the footer, with a draining line */
.sent-bar{position:fixed;left:16px;right:16px;bottom:62px;z-index:30;display:flex;align-items:center;gap:12px;padding:8px 8px 10px 14px;background:#0F172A;color:#fff;border-radius:7px;box-shadow:0 10px 28px #0f172a59;overflow:hidden;font-size:14px}
.sent-bar-text{flex:1}
.sent-bar a{color:#BFDBFE}
.sent-bar-button{height:30px;background:#fff;color:#0F172A;font-weight:600;border-radius:5px}
.sent-bar-button:hover{background:#E2E8F0}
.sent-bar-clock{position:absolute;left:0;bottom:0;height:3px;width:100%;background:#60A5FA;transform-origin:left center}
.sent-bar.running .sent-bar-clock{animation:sent-bar-drain 10s linear forwards}
@keyframes sent-bar-drain{from{transform:scaleX(1)}to{transform:scaleX(0)}}
@media (prefers-reduced-motion:reduce){.sent-bar.running .sent-bar-clock{animation:none}}

/* Dialogs */
dialog{width:calc(100% - 32px);max-width:480px;max-height:calc(100% - 32px);border:1px solid var(--line);border-radius:10px;padding:18px 20px;color:var(--ink);box-shadow:0 18px 48px #0f172a40}
dialog::backdrop{background:#0f172a80}
dialog p{font-size:13px;line-height:1.5}
.actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:14px;justify-content:flex-end}
dl{margin:0}
dt{color:var(--muted);font-size:12px}
dd{margin:2px 0 10px;overflow-wrap:anywhere}
#unsend-fields{margin:12px 0}
#unsend-fields label{display:block;margin:8px 0 4px}
#unsend-confirm .checkbox{white-space:normal}

/* Sent list and detail */
.sent-list>p{font-size:13px}
.sent-list article{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 0;border-top:1px solid var(--line-soft)}
.sent-list article a{font-weight:600;overflow-wrap:anywhere}
.sent-list article p{font-size:12px;color:var(--muted);margin:2px 0 0}
.status{font-size:12.5px;text-align:right}
.detail .actions{justify-content:flex-start}.detail .status{text-align:left;font-weight:600}
.eyebrow{font-size:11.5px;color:var(--accent);text-transform:uppercase;letter-spacing:.7px;margin-bottom:6px}
.message-text{white-space:pre-wrap;overflow-wrap:anywhere}
.section-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.section-heading h2{margin:0}
.detail h2{font-size:15px;margin-top:14px}
.detail p{font-size:13px}
.tally{display:grid;grid-template-columns:1fr auto;gap:6px 12px;margin-bottom:10px}
.tally dt{font-size:13px;color:var(--ink)}
.tally dd{font-weight:600;margin:0}
hr{border:0;border-top:1px solid var(--line-soft);margin:16px 0}

/* Signed-out landing, dev sign-in, no access */
.landing{max-width:400px;margin:40px auto!important;text-align:center;padding:32px 24px}
.landing-logo{display:block;margin:0 auto 14px;border-radius:18px}
.landing h1{font-size:22px;margin-bottom:6px}
.landing p{color:var(--muted);margin:0 0 20px}
.login{max-width:440px}
.login button{margin-top:14px}
.login label{display:block;margin:10px 0 4px}

@media (max-width:420px){.row.two{flex-direction:column;align-items:stretch;gap:0}.brand-name{font-size:15px}.compose-footer{flex-wrap:wrap}.compose-footer button{flex:1}}
