/* AgentDeck app — additions on top of app.css (sign in, dialogs, live runs, usage) */

/* Sign in */
.auth-screen { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; overflow-y: auto; }
.auth-screen[hidden] { display: none; }
.app-body:has(.auth-screen:not([hidden])) { overflow: auto; }
.auth-card {
  width: 100%; max-width: 420px; padding: 32px 30px 26px;
  border: 1px solid var(--line-strong); border-radius: 20px; background: var(--bg-elev); box-shadow: var(--shadow-lg);
}
.auth-brand { margin-bottom: 22px; font-size: 20px; }
.auth-brand .brand-mark { width: 30px; height: 30px; }
.auth-tabs { display: flex; width: 100%; margin: 0 0 20px; }
.auth-tabs button, .src-tabs button { flex: 1; height: 34px; }
.seg button[aria-selected="true"] { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-sm); }
.auth-submit { width: 100%; margin-top: 6px; }
.auth-note { margin: 16px 0 0; font-size: 13px; color: var(--muted); text-align: center; }

.field { display: grid; gap: 6px; margin: 0 0 14px; }
.field[hidden] { display: none; }
.field > span { font-size: 13px; font-weight: 600; }
.field input, .field select, .mem-editor {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 14.5px;
}
.field input[type="file"] { padding: 8px 10px; height: auto; }
.field input:focus, .field select:focus, .mem-editor:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-error { margin: 0 0 12px; padding: 9px 12px; border-radius: 8px; background: var(--bad-soft); color: var(--bad); font-size: 13.5px; }
.form-error[hidden] { display: none; }

/* Dialog content */
.how-list { margin: -6px 0 18px; padding-left: 20px; color: var(--text-2); font-size: 14px; }
.how-list li { margin: 4px 0; }
.src-tabs { display: flex; width: 100%; margin: 0 0 18px; }
.modal-actions.spread { justify-content: space-between; }
.modal-actions { gap: 8px; }
.set-block { padding: 14px 0; border-top: 1px solid var(--line); }
.set-block:first-of-type { border-top: 0; padding-top: 4px; }
.set-block h3 { margin: 0 0 6px; font-size: 14px; }
.set-block p { margin: 0 0 10px; color: var(--text-2); font-size: 14px; }
.row-start { display: flex; gap: 8px; margin-bottom: 14px; }
.modal-body code, .page code { padding: 1px 5px; border-radius: 4px; background: var(--bg-sunk); font-size: .88em; }

/* Connector dialog */
.copy-row { display: flex; gap: 8px; margin: 6px 0 14px; }
.copy-row input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); font-family: var(--font-mono); font-size: 12.5px; color: var(--text); }
.how-list .copy-row { margin: 6px 0 4px; }
.set-h3 { margin: 18px 0 8px; font-size: 14px; }
.conn-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.conn-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 14px; }

/* Sidebar Claude card is a button */
button.agent-card { width: 100%; text-align: left; color: inherit; cursor: pointer; }
button.agent-card:hover { border-color: var(--accent-line); }
.agent-state[data-state="off"] { color: var(--warn); }

/* Chat additions */
.chat-scroll > .working-row { width: 100%; max-width: 800px; margin: 14px auto 0; padding: 0 24px 0 66px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; }
.chat-scroll > .working-row[hidden] { display: none; }
.msg-user.is-memory .bubble { display: inline-flex; align-items: center; gap: 8px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.run-end { display: flex; align-items: flex-start; gap: 8px; padding: 2px 0; font-size: 13px; color: var(--muted); }
.run-end .icon { margin-top: 2px; }
.run-end.is-ok .icon { color: var(--ok); }
.run-end.is-bad { padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); }
.run-end.is-bad b { font-weight: 500; }
.sys-note.inline { align-self: flex-start; }
.chat-thread > .sys-note { margin-top: 8px; border-style: solid; border-color: var(--line); padding: 10px 16px; border-radius: 12px; }
.tool pre.out.cmd { color: var(--term-muted); }
.tool pre.out.bad { color: var(--bad); }
.tool-bash pre.out.bad { color: #f47171; }
.todo-mini { display: grid; gap: 5px; margin: 0; padding: 10px 14px; list-style: none; font-size: 13px; }
.todo-mini li { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.todo-mini li.is-completed { color: var(--muted); }
.todo-mini li.is-completed .icon { color: var(--ok); }
.todo-mini .spinner { width: 11px; height: 11px; }

/* Plan panel facts */
.proj-facts { display: grid; gap: 10px; margin: 0; }
.proj-facts dt { font-size: 11.5px; color: var(--muted); }
.proj-facts dd { margin: 0; font-size: 13.5px; }

/* Memory */
.card-actions { display: flex; gap: 8px; margin-left: auto; }
.mem-editor { height: auto; min-height: 420px; padding: 12px; font-family: var(--font-mono); font-size: 13px; line-height: 1.6; resize: vertical; margin-bottom: 12px; }

/* Files */
.tree-note { margin-left: auto; font-size: 11px; }

/* Usage */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-elev); }
.tile span { font-size: 12.5px; color: var(--muted); }
.tile b { font-family: var(--font-display); font-size: 24px; letter-spacing: -.02em; }
.tile small { font-size: 12px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table.runs { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.runs th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.runs td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.runs tr:last-child td { border-bottom: 0; }
table.runs .num { text-align: right; font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; }
table.runs .task-col { max-width: 360px; overflow-wrap: anywhere; }
.st { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--bg-sunk); color: var(--text-2); }
.st-done { background: var(--ok-soft); color: var(--ok); }
.st-error { background: var(--bad-soft); color: var(--bad); }
.st-running { background: var(--accent-soft); color: var(--accent); }

@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .mobile-nav.mobile-nav-6 { grid-template-columns: repeat(6, 1fr); }
  .mobile-nav-6 button { font-size: 10px; }
  .chat-scroll > .working-row { padding-left: 16px; }
  .auth-card { padding: 26px 20px 22px; }
  .card-actions { margin-left: 0; width: 100%; }
}
