:root {
  --bg: #05080d;
  --ink: #e8f1fb;
  --dim: #8fa3ba;
  --faint: #55657a;
  --line: rgba(140, 180, 230, 0.16);
  --panel: rgba(10, 16, 26, 0.86);
  --accent: #5ad1ff;
  --amber: #ffbe5c;
  --danger: #ff6b6b;
  --radius: 14px;
  --gutter: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: #07080a;
  color: var(--ink);
  font: 16px/1.5 var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

#orb { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* ---------- top bar ---------- */
#top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px;
}
.brand { font-weight: 600; letter-spacing: 0.42em; font-size: 13px; color: var(--dim); }
.brand.big { font-size: 22px; color: var(--ink); margin-bottom: 14px; }
#badges { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; min-width: 0; }
.badge {
  font-size: 12px; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line); color: var(--dim); background: rgba(10, 16, 26, 0.5);
}
.badge.on { color: var(--accent); border-color: rgba(90, 209, 255, 0.4); }
.badge.off { color: var(--danger); border-color: rgba(255, 107, 107, 0.35); }
.badge.warm { color: var(--amber); border-color: rgba(255, 190, 92, 0.4); }
.icon { background: none; border: 0; color: var(--dim); padding: 8px; border-radius: 10px; }
.icon:hover { color: var(--ink); background: rgba(140, 180, 230, 0.08); }

/* ---------- stage ---------- */
#stage {
  position: fixed; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 58vh var(--gutter) 110px;
  pointer-events: none;
}
#state-label {
  font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--faint);
  min-height: 1.5em; margin-bottom: 10px; transition: color 0.3s;
}
body.instrument {
  background: #08090b;
  --bg: #08090b;
  --ink: #ebe6dc;
  --dim: #9a9488;
  --faint: #6e695f;
  --line: rgba(235, 230, 220, 0.14);
  --accent: #ebe6dc;
  --danger: #c45c56;
}
body.instrument #mark-readout,
body.instrument #top .brand,
body.tv:not(.veille) #top .brand { display: none; }
body.instrument #stage {
  align-items: stretch;
  justify-content: flex-start;
  padding: calc(56px + env(safe-area-inset-top)) 28px 118px;
  display: flex;
  flex-direction: column;
}
#face-head, #col-void, #col-side, #presence, #where { display: none; }
#face-clock {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.9;
  font-size: 40px;
  color: var(--ink);
}
#face-date {
  margin: 8px 0 0;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--faint);
  text-transform: capitalize;
}
#hearth { list-style: none; margin: 0; padding: 0; }
#hearth li {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}
#hearth-label {
  margin: 0 0 12px;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--faint);
}
body.instrument #face-head,
body.tv:not(.veille) #face-head { display: block; }
body.instrument #col-void,
body.tv:not(.veille) #col-void { display: block; flex: 1 1 auto; height: auto; min-height: 28vh; }
body.instrument #presence,
body.tv:not(.veille) #presence,
body.instrument #where,
body.tv:not(.veille) #where { display: block; }
body.instrument #presence,
body.tv:not(.veille) #presence {
  margin: 0;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--dim);
}
body.instrument[data-state="off"] #presence,
body.tv[data-state="off"] #presence { color: var(--danger); }
body.instrument #where,
body.tv:not(.veille) #where {
  margin: 8px 0 0;
  min-height: 1.2em;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
body.instrument #state-label,
body.tv:not(.veille) #state-label {
  letter-spacing: 0.02em;
  text-transform: none;
  font-size: 15px;
  color: var(--dim);
  margin: 8px 0 16px;
}
body.instrument #captions,
body.tv:not(.veille) #captions { text-align: left; width: 100%; }
body.instrument #cap-user,
body.tv:not(.veille) #cap-user { text-align: left; font-size: 16px; }
body.instrument #cap-jarvis,
body.tv:not(.veille) #cap-jarvis {
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", "Noto Serif", Georgia, serif;
  font-size: clamp(15px, 1.5vw, 19px);
  font-weight: 400;
  line-height: 1.38;
  letter-spacing: -0.01em;
  text-align: left;
  max-height: 46vh;
  scrollbar-width: none;
}
body.instrument #cap-jarvis::-webkit-scrollbar,
body.tv:not(.veille) #cap-jarvis::-webkit-scrollbar { display: none; }
body.instrument:not(.tv) #col-words { padding-right: 2vw; }
body.instrument[data-state="idle"] #b-conn,
body.instrument[data-state="listening"] #b-conn,
body.instrument[data-state="thinking"] #b-conn,
body.instrument[data-state="speaking"] #b-conn,
body.tv[data-state="idle"] #b-conn,
body.tv[data-state="listening"] #b-conn,
body.tv[data-state="thinking"] #b-conn,
body.tv[data-state="speaking"] #b-conn { display: none; }
body.instrument #cap-sources { justify-content: flex-start; }
body.instrument .badge {
  border: 0; background: none; padding: 0;
  letter-spacing: 0.14em; text-transform: uppercase; font-size: 11px;
}
body.instrument .badge.on { color: var(--dim); border: 0; }
body.instrument .round { border-color: rgba(235, 230, 220, 0.28); background: transparent; color: var(--ink); }
body.instrument .round.live { background: var(--ink); color: #08090b; box-shadow: none; }
body.instrument #text { background: transparent; border-color: rgba(235, 230, 220, 0.16); }
body.instrument #text:focus { border-color: rgba(235, 230, 220, 0.45); }
#mark-readout {
  min-height: 1.2em; margin: 0 0 8px;
  font: 11px/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint);
}
body.tv #mark-readout, body:not(.instrument) #mark-readout { display: none; }
body[data-state="off"] #state-label { color: var(--danger); }
body[data-state="listening"] #state-label { color: var(--accent); }
body[data-state="thinking"] #state-label { color: var(--amber); }
#captions { width: min(760px, 100%); text-align: center; overflow: hidden; pointer-events: auto; }
body.feed-on #captions { display: none; }
#cap-user { color: var(--dim); font-size: 15px; margin: 0 0 10px; min-height: 1.4em; }
#cap-user:not(:empty)::before { content: "« "; } #cap-user:not(:empty)::after { content: " »"; }
#cap-user.partial { color: var(--faint); font-style: italic; }
#cap-jarvis { font-size: clamp(17px, 2.3vw, 22px); line-height: 1.45; max-height: 28vh; overflow-y: auto; text-wrap: pretty; }

