/* SEVEN black & white: colour only for status; the charm is in the motion */
:root {
  /* SEVEN HOUSE tokens */
  --bg: #000000; --fg: #fafafa; --muted: #adaaaa; --line: #333; --panel: #0f0f0f; --raised: #141414; --table: #141414;
  --green: #3ecf6e; --amber: #e8b93a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
body { min-height: 100vh; overflow-x: hidden; }
button, input, select { font: inherit; color: inherit; }
button { background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; transition: border-color .2s, background .2s; }
button:hover { border-color: #777; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
button.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); font-weight: 600; }
button.primary:hover { background: var(--fg); filter: brightness(.92); }
a { color: var(--fg); }
.muted { color: var(--muted); }
.err { color: var(--amber); min-height: 1.4em; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.top h1 { margin: 0; display: flex; align-items: center; gap: 14px; font-size: 13px; font-weight: 400; }
.top h1 .logo { display: block; width: 170px; height: auto; } /* official wordmark, shown unaltered */
.top h1 span { color: var(--muted); letter-spacing: .2em; text-transform: uppercase; }
.pill { border-color: var(--amber); color: var(--amber); font-size: 12px; padding: 4px 12px; animation: pulse-pill 2s ease-in-out infinite; }
@keyframes pulse-pill { 50% { opacity: .6; } }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.conn { font-size: 12px; color: var(--muted); }
.conn.bad { color: var(--amber); }
.break { position: relative; }
.break-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: flex; flex-direction: column; gap: 4px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; min-width: 130px; }
.break-menu button { border: 0; border-radius: 8px; text-align: left; }
.break-menu button:hover { background: var(--raised); }
#break-btn.on { border-color: var(--amber); color: var(--amber); }

