:root {
  --ink: #07070b;
  --glass: #14141c;
  --glass-2: #1d1d29;
  --glass-3: #2a2a3a;
  --edge-hi: #4b4b63;
  --edge-lo: #050508;
  --text: #ecebf2;
  --muted: #a7a6b8;
  --gold: #e2b34a;
  --gold-hi: #f7de8c;
  --gold-lo: #a9782a;
  --cream: #f6f0df;
  --ok: #7bd88f;
  --bar-h: 44px;
  --font: Verdana, "DejaVu Sans", Geneva, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--ink);
  color: var(--text);
  font: 13px/1.5 var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
a { color: var(--gold-hi); }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Boot */
.boot {
  position: fixed; inset: 0; z-index: 9000;
  background: #030305; color: var(--gold);
  padding: clamp(16px, 5vw, 56px);
  display: flex; flex-direction: column; justify-content: space-between;
  cursor: pointer;
}
.boot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .018) 0 1px, transparent 1px 3px);
}
.boot-log { flex: 1; min-height: 0; margin: 0 0 12px; overflow: hidden; font: 14px/1.6 var(--mono); }
.boot-line { min-height: 1.6em; white-space: pre-wrap; overflow-wrap: anywhere; }
.boot-line.bright { color: var(--gold-hi); }
.boot-line.ok { color: var(--gold); }
.boot-line.dim { color: var(--muted); }
.boot-logo { position: absolute; top: clamp(16px, 5vw, 56px); right: clamp(16px, 5vw, 56px); width: clamp(52px, 9vw, 96px); height: auto; }
.boot-skip { flex: none; margin: 0; color: var(--muted); font: 12px var(--mono); }
.boot-cursor { display: inline-block; width: .55em; height: 1em; margin-right: .6em; vertical-align: -.15em; background: var(--gold); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 720px) {
  .boot-log { font-size: 12px; }
  .boot-logo { opacity: .55; }
}
@media (prefers-reduced-motion: no-preference) {
  .boot-log, .boot-logo { animation: boot-on .18s ease-out; }
  @keyframes boot-on { from { opacity: 0; } to { opacity: 1; } }
  .boot-cursor { animation: boot-cursor 1.1s steps(1) infinite; }
  @keyframes boot-cursor { 50% { opacity: 0; } }
  .boot.leaving { opacity: 0; transition: opacity .2s ease-out; pointer-events: none; }
  .boot.skipped { opacity: 0; transition: opacity .1s ease-out; pointer-events: none; }
  /* Only after the first boot, so everyday use stays instant. */
  .desktop-enter .icon { animation: icon-in .2s cubic-bezier(.215, .61, .355, 1) both; }
  .desktop-enter .icon:nth-child(n+2) { animation-delay: 20ms; }
  .desktop-enter .icon:nth-child(n+5) { animation-delay: 50ms; }
  .desktop-enter .icon:nth-child(n+9) { animation-delay: 80ms; }
  .desktop-enter .icon:nth-child(n+13) { animation-delay: 110ms; }
  @keyframes icon-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}

/* Desktop */
.desktop {
  position: fixed; inset: 0 0 var(--bar-h) 0; overflow: hidden;
  background: var(--ink) url("assets/wallpaper.svg") center / cover no-repeat;
}
.watermark {
  position: absolute; left: 50%; top: 50%; width: min(38vw, 420px);
  transform: translate(-50%, -50%); opacity: .07; pointer-events: none; user-select: none;
}
.preview-note {
  position: absolute; right: 14px; top: 12px; z-index: 1; max-width: calc(100% - 28px);
  padding: 5px 10px; font-size: 11px; color: var(--gold-hi);
  background: rgba(7, 7, 11, .78); border: 1px solid rgba(226, 179, 74, .45);
}