/* Idle column: one LTT post at a time, full text, max space. */
#feed {
  width: min(760px, 100%); margin-top: 4px; text-align: left;
  display: flex; flex-direction: column; gap: 10px; min-height: 0;
  flex: 1 1 auto; height: min(58vh, 640px); max-height: min(62vh, 680px);
  overflow: hidden; pointer-events: auto;
}
#feed[hidden] { display: none !important; }
.feed-head {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: 0 2px 2px; opacity: 0.92;
}
.feed-mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  font: 700 11px/1 var(--mono); letter-spacing: 0.04em; color: #0b1220;
  background: linear-gradient(145deg, #7fd6ff, #5aa8ff 55%, #c9a46a);
  box-shadow: 0 0 18px rgba(127, 214, 255, 0.22);
}
.feed-meta { flex: 1; min-width: 0; }
.feed-name { margin: 0; font-size: 13px; letter-spacing: 0.04em; color: var(--ink); }
.feed-handle { margin: 1px 0 0; font-size: 11px; color: var(--faint); letter-spacing: 0.08em; }
.feed-pos {
  margin: 0; flex: none; font: 11px/1 var(--mono); letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--faint);
}
.feed-stage { flex: 1 1 auto; min-height: 0; position: relative; }
.feed-card {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px;
  padding: 14px 16px 16px; border-radius: 18px; box-sizing: border-box;
  background: rgba(14, 18, 28, 0.62); border: 1px solid var(--hair, rgba(235, 230, 220, 0.10));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.feed-card.on { opacity: 1; transform: none; }
.feed-card.has-media .feed-thumb {
  flex: none; width: 100%; max-height: 28%; height: auto; aspect-ratio: 16 / 9;
  object-fit: cover; border-radius: 14px; background: rgba(255,255,255,0.04);
}
.feed-scroll {
  flex: 1 1 auto; min-height: 0; overflow: hidden; position: relative;
  mask-image: linear-gradient(to bottom, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 92%, transparent);
}
.feed-card .feed-text {
  margin: 0; color: var(--ink); font-size: clamp(15px, 2.1vw, 20px); line-height: 1.5;
  text-wrap: pretty; white-space: pre-wrap; overflow-wrap: anywhere;
}
.feed-card .feed-when {
  flex: none; margin: 0; font: 11px/1.2 var(--mono); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--faint);
}
.feed-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  margin: 0; color: var(--faint); font-size: 14px; text-align: center;
  padding: 18px; border-radius: 18px; background: rgba(14, 18, 28, 0.45);
}
#cap-jarvis p { margin: 0 0 0.6em; }
#cap-jarvis :is(h1, h2, h3) { font-size: 1em; margin: 0.6em 0 0.3em; }
#cap-jarvis :is(ul, ol) { text-align: left; display: inline-block; margin: 0.2em 0; }
#cap-jarvis code { font-family: var(--mono); font-size: 0.86em; background: rgba(140, 180, 230, 0.1); padding: 1px 5px; border-radius: 5px; }
#cap-sources { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
#cap-sources a { font-size: 12px; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; text-decoration: none; max-width: 260px; display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#cap-sources a:hover { color: var(--accent); }
#thinking {
  position: fixed; left: var(--gutter); bottom: 96px; width: min(420px, 60vw); max-height: 22vh; margin: 0;
  font: 12px/1.45 var(--mono); color: rgba(255, 190, 92, 0.5); white-space: pre-wrap; overflow: hidden;
  mask-image: linear-gradient(to bottom, transparent, black 35%); -webkit-mask-image: linear-gradient(to bottom, transparent, black 35%);
  display: flex; flex-direction: column; justify-content: flex-end; opacity: 0; transition: opacity 0.5s;
}
body[data-state="thinking"] #thinking:not(:empty) { opacity: 1; }

