/* Agents office — interface. Ivory surfaces, deep navy ink, champagne-gold hairlines. */
@font-face { font-family: "Tajawal"; font-weight: 400; font-display: swap; src: url(/fonts/tajawal-arabic-400-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Tajawal"; font-weight: 400; font-display: swap; src: url(/fonts/tajawal-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Tajawal"; font-weight: 500; font-display: swap; src: url(/fonts/tajawal-arabic-500-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Tajawal"; font-weight: 500; font-display: swap; src: url(/fonts/tajawal-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Tajawal"; font-weight: 700; font-display: swap; src: url(/fonts/tajawal-arabic-700-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Tajawal"; font-weight: 700; font-display: swap; src: url(/fonts/tajawal-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Tajawal"; font-weight: 800; font-display: swap; src: url(/fonts/tajawal-arabic-800-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Tajawal"; font-weight: 800; font-display: swap; src: url(/fonts/tajawal-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --ivory: #faf7f1;
  --surface: #ffffff;
  --surface-2: #f7f4ed;
  --bg: #fbfaf7;
  --line: #e8e2d5;
  --line-strong: #d9d0bd;
  --text: #141b2b;
  --muted: #6a7184;
  --ink: #101828;
  --navy: #16223b;
  --gold: #b08a45;
  --gold-soft: #efe4cc;
  --running: #2563d8;
  --done: #178a5c;
  --attention: #c27a0a;
  --error: #c8324f;
  --off: #9aa1b0;
  --shadow: 0 18px 50px rgba(22, 30, 52, .14), 0 2px 8px rgba(22, 30, 52, .06);
  --shadow-soft: 0 6px 20px rgba(22, 30, 52, .08);
  --body: "Tajawal", "Segoe UI", Tahoma, system-ui, sans-serif;
  --display: "Tajawal", "Segoe UI", Tahoma, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(120% 90% at 50% 0%, #fdfcf9 0%, #f1ede3 55%, #e3dccb 100%);
  color: var(--text);
  font-family: var(--body);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease; }
button:disabled { opacity: .45; cursor: default; }
button:not(:disabled):active { transform: translateY(1px); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ghost, .primary, .yes, .no { border-radius: 10px; padding: 6px 14px; min-height: 36px; font-weight: 500; font-size: 13.5px; }
.ghost { background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); }
.ghost:hover:not(:disabled) { border-color: var(--gold); box-shadow: var(--shadow-soft); }
.primary {
  position: relative; border: 1px solid #0c1424; color: #fff; font-weight: 700;
  background: linear-gradient(180deg, #22304f 0%, var(--navy) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 4px 14px rgba(22, 34, 59, .28);
}
.primary:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 8px 22px rgba(22, 34, 59, .34); }
.primary.has-count::after {
  content: attr(data-count); position: absolute; top: -8px; inset-inline-end: -8px;
  min-width: 20px; height: 20px; border-radius: 10px; padding: 0 5px;
  background: var(--gold); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; box-shadow: 0 0 0 2px var(--surface);
}
.yes { background: var(--done); border: 1px solid var(--done); color: #fff; font-weight: 700; }
.no { background: var(--surface); border: 1px solid var(--error); color: var(--error); font-weight: 700; }

/* Top bar: a floating sheet */
.topbar {
  position: fixed; inset: 12px 12px auto 12px; z-index: 20;
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, .9); border-radius: 18px; box-shadow: var(--shadow);
  padding: 10px 16px; margin-top: env(safe-area-inset-top);
}
.topbar::after { content: ""; position: absolute; inset: auto 18px 0 18px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .55; }
.topbar-row { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; margin-inline-end: auto; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--gold-soft); font-family: var(--display); font-weight: 700; font-size: 18px;
  background: linear-gradient(145deg, #23314f, #0f1728); box-shadow: inset 0 0 0 1px rgba(176, 138, 69, .7), 0 4px 12px rgba(16, 24, 40, .3);
}
.topbar h1 { font-family: var(--display); font-size: 21px; font-weight: 700; margin: 0; letter-spacing: 0; color: var(--ink); line-height: 1.2; }
.updated { color: var(--muted); font-size: 12px; }
.alerts { display: flex; gap: 8px; overflow-x: auto; padding-top: 8px; scrollbar-width: none; }
.alerts:empty { display: none; }
.alert-chip {
  flex: none; max-width: 78vw; display: flex; align-items: center; gap: 8px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 5px 13px; font-size: 13px; white-space: nowrap;
}
.alert-chip span { overflow: hidden; text-overflow: ellipsis; }
.alert-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.alert-chip.urgent { border-color: #e9b3bf; background: #fdf1f3; color: #8f1f37; }
.alert-chip.urgent::before { background: var(--error); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* Scene, labels, view buttons */
.scene { position: fixed; inset: 0; touch-action: none; }
.scene canvas { display: block; }
.scene::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 100% at 50% 45%, transparent 55%, rgba(60, 48, 22, .16) 100%); }
.views {
  position: fixed; inset: auto 0 max(14px, env(safe-area-inset-bottom)) 0; z-index: 10;
  display: flex; gap: 6px; justify-content: safe center; overflow-x: auto; padding: 4px 14px; scrollbar-width: none;
}
.views button {
  flex: none; border: 1px solid rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: var(--text); border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 500; min-height: 38px; box-shadow: var(--shadow-soft);
}
.views button:hover { border-color: var(--gold); }
.views button.on { background: linear-gradient(180deg, #22304f, var(--navy)); border-color: #0c1424; color: #fff; box-shadow: inset 0 0 0 1px rgba(176, 138, 69, .55), 0 6px 18px rgba(22, 34, 59, .3); }
.tag {
  direction: rtl; pointer-events: auto; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 7px; white-space: nowrap; position: relative;
  background: rgba(255, 255, 255, .93); border: 1px solid rgba(255, 255, 255, .95); border-radius: 999px; color: var(--ink);
  padding: 4px 12px; font-size: 12px; line-height: 1.5; box-shadow: 0 6px 18px rgba(22, 30, 52, .2), 0 0 0 1px rgba(176, 138, 69, .22);
}
.tag b { font-size: 13px; font-weight: 700; color: var(--ink); }
/* Over a person: the name only. The job shows on hover and in the side panel; the room's wall names the department. */
.tag span { display: none; }
.tag i { width: 9px; height: 9px; border-radius: 50%; background: var(--off); flex: none; box-shadow: 0 0 0 3px rgba(154, 161, 176, .22); }
.tag.running i { background: var(--running); box-shadow: 0 0 0 3px rgba(37, 99, 216, .22); animation: pulse 1s infinite; }
.tag.done i { background: var(--done); box-shadow: 0 0 0 3px rgba(23, 138, 92, .2); }
.tag.attention i { background: var(--attention); box-shadow: 0 0 0 3px rgba(194, 122, 10, .22); }
.tag.error i { background: var(--error); box-shadow: 0 0 0 3px rgba(200, 50, 79, .22); }
.tag.disabled { opacity: .72; }
.tag.alerted { box-shadow: 0 6px 18px rgba(22, 30, 52, .2), 0 0 0 1.5px var(--error); }
.tag.alerted::after {
  content: attr(data-count); position: absolute; top: -9px; inset-inline-start: -7px;
  min-width: 19px; height: 19px; border-radius: 10px; padding: 0 4px; text-align: center;
  background: var(--error); color: #fff; font-size: 11px; font-weight: 700; line-height: 19px; box-shadow: 0 0 0 2px #fff;
}
.room-sign {
  direction: rtl; pointer-events: none; white-space: nowrap; font-family: var(--display); font-weight: 800; font-size: 14.5px; color: #fff;
  background: linear-gradient(180deg, #24334f, var(--navy)); border: 1px solid rgba(201, 163, 90, .85); border-radius: 10px; padding: 4px 14px;
  box-shadow: 0 8px 20px rgba(16, 24, 40, .35), inset 0 1px 0 rgba(255, 255, 255, .12); letter-spacing: 0;
}
.tag.session-tag { padding: 2px 9px; background: rgba(240, 244, 251, .92); box-shadow: 0 4px 12px rgba(22, 30, 52, .16); }
.tag.session-tag b { font-size: 11.5px; font-weight: 500; }
/* A session is a dot; its name shows when the pointer is on it or when it waits for the owner. */
.tag.session-tag span { display: none; }
.tag.session-tag { padding: 4px; gap: 0; }
.tag.session-tag b { display: none; }
.tag.session-tag:hover, .tag.session-tag.alerted { padding: 2px 9px; gap: 7px; z-index: 5; }
.tag.session-tag:hover b, .tag.session-tag.alerted b { display: inline; }
.reach { margin: 8px 0 0; padding-inline-start: 18px; font-size: 12.5px; line-height: 1.9; color: var(--muted); }
.tag.ready i { background: #5b8def; box-shadow: 0 0 0 3px rgba(91, 141, 239, .2); }
.room-label {
  direction: rtl; pointer-events: none; white-space: nowrap; font-family: var(--display);
  color: rgba(20, 27, 43, .72); font-size: 13px; font-weight: 700; text-shadow: 0 1px 6px rgba(255, 255, 255, .95);
}
.legend {
  position: fixed; inset: auto 14px 64px auto; z-index: 9; direction: rtl;
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .95); border-radius: 16px; box-shadow: var(--shadow-soft); padding: 10px 14px; font-size: 12.5px;
}
.legend ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.legend li { display: flex; align-items: center; gap: 9px; color: var(--text); white-space: nowrap; }
.legend i { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--off); box-shadow: 0 0 0 3px rgba(154, 161, 176, .2); }
.legend i.running { background: var(--running); box-shadow: 0 0 0 3px rgba(37, 99, 216, .2); animation: pulse 1s infinite; }
.legend i.done { background: var(--done); box-shadow: 0 0 0 3px rgba(23, 138, 92, .2); }
.legend i.attention { background: var(--attention); box-shadow: 0 0 0 3px rgba(194, 122, 10, .2); }
.legend i.error { background: var(--error); box-shadow: 0 0 0 3px rgba(200, 50, 79, .2); }
.legend i.ready { background: #5b8def; box-shadow: 0 0 0 3px rgba(91, 141, 239, .2); }
.legend b.count { min-width: 18px; height: 18px; border-radius: 9px; background: var(--error); color: #fff; font-size: 11px; text-align: center; line-height: 18px; margin-inline: -4px; }
.legend b.mini { width: 10px; height: 16px; border-radius: 6px; background: #9fb0cc; }
.legend-toggle { background: transparent; border: 0; padding: 0; font-weight: 700; font-size: 13px; color: var(--ink); cursor: default; }
.toast {
  position: fixed; inset: auto auto 70px 50%; transform: translateX(-50%); z-index: 40; margin: 0;
  background: var(--navy); color: #fff; border: 1px solid rgba(176, 138, 69, .6); border-radius: 12px;
  padding: 9px 18px; font-size: 13.5px; box-shadow: var(--shadow); max-width: 90vw;
}
.toast[hidden] { display: none; }

/* Night: the page's backdrop follows the office */
body.night { background: radial-gradient(120% 90% at 50% 0%, #2a3350 0%, #161d31 55%, #0c111f 100%); }
body.night .scene::after { background: radial-gradient(120% 100% at 50% 45%, transparent 50%, rgba(4, 8, 20, .45) 100%); }
.org-node.lead .org-card { border-color: var(--gold); background: linear-gradient(180deg, #fffdf7, #fff); }

/* The org chart: the team as a tree */
.org { position: fixed; inset: 0; z-index: 8; overflow: auto; padding: 96px 20px 40px; background: radial-gradient(120% 90% at 50% 0%, #fdfcf9 0%, #f1ede3 55%, #e3dccb 100%); }
.org[hidden] { display: none; }
.org-mode .views, .org-mode .legend { display: none; }
.org-top { display: grid; justify-items: center; gap: 26px; margin-bottom: 30px; position: relative; }
.org-top::after { content: ""; position: absolute; top: 58px; bottom: -30px; left: 50%; width: 2px; background: var(--gold-soft); z-index: 0; }
.org-top > * { position: relative; z-index: 1; }
.org-owner { display: grid; justify-items: center; padding: 10px 26px; border-radius: 14px; color: #fff; background: linear-gradient(180deg, #24334f, var(--navy)); box-shadow: inset 0 0 0 1px rgba(201, 163, 90, .8), var(--shadow-soft); }
.org-owner b { font-size: 17px; } .org-owner small { opacity: .75; font-size: 12px; }
.org-depts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; max-width: 1180px; margin: 0 auto; align-items: start; border-top: 2px solid var(--gold-soft); padding-top: 22px; }
.org-dept { display: grid; gap: 10px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: var(--shadow-soft); position: relative; }
.org-dept::before { content: ""; position: absolute; top: -24px; left: 50%; width: 2px; height: 24px; background: var(--gold-soft); }
.org-dept h3 { margin: 0 0 2px; font-size: 15.5px; font-weight: 800; color: var(--ink); text-align: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.org-node p { margin: 4px 6px 0; color: var(--muted); font-size: 11.5px; }
.org-card { width: 100%; display: flex; align-items: center; gap: 10px; text-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px; color: var(--text); position: relative; }
.org-card:hover { border-color: var(--gold); box-shadow: var(--shadow-soft); transform: translateY(-1px); }
.org-card.big { min-width: 250px; padding: 12px 16px; box-shadow: var(--shadow-soft); }
.org-avatar { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; }
.org-who { flex: 1; min-width: 0; display: grid; line-height: 1.4; }
.org-who b { font-size: 14.5px; } .org-who small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-card i { width: 11px; height: 11px; border-radius: 50%; background: var(--off); flex: none; box-shadow: 0 0 0 3px rgba(154, 161, 176, .2); }
.org-card.running i { background: var(--running); box-shadow: 0 0 0 3px rgba(37, 99, 216, .2); animation: pulse 1s infinite; }
.org-card.done i { background: var(--done); box-shadow: 0 0 0 3px rgba(23, 138, 92, .2); }
.org-card.attention i { background: var(--attention); box-shadow: 0 0 0 3px rgba(194, 122, 10, .22); }
.org-card.error i { background: var(--error); box-shadow: 0 0 0 3px rgba(200, 50, 79, .22); }
.org-card.ready i { background: #5b8def; box-shadow: 0 0 0 3px rgba(91, 141, 239, .2); }
.org-card.disabled { opacity: .7; }
.org-card em { position: absolute; top: -8px; inset-inline-start: -6px; min-width: 20px; height: 20px; border-radius: 10px; padding: 0 5px; background: var(--error); color: #fff; font-size: 11.5px; font-style: normal; font-weight: 700; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px #fff; }

.org-hire { justify-self: stretch; border-style: dashed; color: var(--muted); }
.field small { color: var(--muted); font-size: 11.5px; }
.editor.small { min-height: 220px; margin-top: 0; }
.perm { color: var(--error); font-weight: 700; font-size: 12px; }
.setting > span { font-size: 13px; }
.setting .ghost, .setting .no { grid-column: 1 / -1; justify-self: start; }

/* Panel: a floating sheet at the side; a bottom sheet on phones */
.panel {
  position: fixed; z-index: 30; inset: 12px auto 12px 12px; width: min(500px, calc(100vw - 24px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); border: 1px solid rgba(255, 255, 255, .9); border-radius: 22px; box-shadow: var(--shadow);
  animation: slide-in .22s ease;
}
@keyframes slide-in { from { opacity: 0; transform: translateX(-14px); } }
.panel[hidden] { display: none; }
.panel-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px; color: #fff; position: relative;
  background: linear-gradient(135deg, #1d2a47 0%, #0f1728 100%);
}
.panel-head::after { content: ""; position: absolute; inset: auto 0 0 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.avatar {
  flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 22px; color: #fff; background: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 6px 14px rgba(0, 0, 0, .3);
}
.panel-head > div { flex: 1; min-width: 0; }
.panel-head h2 { margin: 0 0 2px; font-family: var(--display); font-size: 20px; font-weight: 700; }
.panel-meta { margin: 0; color: rgba(255, 255, 255, .72); font-size: 12.5px; line-height: 1.6; }
.panel-head .ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); color: #fff; min-width: 36px; padding: 6px 0; }
.panel-head .ghost:hover { border-color: var(--gold); box-shadow: none; }
.panel-scroll { overflow-y: auto; overflow-x: hidden; flex: 1; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.panel-top { padding: 14px 18px 0; display: grid; gap: 12px; }
.panel-top:empty { display: none; }
.panel-top > *, .panel-top section > *, .chat-wrap > *, .chat > *, .stack > * { min-width: 0; }
.panel-top { grid-template-columns: minmax(0, 1fr); }
.panel-top section { display: grid; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.panel-top section:last-child { border-bottom: 0; }
.panel-top h3 { margin: 4px 0 0; font-family: var(--display); font-size: 15.5px; font-weight: 700; color: var(--ink); }
.panel-top .empty, .usage, .hint-line { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.75; }
.usage { font-size: 13.5px; color: var(--text); }
.stack { display: grid; gap: 10px; }

/* Cards */
.agent-row, .decision, .panel-alert, .note-row, .session, .file, .setting, .lead, .gate, .notebook {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(22, 30, 52, .04);
}
.lead { margin: 0; font-size: 14px; line-height: 1.85; padding: 12px 14px; border-inline-start: 3px solid var(--gold); }
.gate { display: grid; gap: 10px; justify-items: start; padding: 12px 14px; border-color: var(--gold); background: #fdf9ef; font-size: 13.5px; line-height: 1.7; }
.gate p { margin: 0; }
p.gate { color: #8f1f37; border-color: #e9b3bf; background: #fdf1f3; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.controls select, .controls input[type=number], .decision input, .note textarea, .setting select, .field select, .field input, .composer textarea, .chat-input textarea, .file-bar input, .editor {
  background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 11px; min-height: 38px; line-height: 1.6;
}
.controls input[type=number] { width: 104px; direction: ltr; }
select:hover, input:hover, textarea:hover { border-color: var(--gold); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); font-size: 13.5px; }
.switch input { width: 19px; height: 19px; accent-color: var(--navy); }
.note { display: grid; gap: 8px; justify-items: start; }
.note textarea { width: 100%; resize: vertical; }
.agent-row { display: grid; gap: 10px; padding: 12px 14px; }
.agent-name { font-size: 13.5px; line-height: 1.6; }
.agent-name b { font-family: var(--display); font-size: 15px; }
.agent-name span { color: var(--muted); }
.agent-name small { display: block; color: var(--muted); font-size: 12px; }
.decision, .panel-alert { display: grid; gap: 8px; padding: 12px 14px; font-size: 13.5px; line-height: 1.7; }
.decision { border-color: var(--gold); background: linear-gradient(180deg, #fffdf7, #fff); box-shadow: 0 6px 18px rgba(176, 138, 69, .12); }
.decision.answered { border-color: var(--line); background: var(--surface); box-shadow: none; opacity: .9; }
.decision span, .panel-alert span { color: var(--muted); font-size: 12.5px; }
.decision em { font-style: normal; color: var(--done); font-weight: 700; }
.decision input { width: 100%; }
.panel-alert.urgent { border-color: #e9b3bf; background: #fdf1f3; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel-alert a, .report a, .bubble a { color: var(--running); }

/* Tabs */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; position: sticky; top: 0; z-index: 2; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.tabs button { flex: 1 0 auto; background: transparent; border: 0; border-radius: 9px; color: var(--muted); padding: 7px 12px; font-size: 13.5px; font-weight: 500; }
.tabs button:hover { color: var(--text); }
.tabs button.on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-soft), inset 0 -2px 0 var(--gold); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--surface); }
.seg button { background: transparent; border: 0; color: var(--muted); padding: 9px 6px; font-size: 13.5px; font-weight: 500; }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button.on { background: var(--navy); color: #fff; font-weight: 700; }
.field { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.field[hidden] { display: none; }
.field select, .field input { width: 100%; }
.settings { display: grid; gap: 10px; }
.setting { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 6px 10px; padding: 12px 14px; font-size: 13.5px; }
.setting b { font-weight: 700; }
.setting small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; line-height: 1.6; }
.setting button { justify-self: start; }
.change { display: grid; gap: 2px; padding: 6px 12px; border-inline-start: 2px solid var(--line-strong); font-size: 13px; line-height: 1.6; }
.change.mine { border-inline-start-color: var(--gold); }
.change strong { font-weight: 500; }
.change span { color: var(--muted); font-size: 12px; }

/* Chat with an agent or a session */
.chat-wrap { display: grid; gap: 10px; }
.chat { display: grid; gap: 9px; }
.bubble { max-width: 90%; padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.bubble p { margin: 0; white-space: pre-wrap; }
.bubble span { display: block; font-size: 11px; opacity: .65; margin-top: 2px; }
.bubble b { display: block; font-size: 12px; color: var(--gold); font-weight: 700; }
.bubble.me { justify-self: start; color: #fff; border-end-start-radius: 5px; background: linear-gradient(180deg, #24334f, var(--navy)); box-shadow: 0 4px 12px rgba(22, 34, 59, .22); }
.bubble.me b { color: var(--gold-soft); }
.hint-line[hidden] { display: none; }
.bubble.me.lead { background: linear-gradient(180deg, #8a2c56, #6b1f42); }
.bubble.me.lead b { color: #ffd9e6; }
.bubble.them { justify-self: end; background: var(--surface); border: 1px solid var(--line); border-end-end-radius: 5px; box-shadow: 0 1px 2px rgba(22, 30, 52, .05); }
.bubble.them ul, .bubble.them ol { padding-inline-start: 20px; margin: 4px 0; }
.bubble.them p { margin: 0 0 4px; }
.bubble.them h1, .bubble.them h2, .bubble.them h3 { font-size: 14.5px; margin: 8px 0 2px; }
.bubble.them table { border-collapse: collapse; font-size: 12.5px; display: block; overflow-x: auto; }
.bubble.them td { border: 1px solid var(--line); padding: 3px 6px; }
.bubble.them code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; direction: ltr; unicode-bidi: isolate; }
.bubble.waiting p { color: var(--muted); animation: pulse 1.4s infinite; }
.steps { margin: 0; justify-self: center; max-width: 100%; color: var(--muted); font-size: 11.5px; direction: ltr; unicode-bidi: plaintext; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--surface-2); border-radius: 999px; padding: 2px 12px; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: 0; background: linear-gradient(180deg, transparent, var(--bg) 30%); padding: 14px 0 12px; }
.chat-input textarea { flex: 1; resize: none; border-radius: 14px; }
.steps.note { background: var(--gold-soft); color: var(--ink); direction: rtl; unicode-bidi: normal; }
.gate textarea { width: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 11px; line-height: 1.6; }
.gate[hidden], .chat-input[hidden] { display: none; }
.session-state { font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 10px; }
.session-state.running { color: var(--running); border-color: var(--running); animation: pulse 1.2s infinite; }
.session-state.error { color: var(--error); border-color: var(--error); }

/* Notes, sessions, files, notebook */
.composer { display: grid; gap: 8px; }
.composer textarea { resize: vertical; width: 100%; }
.composer [hidden] { display: none; }
.note-row { display: flex; gap: 8px; align-items: center; padding: 10px 12px; font-size: 13.5px; line-height: 1.6; }
.note-row > div { flex: 1; min-width: 0; }
.note-row strong { display: block; font-weight: 700; overflow-wrap: anywhere; }
.note-row span { color: var(--muted); font-size: 12px; }
.note-row.reminder { border-inline-start: 3px solid var(--attention); }
.note-row.todo { border-inline-start: 3px solid var(--done); }
.note-row.finished { opacity: .6; }
.note-row.finished strong { text-decoration: line-through; }
.tick { min-width: 36px; padding: 4px 0; }
.session { display: grid; gap: 4px; padding: 11px 14px; font-size: 13.5px; line-height: 1.65; text-align: start; width: 100%; color: var(--text); }
button.session:hover, .file:hover { border-color: var(--gold); box-shadow: var(--shadow-soft); transform: translateY(-1px); }
.session.waiting { border-inline-start: 3px solid var(--attention); }
.session strong { font-weight: 700; }
.session span { color: var(--muted); font-size: 12px; }
.session p { margin: 0; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
a.file { text-decoration: none; }
.file { display: flex; justify-content: space-between; gap: 10px; align-items: center; text-align: start; width: 100%; padding: 10px 14px; color: var(--text); font-size: 13.5px; }
.file strong { direction: ltr; unicode-bidi: isolate; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.file span { color: var(--muted); font-size: 12px; flex: none; }
.file-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 0; position: sticky; top: 0; background: var(--bg); border-bottom: 1px solid var(--line); z-index: 1; }
.file-bar strong { margin-inline-end: auto; font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.file-bar input { flex: 1; min-width: 160px; }
.editor { width: 100%; min-height: 52vh; margin-top: 10px; padding: 14px; line-height: 1.85; font-size: 14px; resize: vertical; }
.notebook { line-height: 1.85; overflow-wrap: anywhere; font-size: 13.5px; padding: 8px 14px; }
.notebook ul { padding-inline-start: 20px; margin: 6px 0; }
.notebook h1, .notebook h2, .notebook h3 { font-size: 14px; margin: 10px 0 4px; }

.report-image { width: 100%; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow-soft); margin: 10px 0 4px; display: block; }
.record { margin-top: 10px; max-width: 240px; }
.record select { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 6px 10px; min-height: 36px; }

/* Reports */
.report { padding: 6px 18px 36px; font-size: 14.5px; line-height: 1.9; overflow-wrap: anywhere; }
.report:empty { display: none; }
.report h1 { font-family: var(--display); font-size: 20px; margin: 14px 0 6px; }
.report h2 { font-family: var(--display); font-size: 17px; margin: 24px 0 6px; padding-bottom: 5px; border-bottom: 1px solid var(--line); }
.report h3 { font-size: 14.5px; color: var(--gold); margin: 16px 0 4px; }
.report code { background: var(--surface-2); border: 1px solid var(--line); padding: 0 5px; border-radius: 6px; font-size: 12.5px; direction: ltr; unicode-bidi: isolate; }
.report ul, .report ol { padding-inline-start: 22px; }
.report li { margin: 3px 0; }
.report blockquote { margin: 6px 0; padding: 4px 14px; border-inline-start: 3px solid var(--gold-soft); color: var(--muted); background: var(--surface); border-radius: 0 10px 10px 0; }
.report table { border-collapse: collapse; width: 100%; font-size: 13px; display: block; overflow-x: auto; background: var(--surface); border-radius: 12px; }
.report th, .report td { border: 1px solid var(--line); padding: 6px 9px; text-align: start; overflow-wrap: normal; word-break: normal; min-width: 84px; }
.report tr:first-child td { background: var(--surface-2); font-weight: 700; }
.report td code { overflow-wrap: anywhere; }
.report .empty { color: var(--muted); }

@media (max-width: 700px) {
  .topbar { inset: 8px 8px auto 8px; padding: 8px 12px; border-radius: 16px; }
  .topbar h1 { font-size: 18px; }
  .updated { display: none; }
  .org { padding: 84px 12px 30px; }
  .org-dept::before { display: none; }
  .org-depts { border-top: 0; padding-top: 0; }
  .panel { inset: auto 0 0 0; width: auto; height: 82vh; border-radius: 22px 22px 0 0; animation-name: slide-up; }
  @keyframes slide-up { from { opacity: 0; transform: translateY(18px); } }
  /* Phones: name only beside the status dot, so the labels do not pile up. */
  .tag { padding: 3px 9px; }
  .tag span { display: none; }
  .room-label { font-size: 10.5px; }
  /* Phones: the legend is a button that opens. */
  .legend { inset: auto 10px 62px auto; padding: 7px 12px; }
  .legend ul { display: none; }
  .legend.open ul { display: grid; }
  .legend-toggle { cursor: pointer; }
  .tag.session-tag { padding: 4px; gap: 0; }
.tag.session-tag b { display: none; }
.tag.session-tag:hover, .tag.session-tag.alerted { padding: 2px 9px; gap: 7px; z-index: 5; }
.tag.session-tag:hover b, .tag.session-tag.alerted b { display: inline; }
  .tabs button { padding: 7px 10px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Login */
.login { display: grid; place-items: center; overflow: auto; }
.login-card {
  width: min(360px, 90vw); background: var(--surface); border: 1px solid rgba(255, 255, 255, .9); border-radius: 22px; padding: 30px; display: grid; gap: 12px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.login-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--navy), var(--gold), var(--navy)); }
.login-card h1 { margin: 6px 0 8px; font-family: var(--display); font-size: 26px; text-align: center; color: var(--ink); }
.login-card label { font-size: 13px; color: var(--muted); }
.login-card input { padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); direction: ltr; }
.login-card button { margin-top: 6px; padding: 11px; border-radius: 12px; border: 1px solid #0c1424; color: #fff; font-weight: 700; background: linear-gradient(180deg, #22304f, var(--navy)); box-shadow: 0 6px 18px rgba(22, 34, 59, .3); }
.login-card button:hover { filter: brightness(1.12); }
.login-error { color: var(--error); min-height: 1.4em; margin: 0; font-size: 13px; }
.file > div { display: grid; gap: 2px; min-width: 0; }

.sheet { display: block; width: 100%; border-radius: 10px; margin: 8px 0; border: 1px solid var(--line-strong); }
.transcript { font-size: 13.5px; line-height: 1.9; white-space: pre-wrap; color: var(--text); }
.file.failed { border-inline-start: 3px solid var(--error); }
.stack input[type=file] { font: inherit; font-size: 13px; }

.setting.post { display: grid; gap: 8px; }
.setting.post .controls { flex-wrap: wrap; }
.setting.post > b { unicode-bidi: plaintext; overflow-wrap: anywhere; }

/* ---- the sessions workspace: the whole screen, calm and light ---- */
.desk { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: 320px 1fr; background: var(--bg); }
.desk-side { border-inline-end: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; min-height: 0; }
.desk-side-head { padding: 18px 20px 10px; font-size: 16px; color: var(--ink); }
.desk-list { overflow-y: auto; padding: 0 12px 16px; display: grid; gap: 4px; align-content: start; }
.desk-owners { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 4px 10px; }
.desk-owners button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; color: var(--muted); }
.desk-owners button.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 700; }
.desk-item { display: flex; align-items: stretch; gap: 2px; }
.desk-row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: start; background: transparent; border: 0; border-radius: 10px; padding: 9px 10px; color: var(--text); }
.desk-row:hover { background: rgba(22, 34, 59, .05); }
.desk-row.on { background: var(--surface); box-shadow: var(--shadow-soft), inset 3px 0 0 var(--gold); }
.desk-row > div { min-width: 0; display: grid; }
.desk-row strong { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desk-row span { font-size: 11.5px; color: var(--muted); }
.desk-row i { width: 8px; height: 8px; border-radius: 50%; background: var(--off); flex: none; }
.desk-row i.live { background: var(--running); }
.desk-row.waiting i { background: var(--attention); }
.desk-row.new strong { color: var(--gold); }
.desk-row.new i { display: none; }
.desk-hide { border: 0; background: transparent; color: var(--line-strong); width: 26px; border-radius: 8px; font-size: 12px; opacity: 0; }
.desk-item:hover .desk-hide { opacity: 1; }
.desk-hide:hover { color: var(--error); background: rgba(200, 50, 79, .08); }
.desk-more { border: 0; background: transparent; color: var(--muted); font-size: 12.5px; padding: 10px; text-align: start; }
.desk-body { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.desk-head { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.desk-head h2 { margin: 0; font-size: 16px; font-weight: 800; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desk-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.desk-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 24px; }
.desk-thread { max-width: 860px; margin: 0 auto; display: grid; gap: 18px; }
.desk-msg small { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.desk-msg > div { font-size: 15px; line-height: 1.9; overflow-wrap: anywhere; }
.desk-msg.them small { color: var(--gold); font-weight: 700; }
.desk-msg.me { justify-self: start; max-width: 78%; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; box-shadow: var(--shadow-soft); }
.desk-msg.me > div { white-space: pre-wrap; }
.desk-msg.working > div { color: var(--muted); animation: pulse 1.2s infinite; }
.desk-msg > div p { margin: 0 0 10px; } .desk-msg > div p:last-child { margin-bottom: 0; }
.desk-msg > div h1, .desk-msg > div h2, .desk-msg > div h3 { font-size: 15.5px; margin: 14px 0 6px; color: var(--ink); }
.desk-msg > div ul, .desk-msg > div ol { margin: 0 0 10px; padding-inline-start: 22px; }
.desk-msg > div code { direction: ltr; unicode-bidi: isolate; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; font-size: 12.5px; }
.desk-msg > div table { border-collapse: collapse; font-size: 13.5px; margin-bottom: 10px; }
.desk-msg > div td { border: 1px solid var(--line); padding: 5px 9px; vertical-align: top; }
.desk-steps { font-size: 12px; color: var(--muted); direction: ltr; text-align: left; }
.desk-steps summary { cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; list-style: none; }
.desk-steps p { margin: 4px 0 0 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desk-note { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.desk-earlier { justify-self: center; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 18px; font-size: 13px; color: var(--muted); }
.desk-earlier:hover { color: var(--ink); border-color: var(--gold); }
.desk-say { border-top: 1px solid var(--line); background: var(--surface); padding: 12px 24px 16px; }
.desk-hint { max-width: 860px; margin: 0 auto 8px; font-size: 12px; color: var(--muted); }
.desk-hint[hidden] { display: none; }
.desk-input { max-width: 860px; margin: 0 auto; display: flex; gap: 10px; align-items: flex-end; }
.desk-input textarea { flex: 1; border: 1px solid var(--line-strong); border-radius: 14px; padding: 11px 15px; font: inherit; font-size: 15px; line-height: 1.7; resize: none; background: var(--bg); color: var(--text); outline: none; }
.desk-input textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176, 138, 69, .15); }
.desk-new { max-width: 640px; margin: 40px auto; padding: 0 24px; width: 100%; }
@media (max-width: 820px) { .desk { grid-template-columns: 1fr; } .desk-side { display: none; } }
.desk[hidden] { display: none; }

/* ---- the studio workspace ---- */
.ws { position: fixed; inset: 0; z-index: 55; display: flex; flex-direction: column; background: var(--bg); }
.ws[hidden] { display: none; }
.ws-head { display: flex; align-items: center; gap: 18px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.ws-head > strong { font-size: 17px; font-weight: 800; color: var(--ink); }
.ws-tabs { display: flex; gap: 4px; flex: 1; }
.ws-tabs button { border: 0; background: transparent; border-radius: 10px; padding: 8px 16px; font-size: 14px; color: var(--muted); }
.ws-tabs button:hover { color: var(--ink); background: var(--surface-2); }
.ws-tabs button.on { background: var(--navy); color: #fff; font-weight: 700; }
.ws-main { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px 40px; }
.ws-narrow { max-width: 760px; margin: 0 auto; }
.ws-narrow.wide { max-width: 1100px; }
.ws-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ws-filters { display: flex; gap: 6px; }
.ws-filters button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 5px 16px; font-size: 13px; color: var(--muted); }
.ws-filters button.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 700; }
.ws-count { flex: 1; color: var(--muted); font-size: 13px; }
.ws-board { display: grid; grid-template-columns: repeat(6, minmax(200px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.ws-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: grid; gap: 10px; min-height: 160px; align-content: start; }
.ws-col h3 { margin: 0 2px 2px; font-size: 13.5px; font-weight: 800; color: var(--ink); display: flex; justify-content: space-between; align-items: center; }
.ws-col h3 b { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; min-width: 24px; text-align: center; padding: 0 7px; }
.ws-col.ready { border-color: var(--gold-soft); background: linear-gradient(180deg, #fffaf0, var(--surface-2)); }
.ws-card { display: grid; gap: 4px; text-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; color: var(--text); box-shadow: var(--shadow-soft); }
.ws-card:hover { border-color: var(--gold); }
.ws-card strong { font-size: 14px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.ws-card span { font-size: 12px; color: var(--muted); }
.ws-card .ws-tag { color: var(--gold); font-weight: 700; }
.ws-cover { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; margin-bottom: 4px; background: var(--surface-2); }
.ws-post { max-width: 1280px; margin: 0 auto; }
.ws-post-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.ws-post-head > div { flex: 1; min-width: 200px; display: grid; }
.ws-post-head h2 { margin: 0; font-size: 20px; font-weight: 800; color: var(--ink); }
.ws-post-head span { font-size: 12.5px; color: var(--muted); }
.ws-stage { border-radius: 999px; padding: 4px 14px; font-size: 12.5px !important; font-weight: 700; border: 1px solid var(--line-strong); color: var(--muted) !important; background: var(--surface); }
.ws-stage.ready { color: var(--attention) !important; border-color: var(--attention); }
.ws-stage.done { color: var(--done) !important; border-color: var(--done); }
.ws-stage.published { color: #fff !important; background: var(--done); border-color: var(--done); }
.ws-post-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 22px; align-items: start; }
.ws-texts { display: grid; gap: 12px; min-width: 0; }
.ws-reader { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; min-height: 200px; }
.ws-aside { display: grid; gap: 4px; min-width: 0; }
.ws-aside section { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; display: grid; gap: 10px; }
.ws-aside section h3 { margin: 0; }
.ws-aside input[type=text], .ws-aside input[type=url], .ws-aside select { width: 100%; }
.ws-run, .ws-asset { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.ws-run > div, .ws-asset > div { flex: 1; min-width: 0; display: grid; }
.ws-run strong, .ws-asset strong { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-run span, .ws-asset span { font-size: 12px; color: var(--muted); }
.ws-asset .ws-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; }
.ws-asset audio { width: 150px; height: 32px; flex: none; }
.ws-media { margin: 0; display: grid; gap: 6px; }
.ws-media .ws-thumb { width: 100%; max-height: 520px; object-fit: contain; border-radius: 12px; background: #111; }
.ws-media audio { width: 100%; }
.ws-media figcaption { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 14px; }
.ws-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: grid; gap: 6px; }
.ws-tile .ws-thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.ws-tile audio { width: 100%; height: 34px; }
.ws-tile strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; }
.ws-tile span { font-size: 12px; color: var(--muted); }
.ws-file { font-size: 34px; text-align: center; padding: 14px 0; }
.ws-colours { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ws-colour > div { display: flex; gap: 6px; align-items: center; }
.ws-colour input[type=color] { width: 40px; height: 38px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); flex: none; }
.ws-colour input[type=text] { min-width: 0; width: 100%; }
@media (max-width: 1000px) { .ws-post-body { grid-template-columns: 1fr; } .ws-colours { grid-template-columns: 1fr 1fr; } }
.ws input[type=text], .ws input[type=url], .ws select, .ws textarea:not(.editor) { border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 14px; background: var(--surface); color: var(--text); outline: none; }
.ws input[type=text]:focus, .ws input[type=url]:focus, .ws select:focus, .ws textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176, 138, 69, .15); }
.ws input[type=file] { font: inherit; font-size: 13px; }

.ws-col.review { border-color: #f1d9a8; background: linear-gradient(180deg, #fff8ea, var(--surface-2)); }
.ws-stage.review { color: var(--attention) !important; border-color: var(--attention); }
.ws-stage.approved { color: var(--done) !important; border-color: var(--done); }
.ws-handed { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; }
.ws-handed summary { cursor: pointer; color: var(--muted); font-weight: 500; }
.ws-handed.failed { border-color: var(--error); } .ws-handed.failed summary { color: var(--error); font-weight: 700; }
.ws-handed > div { margin-top: 8px; line-height: 1.85; }
.ws-nums { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ws-nums input { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px; font: inherit; background: var(--surface); }
.ws button.yes { background: var(--done); border: 1px solid var(--done); color: #fff; border-radius: 10px; padding: 8px 16px; font-weight: 700; }

/* the projects tower */
.tag.floor-tag { background: rgba(22, 34, 59, .92); box-shadow: 0 6px 18px rgba(22, 30, 52, .28), inset 0 0 0 1px rgba(201, 163, 90, .55); }
.tag.floor-tag b { color: #fff; }
.tag.floor-tag span { display: inline; color: #ffd28a; font-size: 11px; }
.tag.floor-tag span:empty { display: none; }
.tag.floor-tag.quiet { background: rgba(60, 68, 86, .78); box-shadow: 0 4px 12px rgba(22, 30, 52, .2); }
.tag.floor-tag.quiet b { color: #d5dbe8; font-weight: 500; }
.tag.floor-tag.quiet i { background: #6b7385; box-shadow: none; }
.tag.floor-tag.cloning i { background: var(--attention); animation: pulse 1s infinite; }
.tag.floor-tag.error i { background: var(--error); }
.project-row.quiet { opacity: .82; }
.project-row.active { box-shadow: inset 3px 0 0 var(--done); }
.project-row.cloning { box-shadow: inset 3px 0 0 var(--attention); }
.project-row.error { box-shadow: inset 3px 0 0 var(--error); }
.project-row small { display: block; overflow-wrap: anywhere; }
.project-row small.bad { color: var(--error); }
.wizard h3 { margin: 0 0 4px; font-size: 17px; }
.wizard small { color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.wizard-done { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.wizard-done li { display: flex; gap: 8px; justify-content: space-between; }
.wizard-done b { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; text-align: end; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid rgba(22, 34, 59, .14); border-radius: 12px; cursor: pointer; }
.choice b { display: block; }
.choice small { display: block; }
.choice input[type=time], .setting input[type=time] { font: inherit; padding: 5px 8px; border-radius: 8px; border: 1px solid rgba(22, 34, 59, .2); }

.desk-main { position: relative; }
.desk-fresh { position: absolute; inset-inline: 0; bottom: 96px; margin: 0 auto; width: max-content; z-index: 2; border: 0; border-radius: 999px; padding: 7px 18px; font-size: 13px; font-weight: 700; color: #fff; background: var(--navy); box-shadow: 0 8px 22px rgba(22, 34, 59, .3); }
.desk-fresh[hidden] { display: none; }
.desk-scroll { overflow-anchor: none; }

/* folding the alerts, the view pad, filming */
.alerts-toggle { font-size: 12.5px; }
.alerts-toggle.urgent { border-color: #e9b3bf; color: #8f1f37; }
.alerts-toggle[hidden] { display: none; }
body.alerts-folded .alerts { display: none; }
.pad { position: fixed; left: 18px; bottom: 74px; z-index: 6; display: grid; grid-template-columns: repeat(2, 40px); gap: 6px; padding: 8px; border-radius: 16px; background: rgba(255, 255, 255, .86); box-shadow: 0 10px 28px rgba(22, 30, 52, .16); backdrop-filter: blur(8px); }
.pad button { height: 40px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); font-size: 18px; line-height: 1; }
.pad button:hover { border-color: var(--gold); }
.pad button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.pad button[data-pad=clean] { grid-column: 1 / -1; font-size: 14px; }
.org-mode .pad { display: none; }
body.clean .topbar, body.clean .views, body.clean .legend, body.clean .pad, body.clean .toast { display: none !important; }
@media (max-width: 820px) { .pad { grid-template-columns: repeat(4, 38px); bottom: 74px; left: 10px; } .pad button[data-pad=clean] { grid-column: auto; } }

.owners-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 12px; font-size: 12.5px; color: var(--muted); }
.owners-pick button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 3px 12px; font-size: 12.5px; color: var(--muted); }
.owners-pick button.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 700; }

/* the people of the office */
.tag.human-tag { background: rgba(255, 252, 244, .96); box-shadow: 0 6px 18px rgba(22, 30, 52, .2), inset 0 0 0 1.5px rgba(201, 163, 90, .8); padding: 3px 10px 3px 4px; gap: 6px; }
.tag.human-tag i { display: none; }
.tag.human-tag img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: #c9a35a; flex: none; }
.tag.human-tag:not(.pictured) img { display: none; }
.tag.human-tag:not(.pictured) { padding: 3px 10px; }
.tag.human-tag span { display: inline; font-size: 13px; font-weight: 700; color: var(--ink); }
.tag.human-tag b { display: none; }
.tag.human-tag.away { opacity: .62; }
.tag.human-tag.here { box-shadow: 0 6px 18px rgba(22, 30, 52, .2), inset 0 0 0 1.5px var(--done); }
.person-photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: block; margin: 4px auto 12px; box-shadow: 0 0 0 3px rgba(201, 163, 90, .6); }

/* a person other than the owner on the 3D page */
.to-app { display: none; text-decoration: none; padding: 7px 14px; border-radius: 10px; border: 1px solid var(--line-strong); color: var(--ink); font-size: 13.5px; }
body.guest .to-app { display: inline-block; }
body.guest #admin, body.guest #studio, body.guest .org-hire { display: none; }

.task-row.done { opacity: .8; }
.task-row.late { box-shadow: inset 3px 0 0 var(--error); }
.task-row.asked { box-shadow: inset 3px 0 0 var(--attention); }
.task-row small.bad { color: var(--attention); display: block; }
.task-row details { font-size: 13px; }
.task-row summary { cursor: pointer; color: var(--gold); font-weight: 700; }

.task-say { margin: 8px 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.task-say.giver { background: rgba(176, 138, 69, .1); }
.task-say small { color: var(--muted); font-size: 11.5px; }
.task-say p { margin: 2px 0 0; white-space: pre-wrap; }
.task-say img { display: block; max-width: 100%; border-radius: 8px; margin-top: 6px; }
.task-row .controls input[type=text] { flex: 1; min-width: 0; }

/* tasks in the panel */
#tasks-btn[hidden] { display: none; }
#tasks-btn.hot { border-color: var(--gold); color: var(--ink); font-weight: 700; box-shadow: inset 0 0 0 1px rgba(176, 138, 69, .5); }
.task-line { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; margin-bottom: 6px; color: var(--text); }
.task-line:hover { border-color: var(--gold); }
.task-line i { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 700; color: #fff; background: var(--navy); }
.task-line.asked i { background: var(--attention); } .task-line.done i { background: var(--done); } .task-line.late i { background: var(--error); }
.task-line.done { opacity: .78; }
.task-line div { min-width: 0; display: grid; gap: 2px; }
.task-line strong { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.task-line span { font-size: 12px; color: var(--muted); }
.task-ask { border-radius: 12px; padding: 12px 14px; margin: 10px 0 14px; background: rgba(176, 138, 69, .1); box-shadow: inset 3px 0 0 var(--gold); }
.task-ask.late { box-shadow: inset 3px 0 0 var(--error); }
.task-ask p { margin: 4px 0 0; font-size: 15px; line-height: 1.8; white-space: pre-wrap; }
.task-ask small { color: var(--muted); font-size: 11.5px; }
.task-say.me { background: var(--surface); border: 1px solid var(--line); margin-inline-end: 28px; }
.task-say.them { background: rgba(176, 138, 69, .1); margin-inline-start: 28px; }
.task-say img { max-height: 320px; object-fit: contain; background: #fff; }
.task-write { margin-top: 12px; }
.task-write > small { color: var(--muted); font-size: 12px; }
.task-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.task-thumbs:empty { display: none; }
.task-thumbs button { padding: 0; width: 64px; height: 64px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: none; }
.task-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

#tower-btn[hidden], .views button[hidden] { display: none; }
