/* Runtime states and responsive layouts over the supplied look B tiles. */
:root { --danger: #ef817b; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, select { cursor: pointer; }
button:hover, a:hover { filter: brightness(1.13); }
button:disabled { opacity: .5; cursor: wait; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
input, textarea, select { font: inherit; color: var(--ink); border: 0; border-radius: 0; background: var(--term); padding: 9px 12px; min-width: 0; caret-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; min-height: 88px; }
input, select, button { min-height: 32px; }
.signin { width: min(480px, calc(100% - 32px)); margin: 18vh auto; padding: 28px; background: var(--surface); }
.signin h1 { font-size: 32px; line-height: 1.2; margin-bottom: 24px; }
.signin form { display: flex; gap: 6px; }
.signin input { flex: 1; width: 100px; }
.signin .message { margin-top: 16px; }
.ws .mark { font-size: 24px; font-weight: 800; color: var(--bg); }
.navs a { min-height: 36px; height: auto; padding-top: 6px; padding-bottom: 6px; overflow-wrap: anywhere; }
.navs.fill { overflow: auto; }
.navs .logout { text-align: left; padding: 8px 10px; color: var(--muted); }
.head { align-items: center; padding: 16px 20px; gap: 16px; min-height: 72px; height: auto; }
.head .right { margin: 0 0 0 auto; align-self: center; }
.head h1 { font-size: 30px; line-height: 34px; }
#content { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; position: relative; }
.queue { overflow: auto; display: block; background: var(--bg); }
.queue .item { margin-bottom: 4px; }
.queue h2 { font-size: 13px; font-weight: 500; color: var(--muted); padding: 18px 20px 10px; background: var(--surface); }
.item .top { flex-wrap: wrap; gap: 8px 14px; }
.item h3 { flex: 1; }
.item .top .meta { flex-wrap: wrap; gap: 8px; }
.item .q { white-space: pre-wrap; overflow-wrap: anywhere; }
.item .opts { flex-wrap: wrap; }
.reply-form { display: flex; flex: 1; min-width: 200px; gap: 6px; }
.reply-form input { flex: 1; width: 100px; }
.item.sel .reply-form button { background: var(--bg); color: var(--accent); }
.opt { height: auto; min-height: 36px; padding: 8px 14px; }
.message { padding: 20px; background: var(--surface); overflow-wrap: anywhere; }
.message button { margin-left: 14px; text-decoration: underline; }
.error { color: var(--danger); }
#connection-state { padding: 8px 20px; background: var(--surface); color: var(--flag); }
.task-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); }
.task-meta .branch { overflow-wrap: anywhere; }
.status-dot { display: inline-block; width: 8px; height: 8px; flex: none; background: var(--wait); border-radius: 50%; }
.status-dot.ask { background: var(--danger); }
.status-dot.review { background: var(--accent); }
.status-dot.ready { background: var(--ok); }
.status-dot.pending { background: none; border: 2px solid var(--wait); border-top-color: var(--ink); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.card .ct { display: flex; align-items: baseline; gap: 8px; }
.card .ct a { flex: 1; }
.card .ct .status-dot { align-self: center; }
.card .cq, .status-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.card .status-line { font-size: 12px; color: var(--muted); }
.claim { align-items: center; }
.claim i { display: inline-block; }
.cols { overflow-x: auto; }
.cols.expanded { grid-template-columns: repeat(5, minmax(190px, 1fr)); }
.stack { overflow: auto; }
.col header { align-items: center; padding-top: 10px; }
.rail header button { font-size: 20px; width: 100%; }
.rail .stack button { writing-mode: vertical-rl; transform: rotate(180deg); }
.col.drop .stack { background: var(--surface-3); }
.card[draggable="true"] { cursor: grab; }
.card.dragging { opacity: .4; }
.panel { width: min(520px, 100%); overflow-y: auto; }
.panel .top { gap: 14px; }
.panel .tile, .panel .log { flex-shrink: 0; }
.panel .log { overflow: visible; min-height: 100px; }
.panel .bar { flex-wrap: wrap; }
.panel .close { margin-left: auto; padding: 2px 10px; background: var(--surface-2); }
.panel .props { flex-wrap: wrap; }
.panel .prose, .panel .said, .panel .hit .q { white-space: pre-wrap; overflow-wrap: anywhere; }
.panel .hit .opts { flex-wrap: wrap; }
.panel .hit .reply-form { flex-basis: 100%; }
.panel .linked { display: flex; flex-direction: column; gap: 4px; }
.panel .linked a { padding: 10px; background: var(--surface-2); overflow-wrap: anywhere; }
.panel .linked .gone { text-decoration: line-through; color: var(--muted); }
.panel form.composer { position: sticky; bottom: 0; height: auto; min-height: 44px; background: var(--bg); }
.composer input { flex: 1; background: var(--surface); }
.composer button { padding: 10px; background: var(--ink); color: var(--bg); }
.panel-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.panel-actions select { flex: 1; }
.form-tile { padding: 20px; background: var(--surface); display: flex; flex-direction: column; gap: 12px; }
.form-tile label { display: flex; flex-direction: column; gap: 6px; }
.form-tile h2 { font-size: 18px; }
.form-tile .blockbtn { align-self: start; }
.settings { overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.settings-section { padding: 20px; background: var(--surface); }
.settings-section h2 { font-size: 18px; margin-bottom: 16px; }
.setting-row { padding: 12px 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--surface-3); }
.setting-row span { flex: 1; min-width: 180px; overflow-wrap: anywhere; }
.setting-row small { color: var(--muted); font-size: 12px; }
.setting-row button { padding: 4px 10px; background: var(--surface-2); }
.webhook-form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.webhook-form input { flex: 1; min-width: 160px; }
.webhook-form button { align-self: stretch; height: auto; }
.secret { white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px; background: var(--term); }
.memory-view { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.memory-toolbar { display: flex; flex-wrap: wrap; gap: 6px; background: var(--surface); padding: 10px; }
.memory-toolbar form { display: flex; flex: 1; gap: 6px; }
.memory-toolbar input { width: 100px; flex: 1; }
.memory-toolbar .views { background: var(--surface); }
.stage { min-height: 220px; }
.stage .when { right: 52px; }
.stage .legend { max-height: 50%; overflow-y: auto; }
.memory-results { overflow-y: auto; max-height: 40%; background: var(--surface); }
.memory-results button { width: 100%; text-align: left; padding: 14px 20px; display: block; }
.memory-results button:hover { background: var(--surface-2); }
.memory-results p { white-space: pre-wrap; margin-top: 6px; }
.theme-0 { background: #f7941d; }.theme-1 { background: #7fd18b; }.theme-2 { background: #a9bdf5; }.theme-3 { background: #d9dbd6; }
.memory-empty { position: absolute; top: 45%; left: 0; right: 0; text-align: center; color: var(--muted); }
.mtabs { display: none; }
@media (min-width: 1100px) { .main:has(#card-panel:not([hidden])) .queue { padding-right: 526px; } }
@media (max-width: 1000px) { .app { grid-template-columns: 170px 1fr; }.cols { grid-template-columns: 48px repeat(4, minmax(210px, 1fr)); }.item .top .meta { margin-left: 54px; width: calc(100% - 54px); }.head h1 { font-size: 24px; } }
@media (max-width: 640px) {
  .app { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 56px; height: 100dvh; }
  .side { display: none; }.main { display: flex; min-height: 0; }.head { display: flex; padding: 16px; height: auto; min-height: 70px; }.head h1 { background: none; display: block; height: auto; padding: 0; font-size: 28px; line-height: 34px; }.head .right { display: flex; margin-left: auto; }
  .mtabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }.mtabs a { display: flex; justify-content: center; align-items: center; min-height: 50px; font-size: 12px; background: var(--surface); }.mtabs a[aria-current] { color: var(--bg); background: var(--ink); }
  .item { padding: 16px; }.item .top { align-items: start; }.item .id { width: auto; }.item h3 { flex-basis: calc(100% - 64px); font-size: 15px; }.item .top .meta { width: 100%; margin: 0; }.item .q, .item .opts { margin-left: 0; }.item .q { line-height: 22px; }.item .opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }.item .opt { justify-content: center; min-height: 44px; }.reply-form { grid-column: 1 / -1; min-width: 0; }.reply-form input, .reply-form button { min-height: 44px; }
  .panel { position: fixed; inset: 6px 6px 68px; width: auto; padding: 0; z-index: 10; }.panel .tile { padding: 16px; }.panel .hit { padding: 12px; }.panel .hit .opt { min-height: 44px; }.panel .log { padding: 16px; }.panel .close { min-height: 44px; }
  .memory-toolbar { padding: 6px; }.memory-toolbar input { min-height: 44px; }.memory-toolbar .views button { padding: 0 10px; }.legend { bottom: 6px; top: auto; flex-direction: row; max-height: none; }.stage .when { bottom: 44px; right: 6px; }.stage .legend { overflow: auto; }.legend button { min-height: 36px; }
  .setting-row button { min-height: 44px; }.settings-section { padding: 16px; }.form-tile { padding: 16px; }.form-tile input { min-height: 44px; }.queue h2 { padding: 16px; }.message { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sr-only:focus-within { position: relative; width: auto; height: auto; clip-path: none; white-space: normal; overflow: auto; background: var(--surface); }
.item:not(.sel) .opt .k { display: none; }
.mtabs a { gap: 4px; }
.item.sel .task-meta, .item.sel .status-line { color: #31332f; }
.item.sel .status-dot.ask { background: #8b211b; }