/* ---------- bottom bar ---------- */
#bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; gap: 10px; align-items: center; justify-content: center;
  padding: 12px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(5, 8, 13, 0.92) 40%, transparent);
}
#text {
  flex: 1; max-width: 640px; min-width: 0; height: 48px; padding: 0 18px;
  background: rgba(14, 22, 35, 0.85); border: 1px solid var(--line); border-radius: 999px; outline: none;
}
#text:focus { border-color: rgba(90, 209, 255, 0.55); }
.round {
  width: 48px; height: 48px; flex: none; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(90, 209, 255, 0.45); background: rgba(90, 209, 255, 0.12); color: var(--accent);
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}
.round:active { transform: scale(0.94); }
.round.live { background: var(--accent); color: #04121c; box-shadow: 0 0 0 8px rgba(90, 209, 255, 0.14); }
.round.ghost { border-color: var(--line); background: rgba(14, 22, 35, 0.85); color: var(--dim); }

/* ---------- side panel ---------- */
#panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 8; width: min(460px, 100%);
  background: var(--panel); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-left: 1px solid var(--line);
  transform: translateX(102%); transition: transform 0.28s ease;
  display: flex; flex-direction: column; padding-top: env(safe-area-inset-top);
}
body.panel-open #panel { transform: none; }
#tabs { display: flex; gap: 2px; padding: 12px 12px 0; overflow-x: auto; flex: none; scrollbar-width: none; }
#tabs::-webkit-scrollbar { display: none; }
#tabs button { background: none; border: 0; padding: 8px 11px; border-radius: 10px 10px 0 0; color: var(--dim); font-size: 14px; white-space: nowrap; border-bottom: 2px solid transparent; }
#tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.tab { display: none; flex: 1; overflow-y: auto; padding: 16px var(--gutter) calc(24px + env(safe-area-inset-bottom)); }
.tab.on { display: block; }
.empty, .hint { color: var(--faint); font-size: 14px; }
.hint a { color: var(--accent); }
.tab h3 { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); margin: 22px 0 10px; font-weight: 600; }
.tab h3:first-child { margin-top: 0; }
.tab label { display: block; font-size: 13px; color: var(--dim); margin: 0 0 12px; }
.tab label.row, .tab .row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); }
.tab input[type="text"], .tab input[type="password"], .tab select, .tab textarea {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px; background: rgba(14, 22, 35, 0.9);
  border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink);
}
.tab textarea { resize: vertical; }
.tab button, #gate button {
  padding: 10px 18px; border-radius: 999px; border: 1px solid rgba(90, 209, 255, 0.45);
  background: rgba(90, 209, 255, 0.12); color: var(--accent);
}
#voice-audio { width: 100%; margin-top: 10px; }
#status { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 0; }
#status dt { color: var(--dim); } #status dd { margin: 0; overflow-wrap: anywhere; }

