/* SMG Xynthea dashboard. Written for old WebKit (Safari 13 / High Sierra) and Android WebView:
   no flex `gap`, no :is(), no aspect-ratio, -webkit- prefixes where needed. */
/* ---------- themes (pick in the top bar; saved per device) ---------- */
:root, [data-theme="midnight"] {
  --bg: #05090f; --glow: #0d2238; --topbar: rgba(5, 9, 15, 0.9);
  --panel: rgba(14, 26, 40, 0.72); --panel-solid: #0b1522; --raise: rgba(var(--fg-rgb), 0.03);
  --line: rgba(90, 200, 250, 0.16);
  --text: #dbe9f5; --muted: #7d93a8; --strong: #ffffff;
  --accent: #4fd1ff; --accent-rgb: 79, 209, 255; --accent-light: var(--accent-light); --on-accent: #001523;
  --fg-rgb: 255, 255, 255; --sunken: rgba(0, 0, 0, 0.28); --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --amber: #ffb547; --red: #ff5a6a; --green: #45e3a0; --danger-text: var(--danger-text); --warn-text: var(--warn-text);
}
[data-theme="crimson"] {
  --bg: #050304; --glow: #2a070c; --topbar: rgba(6, 3, 4, 0.9);
  --panel: rgba(30, 10, 13, 0.72); --panel-solid: #140809; --raise: rgba(var(--fg-rgb), 0.03);
  --line: rgba(255, 70, 85, 0.2);
  --text: #f3e7e8; --muted: #a8898c; --strong: #ffffff;
  --accent: #ff3347; --accent-rgb: 255, 51, 71; --accent-light: #ff8793; --on-accent: #ffffff;
  --fg-rgb: 255, 255, 255; --sunken: rgba(0, 0, 0, 0.28); --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --amber: #ffb547; --red: #ff6b7a; --green: #45e3a0; --danger-text: #ffc2c8; --warn-text: var(--warn-text);
}
[data-theme="gold"] {
  --bg: #060504; --glow: #241a06; --topbar: rgba(6, 5, 4, 0.9);
  --panel: rgba(28, 22, 10, 0.72); --panel-solid: #120f07; --raise: rgba(var(--fg-rgb), 0.03);
  --line: rgba(227, 179, 65, 0.2);
  --text: #f2ead8; --muted: #a39578; --strong: #ffffff;
  --accent: #e3b341; --accent-rgb: 227, 179, 65; --accent-light: #f3d27f; --on-accent: #1c1404;
  --fg-rgb: 255, 255, 255; --sunken: rgba(0, 0, 0, 0.28); --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --amber: #ffb547; --red: #ff5a6a; --green: #45e3a0; --danger-text: var(--danger-text); --warn-text: var(--warn-text);
}
[data-theme="violet"] {
  --bg: #07060d; --glow: #1c1236; --topbar: rgba(7, 6, 13, 0.9);
  --panel: rgba(22, 17, 40, 0.72); --panel-solid: #100c1e; --raise: rgba(var(--fg-rgb), 0.03);
  --line: rgba(167, 139, 250, 0.2);
  --text: #e8e4f7; --muted: #8f88aa; --strong: #ffffff;
  --accent: #a78bfa; --accent-rgb: 167, 139, 250; --accent-light: #c9b8ff; --on-accent: #120a2b;
  --fg-rgb: 255, 255, 255; --sunken: rgba(0, 0, 0, 0.28); --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --amber: #ffb547; --red: #ff6b7a; --green: #45e3a0; --danger-text: #ffc2c8; --warn-text: var(--warn-text);
}
[data-theme="daylight"] {
  --bg: #eef1f5; --glow: #dde8f6; --topbar: rgba(255, 255, 255, 0.9);
  --panel: rgba(255, 255, 255, 0.96); --panel-solid: #ffffff; --raise: rgba(0, 0, 0, 0.025);
  --line: rgba(20, 40, 70, 0.12);
  --text: #18222e; --muted: #5f6d7c; --strong: #0b1220;
  --accent: #0a74e8; --accent-rgb: 10, 116, 232; --accent-light: #0a5bc0; --on-accent: #ffffff;
  --fg-rgb: 0, 0, 0; --sunken: rgba(20, 40, 70, 0.045); --shadow: 0 8px 24px rgba(20, 40, 70, 0.08);
  --amber: #b86e00; --red: #d42d3c; --green: #0f9a63; --danger-text: #c0222f; --warn-text: #9a5d00;
}
:root { --cyan: var(--accent); --cyan-dim: rgba(var(--accent-rgb), 0.38); --radius: 16px; --pill: 999px; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg) radial-gradient(ellipse at 50% -10%, var(--glow) 0%, var(--bg) 60%) fixed;
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, textarea, select { font: inherit; color: inherit; }
select { color: var(--text); }
select option { background: var(--panel-solid); color: var(--text); }
button {
  background: rgba(var(--accent-rgb), 0.08); border: 1px solid var(--line); border-radius: var(--pill);
  padding: 8px 16px; -webkit-transition: background .15s, border-color .15s, color .15s; transition: background .15s, border-color .15s, color .15s; cursor: pointer; margin: 0 6px 6px 0; -webkit-tap-highlight-color: transparent;
}
button:hover { border-color: var(--cyan-dim); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.primary:hover { -webkit-filter: brightness(1.08); filter: brightness(1.08); }
button.ghost { background: transparent; }
button.on { background: rgba(var(--accent-rgb), 0.18); border-color: var(--accent); color: var(--strong); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
h2 { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); margin: 0 0 10px; font-weight: 600; }
code { background: rgba(var(--fg-rgb), 0.06); padding: 1px 5px; border-radius: 4px; }

/* ---------- top bar (two rows) ---------- */
.top {
  padding: 10px 16px 6px; border-bottom: 1px solid var(--line);
  position: -webkit-sticky; position: sticky; top: 0; z-index: 5;
  background: var(--topbar); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.top-row { display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; -ms-flex-wrap: wrap; flex-wrap: wrap; }
.top-row.second { -webkit-box-pack: justify; justify-content: space-between; margin-top: 2px; }
.brand { font-weight: 700; letter-spacing: 0.16em; margin: 0 18px 6px 0; white-space: nowrap; color: var(--strong); }
.brand .muted { font-weight: 400; letter-spacing: 0.04em; margin-left: 6px; }
.logo-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); margin-right: 8px; vertical-align: 1px; }
.tabs { -webkit-box-flex: 1; flex: 1 1 auto; white-space: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabs.tabs-2 { -webkit-box-flex: 0; flex: 0 1 auto; }
.tabs button { padding: 7px 16px; }
.top-right { white-space: nowrap; display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; -ms-flex-wrap: wrap; flex-wrap: wrap; }
.top-right .muted { margin: 0 8px 6px 0; font-size: 12px; }
.theme-pick { -webkit-appearance: none; -moz-appearance: none; appearance: none; background: rgba(var(--accent-rgb), 0.08); border: 1px solid var(--line);
  border-radius: var(--pill); padding: 7px 30px 7px 14px; margin: 0 6px 6px 0; cursor: pointer; color: var(--text);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.theme-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 0; }

.banner { background: rgba(255, 181, 71, 0.12); border-bottom: 1px solid rgba(255, 181, 71, 0.35); color: var(--amber); padding: 6px 16px; font-size: 12px; }

main { padding: 14px; }
.view { display: none; }
.view.on { display: block; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }

/* ---------- command view ---------- */
.command-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.1fr) minmax(280px, 1fr) minmax(280px, 1fr);
  grid-template-areas: "core alerts health" "transcript focus focus";
  grid-gap: 14px;
}
.command-grid .panel { margin: 0; min-width: 0; }
.core-panel { grid-area: core; text-align: center; }
.transcript-panel { grid-area: transcript; }
.alerts-panel { grid-area: alerts; }
.health-panel { grid-area: health; }
.focus-panel { grid-area: focus; }

