/* Wilwatikta dashboard. Two settings of one palette taken from the Yogyakarta kraton:
   day is lime-wash white with kraton green; night is the same green gone deep, lit with lantern gold. */
:root, :root[data-theme="day"] {
  --panel: rgba(251, 251, 246, .95); --ink: #14271f; --muted: #56655c; --line: #d3d8ca; --field: #ffffff;
  --accent: #0f5b46; --accent-ink: #ffffff; --gold: #8f6710; --ok: #18793f; --warn: #9a5f00; --bad: #b3372a;
  --term-bg: #10231c; --term-ink: #dfe9df; --shadow: 0 10px 34px rgba(31, 42, 30, .22); --page: #e8dcc4;
  color-scheme: light;
}
:root[data-theme="night"] {
  --panel: rgba(12, 36, 29, .95); --ink: #f2efe2; --muted: #a6b6aa; --line: #2c5446; --field: #0a1f19;
  --accent: #e3b64d; --accent-ink: #10231c; --gold: #e3b64d; --ok: #5fd68a; --warn: #f0b34a; --bad: #f27a68;
  --term-bg: #071712; --term-ink: #d9e6da; --shadow: 0 12px 38px rgba(0, 0, 0, .5); --page: #151a30;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--page); color: var(--ink); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#scene:active { cursor: grabbing; }
#scene:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
h1, h2, .brand { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; }
h1, h2 { color: var(--ink); margin: 0 0 8px; font-weight: 600; }
h2 { font-size: 17px; line-height: 1.25; }
.muted { color: var(--muted); font-weight: normal; font-size: 12.5px; }
.error { color: var(--bad); min-height: 1.2em; margin: 6px 0 0; }

button { font: inherit; font-weight: 600; color: var(--accent-ink); background: var(--accent); border: 1px solid transparent; border-radius: 9px; padding: 7px 13px; cursor: pointer; transition: transform .12s ease, background-color .2s ease, border-color .2s ease, color .2s ease; }
button:hover { filter: brightness(1.08); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: default; transform: none; }
button.quiet { background: transparent; color: var(--ink); border-color: var(--line); font-weight: 500; }
button.quiet:hover { border-color: var(--accent); filter: none; }
button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--ink); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, li[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select, textarea { font: inherit; width: 100%; color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; margin-top: 3px; }
label { display: block; margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }

.topbar { position: fixed; z-index: 30; top: 10px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 12px 8px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.brand { color: var(--accent); font-size: 21px; font-weight: 700; letter-spacing: .01em; margin-right: 4px; }
:root[data-theme="day"] .brand { color: var(--accent); }
.seats { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.chip.working { border-color: var(--ok); } .chip.working::before { background: var(--ok); }
.chip.resting { border-color: var(--warn); } .chip.resting::before { background: var(--warn); }

.panel { position: fixed; top: calc(var(--topbar-h, 56px) + 22px); bottom: 58px; width: min(340px, 42vw); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; overflow: auto; box-shadow: var(--shadow); }
.panel.left { left: 12px; }
.panel.right { right: 12px; width: min(540px, 50vw); display: flex; flex-direction: column; animation: slide-in .28s cubic-bezier(.2, .8, .2, 1); }
.panel.right[hidden] { display: none; }
@keyframes slide-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.close { position: absolute; top: 10px; right: 10px; padding: 2px 9px; }
#detail-title { padding-right: 40px; }
.list { list-style: none; margin: 0 0 18px; padding: 0; }
.list li { padding: 8px 9px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; overflow-wrap: anywhere; transition: background-color .15s ease, border-color .15s ease; }
.list li:hover { border-color: var(--line); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.list li.empty { cursor: default; color: var(--muted); }
.list li.empty:hover { background: none; border-color: transparent; }
.status { display: inline-flex; align-items: center; gap: 6px; min-width: 84px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.status.running { color: var(--ok); } .status.queued, .status.waiting { color: var(--warn); } .status.failed, .status.interrupted { color: var(--bad); }
.status.running::before { animation: beat 1.6s ease-in-out infinite; }
@keyframes beat { 50% { transform: scale(1.5); opacity: .55; } }
.terminal { flex: 1; min-height: 160px; margin: 8px 0 0; padding: 12px; background: var(--term-bg); border: 1px solid var(--line); border-radius: 10px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--term-ink); }
.terminal .cmd { color: #e9c466; } .terminal .say { color: #f4f1e6; } .terminal .err { color: #ff9a8a; } .terminal .mark { color: #8fa598; }
#detail-actions { display: flex; gap: 8px; }
dialog { width: min(580px, 92vw); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
dialog[open] { animation: rise .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: rgba(8, 20, 16, .55); }
.row { display: flex; gap: 10px; } .row > * { flex: 1; } .row.end { justify-content: flex-end; } .row.end > * { flex: 0 0 auto; }
.login-page { display: grid; place-items: center; }
.login-card { width: min(360px, 92vw); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }
.login-card button { width: 100%; margin-top: 6px; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); vertical-align: baseline; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.list li.health { cursor: default; padding: 5px 9px; }
.list li.health:hover { border-color: transparent; background: none; }
label.inline { display: flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; }
label.inline select { width: auto; margin: 0; padding: 5px 8px; }
#tabs { display: flex; gap: 4px; margin-top: 10px; border-bottom: 1px solid var(--line); }
#tabs button { background: transparent; color: var(--muted); border-radius: 8px 8px 0 0; padding: 6px 12px; font-weight: 500; }
#tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.list li.approval.pending { border-color: var(--warn); }
.list li.approval .row { margin-top: 6px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
label.check input { width: auto; margin: 0; }

/* The message box takes the full width; mode, attach and send sit on the line under it, so a narrow panel never squeezes the box. */
.chat { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.chat textarea { flex: 1 1 100%; order: -1; margin: 0; min-height: 3.2em; resize: vertical; }
.chat button[type=submit] { margin-left: auto; }
.chat[hidden] { display: none; }
/* Files attached to a message that is not sent yet. */
.attached { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.attached:empty { display: none; }
.attached .file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 4px 2px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; overflow-wrap: anywhere; }
.attached .file button { padding: 0 6px; min-width: 0; border: 0; background: none; color: inherit; cursor: pointer; font-size: 1.1em; line-height: 1; }
textarea.dropping { outline: 2px dashed var(--accent); outline-offset: 2px; }

.gate-banner { position: fixed; z-index: 20; left: 50%; top: calc(var(--topbar-h, 56px) + 20px); transform: translateX(-50%); width: min(760px, 94vw); background: var(--panel); border: 2px solid var(--warn); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); animation: drop .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translateX(-50%); } }
.gate-banner[hidden] { display: none; }
.gate-banner code { display: block; margin: 6px 0; padding: 8px 10px; background: var(--term-bg); color: var(--term-ink); border-radius: 8px; font: 12.5px/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 9em; overflow: auto; }

/* Camera and light controls, and what the floor rings mean. */
.viewbar { position: fixed; z-index: 15; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; padding: 6px 8px; max-width: calc(100vw - 24px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.viewbar button { padding: 5px 10px; }
.viewbar .legend { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0 8px; font-size: 12.5px; color: var(--muted); }
.viewbar .legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.viewbar .legend i { width: 9px; height: 9px; border-radius: 50%; }
.legend .working { background: var(--ok); } .legend .queued { background: #d9b23c; } .legend .resting { background: var(--warn); } .legend .denied { background: var(--bad); }
#room-name { font-size: 12.5px; color: var(--muted); padding: 0 6px; }
#room-name:empty { display: none; }
.tip { position: fixed; z-index: 40; pointer-events: none; max-width: 300px; padding: 8px 11px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); font-size: 12.5px; }
.tip[hidden] { display: none; }
.tip strong { display: block; font-size: 14px; }
.tip .muted { display: block; }

@media (max-width: 760px) { .panel.left { display: none; } .panel.right { left: 12px; width: auto; } .viewbar .legend { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
