:root {
  --bg: #05080d;
  --panel: rgba(12, 17, 24, 0.86);
  --card: rgba(255, 255, 255, 0.035);
  --border: rgba(120, 200, 220, 0.14);
  --text: #d6e2ea;
  --muted: #7d8c98;
  --cyan: #3ee6e0;
  --cyan-dim: rgba(62, 230, 224, 0.25);
  --amber: #f0b43c;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font: 13px/1.45 var(--font); }
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

#bgPhoenix { position: fixed; left: 50%; top: 50%; width: min(96vw, 108vh); aspect-ratio: 300 / 266; transform: translate(-50%, -50%);
  pointer-events: none; opacity: var(--bg-phoenix, .05); }
#graph { position: fixed; inset: 0; width: 100%; height: 100%; cursor: grab; }
#graph.dragging { cursor: grabbing; }

.panel {
  position: fixed; z-index: 2;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  backdrop-filter: blur(10px);
}
h3 { margin: 14px 0 6px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
/* Section headings that fold their section away (Top hubs, Forces, Display, Filter) */
.fold { all: unset; cursor: pointer; display: flex; align-items: center; gap: 6px; width: 100%; font: inherit; letter-spacing: inherit; color: inherit; }
.fold::before { content: '▾'; font-size: 9px; width: 9px; transition: transform .15s; }
.fold[aria-expanded="false"]::before { transform: rotate(-90deg); }
.fold:hover, .fold:focus-visible { color: var(--text); }
[data-fold-body].folded { display: none; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 10px; color: var(--muted); }

/* Toolbar */
.toolbar { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: 6px; }
.toolbar button { white-space: nowrap; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 12px; }
.toolbar button:hover { border-color: var(--cyan); }
.mobile-only { display: none; }

/* Left */
.left { top: 14px; left: 14px; bottom: 90px; width: 240px; padding: 12px; overflow-y: auto; }
.side-tools { display: flex; gap: 6px; margin-bottom: 10px; }
.side-tools button { white-space: nowrap; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 5px 10px; font-size: 12px; }
.side-tools button:hover { border-color: var(--cyan); }
.side-tools button:disabled { opacity: .6; cursor: progress; }
.side-tools #refreshBtn { flex: 1; }
.toolbar button.on { border-color: var(--cyan-dim); color: var(--cyan); }
#search { width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: var(--text); outline: none; }
#search:focus { border-color: var(--cyan); }
#inspector { font-size: 12px; max-height: 260px; overflow-y: auto; }
#inspector .type { font: 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
#inspector .title { color: var(--text); font-weight: 600; font-size: 13px; margin: 4px 0; }
#inspector a { color: var(--cyan); }
#inspector .links { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
#inspector .links span { background: rgba(255,255,255,.05); border-radius: 4px; padding: 1px 6px; cursor: pointer; }
.list { list-style: none; margin: 0; padding: 6px; }
.list li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; cursor: pointer; color: var(--text); }
.list li:hover { background: rgba(255,255,255,.05); }
.list li .n { margin-left: auto; color: var(--muted); font: 11px var(--mono); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.slider { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0; color: var(--text); }
.slider input { width: 120px; accent-color: var(--cyan); }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); margin: 3px 0; }
.check input { accent-color: var(--cyan); }

/* Filter */
.legend { list-style: none; margin: 0; padding: 6px 10px; }
.legend li { display: flex; align-items: center; gap: 8px; padding: 2px 0; cursor: pointer; user-select: none; }
.legend li.off { opacity: .35; }
.legend li .n { margin-left: auto; color: var(--muted); font: 11px var(--mono); }

