/* The office is drawn as an architect's floor plan: bottle-green walls on a pale floor. One accent
   (violet) is reserved for live conversation, amber for someone working. Everything else is quiet. */
@font-face {
  font-family: "Bricolage Grotesque"; src: url("fonts/bricolage.woff2") format("woff2");
  font-weight: 300 800; font-stretch: 75% 100%; font-display: swap;
}
:root {
  --floor: #e7ede9; --room: #f8faf7; --wall: #25403b; --ink: #16211f; --muted: #5d6e6a;
  --line: #c9d5d0; --live: #6a4cff; --work: #d99200; --ok: #1e9e6a; --bad: #cf4338; --on-live: #ffffff;
  --panel: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --floor: #0e1917; --room: #16231f; --wall: #a6c2ba; --ink: #e6eeeb; --muted: #8ea39d;
    --line: #2a3b37; --live: #a08cff; --work: #f0b340; --ok: #4cc893; --bad: #f0776c; --on-live: #14102e;
    --panel: #121d1b;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--floor); color: var(--ink); overflow: hidden;
  font: 400 15px/1.45 "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  display: flex; flex-direction: column;
}
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--live); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; border-radius: 9px; padding: 8px 12px; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea {
  background: var(--room); border: 1.5px solid var(--line); border-radius: 9px; padding: 8px 11px; min-width: 0; width: 100%;
}
textarea { resize: none; }
code, pre { font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre { background: var(--floor); padding: 8px 10px; border-radius: 8px; white-space: pre-wrap; word-break: break-word; margin: 6px 0; }
ul.plain, ol { list-style: none; margin: 0; padding: 0; }
.primary { background: var(--wall); color: var(--room); font-weight: 600; }
.quiet { border: 1.5px solid var(--line); }
.danger { color: var(--bad); border: 1.5px solid var(--bad); }
.hint { color: var(--muted); font-size: 13.5px; margin: 0 0 8px; }
.big { font-size: 22px; font-weight: 700; margin: 0 0 6px; }

#bar { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 2px solid var(--wall); background: var(--room); }
#title { font-size: 19px; font-weight: 750; font-stretch: 85%; letter-spacing: -.01em; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#project { width: auto; max-width: 34vw; padding: 5px 8px; }
.seg { display: flex; border: 1.5px solid var(--wall); border-radius: 9px; overflow: hidden; flex: none; }
.seg button { border-radius: 0; padding: 5px 11px; font-size: 13.5px; }
.seg button.on { background: var(--wall); color: var(--room); }
.pill { font-size: 13.5px; padding: 5px 11px; border: 1.5px solid var(--line); border-radius: 999px; flex: none; }
.pill.frozen { background: var(--live); color: var(--on-live); border-color: var(--live); }
#gate { padding: 40px 20px; max-width: 520px; margin: 0 auto; }

#app { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 400px; }
#stage { position: relative; min-width: 0; min-height: 0; padding: 12px; display: flex; }
#scene { width: 100%; height: 100%; display: block; }
#legend { position: absolute; left: 20px; bottom: 14px; margin: 0; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.key { width: 14px; height: 4px; border-radius: 2px; display: inline-block; margin-left: 8px; }
.key.live { background: var(--live); } .key.work { background: var(--work); } .key.off { background: var(--muted); opacity: .45; }

/* scene */
.room rect { fill: var(--room); stroke: var(--wall); stroke-width: 5; }
.room .door { stroke: var(--room); stroke-width: 7; }
.room .swing { fill: none; stroke: var(--wall); stroke-width: 1.2; opacity: .55; }
.room text { fill: var(--wall); font-weight: 750; font-stretch: 80%; font-size: 19px; letter-spacing: -.01em; }
.room .sub { font-weight: 400; font-stretch: 100%; font-size: 12.5px; fill: var(--muted); letter-spacing: 0; }
.room .table { fill: var(--floor); stroke: var(--wall); stroke-width: 1.5; }
.room.pick { cursor: pointer; }
#rooms, #orglines { transition: opacity .45s; }
.org #rooms { opacity: 0; pointer-events: none; }
#orglines { opacity: 0; } .org #orglines { opacity: 1; }
#orglines path { fill: none; stroke: var(--wall); stroke-width: 1.5; opacity: .5; }
.node { cursor: pointer; transition: transform .6s cubic-bezier(.3, .8, .3, 1); }
.node text { font-size: 13px; font-weight: 600; fill: var(--ink); text-anchor: middle; }
.node .role { font-size: 11px; font-weight: 400; fill: var(--muted); }
.node .ring { fill: none; stroke: transparent; stroke-width: 3; }
.node.sel .ring { stroke: var(--wall); }
.node.working .ring { stroke: var(--work); animation: pulse 1.6s ease-in-out infinite; }
.node.off .face { opacity: .38; filter: grayscale(1); }
.node .dot { fill: var(--ok); stroke: var(--room); stroke-width: 2; }
.wire { fill: none; stroke: var(--live); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 2 9; animation: flow .7s linear infinite; }
.spark { fill: var(--live); }
@keyframes flow { to { stroke-dashoffset: -11; } }
@keyframes pulse { 50% { stroke-opacity: .25; } }
@media (prefers-reduced-motion: reduce) {
  .wire, .node.working .ring { animation: none; } .node, #rooms, #orglines { transition: none; } .spark { display: none; }
}

/* panel */
#panel { background: var(--panel); border-left: 2px solid var(--wall); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
#tabs { display: flex; border-bottom: 1.5px solid var(--line); flex: none; }
#tabs button { flex: 1; border-radius: 0; padding: 11px 2px; font-size: 14px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
#tabs button.on { color: var(--ink); border-bottom-color: var(--wall); }
#badge { background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 6px; margin-left: 5px; }
#panel > section { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px; }
#talk { display: flex; flex-direction: column; }
#who { display: flex; align-items: flex-start; gap: 10px; padding-bottom: 10px; border-bottom: 1.5px solid var(--line); margin-bottom: 10px; flex: none; }
#who svg { width: 44px; height: 44px; flex: none; }
#who .name { font-weight: 700; font-size: 17px; line-height: 1.2; }
#who .sub { font-size: 13px; color: var(--muted); }
#who .persona { font-style: italic; margin-top: 3px; }
#who .grow { flex: 1; min-width: 0; }
#messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding-bottom: 8px; min-height: 60px; }
#messages li { max-width: 90%; padding: 7px 11px; border-radius: 12px; background: var(--floor); white-space: pre-wrap; word-break: break-word; }
#messages li.mine { align-self: flex-end; }
#messages li.aside { align-self: stretch; max-width: 100%; background: none; border: 1.5px dashed var(--line); color: var(--muted); font-size: 13.5px; }
#messages .from { display: block; font-size: 12px; font-weight: 700; margin-bottom: 1px; }
#messages time { display: block; font-size: 11px; opacity: .65; margin-top: 2px; }
#composer { display: flex; gap: 8px; align-items: flex-end; flex: none; padding-top: 8px; }
#composer textarea { max-height: 130px; }
#meeting-form { display: grid; gap: 8px; flex: none; padding: 8px 0; border-top: 1.5px solid var(--line); }
#attendees { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: 13.5px; }
.chip.on { background: var(--wall); color: var(--room); border-color: var(--wall); }
.chip:disabled { text-decoration: line-through; }

.card { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: var(--room); }
.card .name { font-weight: 650; }
.card .sub { font-size: 13px; color: var(--muted); }
.card.pick { cursor: pointer; }
.actions { display: flex; gap: 8px; margin-top: 8px; }
.actions button { flex: 1; padding: 6px 10px; }
.col h2 { font-size: 15px; font-weight: 700; margin: 14px 0 6px; display: flex; justify-content: space-between; }
.col h2 span { color: var(--muted); font-weight: 400; }
.col.blocked h2 { color: var(--bad); }
#new-task { border-top: 1.5px solid var(--line); margin-top: 12px; padding-top: 10px; }
#new-task summary { cursor: pointer; font-weight: 650; }
#task-form { display: grid; gap: 7px; margin-top: 8px; }
#mem-form { margin-bottom: 10px; }
#profile-form { display: grid; gap: 10px; }
#profile-form label { display: grid; gap: 3px; font-size: 13px; color: var(--muted); }
#profile-form label > input, #profile-form label > select, #profile-form label > textarea { color: var(--ink); font-size: 15px; }
#profile-form .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#profile-form .head { display: flex; gap: 12px; align-items: center; }
#profile-form .head svg { width: 84px; height: 84px; flex: none; }
#profile-form .swatches { display: flex; flex-wrap: wrap; gap: 5px; }
#profile-form .swatch { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid var(--line); font-size: 11px; }
#profile-form .swatch.word { width: auto; padding: 0 9px; border-radius: 999px; color: var(--ink); }
#profile-form .swatch.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--ink); }
#profile-form h3 { font-size: 15px; margin: 6px 0 0; }
#profile-form .facts { font-size: 13px; color: var(--muted); margin: 0; }
#note h3 { margin: 8px 0 2px; }
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--floor);
  padding: 8px 14px; border-radius: 999px; font-size: 13.5px; max-width: 90vw; z-index: 5;
}

@media (max-width: 860px) {
  body { overflow: auto; }
  #app { display: block; }
  #stage { padding: 8px; }
  #scene { height: auto; }
  #legend { position: static; padding: 6px 4px 0; }
  #panel { border-left: 0; border-top: 2px solid var(--wall); min-height: 60vh; }
  #panel > section { overflow: visible; }
  #messages { max-height: 55vh; }
  #title { font-size: 17px; }
  #project { max-width: 28vw; }
}