/* Icons */
.icons {
  position: absolute; inset: 12px; z-index: 1;
  display: grid; grid-auto-flow: column;
  grid-template-rows: repeat(auto-fill, 92px); grid-auto-columns: 92px;
  gap: 4px; justify-content: start; align-content: start;
}
.icon {
  position: relative; width: 92px; height: 92px; padding: 8px 4px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: 1px solid transparent; cursor: default; text-align: center;
  touch-action: manipulation;
}
.icon svg, .icon img { width: 40px; height: 40px; flex: none; filter: drop-shadow(1px 2px 0 rgba(0, 0, 0, .75)); }
.icon span {
  font-size: 11px; line-height: 1.25; color: #fff; text-shadow: 1px 1px 1px #000;
  overflow-wrap: anywhere;
}
.icon:hover { background: rgba(226, 179, 74, .1); border-color: rgba(226, 179, 74, .25); }
.icon.selected { background: rgba(226, 179, 74, .24); border-color: var(--gold); }
.icon .lock {
  position: absolute; top: 5px; right: 16px; width: 18px; height: 18px;
  display: grid; place-items: center; font-size: 10px;
  background: var(--ink); color: var(--gold-hi); border: 1px solid var(--gold);
}
.icon .lock svg { width: 11px; height: 11px; filter: none; }