.card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 14px;
  background: rgba(12, 19, 31, 0.7); animation: rise 0.35s ease;
}
.card > header { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 8px; }
.card > header h4 { margin: 0; font-size: 16px; }
.card > header time { color: var(--faint); font-size: 12px; white-space: nowrap; }
.md { font-size: 15px; overflow-wrap: break-word; }
.md :is(h1, h2, h3, h4) { font-size: 1.02em; margin: 1em 0 0.4em; color: #cfe6ff; }
.md p { margin: 0 0 0.7em; }
.md :is(ul, ol) { padding-left: 1.3em; margin: 0 0 0.7em; }
.md code { font-family: var(--mono); font-size: 0.86em; background: rgba(140, 180, 230, 0.1); padding: 1px 5px; border-radius: 5px; }
.md pre { background: #070c14; border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; font-size: 0.94em; margin: 0 0 0.8em; }
.md :is(th, td) { border: 1px solid var(--line); padding: 5px 9px; text-align: left; }
.md th { background: rgba(140, 180, 230, 0.08); }
.md a { color: var(--accent); }
.md blockquote { margin: 0 0 0.7em; padding-left: 12px; border-left: 2px solid var(--line); color: var(--dim); }

.task .meta { color: var(--dim); font-size: 13px; margin-bottom: 8px; }
.task .pill { font-size: 12px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); }
.task .pill.en_cours { color: var(--amber); border-color: rgba(255, 190, 92, 0.4); }
.task header .validate { margin-left: 8px; font: inherit; font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid rgba(123, 224, 163, 0.5); background: transparent; color: #7be0a3; cursor: pointer; }
.task header .validate:hover, .task header .validate:focus { background: rgba(123, 224, 163, 0.15); }
.task .pill.terminee { color: #7be0a3; border-color: rgba(123, 224, 163, 0.4); }
.task .pill.echec, .task .pill.arretee { color: var(--danger); border-color: rgba(255, 107, 107, 0.4); }
.task ul { list-style: none; padding: 0; margin: 0 0 8px; font-size: 14px; }
.task .todos li::before { content: "○ "; color: var(--faint); }
.task .todos li.completed { color: var(--faint); } .task .todos li.completed::before { content: "● "; color: #7be0a3; }
.task .todos li.in_progress::before { content: "◐ "; color: var(--amber); }
.task .steps li { font-family: var(--mono); font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task .steps li:last-child { color: var(--ink); }

.entry { border-bottom: 1px solid var(--line); padding: 10px 0; font-size: 14px; }
.entry .who { color: var(--dim); font-size: 12px; }
.entry .q { color: var(--dim); margin: 2px 0 4px; }
.entry h4 { margin: 0 0 4px; font-size: 15px; }
.entry .tags { color: var(--faint); font-size: 12px; }

/* ---------- toasts & gate ---------- */
#toasts { position: fixed; top: calc(56px + env(safe-area-inset-top)); left: 0; right: 0; z-index: 9; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 var(--gutter); }
.toast { background: rgba(12, 19, 31, 0.95); border: 1px solid rgba(90, 209, 255, 0.35); border-radius: 12px; padding: 10px 16px; max-width: 560px; font-size: 14px; animation: rise 0.3s ease; }
.toast b { color: var(--accent); font-weight: 600; margin-right: 8px; }
#gate { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(5, 8, 13, 0.82); backdrop-filter: blur(6px); padding: var(--gutter); }
.gate-box { text-align: center; max-width: 380px; }
.gate-box p { color: var(--dim); }
.gate-box input { display: block; width: 100%; margin: 0 0 12px; padding: 12px 14px; background: rgba(14, 22, 35, 0.9); border: 1px solid var(--line); border-radius: 10px; outline: none; text-align: center; }
#gate-go { font-size: 17px; padding: 13px 34px; }
#gate .link { display: block; margin: 14px auto 0; border: 0; background: none; color: var(--faint); font-size: 13px; text-decoration: underline; }
#gate-error { color: var(--danger); min-height: 1.4em; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- wide screens: panel docks beside the stage ---------- */
@media (min-width: 980px) {
  body.instrument:not(.tv) #stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 0.5fr);
    overflow: hidden;
    grid-template-rows: auto 1fr;
    grid-template-areas: "head void side" "words void side";
    align-items: center;
    column-gap: 3vw;
    padding: 8vh 6vw 12vh;
  }
  body.instrument:not(.tv) #face-head { grid-area: head; align-self: end; display: block; }
  body.instrument:not(.tv) #col-void { grid-area: void; height: auto; min-height: 58vh; }
  body.instrument:not(.tv) #col-words { grid-area: words; align-self: start; }
  body.instrument:not(.tv).has-company #col-side { grid-area: side; display: block; align-self: center; }
  body.instrument:not(.tv) #face-clock { font-size: 68px; }
  body.instrument:not(.tv) #cap-jarvis { max-height: 32vh; }
}

@media (min-width: 1100px) {
  body.panel-open #stage { right: min(460px, 100%); }
  body.panel-open #bar { right: min(460px, 100%); }
}

/* ---------- television layout ---------- */
body.tv {
  cursor: none; font-size: 22px; background: #07080a; overflow: hidden;
  --ink: #ebe6dc; --dim: #9a9488; --faint: #6e695f; --accent: #ebe6dc; --danger: #c45c56;
}
body.tv #tab-ecran > .empty { display: none; }
body.tv #bar, body.tv #btn-panel, body.tv #tabs, body.tv #gate-nomic { display: none; }
body.tv #top { padding: 4vh 5vw 0; }
body.tv:not(.veille) #badges { justify-content: flex-end; }
body.tv:not(.veille) #b-wake,
body.tv:not(.veille) #b-tier { display: none; }
body.tv .brand { font-size: 18px; }
body.tv .badge { font-size: 16px; padding: 5px 14px; }
body.tv:not(.veille) #stage {
  right: 0;
  display: grid;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) minmax(0, min(34vw, 62vh)) minmax(0, 1fr);
  grid-template-rows: minmax(0, auto) minmax(0, 1fr);
  grid-template-areas: "head void side" "words void side";
  align-items: center;
  column-gap: 3vw;
  row-gap: 1.5vh;
  padding: 6vh 4vw 5vh;
}
body.tv:not(.veille).has-company #stage {
  grid-template-columns: minmax(0, 1fr) minmax(0, min(34vw, 62vh)) minmax(0, 1fr);
}
body.tv:not(.veille) #face-head,
body.tv:not(.veille) #col-words,
body.tv:not(.veille) #col-side { min-width: 0; max-width: 100%; overflow: hidden; }
body.tv:not(.veille) #face-head { grid-area: head; align-self: end; }
body.tv:not(.veille) #col-void { grid-area: void; height: 100%; min-height: 0; min-width: 0; flex: none; }
body.tv:not(.veille) #col-words { grid-area: words; align-self: start; }
body.tv:not(.veille).has-company #col-side { grid-area: side; display: block; align-self: center; }
body.tv:not(.veille) #hearth li {
  font-size: clamp(11px, 2.2vmin, 16px);
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.tv.panel-open:not(.veille) #stage {
  display: flex;
  flex-direction: column;
  width: auto;
  right: 50vw;
  align-items: stretch;
  justify-content: flex-start;
  padding: 8vh 4vw 4vh;
  min-width: 0;
}
body.tv.panel-open:not(.veille) #col-side { display: none; }
body.tv.panel-open:not(.veille) #col-void { flex: 1 1 24vh; height: auto; min-height: 24vh; }
body.tv:not(.veille) #face-clock { font-size: clamp(28px, 12vmin, 80px); }
body.tv:not(.veille) #face-date { font-size: clamp(12px, 2.4vmin, 18px); }
body.tv #captions { text-align: left; width: 100%; max-width: 100%; }
body.tv #cap-user { font-size: clamp(14px, 3.2vmin, 22px); }
body.tv:not(.veille) #cap-jarvis { font-size: clamp(14px, 2.7vmin, 18px); max-height: 42vh; overflow: hidden; }
body.tv #feed { width: 100%; max-width: 100%; height: min(64vh, 720px); max-height: min(68vh, 760px); }
body.tv .feed-card .feed-text { font-size: clamp(15px, 2.8vmin, 22px); line-height: 1.48; }
body.tv .feed-card.has-media .feed-thumb { max-height: 32%; }
body.tv .feed-name { font-size: clamp(12px, 2.2vmin, 16px); }
body.tv:not(.veille) #col-words { min-height: 0; display: flex; flex-direction: column; }
body.veille #feed { display: none !important; }
body.tv #cap-sources { justify-content: flex-start; }
body.tv #cap-sources a { font-size: 15px; }
body.tv #state-label { font-size: 15px; }
body.tv #panel {
  width: 50vw; max-width: 50vw; box-sizing: border-box; overflow: auto;
  background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
  padding: 8vh 4vw 4vh 2vw;
}
body.tv .card { max-width: 100%; box-sizing: border-box; }
body.tv .tab { display: none; padding: 0; overflow: hidden; scroll-behavior: auto; }
body.tv #tab-ecran.on, body.tv #tab-taches.on { display: block; }
body.tv .card { padding: clamp(14px, 2.4vmin, 22px) clamp(14px, 2.6vmin, 26px); background: rgba(12, 19, 31, 0.82); }
body.tv .card > header h4 { font-size: clamp(18px, 3.6vmin, 26px); }
body.tv .md { font-size: clamp(15px, 3vmin, 21px); overflow-wrap: anywhere; }
body.tv .md table { font-size: 0.82em; }
body.tv #thinking { left: 5vw; bottom: 5vh; width: 40vw; font-size: 15px; }