.core { position: relative; width: 220px; height: 220px; margin: 6px auto 4px; cursor: pointer; outline: none; }
.core svg { width: 220px; height: 220px; display: block; }
.core canvas { position: absolute; left: -40px; bottom: -6px; width: 300px; height: 60px; opacity: 0; -webkit-transition: opacity .3s; transition: opacity .3s; pointer-events: none; }
.c-ring { fill: none; stroke: var(--cyan); stroke-width: 1.4; opacity: .55; -webkit-transform-origin: 100px 100px; transform-origin: 100px 100px; }
.c1 { stroke-dasharray: 6 10; -webkit-animation: spin 26s linear infinite; animation: spin 26s linear infinite; }
.c2 { stroke-dasharray: 90 30; opacity: .35; -webkit-animation: spin 18s linear infinite reverse; animation: spin 18s linear infinite reverse; }
.c3 { stroke-dasharray: 2 6; opacity: .7; -webkit-animation: spin 40s linear infinite; animation: spin 40s linear infinite; }
.c-glow { fill: rgba(var(--accent-rgb), 0.10); -webkit-transform-origin: 100px 100px; transform-origin: 100px 100px; -webkit-animation: breathe 4s ease-in-out infinite; animation: breathe 4s ease-in-out infinite; }
.c-centre { fill: var(--cyan); opacity: .85; }
.core.listening .c-centre { fill: var(--green); }
.core.listening .c-ring { stroke: var(--green); }
.core.thinking .c1, .core.thinking .c2 { -webkit-animation-duration: 3s; animation-duration: 3s; }
.core.speaking canvas, .core.listening canvas { opacity: 1; }
.core.error .c-centre { fill: var(--red); }
.core-state { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.talk-row { margin-bottom: 4px; }
#talk { min-width: 150px; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#talk.held { background: rgba(69, 227, 160, 0.25); border-color: var(--green); }
.ask { display: -webkit-box; display: flex; margin-top: 6px; }
.ask input { -webkit-box-flex: 1; flex: 1 1 auto; min-width: 0; background: var(--sunken); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; margin-right: 6px; outline: none; }
.ask input:focus { border-color: var(--cyan-dim); }
.ask button { margin: 0; }
.hint { font-size: 12px; margin-top: 8px; }
.wake-line { min-height: 18px; }
.mic-live { color: var(--green); font-size: 12px; }
.msg.note { padding: 2px 10px; }
[hidden] { display: none !important; }

.transcript { max-height: 340px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.msg { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; }
.msg.you { background: rgba(var(--fg-rgb), 0.04); }
.msg.jv { background: rgba(var(--accent-rgb), 0.07); border-left: 2px solid var(--cyan); }
.msg .who { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 2px; }

.alerts { max-height: 360px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.alert { border-left: 3px solid var(--muted); padding: 6px 10px; margin-bottom: 8px; background: var(--sunken); border-radius: 0 6px 6px 0; }
.alert.critical { border-color: var(--red); }
.alert.warning { border-color: var(--amber); }
.alert.info { border-color: var(--cyan); }
.alert .t { font-weight: 600; }
.alert .d { color: var(--muted); font-size: 12px; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: rgba(255, 90, 106, 0.2); color: var(--red); text-align: center; letter-spacing: 0; }

.health-row { display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; padding: 7px 0; border-bottom: 1px solid rgba(var(--fg-rgb), 0.04); }
.health-row:last-child { border-bottom: 0; }
.light { width: 10px; height: 10px; border-radius: 50%; margin-right: 10px; -webkit-box-flex: 0; flex: 0 0 auto; }
.light.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.light.warning { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.light.critical { background: var(--red); box-shadow: 0 0 8px var(--red); }
.health-row .nm { -webkit-box-flex: 1; flex: 1 1 auto; min-width: 0; }
.health-row .st { font-size: 12px; color: var(--muted); text-align: right; }

/* ---------- metric cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-gap: 10px; }
.card { background: var(--sunken); border: 1px solid rgba(var(--fg-rgb), 0.05); border-radius: 8px; padding: 10px 12px; }
.card .lb { font-size: 12px; color: var(--muted); }
.card .v { font-size: 22px; font-weight: 600; margin: 2px 0; }
.card .p { font-size: 11px; color: var(--muted); }
.delta.good { color: var(--green); }
.delta.bad { color: var(--red); }
.badge { display: inline-block; font-size: 10px; letter-spacing: .1em; padding: 1px 6px; border-radius: 4px; vertical-align: 2px; margin-left: 6px; }
.badge.sample { background: rgba(255, 181, 71, 0.15); color: var(--amber); }
.badge.stale { background: rgba(255, 90, 106, 0.15); color: var(--red); }
.focus-panel .src-title { grid-column: 1 / -1; font-weight: 600; margin-top: 4px; }

.sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); grid-gap: 14px; }
.sources .panel { margin: 0; min-width: 0; }
.sources .panel.wide { grid-column: 1 / -1; }
.src-head { display: flex; align-items: flex-start; width: 100%; margin: 0; padding: 0; background: none; border: 0;
  color: inherit; font: inherit; text-align: left; cursor: pointer; }
.src-head .chev { width: 18px; flex: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 20px; }
.src-titles { display: block; flex: 1; min-width: 0; }
.src-head .nm { display: block; font-weight: 700; font-size: 15px; }
.src-head .co { display: block; color: var(--muted); font-size: 12px; }
.src-head .hls { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.src-head .hl { display: inline-block; margin-right: 12px; }
.src-head .hl b { color: var(--strong); font-size: 13px; }
.panel.src.open .src-head { margin-bottom: 10px; }
.panel.src:not(.open) { padding-top: 12px; padding-bottom: 12px; }
.src-tools { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.src-tools button { width: auto; margin: 0 0 0 8px; padding: 6px 12px; font-size: 12px; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 4px 8px 6px 0; border-bottom: 1px solid var(--line); }
td { padding: 6px 8px 6px 0; border-bottom: 1px solid rgba(var(--fg-rgb), 0.04); }
.tbl-label { font-size: 12px; color: var(--cyan); margin-top: 14px; }
.missing { color: var(--amber); font-size: 12px; margin-top: 8px; }
.empty { color: var(--muted); padding: 20px; text-align: center; }

.uptime-row, .conn-row { display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(var(--fg-rgb), 0.04); flex-wrap: wrap; }
.uptime-row .nm, .conn-row .nm { -webkit-box-flex: 1; flex: 1 1 200px; min-width: 0; }
.uptime-row .st, .conn-row .st { color: var(--muted); font-size: 12px; }

/* ---------- login ---------- */
.login-page { display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; -webkit-box-pack: center; justify-content: center; padding: 20px; }
.login { width: 100%; max-width: 360px; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 30px 24px; }
.login h1 { letter-spacing: .3em; margin: 14px 0 2px; font-size: 22px; }
.login .sub { color: var(--muted); margin: 0 0 20px; }
.login input, .login .hash { width: 100%; background: rgba(var(--fg-rgb), .05); border: 1px solid var(--line); border-radius: var(--pill); padding: 11px 16px; margin-bottom: 10px; outline: none; }
.login .hash { height: 90px; font-family: Menlo, monospace; font-size: 12px; }
.login button { width: 100%; margin: 0; }
.login .err { color: var(--red); }
.login .note { color: var(--muted); }
.login-core { position: relative; width: 70px; height: 70px; margin: 0 auto; }
.login-core .ring { position: absolute; border: 1px solid var(--cyan); border-radius: 50%; opacity: .5; }
.login-core .r1 { left: 0; top: 0; right: 0; bottom: 0; border-style: dashed; -webkit-animation: spin 20s linear infinite; animation: spin 20s linear infinite; }
.login-core .r2 { left: 12px; top: 12px; right: 12px; bottom: 12px; }
.login-core .dot { position: absolute; left: 26px; top: 26px; width: 18px; height: 18px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 16px var(--cyan); }

@-webkit-keyframes spin { to { -webkit-transform: rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@-webkit-keyframes breathe { 0%, 100% { -webkit-transform: scale(1); } 50% { -webkit-transform: scale(1.12); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

body.reduce-motion *, body.reduce-motion *::before { -webkit-animation: none !important; animation: none !important; -webkit-transition: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  * { -webkit-animation: none !important; animation: none !important; }
}

/* ---------- responsive: laptop, Fold unfolded, Fold cover screen ---------- */
@media (max-width: 1150px) {
  .command-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "core alerts" "transcript health" "focus focus"; }
}
/* Fold unfolded (portrait ~ 700-880px wide) */
@media (max-width: 900px) {
  .sources { grid-template-columns: 1fr; }
  .top-right .muted { display: none; }
}
/* Fold cover screen and phones */
@media (max-width: 640px) {
  main { padding: 10px; }
  .command-grid { grid-template-columns: 1fr; grid-template-areas: "core" "transcript" "alerts" "focus" "health"; grid-gap: 10px; }
  .brand .muted { display: none; }
  .top { padding: 8px 10px 2px; }
  .tabs button { padding: 7px 10px; font-size: 13px; }
  .top-right button { padding: 6px 9px; font-size: 12px; }
  #motion { display: none; }
  .core, .core svg { width: 170px; height: 170px; }
  .core canvas { left: -65px; }
  .talk-row { display: -webkit-box; display: flex; flex-wrap: wrap; -webkit-box-pack: justify; justify-content: space-between; }
  #talk { display: block; width: 100%; padding: 16px; font-size: 16px; margin: 0 0 8px; }
  #brief, #mute, #wake { width: 49%; margin: 0 0 6px; }
  .xy-row button { width: 32%; margin: 0 0 6px; padding-left: 4px; padding-right: 4px; }
  .transcript { max-height: 260px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .card .v { font-size: 19px; }
}
/* ---------- inbox & drafts ---------- */
.inbox-grid { display: grid; grid-template-columns: 240px minmax(280px, 1fr) minmax(320px, 1.4fr); grid-gap: 14px; }
.inbox-grid .panel { margin: 0; min-width: 0; }
.boxes .box { padding: 8px 10px; border-radius: 8px; cursor: pointer; margin-bottom: 4px; border: 1px solid transparent; }
.boxes .box.on { border-color: var(--cyan-dim); background: rgba(var(--accent-rgb), 0.06); }
.boxes .box .co { font-size: 11px; color: var(--muted); }
.boxes .box .err { font-size: 11px; color: var(--red); }
.boxes-panel button { width: 100%; margin: 6px 0 0; }
.mail-list { max-height: 70vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.mail-item { padding: 9px 10px; border-bottom: 1px solid rgba(var(--fg-rgb), 0.05); cursor: pointer; }
.mail-item:hover, .mail-item.on { background: rgba(var(--accent-rgb), 0.06); }
.mail-item .mtop { display: -webkit-box; display: flex; }
.mail-item .fr { -webkit-box-flex: 1; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item .dt { font-size: 11px; color: var(--muted); margin-left: 8px; white-space: nowrap; }
.mail-item .sj { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item .sn { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item.unread .fr, .mail-item.unread .sj { font-weight: 700; color: var(--strong); }
.tag { display: inline-block; font-size: 10px; letter-spacing: .08em; padding: 1px 5px; border-radius: 4px; margin-left: 6px; vertical-align: 1px; }
.tag.urgent { background: rgba(255, 90, 106, 0.18); color: var(--red); }
.tag.co { background: rgba(var(--accent-rgb), 0.12); color: var(--cyan); }
.read-head .sj { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.read-head .meta { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.read-body { white-space: pre-wrap; word-wrap: break-word; max-height: 45vh; overflow-y: auto; background: var(--sunken); padding: 12px; border-radius: 8px; font-size: 13px; }
.reply-box { margin-top: 12px; }
.reply-box textarea, .draft textarea, .draft input, .draft select, .form input, .form textarea, .form select {
  width: 100%; background: var(--sunken); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; outline: none; margin: 0 0 8px; }
.reply-box textarea { min-height: 70px; }
.drafts .draft { background: rgba(255, 181, 71, 0.06); border: 1px solid rgba(255, 181, 71, 0.4); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.draft h3 { margin: 0 0 10px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.draft label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.draft .row2 { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 10px; }
.draft textarea { min-height: 200px; font-family: inherit; line-height: 1.5; }
.draft .why { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.draft .err { color: var(--red); font-size: 13px; margin-bottom: 8px; }
button.send { background: rgba(69, 227, 160, 0.2); border-color: var(--green); color: var(--strong); font-weight: 700; }
.sent-note { color: var(--green); font-size: 13px; }
.modal { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(0,0,0,.65); z-index: 20; display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; -webkit-box-pack: center; justify-content: center; padding: 16px; }
.modal-box { background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px; padding: 18px; width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto; }
.form label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 10px; }
.acct-row { display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(var(--fg-rgb), .05); flex-wrap: wrap; }
.acct-row .nm { -webkit-box-flex: 1; flex: 1 1 200px; }
.test-out { font-size: 12px; white-space: pre-wrap; margin: 6px 0 10px; }
@media (max-width: 1100px) { .inbox-grid { grid-template-columns: 1fr 1fr; } .boxes-panel { grid-column: 1 / -1; } }
@media (max-width: 700px) {
  .inbox-grid { grid-template-columns: 1fr; }
  .draft .row2, .form .row2 { grid-template-columns: 1fr; }
  .mail-list { max-height: none; }
}

.tidy { margin: 0 0 14px; }
a.xy-go { display: inline-block; padding: 10px 14px; border-radius: 8px; background: rgba(69,227,160,.18); border: 1px solid var(--green); color: var(--strong); text-decoration: none; font-weight: 600; }
.xy-row button { font-size: 13px; }
.msg-actions { margin: 0 0 10px; }
.msg-actions select, .bulk-bar select { width: auto; display: inline-block; margin: 0 6px 6px 0; padding: 7px 10px; background: var(--sunken); border: 1px solid var(--line); border-radius: 8px; }
button.danger { border-color: rgba(255, 90, 106, 0.5); color: var(--danger-text); }
.mail-item .pick { width: auto; margin: 2px 8px 0 0; -webkit-box-flex: 0; flex: 0 0 auto; }
.bulk-bar { position: -webkit-sticky; position: sticky; bottom: 0; z-index: 4; background: var(--panel-solid); border: 1px solid var(--cyan-dim); border-radius: var(--radius); padding: 10px 12px; margin-top: 12px; }
.bulk-bar b { margin-right: 10px; }
.plan .plan-sum { font-size: 15px; font-weight: 700; margin-bottom: 6px; }

/* Native apps add body.native-app to tighten the chrome */
body.native-app #logout { display: none; }

/* ---------- Notes (Xypheron, read-only) */
.notes-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.notes-tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.notes-tabs button, .notes-actions button, .notes-actions .btn { width: auto; margin: 0; padding: 6px 12px; font-size: 13px; }
.notes-tabs button.on { border-color: var(--accent-light); color: var(--accent-light); }
.notes-tabs .sep { width: 10px; }
.notes-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.notes-actions .btn { display: inline-block; border: 1px solid var(--line); border-radius: 8px; color: var(--text); text-decoration: none; }
.notes-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 2px 10px; }
.notes-sum .pill { font-size: 12px; padding: 2px 9px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); }
.notes-sum .pill.bad { color: var(--red); border-color: rgba(255, 90, 106, .5); }
.note-list { display: flex; flex-direction: column; gap: 8px; }
.note-item { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.note-item summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; }
.note-item summary::-webkit-details-marker { display: none; }
.note-item .nt { font-weight: 600; }
.note-item .nm { flex-basis: 100%; }
.note-item .nb { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 14px; white-space: normal; }
.note-item.done .nt { text-decoration: line-through; color: var(--muted); }
.note-item .tag { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 1px 7px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); }
.note-item .tag.bad { color: var(--red); border-color: rgba(255, 90, 106, .5); }
.note-item .tag.warn { color: var(--warn-text); border-color: rgba(255, 212, 121, .45); }
.notes-empty ol { padding-left: 20px; }
.notes-empty a { color: var(--accent-light); }

/* Stop talking: only shown while she is speaking */
.stop-talk { display: block; margin: 6px auto 10px; width: auto; padding: 10px 22px; font-size: 15px; font-weight: 600;
  color: var(--strong); background: rgba(255, 90, 106, .22); border: 1px solid var(--red); border-radius: 22px; }
.stop-talk[hidden] { display: none; }

/* Notes: editing + Team tasks */
.note-add { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.note-add input, .note-add select { background: var(--sunken); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 14px; }
.note-add #na-title { flex: 1 1 200px; min-width: 0; }
.note-add button { width: auto; margin: 0; padding: 8px 16px; }
.note-item .tick { width: 20px; height: 20px; margin: 0 4px 0 0; accent-color: var(--green); flex: 0 0 auto; align-self: center; }
.note-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.note-tools button { width: auto; margin: 0; padding: 5px 11px; font-size: 12px; }
.note-tools .danger, button.danger { color: var(--red); border-color: rgba(255, 90, 106, .5); }
.note-edit { margin-top: 10px; }
.note-edit .form textarea, .note-edit .form input, .note-edit .form select { width: 100%; box-sizing: border-box; }
.note-item.team .team-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.note-item .tag.ok { color: var(--green); border-color: rgba(69, 227, 160, .45); }
.ro-note { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; color: var(--amber); }
.ro-note button { width: auto; margin: 0; }
#notes-body a.btn { display: inline-block; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; color: var(--cyan); text-decoration: none; }

/* Bookings */
.bk-h { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 2px 8px; }
.bk-day { font-weight: 700; margin: 12px 2px 6px; color: var(--cyan); }
.bk-row { margin-bottom: 6px; }
.booking-card { border-color: var(--cyan-dim); }
.booking-card .bc-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.booking-card .bc-actions { margin-top: 10px; }
.booking-card .bc-actions button { width: auto; margin: 0 6px 0 0; }
.form label.chk { display: flex; gap: 8px; align-items: center; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); margin: 8px 0; }
.form label.chk input { width: auto; }
#bookings-body a.btn, .notes-actions a.btn { display: inline-block; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; color: var(--cyan); text-decoration: none; }

/* Mac helper: development-folder suggestions + jobs */
.sug-list { margin: 10px 0; }
.sug { display: -webkit-box; display: flex; -webkit-box-align: start; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px solid rgba(var(--fg-rgb), .06); cursor: pointer; }
.sug input { margin-top: 3px; }
.row-btns { margin-top: 12px; }
ul.plain { list-style: none; padding: 0; margin: 6px 0 10px; }
ul.plain li { padding: 4px 0; }
#mac-helper h3 { font-size: 14px; margin: 12px 0 4px; }

/* Confirm cards (actions.js) */
.xy-cards { position: fixed; right: 16px; bottom: 96px; width: min(420px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; z-index: 60; }
.xy-card { background: var(--panel-solid); border: 1px solid var(--cyan-dim); border-radius: var(--radius); padding: 12px 14px; margin-top: 10px; box-shadow: var(--shadow); }
.xy-card.danger { border-color: rgba(255, 90, 106, .6); }
.xy-card-h { display: -webkit-box; display: flex; -webkit-box-pack: justify; justify-content: space-between; -webkit-box-align: center; align-items: center; }
.xy-card ul { margin: 8px 0; padding-left: 18px; }
.xy-card li { margin: 3px 0; white-space: pre-wrap; word-break: break-word; }
.xy-x { padding: 2px 8px; }
.xy-warn { color: var(--warn-text); margin: 6px 0; }
#social-posts h2 { display: -webkit-box; display: flex; -webkit-box-pack: justify; justify-content: space-between; -webkit-box-align: center; align-items: center; }
#social-posts h3 { font-size: 14px; margin: 14px 0 4px; }
.sp-row { display: -webkit-box; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; gap: 6px 10px; -webkit-box-pack: justify; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sp-main { min-width: 0; -webkit-box-flex: 1; flex: 1 1 260px; }
button.small { padding: 3px 9px; font-size: 12px; }

/* ---------- facelift: rounder, softer ---------- */
input[type="text"], input[type="search"], input[type="email"], input[type="date"], input[type="time"], input[type="password"], textarea, select {
  border-radius: 12px;
}
.ask input, #ask-input, #tidy-input { border-radius: var(--pill) !important; padding-left: 18px !important; }
.count { border-radius: var(--pill); }
.modal-box { border-radius: 18px; box-shadow: var(--shadow); }
.xy-card { border-radius: 18px; }
h2 { color: var(--accent); }
[data-theme="daylight"] .logo-dot, [data-theme="daylight"] .login-core .dot { box-shadow: none; }
[data-theme="daylight"] select option { background: #fff; color: #18222e; }
[data-theme="daylight"] code { background: rgba(0, 0, 0, 0.06); }

/* Leads page */
.lead-msg { white-space: pre-wrap; word-wrap: break-word; background: var(--sunken); border-radius: 12px; padding: 10px 12px; margin: 8px 0; font-size: 13px; max-height: 220px; overflow-y: auto; }
.lead-draft { margin-top: 10px; border-color: var(--cyan-dim); }
.lead-draft .form input, .lead-draft .form select, .lead-draft .form textarea { width: 100%; }
#view-leads .notes-tabs button .muted { margin-left: 4px; }

.bk-edit { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.bk-edit label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.bk-edit label input, .bk-edit label select, .bk-edit label textarea { display: block; width: 100%; margin-top: 3px; color: var(--text); }
.bk-edit label.chk { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.bk-edit label.chk input { width: auto; display: inline-block; margin: 0; }

.xy-fields label { display: block; font-size: 12px; color: var(--muted); margin: 6px 0; }
.xy-fields input, .xy-fields textarea { display: block; width: 100%; margin-top: 3px; color: var(--text); }


/* ---- v20: conversation mode, thinking indicator, reply timing, site checkboxes ---- */
.msg .who .took { opacity: .55; font-weight: 400; margin-left: 6px; font-size: 11px; }
.msg.typing .dots { display: inline-block; padding: 4px 0; }
.msg.typing .dots i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%;
  background: var(--accent, #4fd1ff); opacity: .35; -webkit-animation: xyDot 1.2s infinite; animation: xyDot 1.2s infinite; }
.msg.typing .dots i:nth-child(2) { -webkit-animation-delay: .2s; animation-delay: .2s; }
.msg.typing .dots i:nth-child(3) { -webkit-animation-delay: .4s; animation-delay: .4s; }
@-webkit-keyframes xyDot { 0%, 80%, 100% { opacity: .25; -webkit-transform: translateY(0); } 40% { opacity: 1; -webkit-transform: translateY(-3px); } }
@keyframes xyDot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.reduce-motion .msg.typing .dots i { -webkit-animation: none; animation: none; opacity: .7; }
#convo.on, #mute.on { border-color: var(--accent, #4fd1ff); color: var(--accent, #4fd1ff); }
.core-state { min-height: 1.4em; font-variant-numeric: tabular-nums; }
.display-list { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 10px -6px 6px; }
.show-row { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  width: 280px; max-width: 100%; margin: 4px 6px; padding: 8px 10px; border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 8px; cursor: pointer; }
.show-row input { margin: 0 10px 0 0; width: 18px; height: 18px; }
.show-row .nm { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; margin-right: 8px; }
.show-row input:not(:checked) ~ .nm { opacity: .5; text-decoration: line-through; }
.hidden-note { margin: 0 0 10px 2px; }
.hidden-note a { color: var(--accent, #4fd1ff); }
/* Conversation sits beside Xynthea (not under the fold), so you can follow the back-and-forth. */
.command-grid { grid-template-areas: "core transcript alerts" "core transcript health" "focus focus focus"; }
.transcript-panel .transcript { max-height: 520px; }
@media (max-width: 1150px) {
  .command-grid { grid-template-areas: "core transcript" "alerts health" "focus focus"; }
  .transcript-panel .transcript { max-height: 460px; }
}
@media (max-width: 640px) {
  .command-grid { grid-template-areas: "core" "transcript" "alerts" "focus" "health"; }
  .transcript-panel .transcript { max-height: 300px; }
}
/* v21: canvas core (replaces the SVG rings); the old waveform only feeds the voice level now. */
.core #orb { position: static; display: block; width: 100%; height: 100%; opacity: 1; left: auto; bottom: auto; }
.core #wave { display: none; }
.core { width: 240px; height: 240px; }
.core:focus-visible { box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .5); border-radius: 50%; }
@media (max-width: 640px) { .core { width: 190px; height: 190px; } }
/* "Show it on screen" arrived from another device: a short glow round the page. */
body.screen-flash::after { content: ''; position: fixed; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; z-index: 9999;
  box-shadow: inset 0 0 0 3px rgba(var(--accent-rgb), .9), inset 0 0 60px rgba(var(--accent-rgb), .35);
  -webkit-animation: xyFlash 1.3s ease-out forwards; animation: xyFlash 1.3s ease-out forwards; }
@-webkit-keyframes xyFlash { from { opacity: 1; } to { opacity: 0; } }
@keyframes xyFlash { from { opacity: 1; } to { opacity: 0; } }

/* ---------- v23: studio calendar (Bookings page) + "Studio this week" (Command page) ---------- */
.command-grid { grid-template-areas: "core transcript alerts" "core transcript health" "studio studio studio" "focus focus focus"; }
.studio-panel { grid-area: studio; }
.studio-panel[hidden] { display: none; }
@media (max-width: 1150px) { .command-grid { grid-template-areas: "core transcript" "alerts health" "studio studio" "focus focus"; } }
@media (max-width: 640px) { .command-grid { grid-template-areas: "core" "transcript" "studio" "alerts" "focus" "health"; } }
.studio-panel h2 { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-align: center; -webkit-align-items: center; align-items: center; }
.small-btn { margin-left: auto; padding: 3px 10px; font-size: 11px; letter-spacing: .05em; text-transform: none; }

:root { --c-studio: var(--accent); --c-studio-rgb: var(--accent-rgb); --c-video: #a78bfa; --c-video-rgb: 167, 139, 250; --c-mine: #45e3a0; --c-mine-rgb: 69, 227, 160; }

/* the strip */
.studio-mini { margin-top: 6px; cursor: pointer; }
.sm-scale, .sm-row { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-align: center; -webkit-align-items: center; align-items: center; }
.sm-scale { font-size: 10px; color: var(--muted); margin-bottom: 2px; }
.sm-scale span:first-child { width: 64px; -webkit-flex: none; flex: none; }
.sm-scale span { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; }
.sm-scale span:last-child { -webkit-box-flex: 0; -webkit-flex: none; flex: none; width: 120px; }
.sm-row { padding: 5px 0; border-top: 1px solid var(--line); }
.sm-row:hover .sm-bar { box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .5); }
.sm-d { width: 64px; -webkit-flex: none; flex: none; font-size: 12px; color: var(--muted); }
.sm-row.is-today .sm-d { color: var(--accent); font-weight: 600; }
.sm-bar { position: relative; -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; height: 16px; border-radius: 4px; background: rgba(var(--fg-rgb, 255,255,255), .04); overflow: hidden; }
.sm-bar.closed { background: repeating-linear-gradient(135deg, rgba(var(--fg-rgb, 255,255,255), .05) 0 4px, transparent 4px 8px); }
.sm-bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.sm-bar i.open { background: rgba(var(--accent-rgb), .07); border-radius: 0; }
.sm-bar i.studio { background: var(--c-studio); box-shadow: 0 0 8px rgba(var(--c-studio-rgb), .7); top: 2px; bottom: 2px; }
.sm-bar i.video { background: var(--c-video); box-shadow: 0 0 8px rgba(var(--c-video-rgb), .7); top: 2px; bottom: 2px; }
.sm-bar i.mine { background: var(--c-mine); top: 11px; bottom: 1px; opacity: .85; }
.sm-bar i.block { background: repeating-linear-gradient(135deg, rgba(160,170,185,.45) 0 3px, rgba(160,170,185,.15) 3px 6px); }
.sm-bar i.conflict { background: var(--red); box-shadow: 0 0 8px var(--red); }
.sm-bar em { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--red); box-shadow: 0 0 6px var(--red); }
.sm-n { width: 120px; -webkit-flex: none; flex: none; text-align: right; font-size: 12px; color: var(--muted); }
.sm-key { margin-top: 8px; }
.sm-key .k { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: -1px; }
.sm-key .k:first-child { margin-left: 0; }
.k.studio { background: var(--c-studio); } .k.video { background: var(--c-video); } .k.mine { background: var(--c-mine); }
.k.block { background: repeating-linear-gradient(135deg, rgba(160,170,185,.6) 0 2px, transparent 2px 4px); }

/* the full calendar */
.cal-panel { padding-bottom: 10px; }
.cal-bar { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; -webkit-box-align: center; -webkit-align-items: center; align-items: center; -webkit-box-pack: justify; -webkit-justify-content: space-between; justify-content: space-between; margin-bottom: 10px; }
.cal-nav, .cal-tools { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-align: center; -webkit-align-items: center; align-items: center; -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.cal-nav button, .cal-tools > * { margin: 3px 6px 3px 0; }
.cal-nav button[data-cal=prev], .cal-nav button[data-cal=next] { width: 34px; padding-left: 0; padding-right: 0; font-size: 18px; line-height: 1; }
.cal-range { font-weight: 600; margin-left: 6px; color: var(--strong); letter-spacing: .02em; }
.seg { display: -webkit-inline-box; display: -webkit-inline-flex; display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; margin: 0; padding: 5px 14px; background: transparent; }
.seg button.on { background: rgba(var(--accent-rgb), .18); color: var(--accent); }
.cal-key { font-size: 12px; cursor: pointer; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); }
.cal-key input { margin: 0 6px 0 0; vertical-align: -2px; }
.cal-key.studio { border-color: rgba(var(--c-studio-rgb), .5); } .cal-key.video { border-color: rgba(var(--c-video-rgb), .5); } .cal-key.mine { border-color: rgba(var(--c-mine-rgb), .5); }

.cal-grid { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cal-head, .cal-allday { display: grid; grid-template-columns: 52px repeat(var(--cols), 1fr); border-bottom: 1px solid var(--line); }
.cal-dh { padding: 8px 6px; font-size: 12px; text-align: center; border-left: 1px solid var(--line); cursor: pointer; }
.cal-dh b { color: var(--strong); letter-spacing: .05em; }
.cal-dh.is-today { background: rgba(var(--accent-rgb), .12); color: var(--accent); }
.cal-dh.is-today b { color: var(--accent); }
.cal-dh.closed { opacity: .6; }
.cal-n { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 8px; background: rgba(var(--accent-rgb), .25); color: var(--accent); font-size: 10px; line-height: 16px; }
.cal-ad { border-left: 1px solid var(--line); padding: 3px; }
.cal-ad .ev { position: static; margin-bottom: 2px; }
.cal-gutter { position: relative; font-size: 10px; color: var(--muted); padding: 4px; }
.cal-body { position: relative; display: grid; grid-template-columns: 52px repeat(var(--cols), 1fr); overflow: hidden; }
.cal-hour { position: absolute; right: 6px; -webkit-transform: translateY(-50%); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.cal-hour:first-child { -webkit-transform: none; transform: none; }
.cal-col { position: relative; border-left: 1px solid var(--line); cursor: copy; }
.cal-col.is-today { background: rgba(var(--accent-rgb), .04); }
.cal-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); opacity: .55; pointer-events: none; }
.cal-shut { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, rgba(var(--fg-rgb, 255,255,255), .035) 0 6px, transparent 6px 12px); pointer-events: none; }
.cal-now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--red); box-shadow: 0 0 8px var(--red); pointer-events: none; z-index: 3; }
.cal-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

.ev { position: absolute; overflow: hidden; padding: 3px 6px; border-radius: 6px; font-size: 11px; line-height: 1.3; cursor: pointer; z-index: 2;
  color: var(--strong); -webkit-transition: -webkit-transform .12s, box-shadow .12s; transition: transform .12s, box-shadow .12s; }
.ev:hover { -webkit-transform: translateY(-1px); transform: translateY(-1px); z-index: 4; }
.ev .t { opacity: .8; font-variant-numeric: tabular-nums; }
.ev .who { opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.studio { background: rgba(var(--c-studio-rgb), .22); border: 1px solid rgba(var(--c-studio-rgb), .8); box-shadow: inset 3px 0 0 var(--c-studio), 0 0 14px rgba(var(--c-studio-rgb), .25); }
.ev.video { background: rgba(var(--c-video-rgb), .22); border: 1px solid rgba(var(--c-video-rgb), .8); box-shadow: inset 3px 0 0 var(--c-video), 0 0 14px rgba(var(--c-video-rgb), .25); }
.ev.mine { background: rgba(var(--c-mine-rgb), .16); border: 1px solid rgba(var(--c-mine-rgb), .7); box-shadow: inset 3px 0 0 var(--c-mine); }
.ev.block { background: repeating-linear-gradient(135deg, rgba(150,160,175,.22) 0 6px, rgba(150,160,175,.08) 6px 12px); border: 1px dashed rgba(150,160,175,.6); color: var(--muted); }
.ev.pending { border-style: dashed; opacity: .85; }
.ev.conflict { background: rgba(255, 70, 85, .22); border-color: var(--red); box-shadow: inset 3px 0 0 var(--red), 0 0 14px rgba(255, 70, 85, .35); }
.cal-wait { color: var(--amber, #f5b942); margin: 10px 0 0; }
.cal-tip { margin: 8px 0 0; }
[data-theme="daylight"] .ev { color: #10202f; }
@media (max-width: 640px) {
  .cal-head, .cal-allday, .cal-body { grid-template-columns: 42px repeat(var(--cols), 1fr); }
  .sm-d { width: 52px; } .sm-scale span:first-child { width: 52px; }
  .sm-n, .sm-scale span:last-child { width: 86px; font-size: 11px; }
}
/* strip: hour labels placed exactly over the bars; studio and video on their own lanes */
.sm-scale .sm-ticks { position: relative; -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; height: 12px; }
.sm-scale .sm-ticks b { position: absolute; top: 0; font-weight: 400; -webkit-transform: translateX(-50%); transform: translateX(-50%); }
.sm-scale .sm-ticks b:first-child { -webkit-transform: none; transform: none; }
.sm-scale span.sm-d, .sm-scale span.sm-n { -webkit-box-flex: 0; -webkit-flex: none; flex: none; }
.sm-bar { height: 20px; }
.sm-bar i.studio { top: 2px; bottom: auto; height: 7px; }
.sm-bar i.video { top: 10px; bottom: auto; height: 7px; }
.sm-bar i.mine { top: auto; bottom: 0; height: 2px; }
.sm-bar i.conflict { top: 2px; bottom: 2px; height: auto; }
/* calendar delete buttons */
.ev-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; padding: 0; margin: 0; border-radius: 50%; border: 1px solid rgba(255, 90, 106, .7);
  background: rgba(10, 14, 20, .75); color: var(--red); font-size: 11px; line-height: 18px; text-align: center; cursor: pointer; opacity: 0;
  -webkit-transition: opacity .12s; transition: opacity .12s; z-index: 5; }
.ev:hover .ev-del, .ev-del:focus { opacity: 1; }
.ev-del:hover { background: var(--red); color: #fff; }
@media (hover: none) { .ev-del { opacity: .85; } }
.cal-ad .ev { position: relative; padding-right: 24px; }
.card-lines { margin: 8px 0 10px 18px; padding: 0; }
.card-lines li { margin: 3px 0; }
button.btn-danger { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
button.btn-danger:hover { box-shadow: 0 0 14px rgba(255, 90, 106, .55); }
button.btn-danger[disabled] { opacity: .6; }
#modal .chk { display: block; margin: 6px 0; }

/* ---------- v26: LinkedIn "post it myself" ---------- */
.command-grid { grid-template-areas: "core transcript alerts" "core transcript health" "li li li" "studio studio studio" "focus focus focus"; }
@media (max-width: 1150px) { .command-grid { grid-template-areas: "core transcript" "alerts health" "li li" "studio studio" "focus focus"; } }
@media (max-width: 640px) { .command-grid { grid-template-areas: "core" "li" "transcript" "studio" "alerts" "focus" "health"; } }
.li-panel { grid-area: li; border-color: rgba(10, 102, 194, .7); box-shadow: 0 0 0 1px rgba(10, 102, 194, .35), 0 0 24px rgba(10, 102, 194, .18); }
.li-panel[hidden] { display: none; }
.li-panel h2::before { content: 'in'; display: inline-block; margin-right: 8px; padding: 0 5px; border-radius: 3px; background: #0a66c2; color: #fff; font-weight: 800; letter-spacing: 0; text-transform: none; }
.lm-item { display: -webkit-box; display: -webkit-flex; display: flex; padding: 10px 0; border-top: 1px solid var(--line); }
.lm-item:first-child { border-top: 0; }
.lm-img { width: 120px; height: 120px; -o-object-fit: cover; object-fit: cover; border-radius: 8px; margin-right: 14px; -webkit-flex: none; flex: none; }
.lm-body { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; min-width: 0; }
.lm-due { color: var(--amber); font-size: 12px; margin-left: 6px; }
.lm-text { margin: 6px 0 10px; max-height: 160px; overflow: auto; font-size: 13px; line-height: 1.45; padding: 8px 10px; border-radius: 8px; background: var(--sunken, rgba(0,0,0,.25)); }
.lm-actions > * { margin: 0 6px 6px 0; }
@media (max-width: 640px) { .lm-item { display: block; } .lm-img { width: 100%; height: 160px; margin: 0 0 8px; } }
.lm-actions a.btn { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 13px; line-height: 1.2; vertical-align: middle; }
.lm-actions a.btn:hover { border-color: var(--accent); color: var(--accent); }
.lm-actions a.btn.li-open { border-color: #0a66c2; color: #fff; background: #0a66c2; }

/* ---------------------------------------------------------------- Xynthea window (lists, tables, documents on every screen) */
.xyw { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 15; background: rgba(0, 0, 0, .55);
  display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; -webkit-box-pack: center; justify-content: center; padding: 18px; }
.xyw[hidden] { display: none; }
.xyw-box { background: var(--panel-solid); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .12), 0 24px 70px rgba(0, 0, 0, .55);
  width: 100%; max-width: 920px; height: 88vh; display: -webkit-box; display: flex; -webkit-box-orient: vertical; flex-direction: column; overflow: hidden;
  -webkit-animation: xywIn .22s ease-out; animation: xywIn .22s ease-out; }
@-webkit-keyframes xywIn { from { opacity: 0; -webkit-transform: translateY(12px) scale(.985); } to { opacity: 1; -webkit-transform: none; } }
@keyframes xywIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.xyw-bar { display: -webkit-box; display: flex; -webkit-box-align: start; align-items: flex-start; padding: 16px 18px 6px; border-bottom: 0; }
.xyw-head { -webkit-box-flex: 1; flex: 1; min-width: 0; }
.xyw-title { font-size: 20px; font-weight: 700; color: var(--strong); line-height: 1.25; }
.xyw-meta { margin-top: 3px; }
.xyw-x { padding: 4px 11px; font-size: 15px; margin-left: 10px; }
.xyw-tools { padding: 6px 18px 12px; border-bottom: 1px solid var(--line); }
.xyw-tools button { margin: 4px 6px 0 0; font-size: 13px; padding: 6px 13px; }
.xyw-body { -webkit-box-flex: 1; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 22px 30px; }
.xyw-writing { color: var(--muted); padding: 30px 4px; }
.xyw-writing .dots i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--accent);
  opacity: .35; -webkit-animation: xyDot 1.2s infinite; animation: xyDot 1.2s infinite; }
.xyw-writing .dots i:nth-child(2) { -webkit-animation-delay: .2s; animation-delay: .2s; }
.xyw-writing .dots i:nth-child(3) { -webkit-animation-delay: .4s; animation-delay: .4s; }
.xyw-email { padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--raise); }
.xyw-email h3 { margin: 0 0 8px; font-size: 15px; }
body.xyw-on { overflow: hidden; }
@media (max-width: 700px) {
  .xyw { padding: 0; }
  .xyw-box { max-width: none; height: 100%; border-radius: 0; border: 0; }
  .xyw-body { padding: 12px 16px 40px; }
}

/* Document content: the Xynthea window and the Docs page */
.doc-body { color: var(--text); font-size: 15px; line-height: 1.55; }
.doc-body h1 { font-size: 22px; color: var(--strong); margin: 4px 0 10px; letter-spacing: 0; text-transform: none; }
.doc-body h2 { font-size: 17px; color: var(--accent); letter-spacing: 0; text-transform: none; margin: 22px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); font-weight: 700; }
.doc-body h3, .doc-body h4 { font-size: 15px; color: var(--strong); margin: 16px 0 6px; }
.doc-body p { margin: 0 0 10px; }
.doc-body .kbfig { margin: 14px 0 18px; text-align: center; }
.doc-body .kbfig img { max-width: 100%; height: auto; border-radius: 10px; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.18); }
.doc-body .kbfig figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.doc-body ul, .doc-body ol { margin: 0 0 12px; padding-left: 22px; }
.doc-body li { margin: 3px 0; }
.doc-body li.lv1 { margin-left: 20px; } .doc-body li.lv2 { margin-left: 40px; }
.doc-body ul.checks { list-style: none; padding-left: 2px; }
.doc-body .tick { display: inline-block; width: 15px; height: 15px; border: 1.5px solid var(--muted); border-radius: 4px; margin-right: 8px;
  vertical-align: -2px; font-size: 11px; line-height: 13px; text-align: center; color: var(--green); }
.doc-body li.done { color: var(--muted); }
.doc-body li.done .tick { border-color: var(--green); }
.doc-body .tbl { overflow-x: auto; margin: 8px 0 14px; -webkit-overflow-scrolling: touch; }
.doc-body table { border-collapse: collapse; width: 100%; font-size: 14px; }
.doc-body th { text-align: left; background: rgba(var(--accent-rgb), .16); color: var(--strong); font-weight: 600; }
.doc-body th, .doc-body td { border: 1px solid var(--line); padding: 7px 9px; vertical-align: top; }
.doc-body tr:nth-child(even) td { background: var(--raise); }
.doc-body blockquote { margin: 10px 0; padding: 4px 12px; border-left: 3px solid var(--accent); color: var(--muted); }
.doc-body hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.doc-body a { color: var(--accent-light, var(--accent)); }
.doc-body strong { color: var(--strong); }

/* Docs page */
.doc-row { display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.doc-row:first-of-type { border-top: 0; }
.doc-main { -webkit-box-flex: 1; flex: 1; min-width: 0; }
.doc-main b { color: var(--strong); }
.doc-act button { margin-left: 6px; font-size: 13px; padding: 5px 12px; }
.doc-row .badge.bad { color: var(--red); }
.d-attach { margin: 6px 0 10px; padding: 7px 10px; border: 1px dashed var(--line); border-radius: 10px; color: var(--strong); font-size: 13px; }

/* ---------------------------------------------------------------- Pictures (picture window + Images page) */
.xyi .xyw-box { max-width: 1040px; }
.xyi-body { display: -webkit-box; display: flex; -webkit-box-orient: vertical; flex-direction: column; }
.xyi-pic { position: relative; -webkit-box-flex: 1; flex: 1 1 0; min-height: 260px; border-radius: 14px; background: var(--sunken); }
.xyi-pic.checker { background: repeating-conic-gradient(rgba(var(--fg-rgb), .07) 0% 25%, transparent 0% 50%) 50% / 22px 22px; }
.xyi-pic img { position: absolute; top: 10px; left: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: contain; display: block;
  -webkit-filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .45)); filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .45)); }
.xyi-prompt { margin-top: 10px; }
.xyi-prompt summary { cursor: pointer; }
.xyi-prompt p { white-space: pre-wrap; color: var(--text); margin: 6px 0 0; }
.xyi-making .xyi-brief { margin-top: 14px; white-space: pre-wrap; max-width: 680px; }
.xyi-strip { display: -webkit-box; display: flex; padding: 8px 18px 12px; border-top: 1px solid var(--line); overflow-x: auto; }
.xyi-th { width: 64px; height: 64px; padding: 0; margin-right: 8px; border-radius: 10px; overflow: hidden; -webkit-box-flex: 0; flex: 0 0 64px;
  display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; -webkit-box-pack: center; justify-content: center; }
.xyi-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xyi-th.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.xyw-email textarea { width: 100%; }
.modal-box .form h2 { margin-top: 0; }
.modal-box label.chk, .xyw-email label.chk { display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; text-transform: none; letter-spacing: 0;
  font-size: 14px; color: var(--text); margin: 22px 0 0; }
.modal-box label.chk input { width: auto; margin-right: 8px; }
.xyi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); grid-gap: 14px; }
.xyi-tile { display: block; width: 100%; padding: 0; text-align: left; border-radius: 16px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); cursor: pointer; }
.xyi-tile:hover { border-color: var(--accent); }
.xyi-tile img, .xyi-ph { display: block; width: 100%; height: 190px; object-fit: cover;
  background: repeating-conic-gradient(rgba(var(--fg-rgb), .05) 0% 25%, transparent 0% 50%) 50% / 18px 18px; }
.xyi-tile.portrait img, .xyi-tile.portrait .xyi-ph { object-position: center 30%; }
.xyi-ph { color: var(--muted); font-size: 13px; text-align: center; padding-top: 70px; }
.xyi-ph .dots i { display: inline-block; width: 7px; height: 7px; margin: 0 3px; border-radius: 50%; background: var(--accent); opacity: .35;
  -webkit-animation: xyDot 1.2s infinite; animation: xyDot 1.2s infinite; }
.xyi-ph .dots i:nth-child(2) { -webkit-animation-delay: .2s; animation-delay: .2s; }
.xyi-ph .dots i:nth-child(3) { -webkit-animation-delay: .4s; animation-delay: .4s; }
.xyi-cap { display: block; padding: 8px 10px 10px; }
.xyi-cap b { display: block; color: var(--strong); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xy-card-img { display: block; max-width: 160px; max-height: 160px; border-radius: 10px; margin: 8px 0 4px; }
@media (max-width: 700px) {
  .xyi-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-gap: 10px; }
  .xyi-tile img, .xyi-ph { height: 140px; }
  .xyi-ph { padding-top: 46px; }
  .xyi-pic { min-height: 55vh; }
}

/* Version line at the bottom of the dashboard */
.ver-foot { text-align: center; font-size: 11px; color: var(--muted); opacity: .75; padding: 14px 10px 18px; letter-spacing: .03em; }

/* Reopen the last Xynthea window */
.xyw-reopen { position: fixed; right: 16px; bottom: 18px; z-index: 60; border-radius: 999px; padding: 10px 16px; font-size: 14px; background: var(--accent, #4fd1ff); color: #001523; border: 0; box-shadow: 0 4px 16px rgba(0,0,0,.35); cursor: pointer; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xyw-reopen[hidden] { display: none; }