/* Windows */
.windows { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.win {
  position: absolute; display: flex; flex-direction: column; min-width: 280px; min-height: 180px;
  pointer-events: auto; background: var(--glass); padding: 3px;
  border: 1px solid; border-color: var(--edge-hi) var(--edge-lo) var(--edge-lo) var(--edge-hi);
  box-shadow: inset 1px 1px 0 #34344a, 6px 8px 0 rgba(0, 0, 0, .35);
}
.win.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; }
.win-title {
  display: flex; align-items: center; gap: 8px; height: 28px; flex: none; padding: 0 3px 0 8px;
  background: linear-gradient(90deg, #2d2d3d, #1a1a24);
  color: var(--muted); font-weight: 700; font-size: 12px; user-select: none; touch-action: none;
}
.win.active .win-title { background: linear-gradient(90deg, var(--gold-lo), #5d4318 62%, #1f1810); color: #fff7dd; }
.win-title svg, .win-title img { width: 16px; height: 16px; flex: none; }
.win-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.win-btn {
  width: 24px; height: 22px; padding: 0; display: grid; place-items: center; flex: none;
  background: var(--glass-2); color: var(--text); font: 700 12px var(--font);
  border: 1px solid; border-color: var(--edge-hi) var(--edge-lo) var(--edge-lo) var(--edge-hi);
}
.win-btn:hover { background: var(--glass-3); }
.win-btn:active { border-color: var(--edge-lo) var(--edge-hi) var(--edge-hi) var(--edge-lo); }
.win-body { flex: 1; min-height: 0; overflow: auto; padding: 16px; margin-top: 3px; background: #0d0d13; overscroll-behavior: contain; }
.win-resize {
  position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 50%, var(--edge-hi) 50%, var(--edge-hi) 60%, transparent 60%, transparent 72%, var(--edge-hi) 72%, var(--edge-hi) 82%, transparent 82%);
}
.win.max .win-resize { display: none; }

/* Window content */
.app-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.app-head svg, .app-head img { width: 48px; height: 48px; flex: none; }
.app-head h2 { margin: 0; font-size: 18px; line-height: 1.25; color: #fff; }
.tag { display: inline-block; margin-top: 3px; padding: 1px 6px; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; border: 1px solid var(--gold); color: var(--gold-hi); }
.win-body p { margin: 0 0 12px; color: #d6d5e0; }
.win-body h3 { margin: 18px 0 6px; font-size: 13px; color: var(--gold-hi); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px 14px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo));
  color: #1b1405; font-weight: 700; text-decoration: none; border: 1px solid #3b2a0a; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--glass-2); color: var(--text); border-color: var(--edge-hi); }
.btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.note { font-size: 11px; color: var(--muted); }
.mt { margin-top: 14px; }
.rows { width: 100%; border-collapse: collapse; font-size: 12px; }
.rows th, .rows td { padding: 6px 8px 6px 0; border-bottom: 1px solid #25253a; text-align: left; vertical-align: top; }
.rows th { color: var(--muted); font-weight: 400; }
.rows td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 11px; overflow-wrap: anywhere; }
.tiers { display: grid; gap: 8px; }
.tier {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; width: 100%; padding: 10px 12px;
  text-align: left; background: var(--glass-2); border: 1px solid var(--edge-hi); cursor: pointer;
}
.tier:hover { border-color: var(--gold); }
.tier[aria-pressed="true"] { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.tier b { color: #fff; }
.tier small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.tier em { font-style: normal; color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.console {
  margin: 12px 0; padding: 10px 12px; min-height: 92px; background: #030305; color: var(--gold);
  font: 12px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
}

/* Start menu */
.start-menu {
  position: fixed; left: 4px; bottom: calc(var(--bar-h) + 2px); z-index: 8000; display: flex;
  width: min(300px, calc(100vw - 8px)); max-height: calc(100dvh - var(--bar-h) - 10px);
  background: var(--glass); padding: 3px;
  border: 1px solid; border-color: var(--edge-hi) var(--edge-lo) var(--edge-lo) var(--edge-hi);
  box-shadow: 4px 6px 0 rgba(0, 0, 0, .45);
}
.start-side { flex: none; width: 30px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; background: linear-gradient(0deg, var(--gold-lo), #2a1f0c); }
.start-side span { writing-mode: vertical-rl; transform: rotate(180deg); color: #fff7dd; font-weight: 700; font-size: 13px; letter-spacing: .04em; }
.start-list { flex: 1; min-width: 0; overflow: auto; }
.start-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 5px 10px;
  background: none; border: 0; text-align: left; cursor: pointer;
}
.start-item:hover, .start-item:focus-visible { background: var(--gold-lo); color: #fff; }
.start-item svg, .start-item img { width: 24px; height: 24px; flex: none; }
.start-sep { height: 1px; margin: 4px 6px; background: var(--edge-hi); }

/* Taskbar */
.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--bar-h); z-index: 7000;
  display: flex; align-items: center; gap: 6px; padding: 4px;
  background: var(--glass); border-top: 1px solid var(--edge-hi);
}
.start-btn {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; flex: none; font-weight: 700;
  background: var(--glass-2); cursor: pointer;
  border: 1px solid; border-color: var(--edge-hi) var(--edge-lo) var(--edge-lo) var(--edge-hi);
}
.start-btn img { height: 20px; width: auto; }
.start-btn[aria-expanded="true"] { border-color: var(--edge-lo) var(--edge-hi) var(--edge-hi) var(--edge-lo); background: #0d0d13; }
.tasks { flex: 1; min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.task {
  display: flex; align-items: center; gap: 6px; flex: 0 1 160px; min-width: 40px; height: 34px; padding: 0 8px;
  background: var(--glass-2); font-size: 12px; cursor: pointer;
  border: 1px solid; border-color: var(--edge-hi) var(--edge-lo) var(--edge-lo) var(--edge-hi);
}
.task span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.task svg, .task img { width: 16px; height: 16px; flex: none; }
.task.active { background: #0d0d13; border-color: var(--edge-lo) var(--gold) var(--gold) var(--edge-lo); }
.tray { display: flex; align-items: center; gap: 8px; flex: none; height: 34px; padding: 0 8px; border: 1px solid; border-color: var(--edge-lo) var(--edge-hi) var(--edge-hi) var(--edge-lo); }
.tray-tier { padding: 2px 6px; background: none; border: 1px solid var(--gold-lo); color: var(--gold-hi); font-size: 11px; cursor: pointer; white-space: nowrap; }
.clock { font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Phones: a home screen of icons, with full-screen windows */
@media (max-width: 720px) {
  .icons { inset: 44px 16px 16px; display: grid; grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); grid-template-rows: none; grid-auto-rows: 96px; grid-auto-columns: auto; justify-items: center; overflow: auto; }
  .watermark { width: 70vw; }
  .preview-note { left: 16px; right: 16px; }
  .win { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; box-shadow: none; }
  .win-resize, .win-btn.max-btn { display: none; }
  .win-btn { width: 36px; height: 26px; }
  .win-body { padding: 16px; }
  .task span { display: none; }
  .task { flex: 0 0 40px; justify-content: center; }
  .clock { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .win { animation: pop .12s ease-out; }
  @keyframes pop { from { transform: scale(.97); opacity: .4; } to { transform: none; opacity: 1; } }
}


/* ---------- Linux Terminal ---------- */
.win-body.flush { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.btn.small { min-height: 28px; padding: 3px 10px; font-size: 11px; }
.term-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 6px 8px; background: var(--glass-2); border-bottom: 1px solid #000; }
.term-status { font-size: 11px; color: var(--gold-hi); min-width: 0; }
.term-actions { display: flex; gap: 4px; flex: none; }
.term-pass { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px; background: #17120a; border-bottom: 1px solid var(--gold-lo); }
.term-pass label { display: flex; align-items: center; gap: 6px; font-size: 11px; flex: 1 1 220px; }
.term-pass input, .term-send input { flex: 1; min-width: 0; height: 28px; padding: 2px 6px; color: var(--text); background: #06060a; border: 1px solid var(--edge-hi); font: 12px var(--mono); }
.term-pass .note { flex-basis: 100%; margin: 0; }
.term-screen { flex: 1; min-height: 0; overflow: auto; padding: 8px; background: #000; outline-offset: -2px; }
.term-text { white-space: pre; font: 14px/16px var(--mono); color: #d8d8d8; width: max-content; }
.term-screen canvas { display: block; max-width: 100%; }
.term-send { display: flex; gap: 6px; padding: 6px 8px; background: var(--glass-2); border-top: 1px solid #000; }

/* ---------- Polish ---------- */
:root { --panel-line: rgba(226, 179, 74, .32); --shadow: 0 18px 48px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .5); }
.desktop::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 20% 10%, rgba(226, 179, 74, .07), transparent 55%), radial-gradient(90% 80% at 85% 100%, rgba(0, 0, 0, .55), transparent 70%); }
.watermark { opacity: .055; z-index: 0; }
.icons, .windows, .preview-note { z-index: 2; }
.icons { z-index: 1; }
.icon { border-radius: 3px; transition: background-color .1s; }
.icon svg, .icon img { width: 44px; height: 44px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .7)); }
.icon span { font-weight: 600; font-size: 11px; overflow-wrap: normal; word-break: normal; text-shadow: 0 1px 3px #000, 0 0 1px #000; }
.preview-note { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; border-color: var(--panel-line); color: #eadcae; background: rgba(10, 10, 15, .72); backdrop-filter: blur(6px); }
.preview-note i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--gold); }
.win { border: 1px solid #000; box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, .05); border-radius: 4px; padding: 0; overflow: hidden; background: #0e0e15; }
.win.active { box-shadow: var(--shadow), inset 0 0 0 1px var(--panel-line); }
.win-title { height: 32px; padding: 0 5px 0 10px; background: linear-gradient(180deg, #24242f, #191922); border-bottom: 1px solid #000; }
.win.active .win-title { background: linear-gradient(180deg, #3a2c12, #1f1809); color: #f9e9bd; border-bottom-color: var(--gold-lo); }
.win-btn { width: 24px; height: 22px; margin-left: 2px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 3px; background: rgba(255, 255, 255, .05); }
.win-btn:hover { background: rgba(255, 255, 255, .13); }
.win-btn.close-btn:hover { background: #7c2a1e; border-color: #a33f2f; }
.win-btn:active { border-color: rgba(255, 255, 255, .1); transform: translateY(1px); }
.win-body { margin-top: 0; background: #0e0e15; }
.win-resize { z-index: 1; }
.app-head h2 { font-size: 19px; letter-spacing: -.01em; }
.tag { border-color: var(--panel-line); border-radius: 2px; }
.btn { border-radius: 3px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn.ghost { box-shadow: none; }
.rows th, .rows td { border-bottom-color: #20202c; }
.tier { border-radius: 3px; border-color: #30303f; }
.console { border-radius: 3px; border: 1px solid #1f1f2b; }
.start-menu { display: block; width: min(320px, calc(100vw - 8px)); padding: 0; overflow: hidden; border: 1px solid #000; border-radius: 4px; box-shadow: var(--shadow), inset 0 0 0 1px var(--panel-line); background: #101018; }
.start-main { display: flex; flex-direction: column; max-height: calc(100dvh - var(--bar-h) - 12px); }
.start-head { display: flex; align-items: center; gap: 10px; flex: none; padding: 12px; background: linear-gradient(180deg, #3a2c12, #1b1509); border-bottom: 1px solid var(--gold-lo); }
.start-head img { width: 36px; height: 36px; }
.start-head b { display: block; color: #fff7dd; }
.start-head small { color: #cdbd93; font-size: 11px; }
.start-list { padding: 4px; }
.start-item { border-radius: 3px; }
.start-item:hover, .start-item:focus-visible { background: rgba(226, 179, 74, .22); color: #fff; }
.taskbar { background: linear-gradient(180deg, #1a1a23, #0e0e14); border-top: 1px solid rgba(226, 179, 74, .28); }
.start-btn { border: 1px solid var(--panel-line); border-radius: 3px; background: linear-gradient(180deg, #2c2413, #17120a); color: #fbeec6; }
.start-btn:hover { background: linear-gradient(180deg, #3a2f18, #1d170c); }
.start-btn[aria-expanded="true"] { background: #120e06; border-color: var(--gold); }
.task { border: 1px solid rgba(255, 255, 255, .08); border-radius: 3px; background: rgba(255, 255, 255, .05); }
.task:hover { background: rgba(255, 255, 255, .1); }
.task.active { background: rgba(226, 179, 74, .16); border-color: var(--panel-line); }
.tray { border: 0; padding: 0 4px 0 8px; border-left: 1px solid rgba(255, 255, 255, .08); }
.tray-tier { border-radius: 999px; padding: 2px 9px; border-color: var(--panel-line); }

/* Identity window */
.id-pane { padding: 16px; }
.id-pane h2 { margin: 0 0 8px; font-size: 16px; color: var(--gold-hi); }
.id-pane h3 { margin: 16px 0 6px; font-size: 13px; color: var(--gold-hi); }
.id-pane p { margin: 0 0 10px; }
.id-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.id-row { display: flex; gap: 6px; align-items: center; }
.id-principal { flex: 1; min-width: 0; padding: 5px 7px; background: var(--ink); color: var(--text); border: 1px solid var(--edge-hi); font: 12px var(--mono); }
.id-balances { list-style: none; margin: 0 0 8px; padding: 0; }
.id-balances li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--glass-3); }
.id-balances li.note { border: 0; }
#tray-id { margin-right: 4px; }
@media (max-width: 720px) { #tray-id { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* Apps inside windows */
.app-bar { display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: var(--glass); border-bottom: 1px solid var(--glass-3); }
.app-host { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font: 12px var(--mono); }
.app-bar .btn { flex: none; }
.app-frame { flex: 1; min-height: 0; width: 100%; border: 0; background: #fff; }

/* Asking whether an app may use the desktop's sign-in */
.access-back { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .55); }
.access-box { width: 100%; max-width: 420px; padding: 18px; background: var(--glass); color: var(--text); border: 1px solid var(--panel-line); border-radius: 8px; box-shadow: var(--shadow); }
.access-box h2 { margin: 0 0 8px; font-size: 16px; color: var(--gold-hi); }
.access-box p { margin: 0 0 10px; }
.access-box .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* Larger desktop text and easier tray targets */
.icon span { font-size: 12px; }
.preview-note { font-size: 12px; }
.tray-tier { position: relative; min-height: 28px; font-size: 12px; }
@media (max-width: 720px) {
  /* The button fills the 44px bar for fingers, and the visible chip is drawn inside it. */
  .tray-tier { min-height: 44px; border-color: transparent; background: none; }
  .tray-tier::before { content: ""; position: absolute; inset: 8px 0; border: 1px solid var(--panel-line); border-radius: 999px; pointer-events: none; }
}

/* Welcome window */
.welcome h2 { margin: 0 0 8px; font-size: 18px; color: var(--gold-hi); }
.welcome h2:focus { outline: none; }
.welcome h3 { margin: 18px 0 6px; font-size: 13px; color: var(--gold-hi); }
.welcome p { margin: 0 0 10px; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }
.welcome-msg:empty { display: none; }
.welcome-apps { list-style: none; margin: 0 0 10px; padding: 0; }
.welcome-app {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 5px 8px;
  background: none; border: 0; border-radius: 4px; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.welcome-app:hover, .welcome-app:focus-visible { background: rgba(226, 179, 74, .14); }
.welcome-app svg, .welcome-app img { flex: none; width: 28px; height: 28px; }
.welcome-app span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.welcome-app small { color: var(--muted); font-size: 12px; }
.welcome-app i { flex: none; padding: 1px 7px; border: 1px solid var(--panel-line); border-radius: 999px; color: var(--gold-hi); font-size: 11px; font-style: normal; }

/* Developer Chat. Layout conventions familiar from team chat apps, in Obsidian's own style. */
.win-body.chat-body { padding: 0; overflow: hidden; container-type: inline-size; }
.chat-app { display: flex; height: 100%; min-height: 0; background: var(--glass); }
.chat-side { display: flex; flex: 0 0 230px; flex-direction: column; min-height: 0; background: #0d0d14; border-right: 1px solid var(--edge-lo); }
.chat-workspace { padding: 12px 14px; border-bottom: 1px solid var(--glass-3); }
.chat-workspace b { display: block; color: var(--cream); font-size: 14px; }
.chat-workspace small { color: var(--muted); font-size: 11px; }
.chat-section { padding: 14px 14px 4px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.chat-channels { flex: 1; min-height: 0; padding: 0 6px; overflow-y: auto; }
.chat-channel { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 32px; padding: 4px 8px; color: var(--muted); text-align: left; background: none; border: 0; border-radius: 6px; cursor: pointer; }
.chat-channel:hover { background: var(--glass-2); color: var(--text); }
.chat-channel.active { background: var(--gold); color: #14141c; font-weight: 700; }
.chat-channel.unread { color: var(--cream); font-weight: 700; }
.chat-channel-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-hash { opacity: .7; }
.chat-badge { min-width: 20px; padding: 0 6px; color: #14141c; font-size: 11px; font-weight: 700; text-align: center; background: var(--gold-hi); border-radius: 10px; }
.chat-me { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--glass-3); }
.chat-me-name { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; min-height: 36px; padding: 2px 4px; text-align: left; background: none; border: 0; border-radius: 6px; cursor: pointer; }
.chat-me-name:hover { background: var(--glass-2); }
.chat-me-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-link { min-height: 32px; padding: 2px 8px; color: var(--gold-hi); font-size: 12px; background: none; border: 0; border-radius: 6px; cursor: pointer; }
.chat-link:hover { background: var(--glass-2); }
.chat-main { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; }
.chat-top { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 6px 14px; border-bottom: 1px solid var(--glass-3); }
.chat-menu { display: none; min-height: 36px; padding: 2px 10px; background: var(--glass-2); border: 1px solid var(--glass-3); border-radius: 6px; cursor: pointer; }
.chat-title { flex: 1; min-width: 0; }
.chat-title b { display: block; color: var(--cream); font-size: 14px; }
.chat-title span { display: block; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.chat-log { flex: 1; min-height: 0; padding: 8px 0; overflow-y: auto; }
.chat-older { display: block; margin: 4px auto 10px; padding: 6px 12px; color: var(--gold-hi); font-size: 12px; background: var(--glass-2); border: 1px solid var(--glass-3); border-radius: 14px; cursor: pointer; }
.chat-empty { padding: 28px 18px; color: var(--muted); }
.chat-empty b { display: block; margin-bottom: 4px; color: var(--cream); font-size: 18px; }
.chat-day { display: flex; align-items: center; margin: 14px 0 6px; padding: 0 14px; color: var(--muted); font-size: 11px; font-weight: 700; }
.chat-day::before, .chat-day::after { flex: 1; height: 1px; content: ""; background: var(--glass-3); }
.chat-day span { padding: 0 10px; }
.chat-msg { position: relative; display: flex; gap: 10px; padding: 6px 16px 4px; }
.chat-msg.grouped { padding-top: 1px; padding-bottom: 1px; }
.chat-msg:hover, .chat-msg:focus-within { background: var(--glass-2); }
.chat-avatar { display: grid; flex: 0 0 36px; width: 36px; height: 36px; place-items: center; color: #14141c; font-weight: 700; border-radius: 6px; }
.chat-avatar.small { flex-basis: 24px; width: 24px; height: 24px; font-size: 12px; border-radius: 4px; }
.who-0 { background: #e2b34a; } .who-1 { background: #7bd88f; } .who-2 { background: #8ec5ff; } .who-3 { background: #e79dc3; }
.who-4 { background: #f2a36b; } .who-5 { background: #b9a4f5; } .who-6 { background: #6fd6cf; } .who-7 { background: #f6f0df; }
.chat-stamp { flex: 0 0 36px; min-width: 0; padding-top: 3px; overflow: hidden; color: transparent; font-size: 9px; text-align: right; white-space: nowrap; }
.chat-msg:hover .chat-stamp { color: var(--muted); }
.chat-content { flex: 1; min-width: 0; }
.chat-byline { display: flex; align-items: baseline; gap: 8px; }
.chat-byline b { color: var(--cream); }
.chat-time { color: var(--muted); font-size: 11px; }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-text.removed, .chat-edited { color: var(--muted); font-size: 12px; font-style: italic; }
.chat-quote { margin: 2px 0; padding: 2px 8px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid var(--gold-lo); }
.chat-quote b { color: var(--text); }
.chat-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chat-chip { min-height: 26px; padding: 1px 8px; font-size: 12px; background: var(--glass-2); border: 1px solid var(--glass-3); border-radius: 13px; cursor: pointer; }
.chat-chip.mine { background: #33290f; border-color: var(--gold); }
.chat-tools { position: absolute; top: -10px; right: 14px; display: none; gap: 2px; padding: 2px; background: var(--glass-3); border: 1px solid var(--edge-hi); border-radius: 6px; }
.chat-msg:hover .chat-tools, .chat-msg:focus-within .chat-tools { display: flex; }
.chat-tool { min-width: 28px; min-height: 28px; padding: 0 6px; font-size: 12px; background: none; border: 0; border-radius: 4px; cursor: pointer; }
.chat-tool:hover { background: var(--glass); }
.chat-composer { padding: 6px 14px 12px; }
.chat-banner { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 4px 8px; color: var(--muted); font-size: 12px; }
.chat-compose-row { display: flex; align-items: flex-end; gap: 8px; padding: 6px; background: var(--glass-2); border: 1px solid var(--edge-hi); border-radius: 8px; }
.chat-compose-row:focus-within { border-color: var(--gold); }
.chat-compose-row textarea { flex: 1; min-height: 36px; max-height: 140px; padding: 7px 8px; color: var(--text); font: inherit; resize: vertical; background: none; border: 0; outline: 0; }
.chat-send { min-height: 36px; }
.chat-error { margin: 6px 0 0; color: #ff9d8f; font-size: 12px; }
.chat-people { flex: 0 0 200px; min-height: 0; overflow-y: auto; background: #0d0d14; border-left: 1px solid var(--edge-lo); }
.chat-person { display: flex; align-items: center; gap: 8px; padding: 6px 14px; }
.chat-gate { max-width: 520px; height: 100%; margin: 0 auto; padding: 28px 22px; overflow-y: auto; }
.chat-gate h2 { margin: 0 0 8px; color: var(--cream); font-size: 20px; }
.chat-gate h3 { margin: 20px 0 6px; color: var(--cream); font-size: 14px; }
.chat-steps { margin: 18px 0; padding: 0; list-style: none; counter-reset: step; }
.chat-steps li { position: relative; margin-bottom: 12px; padding-left: 38px; counter-increment: step; }
.chat-steps li::before { position: absolute; top: 2px; left: 0; display: grid; width: 26px; height: 26px; color: #14141c; font-weight: 700; content: counter(step); place-items: center; background: var(--gold); border-radius: 50%; }
.chat-steps b, .chat-steps span { display: block; }
.chat-steps span { color: var(--muted); font-size: 12px; }
.chat-buy { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--glass-3); }
.chat-lock { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.chat-lock label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
.chat-lock input, .chat-lock select { min-height: 38px; padding: 6px 10px; color: var(--text); font: inherit; background: var(--glass-2); border: 1px solid var(--edge-hi); border-radius: 6px; }
.chat-lock-summary { margin: 0; color: var(--text); font-size: 12px; }
.chat-locks { margin: 0; padding: 0; list-style: none; }
.chat-locks li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--glass-3); }
@container (max-width: 640px) {
  .chat-side { position: absolute; z-index: 3; top: 0; bottom: 0; left: 0; display: none; width: 240px; }
  .chat-app.show-side .chat-side { display: flex; }
  .chat-app { position: relative; }
  .chat-menu { display: block; }
  .chat-people { display: none; }
  .chat-tools { position: static; flex-wrap: wrap; flex-basis: 100%; margin-top: 4px; background: none; border: 0; }
  .chat-msg { flex-wrap: wrap; }
}

.start-group { padding: 8px 10px 2px; color: var(--gold-hi); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.welcome-group { margin-top: 12px; }
.welcome-group b { display: block; color: var(--gold-hi); }
.welcome-group small { color: var(--muted); }