/* ---------- écran de veille : l'écran général de la maison ---------- */
body.veille { cursor: none; }
body.veille #top, body.veille #panel, body.veille #bar, body.veille #btn-panel, body.veille #tabs { display: none; }
body.veille #veille {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: fixed; inset: 0 0 28vh; z-index: 2; pointer-events: none; text-align: center;
}
body.veille .veille-brand { margin: 0; letter-spacing: 0.42em; text-transform: uppercase; font-size: 18px; opacity: 0.55; }
body.veille #veille-date { margin: 1.2vh 0 0; font-size: 28px; text-transform: capitalize; opacity: 0.8; }
body.veille #veille-clock { margin: 0; font-size: 14vw; font-weight: 500; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
body.veille #veille-state { margin: 1vh 0 0; font-size: 22px; opacity: 0.7; min-height: 1.2em; }
body.veille #face-head, body.veille #col-void, body.veille #col-side, body.veille #presence, body.veille #where { display: none; }
body.veille #stage { inset: auto 8vw 6vh; align-items: center; text-align: center; padding: 0; }
body.veille #captions, body.veille #cap-sources { text-align: center; justify-content: center; }
body.veille #state-label { display: none; }
body.veille #cap-jarvis { font-size: 34px; max-height: 18vh; }


/* ==========================================================================
   Habillage (v40). La mise en page au-dessus ne change pas ; ici, la lumière,
   le verre et la typographie. Une seule couleur vivante, --glow, suit l'état.
   ========================================================================== */