main { max-width: 1100px; margin: 0 auto; padding: 24px; }
.panel { max-width: 560px; margin: 8vh auto; padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.panel h2 { margin-top: 0; font-weight: 600; }

/* the room */
.room { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--bg); }
.wall { display: flex; align-items: flex-start; gap: 16px; padding: 16px; border-bottom: 1px solid #1d1d1d; background: linear-gradient(var(--panel), var(--bg)); }
.board { flex: none; width: 180px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 12px; color: var(--muted); background: #0a0a0a; display: flex; flex-direction: column; gap: 2px; }
.board b { color: var(--fg); font-weight: 600; }
.floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 28px 16px; padding: 28px 20px 32px; }

/* project whiteboard: white marker on a black board */
.marker { margin: 0 0 10px; font: 400 22px/1.1 "Marker Felt", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; color: var(--fg); letter-spacing: .02em; text-transform: none; }
.whiteboard { flex: 1; min-width: 0; padding: 14px 16px 16px; border: 2px solid #3a3a3a; border-radius: 10px; background: #0a0a0a; box-shadow: inset 0 0 0 4px #000, inset 0 0 0 5px #222; }
.wb-note { margin: 0; color: var(--muted); font-size: 13px; }
.wb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.wb-proj { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px dashed #333; border-radius: 8px; text-decoration: none; color: var(--fg); transition: border-color .2s, transform .2s; }
.wb-proj:hover { border-color: #777; transform: translateY(-2px); }
.wb-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.wb-head b { font: 400 17px/1.2 "Marker Felt", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; margin-right: auto; overflow-wrap: anywhere; }
.wb-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wb-over { font-size: 12px; color: var(--amber); }
.wb-bar { position: relative; height: 6px; border: 1px solid #555; border-radius: 4px; overflow: hidden; }
.wb-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--pct); background: var(--fg); transition: width .8s ease-out; }
.wb-recent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.wb-recent li { display: flex; gap: 6px; min-width: 0; }
.wb-recent .task { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ini { flex: none; min-width: 24px; padding: 0 4px; border: 1px solid #444; border-radius: 8px; text-align: center; font-size: 10px; line-height: 16px; color: var(--fg); }

/* robot corner: opposite side of the room */
.corner { padding: 16px 20px 24px; border-top: 1px solid #1d1d1d; background: linear-gradient(var(--bg), var(--panel)); }
.robots { display: flex; gap: 32px; flex-wrap: wrap; justify-content: center; }
.robot { display: flex; flex-direction: column; align-items: center; width: 190px; padding: 8px 6px 10px; border: 1px solid transparent; border-radius: 12px; font-size: 12px; }
.robot:hover { border-color: var(--line); }
.bot { position: relative; width: 46px; height: 34px; margin-top: 18px; border: 2px solid var(--fg); border-radius: 10px; background: var(--raised); transition: transform .6s cubic-bezier(.34, 1.56, .64, 1); transform-origin: bottom center; }
.antenna { position: absolute; left: 50%; top: -16px; width: 2px; height: 14px; margin-left: -1px; background: var(--fg); }
.antenna::after { content: ""; position: absolute; left: -4px; top: -8px; width: 10px; height: 10px; border-radius: 50%; background: #2a2a2a; transition: background .4s; }
.eyes, .eyes::after { position: absolute; top: 11px; left: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--fg); }
.eyes::after { content: ""; top: 0; left: 15px; }
.monitor { display: flex; align-items: center; justify-content: center; width: 170px; min-height: 52px; margin-top: 6px; padding: 6px 8px; border: 2px solid #444; border-radius: 6px; background: #050505; transition: opacity .4s, border-color .4s; }
.screen { font: 12px/1.3 ui-monospace, Menlo, monospace; color: var(--fg); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.rtbl { width: 180px; height: 10px; margin-top: 2px; background: var(--table); border: 1px solid var(--line); border-radius: 4px; }
.robot .name { margin-top: 6px; }
.robot .tag { white-space: normal; max-width: 100%; }
.r-working .antenna::after { background: var(--green); animation: beacon 1.6s ease-in-out infinite; }
.r-working .eyes, .r-working .eyes::after { animation: blink 4s infinite; }
.r-working .monitor { border-color: #777; }
.r-working .screen::after { content: "▍"; animation: caret 1s steps(1) infinite; }
.r-working .tag { border-color: #2b5a3a; }
.r-idle .bot { transform: rotate(-12deg) translate(-4px, 2px); } /* leaning back */
.r-idle .monitor, .r-soon .monitor { opacity: .35; }
.r-soon .bot { opacity: .5; }
.r-waiting_approval .antenna::after, .r-waiting_capacity .antenna::after { background: var(--amber); }
.r-waiting_approval .monitor, .r-waiting_capacity .monitor { border-color: var(--amber); }
.r-waiting_approval .screen, .r-waiting_capacity .screen { color: var(--amber); }
.r-waiting_approval .tag, .r-waiting_capacity .tag { border-color: #6b5520; color: var(--amber); }
@keyframes beacon { 50% { box-shadow: 0 0 12px 4px rgba(62, 207, 110, .55); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes caret { 50% { opacity: 0; } }
.jobs { list-style: none; padding: 0; margin: 12px 0 18px; text-align: left; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.jobs li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding-bottom: 8px; border-bottom: 1px solid #1f1f1f; }
.jobs .when { color: var(--muted); font-variant-numeric: tabular-nums; }
.jobs .st-waiting_approval, .jobs .st-waiting_capacity { color: var(--amber); }
.jobs .job { grid-column: 1 / -1; overflow-wrap: anywhere; }

.desk { position: relative; text-align: center; font-size: 12px; padding-top: 6px; transition: opacity .4s; }
.desk.me .tbl { border-color: #777; box-shadow: 0 0 0 1px #777; }
.seat { height: 50px; display: flex; align-items: flex-end; justify-content: center; }
.p { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px;
  background: var(--fg); color: var(--bg); position: relative; z-index: 2; margin-bottom: -6px;
  transition: transform .6s cubic-bezier(.34, 1.56, .64, 1), opacity .4s, box-shadow .4s, background .4s; }
.tbl { position: relative; width: 104px; height: 28px; margin: 0 auto; background: var(--table); border: 1px solid var(--line); border-radius: 6px; }
.lamp { position: absolute; top: -5px; right: 12px; width: 10px; height: 10px; border-radius: 50%; background: #2a2a2a; transition: background .5s, box-shadow .5s; }
.cup { position: absolute; right: 30px; top: -12px; width: 12px; height: 12px; border: 1px solid #bbb; border-top: 0; border-radius: 0 0 4px 4px; opacity: 0; transform: translateY(4px); transition: opacity .4s, transform .4s; }
.cup::after { content: ""; position: absolute; right: -5px; top: 2px; width: 4px; height: 5px; border: 1px solid #bbb; border-left: 0; border-radius: 0 3px 3px 0; }
.steam, .steam::before { position: absolute; bottom: 14px; left: 3px; width: 2px; height: 8px; border-radius: 2px; background: #888; opacity: 0; }
.steam::before { content: ""; left: 4px; bottom: 0; }
.tag { display: inline-block; margin-top: 10px; padding: 1px 8px; border: 1px solid #444; border-radius: 10px; color: var(--muted); white-space: nowrap; }
.name { margin-top: 4px; font-size: 13px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name small { color: var(--muted); font-size: 11px; margin-left: 4px; }
.you { color: var(--muted); font-size: 11px; }
.acts { display: flex; gap: 6px; justify-content: center; margin-top: 8px; min-height: 28px; }
.acts button { padding: 2px 10px; font-size: 12px; }

/* selfie: greyscale (colour is for status only), colour on hover/focus */
.p img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; filter: grayscale(1); transition: filter .3s; }
.desk:hover .p img, .desk:focus-within .p img { filter: none; }
.p.has-photo { background: var(--raised); }
.btn { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.btn:hover { border-color: var(--fg); }
#photo-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
#photo-file:focus-visible + .btn { outline: 2px solid var(--fg); outline-offset: 2px; }
.photo-view { display: block; width: 256px; max-width: 100%; aspect-ratio: 1; object-fit: cover; margin: 12px auto; border-radius: 50%; background: var(--raised); border: 1px solid var(--line); }

/* states */
.s-at_desk .p { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--green); animation: bob 2.4s ease-in-out infinite; }
.s-at_desk .lamp { background: var(--fg); animation: glow 2.2s ease-in-out infinite; }
.s-at_desk .tag { border-color: #2b5a3a; }
.s-away .p, .s-no_permission .p { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--amber); }
.s-away .tag, .s-no_permission .tag, .s-break .tag { border-color: #6b5520; color: var(--amber); }
.s-break .p { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--amber); transform: translate(-22px, -8px); } /* stood up, beside the desk */
.s-break .cup { opacity: 1; transform: none; }
.s-break .steam, .s-break .steam::before { animation: steam 2s ease-out infinite; }
.s-break .steam::before { animation-delay: .7s; }
.s-gone .p, .s-not_in .p, .s-off .p { background: transparent; color: #555; border: 1px dashed #555; box-shadow: none; transform: translateY(6px) scale(.9); }
.s-off { opacity: .45; }

@keyframes bob { 50% { transform: translateY(-3px); } }
@keyframes glow { 50% { box-shadow: 0 0 14px 4px rgba(255, 255, 255, .35); } }
@keyframes steam { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: .7; } 100% { opacity: 0; transform: translateY(-10px) scaleX(1.6); } }

/* confetti on a merged PR */
.confetti { position: absolute; left: 50%; top: 20px; width: 6px; height: 10px; pointer-events: none; z-index: 5; background: var(--c);
  animation: pop 1.4s cubic-bezier(.2, .7, .4, 1) forwards; }
@keyframes pop { to { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }

/* modals */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .78); animation: fade .25s ease-out; }
.card { width: min(440px, 100%); text-align: center; padding: 34px 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; animation: rise .35s cubic-bezier(.34, 1.56, .64, 1); }
.card h2 { margin: 12px 0 6px; font-size: 26px; font-weight: 600; }
.card .row { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
button.big { font-size: 20px; padding: 14px 40px; margin-top: 14px; }
.count { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 18px; margin: 14px 0 0; }
.pulse { width: 18px; height: 18px; margin: 0 auto; border-radius: 50%; background: var(--green); animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(62, 207, 110, .6); } 100% { box-shadow: 0 0 0 22px rgba(62, 207, 110, 0); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px) scale(.96); opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: calc(100% - 32px); padding: 10px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; animation: fade .25s; }

/* call overlay (public/call.js) */
.call-overlay { position: fixed; inset: 0; z-index: 99; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; }
.call-overlay video { background: var(--raised); border: 1px solid var(--line); border-radius: 14px; }
#call-remote { max-width: 100%; width: 860px; max-height: 70vh; }
#call-local { width: 160px; }
.announce-note { margin: 12px 16px 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); color: var(--muted); font-size: 13px; }
.announce-stage h2 { margin: 0; font-size: 20px; font-weight: 600; }
.announce-stage video { max-width: 100%; width: 860px; max-height: 60vh; }
.an-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 860px; }
.an-list li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); font-size: 13px; }
.an-list li.hand { border-color: var(--amber); }
.an-invite { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--amber); border-radius: 10px; background: var(--raised); }
.an-invite p { margin: 0; }
.an-hand[aria-pressed="true"] { border-color: var(--amber); color: var(--amber); }
.an-end, #call-hangup { border-color: var(--fg); background: var(--fg); color: var(--bg); font-weight: 600; padding: 10px 28px; }

/* admin */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border-bottom: 1px solid #1f1f1f; padding: 8px 6px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
td input, td select, .form input, .form select { width: 100%; min-width: 80px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; }
.scroll { overflow-x: auto; }
.form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.form input, .form select { width: auto; }
section h2 { font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 32px 0 8px; }
.small { font-size: 11px; color: var(--muted); }

@media (max-width: 600px) {
  .top h1 .logo { width: 140px; }
  .top, main { padding-left: 16px; padding-right: 16px; }
  .floor { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 20px 8px; }
  .wall { flex-direction: column; align-items: stretch; }
  .board { width: 100%; }
  .wb-list { grid-template-columns: minmax(0, 1fr); }
  .robots { gap: 8px; }
  .robot { width: calc(50% - 4px); }
  .monitor, .rtbl { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .confetti { display: none; }
}