/* HUD */
.hud { position: fixed; z-index: 2; right: 14px; top: 14px; width: 260px; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.hud > * { pointer-events: auto; }
#ring { width: 170px; height: 170px; }
.pills { display: flex; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--cyan-dim); border-radius: 999px; font: 10px var(--mono); letter-spacing: .12em; color: var(--cyan); background: rgba(10, 30, 32, .6); text-transform: uppercase; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.pill.listening i { background: #ff4d6d; box-shadow: 0 0 8px #ff4d6d; }
.pill.thinking i { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.pill.speaking i { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.pill.warn { color: var(--amber); border-color: rgba(240,180,60,.35); }
.toggles { display: flex; flex-direction: column; gap: 6px; width: 140px; align-self: flex-end; }
.toggle { display: flex; justify-content: space-between; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; font: 10px var(--mono); letter-spacing: .1em; text-align: left; }
.toggle em { font-style: normal; color: var(--muted); }
.toggle[data-on="1"] { border-color: var(--cyan-dim); }
.toggle[data-on="1"] em { color: var(--cyan); }

/* News */
.news { left: 270px; top: 56px; bottom: 90px; width: 440px; display: flex; flex-direction: column; }
.news.collapsed { bottom: auto; }
.news.collapsed .tabs { border-bottom: 0; }
.news.collapsed > :not(.tabs) { display: none !important; }
.news > :not(.tabs) { flex: 1; min-height: 0; }
.news-tag { font: 600 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.news > .hn-lists { flex: none; display: flex; gap: 4px; padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,.05); overflow-x: auto; scrollbar-width: none; }
.hn-lists button { flex-shrink: 0; background: none; border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; font-size: 11px; color: var(--muted); }
.hn-lists button.on { color: #ff9a4a; border-color: rgba(255,122,26,.5); background: rgba(255,122,26,.08); }
.hn-score { color: #ff9a4a; font-weight: 600; }
.hn-comments { margin: 8px 0 2px; padding: 6px 0 2px 10px; border-left: 2px solid rgba(255,122,26,.35); font-size: 12px; }
.hn-comments > a { color: var(--cyan); font-size: 11px; text-decoration: none; }
.hn-comment { margin-bottom: 10px; color: var(--text); }
.hn-comment p { margin: 3px 0; line-height: 1.45; word-break: break-word; }
.hn-by { color: var(--muted); font-size: 10.5px; }
.tabs { display: flex; align-items: center; gap: 0; padding: 8px 8px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar, .tab-scroll::-webkit-scrollbar { display: none; }
/* On narrow screens the tabs scroll sideways; the time and buttons stay put. */
.tab-scroll { display: flex; align-items: center; flex: 1; min-width: 0; flex-wrap: wrap; row-gap: 2px; } /* tabs that don't fit go onto a second line rather than off the edge */
.tabs > .updated, .tabs > .panel-refresh, .tabs > .mem-close { flex-shrink: 0; }
.tab { flex-shrink: 0; background: none; border: 1px solid transparent; border-radius: 6px; padding: 3px 7px; color: var(--muted); }
.tab.active { color: var(--cyan); border-color: var(--cyan-dim); background: rgba(62,230,224,.06); }
.panel-refresh { background: none; border: 1px solid transparent; border-radius: 6px; color: var(--muted); font-size: 14px; line-height: 1; padding: 3px 6px; }
.panel-refresh:hover { color: var(--cyan); border-color: var(--cyan-dim); }
.panel-refresh.spinning { animation: spin .8s linear infinite; color: var(--cyan); pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.toolbar button:disabled { opacity: .6; cursor: progress; }
.updated { white-space: nowrap; margin-left: auto; color: var(--muted); font: 10px var(--mono); }
.newslist { list-style: none; margin: 0; padding: 4px 6px 8px; overflow-y: auto; }
.newslist li { padding: 7px 6px; border-bottom: 1px solid rgba(255,255,255,.04); }
.newslist a { color: var(--text); text-decoration: none; font-weight: 500; }
.newslist a:hover { color: var(--cyan); }
.newslist .meta { color: var(--muted); font-size: 11px; margin-top: 2px; display: flex; gap: 8px; }
.newslist .meta button { background: none; border: none; padding: 0; color: var(--cyan); font-size: 11px; }

/* Weather */
.news.wx { width: 440px; }
.weather { overflow-y: auto; padding: 4px 12px 10px; }
.wx-pad { padding: 8px 0; }
.wx-now { display: flex; align-items: center; gap: 10px; padding: 8px 0 4px; }
.wx-now-icon { font-size: 34px; line-height: 1; }
.wx-now-temp { font: 600 34px/1 var(--font); color: var(--text); }
.wx-now-text { display: flex; flex-direction: column; font-size: 11.5px; color: var(--muted); min-width: 0; }
.wx-now-text b { color: var(--text); font-size: 13px; font-weight: 600; }
.wx-title { margin: 12px 0 6px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.wx-hours { display: flex; gap: 2px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.wx-hour { flex: none; width: 46px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border-radius: 8px; scroll-snap-align: start; }
.wx-hour.sel { background: rgba(62,230,224,.07); }
.wx-h-time { font: 10px var(--mono); color: var(--muted); }
.wx-h-icon { font-size: 18px; line-height: 1.2; }
.wx-h-temp { font-weight: 600; color: var(--text); }
.wx-h-rain { position: relative; width: 30px; height: 26px; display: flex; align-items: flex-end; justify-content: center; font: 9px var(--mono); color: #7fb8ff; }
.wx-h-rain i { position: absolute; left: 50%; bottom: 12px; width: 4px; height: calc(var(--p) * .14); max-height: 14px; transform: translateX(-50%); background: #5b8cff; border-radius: 2px; }
.wx-divider { flex: none; width: 18px; display: flex; align-items: center; justify-content: center; border-left: 1px solid var(--border); margin: 6px 2px; scroll-snap-align: start; }
.wx-divider span { writing-mode: vertical-rl; transform: rotate(180deg); font: 10px var(--mono); letter-spacing: .1em; color: var(--cyan); text-transform: uppercase; }
.wx-days { list-style: none; margin: 0; padding: 0; }
.wx-day { display: grid; grid-template-columns: 62px 24px 1fr 44px 26px 70px 26px; align-items: center; gap: 6px; padding: 6px 4px; border-radius: 6px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,.04); }
.wx-day:hover { background: rgba(255,255,255,.04); }
.wx-day.sel { background: rgba(62,230,224,.08); }
.wx-d-name { color: var(--text); font-weight: 500; }
.wx-d-icon { font-size: 16px; text-align: center; }
.wx-d-sum { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-d-rain { color: #7fb8ff; font: 10px var(--mono); text-align: right; }
.wx-d-lo { color: var(--muted); text-align: right; }
.wx-d-hi { color: var(--text); font-weight: 600; }
.wx-d-bar { position: relative; height: 4px; border-radius: 2px; background: rgba(255,255,255,.08); }
.wx-d-bar i { position: absolute; top: 0; bottom: 0; border-radius: 2px; background: linear-gradient(90deg, #5b8cff, #3ee6e0, #f0b43c); min-width: 6px; }
.wx-credit { margin: 8px 0 0; font-size: 10px; color: var(--muted); }
.wx-chip { background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px; font-size: 12px; }
.wx-chip:hover { border-color: var(--cyan); }

/* Calendar */
.calendar { overflow-y: auto; padding: 4px 12px 10px; }
.cal-pad { padding: 8px 0; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 2px; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.cal-day { margin: 12px 0 4px; font-size: 11px; color: var(--cyan); font-weight: 600; letter-spacing: .04em; }
.cal-list { list-style: none; margin: 0; padding: 0; }
.cal-event { display: grid; grid-template-columns: 50px 3px 1fr; gap: 10px; align-items: start; padding: 7px 6px; border-radius: 6px; }
.cal-event[data-link] { cursor: pointer; }
.cal-event:hover { background: rgba(255,255,255,.04); }
.cal-time { font: 12px var(--mono); color: var(--text); display: flex; flex-direction: column; }
.cal-time small { color: var(--muted); font-size: 10px; }
.cal-bar { align-self: stretch; border-radius: 2px; min-height: 28px; }
.cal-text { display: flex; flex-direction: column; min-width: 0; }
.cal-text b { font-weight: 500; color: var(--text); }
.cal-text small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-error { color: var(--amber); font-size: 12px; margin: 6px 0; }
.cal-error a { color: var(--cyan); }
.cal-empty { padding: 16px 0; text-align: center; color: var(--muted); }
.cal-hint { font-size: 11px; margin: 12px auto 0; max-width: 340px; line-height: 1.45; }
.cal-hint b { color: var(--text); font-weight: 600; }
.cal-btn { display: inline-block; background: rgba(62,230,224,.15); border: 1px solid var(--cyan-dim); color: var(--cyan); border-radius: 8px; padding: 8px 14px; font-weight: 600; text-decoration: none; }
.cal-btn:hover { background: rgba(62,230,224,.22); }
.cal-link { background: none; border: none; color: var(--cyan); font-size: 12px; padding: 2px 4px; }
.cal-link.danger { color: #ff7a8a; }
.cal-setup { font-size: 12.5px; color: var(--text); padding: 6px 0; }
.cal-setup ol { padding-left: 18px; margin: 6px 0; display: flex; flex-direction: column; gap: 8px; color: var(--muted); }
.cal-setup a { color: var(--cyan); }
.cal-setup code { font: 11px var(--mono); color: var(--text); }
.cal-uri { display: block; margin-top: 4px; padding: 6px 8px; background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 6px; word-break: break-all; user-select: all; }
.cal-modal { position: static; width: min(440px, 100%); max-height: 80vh; overflow-y: auto; padding: 18px 20px; }
.cal-modal-title { margin: 0 0 4px; font-size: 12px; color: var(--cyan); }
.cal-acc { margin-top: 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); }
.cal-acc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.cal-acc-head b { color: var(--text); font-weight: 600; word-break: break-all; }
.cal-check { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--text); cursor: pointer; }
.cal-check input { accent-color: var(--cyan); }
.cal-check em { color: var(--muted); font-style: normal; font-size: 11px; }
.cal-modal-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; flex-direction: column; align-items: center; gap: 6px; }

/* Music */
.music { left: 270px; top: 56px; width: 380px; max-height: calc(100vh - 152px); z-index: 5; display: flex; flex-direction: column; }
.music-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px 2px; }
.music-head b { color: var(--amber); letter-spacing: .06em; }
.music-head span { flex: 1; }
.music-form { padding-top: 6px; }
.music-hint { margin: 0 12px 6px; font-size: 11.5px; }
.music-player { display: none; margin: 0 12px; height: 200px; border-radius: 8px; overflow: hidden; background: #000; }
.music.playing .music-player { display: block; }
.music-player iframe { width: 100%; height: 100%; border: 0; }
.music-now { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px; }
.music-now-text { display: flex; flex-direction: column; min-width: 0; }
.music-now-text b { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-now-text small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-controls { display: flex; align-items: center; gap: 6px; }
.music-controls button { width: 32px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: rgba(255,255,255,.04); color: var(--text); }
.music-controls button:hover { border-color: var(--amber); color: var(--amber); }
#mPlay { width: 40px; color: var(--amber); border-color: rgba(240,180,60,.45); }
#mVol { flex: 1; accent-color: var(--amber); min-width: 60px; }
.music:not(.playing) .music-controls { opacity: .4; pointer-events: none; }
.music-tabs { border-top: 1px solid var(--border); }
.music-list { list-style: none; margin: 0; padding: 4px 8px 10px; overflow-y: auto; min-height: 60px; }
.music-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 8px; align-items: center; padding: 6px 4px; border-radius: 6px; }
.music-item:hover { background: rgba(255,255,255,.04); }
.music-item.now { background: rgba(240,180,60,.08); }
.music-item img, .music-thumb { width: 56px; height: 32px; object-fit: cover; border-radius: 4px; background: rgba(255,255,255,.06); display: grid; place-items: center; color: var(--muted); }
.music-meta { display: flex; flex-direction: column; min-width: 0; }
.music-meta b { color: var(--text); font-weight: 500; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-meta small { color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-actions button { background: none; border: none; color: var(--muted); font-size: 13px; padding: 0 3px; }
.music-actions button:hover { color: var(--amber); }
.music.mini .music-form, .music.mini .music-hint, .music.mini .music-tabs, .music.mini .music-list { display: none; }
.music.mini { top: auto; bottom: 90px; left: 14px; width: 240px; max-height: none; }
/* In the sidebar under Display (position set by app.js) */
.music.mini.docked { bottom: auto; border-radius: 8px; box-shadow: none; }
.music.mini .music-controls { gap: 4px; }
.music.mini .music-controls button { width: 28px; }
.music.mini #mPlay { width: 34px; }
.music.mini #mVol { min-width: 30px; }
.mini-slot { margin-top: 14px; }
.music-chip { color: var(--amber); border-color: rgba(240,180,60,.4); }

/* Voice check */
.voice-check { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.vc-line { display: grid; grid-template-columns: 12px auto 1fr; gap: 8px; align-items: baseline; padding: 6px 2px; }
.vc-line b { color: var(--text); font-weight: 600; white-space: nowrap; }
.vc-line span:last-child { color: var(--muted); font-size: 12px; }
.vc-say { color: var(--text); margin: 8px 0 6px; }
.vc-meter { height: 10px; border-radius: 5px; background: rgba(255,255,255,.07); overflow: hidden; }
.vc-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2fd08a, #f0b43c, #ff4d6d); transition: width .08s linear; }
#vcMic:disabled { opacity: .6; cursor: progress; }

/* Career */
.cr-modal { width: min(680px, 100%); max-height: 88vh; }
#careerPanel .cal-link { background: none; border: none; color: var(--cyan); font-size: 12px; font-weight: 400; padding: 2px 6px; }
#careerPanel .cal-link.danger { color: #ff7a8a; }
#careerPanel .cal-btn { padding: 7px 14px; }
#careerPanel .cal-btn:disabled, #careerPanel .cal-link:disabled { opacity: .6; cursor: progress; }
#careerPanel .tab { background: none; border: 1px solid transparent; padding: 3px 10px; color: var(--muted); font-weight: 400; border-radius: 6px; }
#careerPanel .tab.active { color: var(--cyan); border-color: var(--cyan-dim); background: rgba(62,230,224,.06); }
.cr-tabs { padding: 6px 0; margin-bottom: 10px; }
.cr-who { margin: 2px 0 6px; font-size: 13px; color: var(--text); }
#careerPanel form.cr-form { position: static; width: auto; padding: 0; display: block; }
.cr-form fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px 12px; margin: 0 0 12px; }
.cr-form legend { color: var(--amber); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 0 6px; }
.cr-form fieldset > p { margin: 0 0 8px; font-size: 12px; }
.cr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.cr-field { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); }
.cr-field.wide { grid-column: 1 / -1; }
.cr-field b { color: var(--amber); }
#careerPanel .cr-field input, #careerPanel .cr-field textarea { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; color: var(--text); font: inherit; font-size: 12.5px; resize: vertical; outline: none; }
#careerPanel .cr-field input:focus, #careerPanel .cr-field textarea:focus { border-color: var(--cyan); }
.cr-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 4px; }
.cr-empty { text-align: center; padding: 18px 10px; color: var(--text); }
.cr-summary { color: var(--text); line-height: 1.55; }
.cr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.cr-list { margin: 4px 0 8px; padding-left: 18px; color: var(--text); font-size: 12.5px; line-height: 1.5; }
.cr-area, .cr-goal { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.cr-area p, .cr-goal p { margin: 4px 0 4px 22px; font-size: 12.5px; color: var(--text); line-height: 1.45; }
.cr-area p.muted, .cr-goal p.muted { color: var(--muted); }
.cr-area ul, .cr-goal ul { list-style: none; margin: 6px 0 0 22px; padding: 0; }
.cr-area li, .cr-goal li { padding: 3px 0; font-size: 12.5px; }
.cr-check { display: inline-flex; gap: 7px; align-items: baseline; cursor: pointer; color: var(--text); }
.cr-check input { accent-color: var(--cyan); }
.cr-check b { color: var(--cyan); }
.cr-goal.done { opacity: .6; }
.cr-goal li.done { color: var(--muted); text-decoration: line-through; }
.cr-goal-head { display: flex; justify-content: space-between; gap: 10px; }
.cr-goal-head b { color: var(--cyan); }
.cr-plan-head b { color: var(--cyan); font-size: 16px; }
.cr-plan-head .hl-bar { margin: 6px 0; }
.cr-due { color: var(--amber); }
.cr-weeks { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.cr-weeks select { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; }
.cr-credit { font-size: 11px; }
.cr-rating { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px; font-size: 12.5px; color: var(--text); }
.cr-rating > span { flex-basis: 100%; }
.cr-rating label { display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.cr-rating input { position: absolute; opacity: 0; }
.cr-rating i { font-style: normal; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: var(--muted); }
.cr-rating input:checked + i { border-color: var(--cyan); color: var(--cyan); background: rgba(62,230,224,.1); }
.cr-rating input:focus-visible + i { outline: 2px solid var(--cyan-dim); }
.cr-rating small { font-size: 10px; color: var(--muted); }
.cr-reply { padding: 10px 14px; border: 1px solid rgba(62,230,224,.35); border-radius: 10px; background: rgba(62,230,224,.05); margin: 8px 0; color: var(--text); font-size: 12.5px; line-height: 1.5; }
.cr-reply > p { margin: 4px 0 8px; }
.cr-focus b { color: var(--cyan); }
.cr-new { list-style: none; padding: 0; margin: 4px 0 10px; }
.cr-new li { padding: 3px 0; }
.cr-past { border-bottom: 1px solid rgba(255,255,255,.06); padding: 6px 0; font-size: 12.5px; color: var(--text); }
.cr-past summary { cursor: pointer; color: var(--muted); }
.cr-past p { margin: 4px 0; }
@media (max-width: 560px) { .cr-grid, .cr-two { grid-template-columns: 1fr; } }

/* Adding a calendar event (reuses the Career form layout) */
.ev-modal { width: min(520px, 100%); max-height: 88vh; }
#eventPanel form.ev-form { position: static; width: auto; padding: 0; display: block; margin-top: 8px; }
#eventPanel .cal-link { background: none; border: none; color: var(--cyan); font-size: 12px; font-weight: 400; padding: 2px 6px; }
#eventPanel .cal-btn { padding: 7px 14px; }
#eventPanel .cal-btn:disabled { opacity: .6; cursor: progress; }
#eventPanel .cr-field input, #eventPanel .cr-field select { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; color: var(--text); font: inherit; font-size: 12.5px; outline: none; color-scheme: dark; }
#eventPanel .cr-field input:focus, #eventPanel .cr-field select:focus { border-color: var(--cyan); }
#eventPanel .cr-field input:disabled { opacity: .4; }
.ev-allday { grid-column: 1 / -1; font-size: 12.5px; }
.ev-steps { color: var(--text); font-size: 12.5px; line-height: 1.7; padding-left: 18px; }
.ev-steps .cal-btn { display: inline-block; margin: 4px 0; }
.cal-head > span { display: flex; gap: 4px; }
.cal-ro { font-size: 11.5px; margin: 4px 0 6px; }
#eventPanel .cal-hint a, .cal-ro a { color: var(--cyan); }

/* Automations */
.auto-modal { width: min(660px, 100%); max-height: 88vh; }
.auto-modal .cal-link { background: none; border: none; color: var(--cyan); font-size: 12px; font-weight: 400; padding: 2px 6px; }
.auto-modal .cal-btn { padding: 7px 14px; }
.auto-modal .cal-btn:disabled { opacity: .6; cursor: progress; }
.auto-engine { font-size: 12px; color: var(--text); margin: 8px 0 12px; line-height: 1.5; }
.auto-engine .sys-dot { display: inline-block; margin-right: 8px; vertical-align: 1px; }
.auto-engine.ok .sys-dot { background: #2fd08a; }
.auto-engine.warn .sys-dot { background: var(--amber); }
.auto-engine small { color: var(--muted); }
#autoNew { position: static; width: auto; padding: 0; display: block; }
.auto-new textarea, .auto-json { width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; color: var(--text); font: inherit; resize: vertical; outline: none; }
.auto-new textarea:focus, .auto-json:focus { border-color: var(--cyan); }
.auto-json { font: 11.5px/1.45 var(--mono); margin-top: 8px; }
.auto-new-row { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; }
.auto-examples { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.auto-modal .auto-ex { background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 999px; padding: 3px 9px; font-size: 11px; color: var(--muted); font-weight: 400; text-align: left; }
.auto-modal .auto-ex:hover { color: var(--text); border-color: var(--cyan-dim); }
.auto-draft { margin: 12px 0; padding: 12px 14px; border: 1px solid rgba(62,230,224,.35); border-radius: 10px; background: rgba(62,230,224,.05); }
.auto-draft b { color: var(--cyan); }
.auto-draft p { color: var(--text); margin: 6px 0; line-height: 1.5; }
.auto-draft summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.auto-draft-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px; }
.auto-draft-actions small { flex-basis: 100%; font-size: 10.5px; word-break: break-word; }
.auto-h { margin: 16px 0 6px; color: var(--amber); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.auto-list { list-style: none; margin: 0; padding: 0; }
.auto-rule { padding: 10px 2px; border-bottom: 1px solid rgba(255,255,255,.06); }
.auto-rule.off { opacity: .55; }
.auto-rule p { margin: 4px 0 2px 44px; color: var(--text); font-size: 12.5px; line-height: 1.45; }
.auto-rule > small { margin-left: 44px; font-size: 11px; }
.auto-rule > .auto-json, .auto-rule > .auto-draft-actions { margin-left: 44px; width: calc(100% - 44px); }
.auto-rule-head { display: flex; align-items: center; gap: 10px; }
.auto-rule-head b { color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auto-modal .auto-rule-actions button { background: none; border: none; color: var(--muted); font-size: 13px; padding: 2px 5px; font-weight: 400; }
.auto-modal .auto-rule-actions button:hover { color: var(--cyan); }
.auto-switch { position: relative; width: 34px; height: 18px; flex: none; cursor: pointer; }
.auto-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.auto-switch i { position: absolute; inset: 0; border-radius: 999px; background: rgba(255,255,255,.12); transition: background .15s; }
.auto-switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.auto-switch input:checked + i { background: rgba(62,230,224,.35); }
.auto-switch input:checked + i::after { transform: translateX(16px); background: var(--cyan); }
.auto-switch input:focus-visible + i { outline: 2px solid var(--cyan); }
.auto-log { margin-top: 12px; font-size: 12px; }
.auto-log summary { cursor: pointer; color: var(--muted); }
.auto-log ul { list-style: none; margin: 6px 0; padding: 0; max-height: 220px; overflow-y: auto; }
.auto-log li { padding: 3px 0; color: var(--text); border-left: 2px solid #2fd08a; padding-left: 8px; margin: 3px 0; }
.auto-log li.bad { border-left-color: #ff4d6d; }
.auto-log li span { color: var(--muted); font: 10.5px var(--mono); }
.auto-push { font-size: 11.5px; margin-top: 10px; }
@media (max-width: 1600px) { .toolbar .lbl { display: none; } .toolbar button { padding: 5px 12px; font-size: 14px; } }
@media (max-width: 600px) { .toolbar { gap: 4px; } .toolbar button { padding: 5px 9px; font-size: 13px; } }
@media (max-width: 400px) { .toolbar { gap: 3px; } .toolbar button { padding: 4px 6px; font-size: 12.5px; } }

/* Projects */
.pj-toolbar { display: flex; justify-content: flex-end; padding: 0 12px 2px; }
#memProjects .cal-link, .pj-modal .cal-link, .pick-modal .cal-link { background: none; border: none; color: var(--cyan); font-size: 12px; font-weight: 400; padding: 2px 6px; }
.pj-modal .cal-link.danger { color: #ff7a8a; }
.pj-list { overflow-y: auto; }
.pj-card { padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; margin: 6px 4px; cursor: pointer; background: var(--card); }
.pj-card:hover { border-color: var(--cyan-dim); }
.pj-card.paused, .pj-card.done { opacity: .6; }
.pj-card-head { display: flex; align-items: baseline; gap: 8px; }
.pj-card-head b { color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-status { font: 600 9.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; }
.pj-bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.07); overflow: hidden; margin: 6px 0 5px; }
.pj-bar i { display: block; height: 100%; background: linear-gradient(90deg, #2fd08a, var(--cyan)); }
.pj-bar.big { height: 8px; }
.pj-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--muted); align-items: center; }
.pj-flag { font-size: 10.5px; color: var(--amber); }
.pj-flag.bad { color: #ff7a8a; }
.pj-flag.warn { color: var(--amber); }
.pj-ms { color: #b38cff; }
.pj-next { font-size: 12px; color: var(--text); margin-top: 4px; }
.pj-next small { color: var(--muted); }
.pj-due { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.pj-due.soon { color: var(--amber); }
.pj-due.late { color: #ff7a8a; }
.task-group { list-style: none; margin-top: 8px; }
.pj-group { background: none; border: none; color: var(--cyan); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 4px 2px; font-weight: 600; }
.pj-group small { color: var(--muted); }
.task { flex-wrap: wrap; }
.task-tags { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 6px; padding-left: 26px; }
.task-tags:empty { display: none; }
.pj-state { font-size: 10.5px; border-radius: 4px; padding: 0 5px; background: rgba(255,255,255,.05); color: var(--muted); }
.pj-state.next { color: #2fd08a; background: rgba(47,208,138,.1); }
.pj-state.waiting { color: var(--amber); background: rgba(240,180,60,.1); }
.pj-state.blocked { color: #ff7a8a; background: rgba(255,77,109,.1); }
.pj-chip, .pj-link { font-size: 10.5px; color: var(--cyan); text-decoration: none; cursor: pointer; border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; white-space: nowrap; }
.pj-link-wrap { display: inline-flex; align-items: center; gap: 2px; }
.pj-link-wrap button { background: none; border: none; color: var(--muted); font-size: 10px; padding: 0 3px; }
.pj-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pj-modal { width: min(680px, 100%); max-height: 90vh; }
.pj-head-actions { display: flex; gap: 4px; }
.pj-title { margin: 10px 0 2px; font-size: 18px; color: var(--text); font-weight: 600; }
.pj-desc { color: var(--muted); margin: 2px 0 6px; font-size: 12.5px; }
.pj-summary { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 12px; color: var(--text); margin: 6px 0 10px; }
.pj-summary .pj-bar { flex-basis: 100%; }
.pj-ask { margin: 8px 0; }
.pj-h { margin: 16px 0 6px; color: var(--amber); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.pj-milestones { list-style: none; margin: 0; padding: 0; }
.pj-milestones li { display: flex; align-items: center; gap: 8px; padding: 4px 2px; color: var(--text); }
.pj-milestones li b { color: #b38cff; font-weight: 600; }
.pj-milestones li.done b { text-decoration: line-through; opacity: .6; }
.pj-milestones label { display: flex; align-items: center; gap: 6px; flex: 1; cursor: pointer; }
.pj-milestones button { background: none; border: none; color: var(--muted); }
#projPanel form.pj-add, #projPanel form.pj-editor, #projPanel #pjForm { position: static; width: auto; padding: 0; }
.pj-add { display: flex; gap: 6px; margin: 6px 0; }
.pj-add input, .pj-add select, .pj-editor input, .pj-editor select, .pj-editor textarea { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; color: var(--text); font: inherit; font-size: 12.5px; outline: none; min-width: 0; }
.pj-add input:first-child { flex: 1; }
.pj-add button { background: rgba(62,230,224,.12); border: 1px solid var(--cyan-dim); color: var(--cyan); border-radius: 6px; padding: 5px 12px; }
.pj-group-h { margin: 10px 0 2px; font-size: 11.5px; color: #b38cff; }
.pj-done summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-top: 8px; }
.pj-editor { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--cyan-dim); border-radius: 8px; background: rgba(62,230,224,.04); margin: 4px 0; }
.task-edit { list-style: none; }
.pj-field { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.pj-field > span { font-size: 11px; color: var(--muted); }
.pj-row { display: flex; gap: 8px; }
.pj-editor-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pj-blockers { margin: 10px 0; padding: 12px 14px; border: 1px solid rgba(240,180,60,.4); border-radius: 10px; background: rgba(240,180,60,.06); }
.pj-analysis { color: var(--text); line-height: 1.55; font-size: 13px; margin-bottom: 8px; }
.pj-findings { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12px; }
.pj-findings li { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; color: var(--text); }
.pj-findings .sys-dot { flex: none; }
.pj-findings li.bad .sys-dot { background: #ff4d6d; }
.pj-findings li.warn .sys-dot { background: var(--amber); }
.pj-findings li.ok .sys-dot { background: #2fd08a; }
.rv-project { border-top: 1px solid rgba(255,255,255,.06); padding: 10px 0; cursor: pointer; }
.rv-facts { list-style: none; margin: 4px 0; padding: 0; font-size: 12.5px; color: var(--text); }
.rv-facts li { margin: 3px 0; }
.rv-facts .late { color: #ff7a8a; }
.rv-inbox { font-size: 12px; }
.pick-modal { width: min(460px, 100%); max-height: 80vh; }
.pj-picker-head { display: flex; gap: 2px; align-items: center; margin-bottom: 8px; }
.pj-picker-head .cal-link { margin-left: auto; }
#pickQuery { width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 7px 9px; color: var(--text); font: inherit; outline: none; }
.pj-pick-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.pj-pick-list li { padding: 7px 6px; border-bottom: 1px solid rgba(255,255,255,.05); cursor: pointer; color: var(--text); font-size: 12.5px; }
.pj-pick-list li:hover { background: rgba(62,230,224,.06); }
.pj-pick-list li small { color: var(--muted); }
/* Inside the project / picker windows, undo the login dialog's generic form and button styles */
#projPanel form.pj-add { flex-direction: row; gap: 6px; }
#projPanel .pj-add input, #projPanel .pj-add select, #projPanel .pj-editor input, #projPanel .pj-editor select, #projPanel .pj-editor textarea { padding: 6px 8px; font-size: 12.5px; }
#projPanel .pj-add button { padding: 5px 12px; font-weight: 400; }
#projPanel .task-actions button, #projPanel .pj-milestones button, #projPanel .pj-link-wrap button, #pickPanel .tab {
  background: none; border: 1px solid transparent; padding: 0 5px; color: var(--muted); font-weight: 400; border-radius: 6px; }
#pickPanel .tab { padding: 3px 8px; }
#pickPanel .tab.active { color: var(--cyan); border-color: var(--cyan-dim); }
#projPanel .task-actions button:hover, #projPanel .pj-milestones button:hover { color: var(--cyan); }
@media (max-width: 560px) { .pj-row { flex-direction: column; } .pj-add, #projPanel form.pj-add { flex-wrap: wrap; } }

/* Health */
.hl-modal { width: min(560px, 100%); max-height: 88vh; }
#healthPanel .cal-link { background: none; border: none; color: var(--cyan); font-size: 12px; font-weight: 400; padding: 2px 6px; }
#healthPanel .cal-link.danger { color: #ff7a8a; }
#healthPanel .cal-btn { display: inline-block; padding: 7px 14px; }
#healthPanel .updated { font: 10px var(--mono); color: var(--muted); }
#healthRefresh.spinning { animation: spin 1s linear infinite; display: inline-block; }
.health { padding: 2px 0 4px; }
.hl-range { display: flex; align-items: center; gap: 4px; margin: 16px 0 4px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.hl-range small { margin-left: auto; font-size: 11px; }
#healthPanel .hl-range .tab { background: none; border: 1px solid transparent; padding: 3px 10px; color: var(--muted); font-weight: 400; border-radius: 6px; }
#healthPanel .hl-range .tab.active { color: var(--cyan); border-color: var(--cyan-dim); background: rgba(62,230,224,.06); }
.hl-chart.many { gap: 2px; }
.hl-chart.many .hl-col i { width: 80%; border-radius: 2px 2px 0 0; }
.hl-col i.azm { background: rgba(240,180,60,.45); }
.hl-col i.azm.met { background: var(--amber); }
.hl-col i.o2 { background: rgba(255,95,162,.55); }
/* Sleep: one stacked bar a day, the night at the bottom and naps above it */
.hl-stack { position: relative; width: 70%; max-width: 26px; min-height: 2px; display: flex; flex-direction: column-reverse; gap: 1px; }
.hl-chart.many .hl-stack { width: 80%; }
.hl-stack i { width: 100% !important; max-width: none !important; min-height: 2px; border-radius: 0 !important; }
.hl-stack i:last-child { border-radius: 3px 3px 0 0 !important; }
.hl-col .hl-stack i.sleep { background: rgba(179,140,255,.5); }
.hl-col .hl-stack.met i.sleep { background: #b38cff; }
.hl-col .hl-stack i.sleep.nap { background: rgba(255,200,120,.75); }
.hl-total { position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); font: 9.5px var(--mono); font-style: normal; color: var(--muted); white-space: nowrap; }
.hl-chart.sleepy { margin-top: 14px; }
.hl-note { font-size: 12px; line-height: 1.5; }
.wx-title small { font-weight: 400; letter-spacing: 0; text-transform: none; }
.hl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin: 6px 0 4px; }
.hl-card { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--card); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hl-label { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hl-card b { font-size: 20px; color: var(--text); font-weight: 600; }
.hl-card b small { font-size: 11px; color: var(--muted); font-weight: 400; }
.hl-card > small { font-size: 10.5px; color: var(--muted); }
.hl-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.07); overflow: hidden; }
.hl-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff7a8a, #2fd08a); }
.hl-chart { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 92px; padding-bottom: 16px; }
.hl-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.hl-col i { width: 70%; max-width: 26px; background: rgba(62,230,224,.45); border-radius: 3px 3px 0 0; min-height: 2px; }
.hl-col i.met { background: #2fd08a; }
.hl-col i.sleep { background: rgba(179,140,255,.5); }
.hl-col i.sleep.met { background: #b38cff; }
.hl-col span { position: absolute; bottom: -16px; font: 10px var(--mono); color: var(--muted); }
.hl-goal { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(240,180,60,.6); pointer-events: none; }
.hl-warn { font-size: 11px; margin: 12px 0 4px; }
.hl-warn ul { margin: 4px 0 0; padding-left: 16px; }
.hl-hint { border: 1px solid rgba(240,180,60,.4); background: rgba(240,180,60,.06); border-radius: 10px; padding: 10px 12px; margin: 4px 0 10px; font-size: 12.5px; color: var(--text); line-height: 1.5; }
.hl-hint b { color: var(--amber); }
.hl-hint ol { margin: 6px 0; padding-left: 18px; }
.hl-hint p { margin: 4px 0; }

/* Briefing */
.brief-modal { width: min(640px, 100%); max-height: 86vh; }
.brief-actions { display: flex; align-items: center; gap: 6px; }
.brief-modal .cal-link { background: none; border: none; color: var(--cyan); font-size: 12px; font-weight: 400; padding: 2px 6px; }
.brief-modal .cal-btn { padding: 6px 12px; }
.brief-hello { color: var(--text); font-size: 14px; margin: 10px 0 4px; }
.brief-sec { border-top: 1px solid rgba(255,255,255,.06); padding: 6px 0 4px; margin-top: 8px; }
.brief-sec h4 { margin: 8px 0 6px; color: var(--amber); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.brief-sec p { color: var(--text); line-height: 1.55; margin: 6px 0; }
.brief-tag { color: var(--cyan); font-weight: 600; margin-right: 2px; }
.brief-wait { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.brief-heads { margin: 4px 0; font-size: 12px; }
.brief-heads summary { cursor: pointer; color: var(--muted); }
.brief-heads ul { margin: 4px 0 8px; padding-left: 18px; }
.brief-heads li { margin: 3px 0; }
.brief-heads a { color: var(--text); text-decoration: none; }
.brief-heads a:hover { color: var(--cyan); }
.brief-heads small, .brief-cal small { color: var(--muted); }
.brief-credit { font-size: 11px; }
.brief-days, .brief-cal { list-style: none; margin: 4px 0; padding: 0; color: var(--text); }
.brief-days li { margin: 4px 0; line-height: 1.45; }
.brief-cal > li { margin: 6px 0; }
.brief-cal ul { list-style: none; margin: 3px 0 0 12px; padding: 0; }
.brief-time { display: inline-block; min-width: 52px; color: var(--muted); font: 11px var(--mono); }

/* Notion (Planner → Notion) */
.notion-setup { padding: 4px 14px; color: var(--muted); font-size: 12px; }
.notion-setup b { color: var(--text); }
.notion-setup ol { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.notion-setup a, .notion-inbox a, .notion-q a, .notion-page a { color: var(--cyan); text-decoration: none; }
.notion-inbox { margin: 8px 14px 0; font-size: 11.5px; }
.notion-list { overflow-y: auto; }
.notion-item { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.notion-item:hover .notion-title { color: var(--cyan); }
.notion-icon { width: 18px; text-align: center; flex: none; }
.notion-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.notion-item small { color: var(--muted); font-size: 10.5px; flex: none; }
.notion-q { font-size: 11px; }
.notion-page { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 14px 12px; }
.notion-page-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.notion-page h4 { margin: 10px 0 6px; color: var(--text); font-size: 14px; }
.notion-text { white-space: pre-wrap; color: var(--text); font-size: 12.5px; line-height: 1.5; word-break: break-word; }
.notion-rows { list-style: none; margin: 0; padding: 0; }
.notion-rows li { padding: 5px 2px; border-bottom: 1px solid rgba(255,255,255,.04); cursor: pointer; color: var(--text); }
.notion-rows li:hover { color: var(--cyan); }

/* Settings */
.set-modal { width: min(600px, 100%); max-height: 86vh; }
#setForm { position: static; width: auto; padding: 0; display: block; }
.set-modal .cal-link { background: none; border: none; color: var(--cyan); font-size: 12px; font-weight: 400; padding: 2px 4px; }
.set-modal .cal-link.danger { color: #ff7a8a; }
.set-intro { font-size: 12px; margin: 6px 0 10px; }
.set-section { border-bottom: 1px solid rgba(255,255,255,.06); padding: 2px 0 8px; }
.set-section summary { cursor: pointer; padding: 8px 2px; color: var(--cyan); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.set-field { display: flex; flex-direction: column; gap: 4px; margin: 8px 2px 10px; }
.set-label { color: var(--text); font-size: 12.5px; }
.set-state { font-style: normal; color: var(--muted); font-size: 11px; margin-left: 6px; }
.set-state.on { color: #2fd08a; }
.set-field small, .set-note { color: var(--muted); font-size: 11px; }
.set-field small a, .set-note a { color: var(--cyan); }
.set-field code, .set-note code { font: 11px var(--mono); color: var(--text); }
.set-over { color: var(--amber) !important; }
.set-modal input, .set-modal select { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 7px 9px; color: var(--text); font: inherit; font-size: 12.5px; outline: none; width: 100%; min-width: 0; }
.set-modal input:focus, .set-modal select:focus { border-color: var(--cyan); }
.set-modal input:disabled { opacity: .55; }
.set-check { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.set-check input { width: auto; }
.set-check small { flex-basis: 100%; }
.set-secret { display: flex; gap: 6px; align-items: center; }
.set-feeds { margin: 8px 2px 12px; display: flex; flex-direction: column; gap: 6px; }
.set-feed { display: grid; grid-template-columns: 1fr 2fr 1.4fr auto; gap: 6px; align-items: center; }
.set-feeds > .cal-link { align-self: flex-start; }
.set-reset { margin: 0 0 4px; }
.set-store { margin-left: 0; }
.set-actions { position: sticky; bottom: -18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0 2px; background: #0b1118; }
.set-msg { font-size: 12px; color: #2fd08a; }
.set-msg.bad { color: #ff7a8a; }
@media (max-width: 560px) {
  .set-feed { grid-template-columns: 1fr auto; padding-bottom: 6px; border-bottom: 1px dashed rgba(255,255,255,.06); }
  .set-feed input[data-f="url"], .set-feed input[data-f="mustMention"] { grid-column: 1 / -1; }
  .set-feed button { grid-column: 2; grid-row: 1; }
}

/* System check */
.sys-update { display: flex; align-items: center; gap: 12px; margin: 12px 0 4px; padding: 10px 12px; border: 1px solid rgba(240,180,60,.45); border-radius: 8px; background: rgba(240,180,60,.08); }
.sys-update > div { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.sys-update b { color: var(--amber); font-weight: 600; }
.sys-update small { color: var(--muted); font-size: 11.5px; }
.sys-update .cal-btn { flex: none; }
.sys-update .cal-btn:disabled { opacity: .6; cursor: progress; }
.sys-modal { width: min(560px, 100%); }
.sys-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sys-head .cal-btn:disabled { opacity: .6; cursor: progress; }
.sys-summary { color: var(--text); margin: 10px 0 2px; }
.sys-meta { font-size: 11px; margin: 0 0 8px; }
.sys-list { list-style: none; margin: 0; padding: 0; }
.sys-item { border-bottom: 1px solid rgba(255,255,255,.05); }
.sys-item summary { display: grid; grid-template-columns: 12px auto 1fr; gap: 8px; align-items: baseline; padding: 8px 2px; cursor: pointer; list-style: none; }
.sys-item summary::-webkit-details-marker { display: none; }
.sys-item summary b { color: var(--text); font-weight: 600; white-space: nowrap; }
.sys-item summary span:last-child { color: var(--muted); font-size: 12px; }
.sys-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); align-self: center; }
.sys-item.ok .sys-dot { background: #2fd08a; }
.sys-item.warn .sys-dot { background: var(--amber); }
.sys-item.bad .sys-dot { background: #ff4d6d; box-shadow: 0 0 8px #ff4d6d; }
.sys-details { margin: 0 0 6px 20px; padding-left: 14px; color: var(--muted); font-size: 12px; }
.sys-details li { margin: 2px 0; word-break: break-word; }
.sys-fix { margin: 0 0 10px 20px; font-size: 12px; color: var(--text); }
.sys-foot { font-size: 11px; margin-top: 12px; }
.sys-foot code { font: 11px var(--mono); color: var(--text); }
.sys-chip { color: var(--amber); border-color: rgba(240,180,60,.35); }
.sys-chip.bad { color: #ff7a8a; border-color: rgba(255,77,109,.5); }

/* Met Office warnings */
.wx-warning { display: flex; flex-direction: column; gap: 2px; margin: 8px 0 4px; padding: 8px 10px; border-radius: 8px; text-decoration: none; border: 1px solid; }
.wx-warning b { font-size: 12.5px; }
.wx-warning span { font-size: 11.5px; color: var(--text); }
.wx-warning small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-warning.yellow { background: rgba(250, 210, 50, .1); border-color: rgba(250, 210, 50, .5); color: #f6d64a; }
.wx-warning.amber { background: rgba(255, 150, 30, .12); border-color: rgba(255, 150, 30, .6); color: #ffa53a; }
.wx-warning.red { background: rgba(255, 60, 80, .14); border-color: rgba(255, 60, 80, .7); color: #ff6b7d; }
.wx-chip.warn { color: #f6d64a; border-color: rgba(250, 210, 50, .5); }

/* Rain radar */
#radarBox { margin-bottom: 4px; }
.radar-map { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: #0b0f14; }
.radar-map canvas { display: block; width: 100%; height: 220px; cursor: grab; touch-action: none; }
.radar-map canvas:active { cursor: grabbing; }
.radar-bar { position: absolute; left: 6px; right: 6px; top: 6px; display: flex; align-items: center; gap: 6px; pointer-events: none; }
.radar-bar > * { pointer-events: auto; }
.radar-bar button { background: rgba(5, 8, 13, .8); border: 1px solid var(--border); color: var(--text); border-radius: 6px; min-width: 26px; height: 24px; font-size: 12px; }
.radar-bar button:hover { border-color: var(--cyan); }
.radar-time { background: rgba(5, 8, 13, .8); border-radius: 6px; padding: 3px 8px; font: 11px var(--mono); color: var(--cyan); }
.radar-zoom { margin-left: auto; display: flex; gap: 3px; }
.radar-credit { position: absolute; right: 4px; bottom: 2px; font-size: 9px; color: rgba(255,255,255,.55); background: rgba(0,0,0,.45); padding: 0 4px; border-radius: 3px; }
.radar-credit a { color: inherit; }

/* To-do and reminders */
.task label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; color: var(--text); }
.task input { accent-color: var(--cyan); margin-top: 3px; }
.task.done span { color: var(--muted); text-decoration: line-through; }
.task-list li.task, .rem-list li.reminder { flex-direction: row; justify-content: space-between; align-items: flex-start; }
.task-actions button, .reminder button { background: none; border: none; color: var(--muted); font-size: 12px; padding: 0 3px; }
.task-actions button:hover, .reminder button:hover { color: var(--cyan); }
.task-sep { border-bottom: none !important; }
.task-sep summary { color: var(--muted); font-size: 12px; cursor: pointer; padding: 4px 0; }
.task-sep ul { list-style: none; margin: 0; padding: 0; }
.rem-form { flex-wrap: wrap; }
.rem-form #remText { flex: 1 1 100%; }
.rem-form #remWhen { flex: 1; color-scheme: dark; }
.set-backup { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.set-backup h5 { margin: 0; font-size: 12px; color: var(--amber); font-weight: 600; letter-spacing: .04em; }
.set-backup input[type=password], .set-backup input[type=file] { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; color: var(--text); font: inherit; font-size: 12.5px; }
.set-backup .cal-btn { align-self: flex-start; }
.set-backup .cal-btn.danger { color: #ff7a8a; border-color: rgba(255,122,138,.4); }
.set-backup .set-check { font-size: 12px; color: var(--text); display: flex; gap: 6px; align-items: center; }
.set-backup small { font-size: 11px; line-height: 1.45; }
#backupMsg { margin: 4px 0; font-size: 12px; color: var(--text); }
#backupMsg.bad { color: #ff7a8a; }
.rem-form #remRepeat { flex: none; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 12.5px; color-scheme: dark; }
.reminder.repeat .rem-time { display: flex; flex-direction: column; gap: 1px; }
.reminder.repeat .rem-time b { font-weight: 400; color: var(--amber); }
.reminder.repeat .rem-time small { color: var(--muted); font-size: 10px; }
.rem-hint { font-size: 11px; margin: 0 12px; }
.reminder { display: flex; gap: 8px; }
.rem-time { flex: none; width: 112px; font: 11px var(--mono); color: var(--cyan); padding-top: 2px; }
.rem-text { flex: 1; color: var(--text); }
.reminder.fired .rem-time, .reminder.done .rem-time { color: var(--muted); }
.reminder.done .rem-text { color: var(--muted); text-decoration: line-through; }

/* Alerts (reminders, weather warnings) */
.alerts { position: fixed; z-index: 20; top: 56px; left: 50%; transform: translateX(-50%); width: min(460px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.alert { pointer-events: auto; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: rgba(14, 18, 24, .97); border: 1px solid var(--cyan-dim); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.alert.fresh { animation: alert-in .35s ease-out, alert-glow 1.2s ease-in-out 4; }
.alert-icon { font-size: 22px; grid-row: span 2; }
.alert-body { display: flex; flex-direction: column; min-width: 0; }
.alert-body b { color: var(--cyan); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.alert-body span { color: var(--text); font-size: 14px; font-weight: 500; }
.alert-actions { grid-column: 2; display: flex; gap: 6px; flex-wrap: wrap; }
.alert-actions button, .alert-actions a { background: rgba(62,230,224,.12); border: 1px solid var(--cyan-dim); color: var(--cyan); border-radius: 6px; padding: 4px 10px; font-size: 12px; text-decoration: none; }
.alert-actions [data-alert="close"] { margin-left: auto; background: none; border-color: transparent; color: var(--muted); }
.alert.warning { border-color: rgba(250, 210, 50, .6); }
.alert.warning .alert-body b { color: #f6d64a; }
.alert.warning.amber { border-color: rgba(255, 150, 30, .7); }
.alert.warning.red { border-color: rgba(255, 60, 80, .8); }
@keyframes alert-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes alert-glow { 50% { box-shadow: 0 0 0 3px rgba(62,230,224,.35), 0 10px 30px rgba(0,0,0,.5); } }

/* Memory panel: notes + chat log */
.memory { right: 290px; top: 56px; bottom: 90px; width: 340px; display: flex; flex-direction: column; }
.mem-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.note-form { display: flex; gap: 6px; padding: 10px 12px 6px; }
.note-form input { flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; color: var(--text); font: inherit; outline: none; }
.note-form input:focus { border-color: var(--cyan); }
.note-form button { background: rgba(62,230,224,.15); border: 1px solid var(--cyan-dim); color: var(--cyan); border-radius: 8px; padding: 0 12px; }
.note-list { list-style: none; margin: 0; padding: 4px 12px 12px; overflow-y: auto; }
.note-list li { padding: 8px 2px; border-bottom: 1px solid rgba(255,255,255,.04); display: flex; flex-direction: column; gap: 2px; }
.note-text { color: var(--text); white-space: pre-wrap; word-break: break-word; }
.note-meta { color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 6px; }
.note-meta button { background: none; border: none; color: var(--muted); padding: 0 2px; font-size: 12px; }
.note-meta button:hover { color: var(--cyan); }
.chatlog-list { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.clear-chat { align-self: center; margin: 6px 0 10px; }
#memoryPanel .tabs { gap: 2px; padding: 8px; }
#memoryPanel .tab { padding: 3px 8px; white-space: nowrap; }
#memSynced { color: #2fd08a; }
.mem-close { background: none; border: none; color: var(--muted); font-size: 14px; padding: 2px 6px; }
.mem-close:hover { color: var(--cyan); }
.msg { padding: 8px 10px; border-radius: 10px; max-width: 92%; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: rgba(62,230,224,.1); border: 1px solid var(--cyan-dim); }
.msg.assistant { align-self: flex-start; background: var(--card); border: 1px solid var(--border); }

/* Bubble + input */
.bubble {
  position: fixed; z-index: 3; left: 50%; bottom: 84px; transform: translateX(-50%);
  max-width: min(640px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 12px;
  background: rgba(14, 18, 24, .94); border: 1px solid var(--border); white-space: pre-wrap;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.inputbar {
  position: fixed; z-index: 3; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: min(720px, calc(100vw - 32px)); display: flex; gap: 6px; padding: 6px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px; backdrop-filter: blur(10px);
}
#prompt { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text); padding: 0 12px; font: inherit; }
#prompt::placeholder { color: var(--muted); }
.round { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 1px solid var(--border); background: rgba(255,255,255,.04); display: grid; place-items: center; }
.round:hover { border-color: var(--cyan); }
.round.primary { background: rgba(62,230,224,.15); border-color: var(--cyan-dim); color: var(--cyan); }
#micBtn.active { background: rgba(255,77,109,.2); border-color: #ff4d6d; box-shadow: 0 0 calc(10px + var(--mic, 0) * 26px) calc(var(--mic, 0) * 8px) rgba(255,77,109,.6); transition: box-shadow .08s linear; }

/* Login */
.login { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(3, 5, 8, .8); backdrop-filter: blur(6px); padding: 16px; }
.login form { position: static; width: min(320px, 100%); padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.login-title { font: bold 18px var(--mono); letter-spacing: .2em; color: var(--cyan); text-align: center; text-shadow: 0 0 12px var(--cyan-dim); }
.login input { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; color: var(--text); font: inherit; outline: none; }
.login input:focus { border-color: var(--cyan); }
.login button { background: rgba(62,230,224,.15); border: 1px solid var(--cyan-dim); color: var(--cyan); border-radius: 8px; padding: 10px; font-weight: 600; }
.login-error { min-height: 1.2em; color: var(--amber); text-align: center; font-size: 12px; }

/* Phones / small tablets */
@media (max-width: 900px) {
  .mobile-only { display: inline-block; }
  .left { display: none; width: auto; right: 16px; left: 16px; top: 56px; z-index: 4; }
  .left.open { display: block; }
  .hud { top: 56px; right: 8px; width: auto; gap: 6px; }
  #ring { width: 92px; height: 92px; }
  .wx-chip { font-size: 11px; padding: 2px 10px; }
  .chips { align-items: flex-end; gap: 4px; }
  .pills { flex-direction: column; align-items: flex-end; }
  .toggles { width: 128px; }
  .toggle { font-size: 9px; padding: 4px 8px; white-space: nowrap; }
  .news { left: 16px; right: 16px; width: auto; top: auto; bottom: 80px; height: 34vh; }
  .news.wx { width: auto; height: 42vh; }
  .news.collapsed { height: auto; }
  .tabs { padding: 8px 6px; }
  .tab { padding: 3px 6px; }
  .wx-day { grid-template-columns: 70px 22px 1fr 40px 24px 44px 26px; gap: 4px; }
  .memory { left: 16px; right: 16px; width: auto; top: 56px; z-index: 4; }
  .music { left: 16px; right: 16px; width: auto; top: 56px; }
  .music.mini { left: 16px; right: 16px; width: auto; bottom: 80px; top: auto; }
  .bubble { bottom: 76px; }
  .inputbar { bottom: max(12px, env(safe-area-inset-bottom)); }
  body.news-open .bubble { bottom: calc(80px + 34vh + 8px); }
  body.news-open.news-collapsed .bubble { bottom: 132px; }
}

/* 🔌 Devices (smart plugs through Home Assistant) */
.dv-modal { width: min(600px, 100%); max-height: 88vh; }
#devPanel .cal-link { background: none; border: none; color: var(--cyan); font-size: 12px; font-weight: 400; padding: 2px 6px; }
#devPanel .cal-link.danger { color: #ff7a8a; }
#devPanel .cal-btn { padding: 7px 14px; }
#devPanel .cal-btn:disabled { opacity: .6; cursor: progress; }
#devPanel .updated { font: 10px var(--mono); color: var(--muted); }
.dv-summary { margin: 4px 0 10px; color: var(--muted); }
.dv-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
#devPanel .dv-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; text-align: left;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px 12px; color: var(--text); font-weight: 400; transition: border-color .15s, background .15s; }
#devPanel .dv-card:hover:not(:disabled) { border-color: var(--cyan-dim); }
#devPanel .dv-card.on { background: rgba(62,230,224,.08); border-color: var(--cyan-dim); }
#devPanel .dv-card.off-line { opacity: .55; }
#devPanel .dv-card:disabled { cursor: default; }
.dv-icon { font-size: 20px; line-height: 1.2; }
.dv-name { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-card small { color: var(--muted); font-size: 10.5px; }
.dv-state { font-size: 11.5px; color: var(--muted); }
.dv-card.on .dv-state { color: var(--cyan); }
.dv-switch { position: absolute; top: 12px; right: 12px; width: 30px; height: 17px; border-radius: 9px; background: rgba(255,255,255,.12); transition: background .15s; }
.dv-switch i { position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.dv-card.on .dv-switch { background: var(--cyan-dim); }
.dv-card.on .dv-switch i { transform: translateX(13px); background: var(--cyan); }
.dv-timers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dv-timers li { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px 5px 10px; background: var(--card); }
.dv-note { font-size: 11.5px; margin: 12px 0 4px; }
.dv-actions { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.dv-picks { display: flex; flex-direction: column; gap: 6px; }
#devPanel .dv-pick { display: grid; grid-template-columns: auto 1fr minmax(120px, 190px); align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; background: var(--card); }
.dv-pick-name { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.dv-pick-name small { color: var(--muted); font: 10px var(--mono); }
#devPanel .dv-pick input[type=text] { padding: 6px 8px; font-size: 12px; min-width: 0; }
#devPanel .dv-pick input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--cyan); }
.dv-extra { margin-top: 10px; }
.dv-extra summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.dv-setup ol { padding-left: 18px; margin: 8px 0 14px; display: flex; flex-direction: column; gap: 6px; }
.dv-setup p { margin: 4px 0; }
@media (max-width: 600px) {
  #devPanel .dv-pick { grid-template-columns: auto 1fr; }
  #devPanel .dv-pick input[type=text] { grid-column: 2; }
  .dv-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Sign-in extras: passkey, pairing code; ⚙ Settings → Signed-in devices */
.login-lead { margin: 0; text-align: center; color: var(--text); font-size: 13px; }
.login .login-passkey { background: rgba(62,230,224,.22); }
.login.locked #loginPassword, .login.locked #loginForm > button[type=submit] { display: none; }
.login.locked .login-pair { display: none; }
.login .login-other { display: none; background: none; border: none; color: var(--muted); font-weight: 400; font-size: 12px; padding: 2px; }
.login.locked .login-other { display: block; }
.login.locked .login-error:empty { display: none; }
.login-pair summary { cursor: pointer; color: var(--muted); font-size: 12px; text-align: center; }
.login-pair[open] summary { margin-bottom: 8px; }
.login-pair-row { display: flex; gap: 8px; }
.login-pair-row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .15em; font-family: var(--mono); }
.login-pair-row button { padding: 10px 14px; }
.login-pair small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; text-align: center; }
.ac-note { color: var(--amber); }
.ac-pair { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin: 8px 0 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.ac-qr svg { display: block; border-radius: 6px; width: 200px; height: 200px; }
.ac-pair-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px; }
.ac-pair-text ol { margin: 0; padding-left: 18px; }
.ac-pair-text code { overflow-wrap: anywhere; }
.ac-code { font: 600 26px var(--mono); letter-spacing: .18em; color: var(--cyan); }
.ac-pair-text .cal-link { align-self: flex-start; }
.ac-me { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.ac-me .cal-btn { align-self: flex-start; }
.ac-list { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.ac-dev { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; background: var(--card); }
.ac-dev.current { border-color: var(--cyan-dim); }
.ac-dev-main { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; color: var(--text); }
.ac-dev-main small { font-size: 11px; }
.ac-tag { font-style: normal; font-size: 10px; color: var(--cyan); border: 1px solid var(--cyan-dim); border-radius: 4px; padding: 0 4px; }
.ac-dev-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.ac-lock { display: flex; align-items: center; gap: 2px; font-size: 12px; cursor: pointer; }
#authView h5 { margin: 12px 0 0; font-size: 12px; color: var(--amber); font-weight: 600; }

/* ---------- Phones and tablets ---------- */
/* Hidden on computers; the media queries below bring them in. */
.conv, .tabbar { display: none; }
.sheet { position: fixed; inset: 0; z-index: 9; background: rgba(3,5,8,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet-body { position: static; width: min(560px, 100%); max-height: 80vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
.more-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: var(--cyan); }
#moreSheet .cal-link { background: none; border: none; color: var(--cyan); font-size: 13px; }
.more-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.more-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); font-size: 11.5px; color: var(--text); }
.more-tile span { font-size: 20px; line-height: 1.2; }
.more-switches { display: flex; flex-direction: column; gap: 6px; }
.more-switch { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); font-size: 13px; }
.more-switch em { font-style: normal; font: 11px var(--mono); color: var(--muted); text-transform: uppercase; }
.more-switch.on em { color: var(--cyan); }
.install { position: fixed; z-index: 8; left: 50%; transform: translateX(-50%); top: calc(10px + env(safe-area-inset-top)); width: min(520px, calc(100vw - 20px));
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(14,18,24,.97); border: 1px solid var(--cyan-dim); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.install span { flex: 1; font-size: 12.5px; }
.install .cal-link { background: none; border: none; color: var(--muted); font-size: 14px; }
.conv { flex-direction: column; overflow: hidden; }
.conv-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px; overscroll-behavior: contain; }
.conv-msg { max-width: 86%; padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.45; }
.conv-msg time { display: block; font: 10px var(--mono); color: var(--muted); margin-top: 3px; text-align: right; }
.conv-msg.me { align-self: flex-end; background: rgba(62,230,224,.14); border: 1px solid var(--cyan-dim); border-bottom-right-radius: 4px; }
.conv-msg.ai { align-self: flex-start; background: var(--card); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.conv-day { align-self: center; font: 10px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 6px; }
.conv-empty { margin: auto 0 0; text-align: center; color: var(--muted); }
.conv-sugg { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.conv-sugg button { border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 7px 12px; font-size: 12.5px; color: var(--text); }
@media (pointer: coarse) {
  /* iPhones zoom into inputs smaller than 16px; and no grey flash on taps. */
  input, select, textarea, #prompt { font-size: 16px !important; }
  button, a { -webkit-tap-highlight-color: transparent; }
  .toggle, .wx-chip { min-height: 28px; }
}
.standalone body { user-select: none; -webkit-user-select: none; }
.standalone input, .standalone textarea, .standalone .conv-msg, .standalone .news, .standalone .memory { user-select: text; -webkit-user-select: text; }

/* Phones: a tab bar along the bottom; Home is the conversation; panels fill the screen. */
@media (max-width: 600px) {
  .toolbar { display: none; }
  #graph, #bgPhoenix { opacity: .28; }
  .tabbar { display: flex; position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; padding: 4px 4px env(safe-area-inset-bottom);
    background: rgba(8, 12, 18, .96); border-top: 1px solid var(--border); backdrop-filter: blur(12px); }
  .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; background: none; border: none; color: var(--muted); font-size: 10.5px; padding: 6px 0 7px; min-height: 52px; }
  .tabbar button span { font-size: 19px; line-height: 1.25; }
  .tabbar button.on { color: var(--cyan); }
  .tabbar button.talk span { width: 42px; height: 42px; margin-top: -14px; border-radius: 50%; display: grid; place-items: center; font-size: 20px;
    background: rgba(62,230,224,.2); border: 1px solid var(--cyan-dim); box-shadow: 0 0 18px rgba(62,230,224,.25); }
  .inputbar { bottom: calc(66px + env(safe-area-inset-bottom)); width: calc(100vw - 16px); }
  .bubble { bottom: calc(126px + env(safe-area-inset-bottom)); max-height: 40vh; overflow-y: auto; }
  body.news-open .bubble, body.news-open.news-collapsed .bubble { bottom: calc(126px + env(safe-area-inset-bottom)); }
  /* The HUD: the phoenix and status in a row along the top; its switches live in More. */
  .hud { top: calc(8px + env(safe-area-inset-top)); left: 8px; right: 8px; width: auto; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
  .hud .toggles { display: none; }
  #ring { width: 64px; height: 64px; order: 2; }
  .pills { order: 1; flex-direction: column; align-items: flex-end; gap: 4px; }
  .chips { order: 0; flex: 1; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: center; }
  .conv { display: flex; position: fixed; z-index: 2; left: 8px; right: 8px; top: calc(86px + env(safe-area-inset-top)); bottom: calc(124px + env(safe-area-inset-bottom));
    background: rgba(8, 12, 18, .72); }
  body.news-open .conv, body.planner-open .conv { visibility: hidden; }
  .news, .news.wx, .memory, .music { left: 8px; right: 8px; width: auto; top: calc(8px + env(safe-area-inset-top)); bottom: calc(124px + env(safe-area-inset-bottom)); height: auto; z-index: 4; }
  .news.collapsed { top: auto; height: auto; }
  .music.mini { left: 8px; right: 8px; top: auto; bottom: calc(124px + env(safe-area-inset-bottom)); }
  .left { top: calc(8px + env(safe-area-inset-top)); bottom: calc(124px + env(safe-area-inset-bottom)); overflow-y: auto; left: 8px; right: 8px; }
  /* Pop-up panels (Devices, Health, Settings…) take the whole screen above the tab bar, which stays usable. */
  .login { padding: env(safe-area-inset-top) 0 0; align-items: stretch; bottom: calc(61px + env(safe-area-inset-bottom)); }
  #login.login { bottom: 0; }
  .login .cal-modal { width: 100%; max-width: none; max-height: none; height: 100%; border-radius: 0; border-left: none; border-right: none; border-bottom: none; }
  body:has(.login:not(#login):not(.hidden)) .tabbar { z-index: 11; }
  #login, #login.login { align-items: center; padding: 16px; }
  .rem-alerts, .alerts { bottom: calc(126px + env(safe-area-inset-bottom)); }
}

/* Tablets (touch, 601–1366px): the conversation down the left, the open panel on the right. */
@media (min-width: 601px) and (max-width: 1366px) and (pointer: coarse) {
  .left:not(.open) { display: none; }
  .mobile-only { display: inline-block; }
  .conv { display: flex; position: fixed; z-index: 2; left: 16px; top: 64px; bottom: 90px; width: min(380px, 42vw); }
  .news, .news.wx, .memory { left: calc(min(380px, 42vw) + 28px); right: 16px; width: auto; top: 64px; bottom: 90px; height: auto; z-index: 4; }
  .news.collapsed { top: auto; height: auto; }
  body.news-open .hud, body.planner-open .hud { display: none; }
  .inputbar { left: calc(16px + min(380px, 42vw) / 2); transform: translateX(-50%); width: min(380px, 42vw); }
  .bubble { left: calc(min(380px, 42vw) + 28px); right: 16px; transform: none; max-width: none; }
  .toolbar { top: calc(14px + env(safe-area-inset-top)); }
}

/* 🎙 Hands-free talk mode */
.talk-mode { position: fixed; inset: 0; z-index: 12; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: calc(16px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom)); background: radial-gradient(circle at 50% 45%, #0b1620 0%, #04070b 70%); text-align: center; }
.talk-top { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; }
.talk-title { font: 600 11px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--cyan); }
.talk-end { background: rgba(255,77,109,.15); border: 1px solid rgba(255,77,109,.5); color: #ff8a9c; border-radius: 999px; padding: 8px 18px; font-weight: 600; font-size: 14px; }
.talk-orb { position: relative; width: min(64vw, 300px); aspect-ratio: 1; border-radius: 50%; border: none; background: none; display: grid; place-items: center; padding: 0; }
.talk-orb canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.talk-orb span { position: relative; width: 46%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: clamp(34px, 11vw, 56px);
  background: rgba(62,230,224,.12); border: 1px solid var(--cyan-dim); box-shadow: 0 0 40px rgba(62,230,224,.2); }
.talk-mode[data-state=listening] .talk-orb span { background: rgba(255,77,109,.16); border-color: rgba(255,77,109,.6); box-shadow: 0 0 46px rgba(255,77,109,.35); }
.talk-mode[data-state=thinking] .talk-orb span { background: rgba(240,180,60,.12); border-color: rgba(240,180,60,.5); }
.talk-status { margin: 0; font: 600 13px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.talk-heard { margin: 0; min-height: 1.4em; color: var(--muted); font-size: 16px; max-width: 640px; }
.talk-reply { margin: 0; color: var(--text); font-size: clamp(17px, 4.6vw, 24px); line-height: 1.4; max-width: 680px; max-height: 32vh; overflow-y: auto; }
.talk-hint { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom)); margin: 0; font-size: 11.5px; color: var(--muted); padding: 0 20px; }
@media (max-height: 560px) { .talk-orb { width: 38vh; } .talk-hint { display: none; } }

/* 🔴 Breaking news alert card */
.alert.breaking { border-color: rgba(255, 60, 80, .85); box-shadow: 0 0 24px rgba(255, 60, 80, .25); }
.alert.breaking .alert-body b { color: #ff6b7d; }

/* 🖥 Homelab */
.hl2-modal { width: min(680px, 100%); max-height: 88vh; }
#hlPanel .cal-link { background: none; border: none; color: var(--cyan); font-size: 12px; font-weight: 400; padding: 2px 6px; }
#hlPanel .cal-btn { padding: 7px 14px; }
#hlPanel .updated { font: 10px var(--mono); color: var(--muted); }
.hl-summary { margin: 6px 0 8px; font-size: 14px; }
.hl-summary.ok { color: #2fd08a; }
.hl-summary.bad { color: #ff7a8a; }
.hl-problems { margin: 0 0 8px; padding-left: 18px; color: #ffb3bd; font-size: 12.5px; }
.hl-only { font-size: 12px; margin-bottom: 4px; }
.hl-sec { margin-top: 12px; }
.hl-sec h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); font-weight: 600; }
.hl-sec h4 small { text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 400; margin-left: 6px; }
.hl-group { margin-bottom: 8px; }
.hl-group-name { font: 10.5px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 6px 0 3px; }
.hl-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 7px; background: var(--card); border: 1px solid var(--border); margin-bottom: 3px; }
.hl-row.ignored { opacity: .5; }
.hl-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.hl-dot.ok { background: #2fd08a; box-shadow: 0 0 6px rgba(47,208,138,.6); }
.hl-dot.warn { background: var(--amber); }
.hl-dot.bad { background: #ff4d6d; box-shadow: 0 0 6px rgba(255,77,109,.6); }
.hl-dot.off { background: #4a5560; }
.hl-name { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--text); overflow-wrap: anywhere; }
.hl-name small { color: var(--muted); font-size: 10.5px; }
.hl-state { font-size: 11.5px; color: var(--muted); text-align: right; max-width: 45%; overflow-wrap: anywhere; }
.hl-state.bad { color: #ff7a8a; }