@property --glow { syntax: "<color>"; inherits: true; initial-value: #7fd6ff; }
body { --glow: #7fd6ff; --glass: rgba(18, 20, 26, 0.55); --hair: rgba(235, 230, 220, 0.10); transition: --glow 0.9s ease; }
body[data-state="listening"] { --glow: #5ee6ff; }
body[data-state="thinking"] { --glow: #ffb05c; }
body[data-state="speaking"] { --glow: #d8f1ff; }
body[data-state="off"], body[data-state="offline"] { --glow: #c45c56; }

/* The room: the light comes from the sphere, a fine grid fades away from it. */
#backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at var(--ox, 50%) var(--oy, 40%), color-mix(in srgb, var(--glow) 13%, transparent), transparent 70%),
    radial-gradient(ellipse 120% 90% at 50% 110%, rgba(40, 52, 74, 0.34), transparent 60%),
    linear-gradient(180deg, #0b0c10 0%, #07080a 46%, #050506 100%);
}
#backdrop::before { content: ""; position: absolute; inset: -40px;
  background-image: radial-gradient(circle, rgba(235, 230, 220, 0.5) 0.7px, transparent 1.1px);
  background-size: 26px 26px; opacity: 0.13;
  -webkit-mask-image: radial-gradient(ellipse 62% 48% at var(--ox, 50%) var(--oy, 40%), #000 8%, transparent 72%);
  mask-image: radial-gradient(ellipse 62% 48% at var(--ox, 50%) var(--oy, 40%), #000 8%, transparent 72%);
  animation: drift 60s linear infinite;
}
#backdrop::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 100% 80% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%); }
@keyframes drift { to { transform: translate(26px, 26px); } }
body, body.instrument, body.tv { background: #07080a; }

/* Clock and date */
#face-clock, body.veille #veille-clock {
  font-weight: 250; letter-spacing: -0.05em;
  background: linear-gradient(180deg, #fbf7ee 10%, #b9b2a3 95%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
#face-clock { font-size: 58px; }
#face-date { margin-top: 10px; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); }
#face-date::before { content: ""; display: inline-block; width: 18px; height: 1px; margin: 0 10px 4px 0; background: var(--glow); opacity: 0.8; }

/* Name, place, state */
body.instrument #presence, body.tv:not(.veille) #presence { display: flex; align-items: center; gap: 10px; color: var(--ink); letter-spacing: 0.46em; }
body.instrument #presence::before, body.tv:not(.veille) #presence::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--glow);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--glow) 18%, transparent), 0 0 14px var(--glow); animation: pulse 3.2s ease-in-out infinite;
}
body[data-state="listening"] #presence::before, body[data-state="thinking"] #presence::before { animation-duration: 1.1s; }
@keyframes pulse { 50% { opacity: 0.45; transform: scale(0.82); } }
body.instrument #state-label:not(:empty), body.tv:not(.veille) #state-label:not(:empty) {
  display: inline-block; margin: 12px 0 14px; padding: 5px 14px; border-radius: 999px; font-size: 13px; letter-spacing: 0.04em;
  color: var(--glow); background: color-mix(in srgb, var(--glow) 9%, transparent); border: 1px solid color-mix(in srgb, var(--glow) 30%, transparent);
}

/* What was said, what he answers */
body.instrument #cap-user:not(:empty), body.tv:not(.veille) #cap-user:not(:empty) {
  padding-left: 12px; border-left: 2px solid color-mix(in srgb, var(--glow) 55%, transparent); color: var(--dim); line-height: 1.4;
}
body.instrument #cap-jarvis, body.tv:not(.veille) #cap-jarvis {
  color: #f4efe5; -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent); mask-image: linear-gradient(180deg, #000 82%, transparent);
}
#cap-jarvis strong { color: #fff; font-weight: 600; }
#cap-sources a { background: var(--glass); border-color: var(--hair); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
#thinking { color: color-mix(in srgb, var(--glow) 55%, transparent); }

/* Who is in the house */
#hearth-label { display: flex; align-items: center; gap: 10px; }
#hearth-label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--hair), transparent); }
#hearth li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 0 0 8px; border-radius: 12px;
  background: var(--glass); border: 1px solid var(--hair); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); text-transform: none; letter-spacing: 0.02em; color: var(--ink); }
#hearth li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: #7be0a3; box-shadow: 0 0 8px #7be0a3; }

/* Top and bottom bars */
body.instrument .icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: var(--ink);
  background: var(--glass); border: 1px solid var(--hair); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
#bar { background: linear-gradient(to top, rgba(5, 5, 6, 0.94) 35%, transparent); padding-top: 26px; }
body.instrument #text, #text { height: 52px; padding: 0 20px; background: var(--glass); border: 1px solid var(--hair);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 30px rgba(0, 0, 0, 0.35); }
body.instrument #text:focus, #text:focus { border-color: color-mix(in srgb, var(--glow) 55%, transparent); }
#text::placeholder { color: var(--faint); }
body.instrument .round, .round { width: 52px; height: 52px; position: relative; color: var(--ink);
  background: var(--glass); border: 1px solid color-mix(in srgb, var(--glow) 35%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 30px rgba(0, 0, 0, 0.35); }
body.instrument .round.live, .round.live { background: var(--glow); color: #08090b; border-color: transparent;
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--glow) 16%, transparent), 0 0 34px color-mix(in srgb, var(--glow) 55%, transparent); }
body.instrument .round.ghost, .round.ghost { border-color: var(--hair); color: var(--dim); }
body.instrument .badge.off { color: var(--danger); }

/* Side panel */
#panel { background: linear-gradient(180deg, rgba(20, 22, 28, 0.78), rgba(10, 11, 14, 0.86)); backdrop-filter: blur(28px) saturate(1.2); -webkit-backdrop-filter: blur(28px) saturate(1.2);
  border-left: 1px solid var(--hair); }
body.panel-open #panel { box-shadow: -30px 0 80px rgba(0, 0, 0, 0.5); }
#tabs { gap: 6px; padding: 14px 14px 10px; }
#tabs button { border-radius: 999px; border: 1px solid transparent; padding: 7px 14px; font-size: 13px; letter-spacing: 0.02em; }
#tabs button.on { color: #08090b; background: var(--ink); border-color: transparent; }
.tab h3 { color: var(--faint); letter-spacing: 0.26em; font-size: 11px; display: flex; align-items: center; gap: 10px; }
.tab h3::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--hair), transparent); }
.tab input[type="text"], .tab input[type="password"], .tab select, .tab textarea { background: rgba(255, 255, 255, 0.04); border-color: var(--hair); border-radius: 12px; }
.tab input:focus, .tab select:focus, .tab textarea:focus { border-color: color-mix(in srgb, var(--glow) 55%, transparent); }
.tab input[type="checkbox"] { accent-color: #ebe6dc; width: 18px; height: 18px; flex: none; }
.tab button, #gate button { border: 1px solid var(--hair); background: rgba(255, 255, 255, 0.05); color: var(--ink); }
.hint a { color: var(--ink); }
#status { gap: 0; }
#status dt, #status dd { padding: 9px 0; border-bottom: 1px solid var(--hair); }
#status dt { padding-right: 16px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }

/* Cards and code tasks */
.card, body.tv .card { position: relative; border: 1px solid var(--hair); border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 50px rgba(0, 0, 0, 0.35); }
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--glow) 70%, transparent), transparent); opacity: 0.7; }
.card > header h4 { font-weight: 600; letter-spacing: -0.01em; }
.md :is(h1, h2, h3, h4) { color: #fbf7ee; }
.md a { color: var(--ink); }
.md pre { background: rgba(0, 0, 0, 0.45); border-color: var(--hair); }
.md th { background: rgba(255, 255, 255, 0.05); }
.task .pill { letter-spacing: 0.06em; text-transform: uppercase; font-size: 10.5px; padding: 3px 10px; }
.task .pill.en_cours { background: rgba(255, 176, 92, 0.10); }
.task .pill.en_cours::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--amber); animation: pulse 1.1s ease-in-out infinite; }
.task .pill.terminee { background: rgba(123, 224, 163, 0.08); }
.task .steps { border-left: 1px solid var(--hair); margin-left: 4px; padding-left: 12px; }
.task .steps li { position: relative; padding: 1px 0; }
.task .steps li::before { content: ""; position: absolute; left: -15px; top: 0.6em; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.task .steps li:last-child::before { background: var(--glow); box-shadow: 0 0 8px var(--glow); }
.entry { border-bottom-color: var(--hair); }

/* Toasts and the gate */
.toast { background: rgba(18, 20, 26, 0.78); border-color: var(--hair); border-radius: 14px; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); }
.toast b { color: var(--glow); }
#gate { background: rgba(5, 5, 6, 0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.gate-box { padding: 34px 30px; border-radius: 24px; border: 1px solid var(--hair); background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); }
.brand.big { letter-spacing: 0.5em; font-weight: 500; }
#gate-go { background: var(--ink); color: #08090b; border-color: transparent; font-weight: 600; }

/* Television and house screen */
body.tv:not(.veille) #face-clock { font-size: clamp(34px, 14vmin, 96px); }
body.veille #veille-clock { font-size: 15vw; }
body.veille .veille-brand { letter-spacing: 0.6em; }
body.veille #veille-date { letter-spacing: 0.18em; text-transform: uppercase; font-size: 20px; }
body.veille #veille-state { color: var(--glow); letter-spacing: 0.06em; }


/* The menu button stays reachable above the open panel: it is the way back. */
body.panel-open:not(.tv) #top { z-index: 9; pointer-events: none; }
body.panel-open:not(.tv) #top > :not(#btn-panel) { visibility: hidden; }
body.panel-open:not(.tv) #btn-panel { pointer-events: auto; }
body:not(.tv) #tabs { padding-right: 66px; }


/* ==========================================================================
   Instrument (v52) : cadre, sol en perspective, tuiles de systèmes.
   Tout ce qui est écrit dans une tuile vient de /api/status.
   ========================================================================== */
:root { --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace; }

/* Frame: four corner brackets, the colour of the current state. */
#frame { position: fixed; inset: 14px; z-index: 2; pointer-events: none; }
#frame i { position: absolute; width: 22px; height: 22px; border: 1px solid color-mix(in srgb, var(--glow) 55%, transparent); opacity: 0.8; transition: border-color 0.9s; }
#frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; }
#frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
#frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; }
#frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
body.veille #frame, body:not(.tv):not(.instrument) #frame { display: none; }
body.instrument:not(.tv) #frame { inset: calc(8px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom)); }
body.instrument:not(.tv) #frame i { width: 14px; height: 14px; opacity: 0.55; }

/* Floor: a grid receding under the core. */
#floor { position: absolute; z-index: 1; left: 50%; bottom: -4%; width: 220%; height: 56%; transform: translateX(-50%) perspective(520px) rotateX(64deg); transform-origin: 50% 100%;
  background-image: linear-gradient(color-mix(in srgb, var(--glow) 26%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--glow) 26%, transparent) 1px, transparent 1px);
  background-size: 54px 54px; opacity: 0.5; animation: floor 9s linear infinite;
  -webkit-mask-image: radial-gradient(ellipse 46% 90% at 50% 100%, #000 0%, transparent 78%); mask-image: radial-gradient(ellipse 46% 90% at 50% 100%, #000 0%, transparent 78%); }
@keyframes floor { to { background-position: 0 54px; } }
body.veille #floor { opacity: 0.10; }

/* Systems */
.sys-title, #hearth-label { margin: 0 0 10px; font: 10px/1 var(--mono); letter-spacing: 0.32em; text-transform: uppercase; color: var(--faint); display: flex; align-items: center; gap: 10px; }
.sys-title::before, #hearth-label::before { content: ""; width: 6px; height: 6px; background: var(--glow); transform: rotate(45deg); opacity: 0.9; }
.sys-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--hair), transparent); }
#sys { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 16px; }
#sys .cell { position: relative; min-width: 0; padding: 10px 12px 11px; border: 1px solid var(--hair); border-radius: 4px 14px 4px 14px;
  background: linear-gradient(160deg, rgba(120, 190, 255, 0.07), rgba(255, 255, 255, 0.012)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); overflow: hidden; }
#sys .cell::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; background: var(--glow); opacity: 0.55; transition: background 0.9s; }
#sys .cell[data-tone="warn"]::before { background: var(--amber); opacity: 1; }
#sys .cell[data-tone="busy"]::before { background: var(--amber); opacity: 1; animation: pulse 1.1s ease-in-out infinite; }
#sys .k { display: block; font: 9.5px/1 var(--mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--faint); }
#sys .v { display: block; margin-top: 7px; font-size: 19px; font-weight: 300; letter-spacing: -0.01em; color: #f2f6fb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
#sys .s { display: block; margin-top: 3px; font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#sys .cell[data-tone="warn"] .v { color: var(--amber); }
#sys #sys-brain, #sys #sys-tasks { grid-column: 1 / -1; }
#hearth li { border-radius: 4px 12px 4px 12px; padding: 8px 10px; gap: 8px; background: rgba(255, 255, 255, 0.025); }
#hearth .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hearth .tag { flex: none; font: 9px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); padding: 3px 5px; border: 1px solid var(--hair); border-radius: 3px; }

/* Labels that belong to the instrument use the monospace hand. */
#face-date, body.instrument #presence, body.tv:not(.veille) #presence, body.instrument #where, body.tv:not(.veille) #where { font-family: var(--mono); }
#face-clock { font-variant-numeric: tabular-nums; }
body.instrument #cap-jarvis, body.tv:not(.veille) #cap-jarvis { font-family: var(--font); font-weight: 300; letter-spacing: 0; }
body.instrument #cap-user:not(:empty), body.tv:not(.veille) #cap-user:not(:empty) { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.01em; }

/* Television: the side column is the systems panel. */
body.tv:not(.veille) #col-side { align-self: center; }
body.tv:not(.veille) #sys .v { font-size: clamp(14px, 3.4vmin, 22px); }
body.tv:not(.veille) #sys .s { font-size: clamp(9px, 2vmin, 12px); }
body.tv:not(.veille) #hearth li { font-size: clamp(10px, 2.1vmin, 14px); }
body.tv:not(.veille) #hearth .tag { display: none; }

/* Phone: two readings in a strip under the clock; the rest lives in the panel. */
@media (max-width: 979px) {
  body.instrument:not(.tv) #col-side { display: block; order: 2; margin-top: 14px; }
  body.instrument:not(.tv) #face-head { order: 1; }
  body.instrument:not(.tv) #col-void { order: 3; }
  body.instrument:not(.tv) #col-words { order: 4; }
  body.instrument:not(.tv) .sys-title, body.instrument:not(.tv) #hearth-label, body.instrument:not(.tv) #hearth,
  body.instrument:not(.tv) #week, body.instrument:not(.tv) #sys-voice, body.instrument:not(.tv) #sys-tasks { display: none; }
  body.instrument:not(.tv) #sys { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
  body.instrument:not(.tv) #sys .k { letter-spacing: 0.12em; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.instrument:not(.tv) #col-side { min-width: 0; max-width: 100%; }
  body.instrument:not(.tv) #sys #sys-brain { grid-column: auto; }
  body.instrument:not(.tv) #sys .cell { padding: 8px 10px 9px; }
  body.instrument:not(.tv) #sys .v { font-size: 15px; margin-top: 6px; }
  body.instrument:not(.tv) #sys .s { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Photo waiting to be sent: a strip above the bottom bar */
#photo-tray { position: fixed; left: 12px; right: 12px; bottom: 96px; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 16px; background: rgba(18, 20, 26, 0.86); border: 1px solid var(--hair);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); }
#photo-tray[hidden] { display: none; }
#photo-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex: none; }
#photo-hint { flex: 1; font-size: 13px; color: var(--dim); line-height: 1.35; }
#photo-send { flex: none; height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid transparent; background: var(--glow); color: #08090b; font-weight: 600; }
#photo-cancel { flex: none; border: 0; background: none; font-size: 13px; color: var(--dim); text-decoration: underline; }
body.tv #photo-tray, body.veille #photo-tray { display: none; }

/* Week in Jodoigne: a strip in the side column. The centre column, which sizes the sphere, is unchanged. */
#week { display: none; }
body.tv:not(.veille) #week:not([hidden]) { display: block; margin: 0; }
body.tv:not(.veille) #week:not([hidden]) + .sys-title { margin-top: 16px; }
#week .sys-title { margin-bottom: 8px; }
#week-days {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px;
  min-width: 0; padding: 7px 5px 6px;
  border: 1px solid var(--hair); border-radius: 4px 14px 4px 14px;
  background: linear-gradient(160deg, rgba(120, 190, 255, 0.07), rgba(255, 255, 255, 0.012));
}
#week .day { position: relative; min-width: 0; text-align: center; padding: 6px 0 4px; border-radius: 3px 8px 3px 8px; color: var(--dim); }
#week .day.today {
  color: var(--ink);
  background: color-mix(in srgb, var(--glow) 13%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--glow) 55%, transparent);
}
#week .day.today::before { content: ""; position: absolute; left: 18%; right: 18%; top: 0; height: 1px; background: var(--glow); }
#week .d { display: block; font: 8px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
#week .day.today .d { color: var(--glow); }
#week .sky { display: block; width: 9px; height: 9px; margin: 6px auto 0; color: currentColor; font-style: normal; }
#week .hi { display: block; margin-top: 4px; font-size: clamp(11px, 2.1vmin, 16px); font-weight: 300; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--dim); }
#week .day.today .hi { color: #fbf7ee; }
#week .lo { display: block; margin-top: 2px; font: 8px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--faint); }
#week .w { display: block; margin-top: 4px; font: 7px/1.1 var(--mono); letter-spacing: 0.02em; text-transform: uppercase; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#week .day.today .w { color: var(--dim); }
:is(#week, #veille-now) .sky-clair { border: 1.2px solid currentColor; border-radius: 50%; }
:is(#week, #veille-now) .sky-voile { border-radius: 50%; border: 1.2px solid currentColor; background: linear-gradient(90deg, currentColor 0 46%, transparent 46%); }
:is(#week, #veille-now) .sky-couvert { border-radius: 50%; background: currentColor; opacity: 0.45; }
:is(#week, #veille-now) .sky-brume { width: 13px; height: 5px; margin-top: 8px; border-radius: 5px; background: currentColor; opacity: 0.4; }
:is(#week, #veille-now) .sky-pluie { position: relative; width: 11px; height: 11px; }
:is(#week, #veille-now) .sky-pluie::before { content: ""; position: absolute; left: 1px; top: 0; width: 8px; height: 5px; border-radius: 6px 6px 5px 5px; background: currentColor; opacity: 0.85; }
:is(#week, #veille-now) .sky-pluie::after { content: ""; position: absolute; left: 2px; top: 7px; width: 1px; height: 3px; background: currentColor; box-shadow: 3px 0 0 currentColor, 6px 1px 0 currentColor; }
:is(#week, #veille-now) .sky-neige { width: 6px; height: 6px; margin-top: 7px; background: currentColor; transform: rotate(45deg); }
:is(#week, #veille-now) .sky-orage { width: 0; height: 0; margin-top: 6px; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 8px solid currentColor; background: none; }

/* House screen weather: a whisper under the clock, not the television's week. */
body.veille #veille-meteo { margin-top: 5vh; display: flex; flex-direction: column; align-items: center; gap: 1.4vh; opacity: 0.85; }
body.veille #veille-meteo[hidden] { display: none; }
body.veille #veille-now { margin: 0; display: flex; align-items: center; gap: 16px; min-height: 1em; }
body.veille #veille-now:empty { display: none; }
body.veille #veille-now .sky { display: block; width: 9px; height: 9px; color: var(--dim); font-style: normal; transform: scale(1.7); margin: 0 6px; }
body.veille #veille-now .t {
  font-size: 44px; font-weight: 250; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fbf7ee 10%, #b9b2a3 95%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
body.veille #veille-now .w { font: 13px/1 var(--mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); }
body.veille #veille-days { margin: 0; font: 13px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); white-space: pre; font-variant-numeric: tabular-nums; }
body.veille #veille-days:empty { display: none; }
