:root {
  color-scheme: dark;
  --ink: #edf2f7;
  --muted: #a9b6c4;
  --panel: #17212b;
  --line: #344452;
  --accent: #5eead4;
}

* { box-sizing: border-box; }
body { margin: 0; background: #0c1218; color: var(--ink); font-family: system-ui, sans-serif; line-height: 1.7; }
.layout { width: min(1100px, 100% - 2rem); margin: 0 auto; padding: 2rem 0 4rem; }
.hero { padding: 1.5rem; border: 1px solid var(--line); border-radius: 1.25rem; background: linear-gradient(145deg, #17212b, #101820); }
.eyebrow, .approval { color: var(--accent); font-weight: 700; }
h1, h2, h3 { line-height: 1.3; }
h1 { margin: .25rem 0 .75rem; font-size: clamp(1.8rem, 5vw, 3rem); }
h2 { margin: 2rem 0 1rem; font-size: 1.35rem; }
.status { min-height: 1.8em; color: var(--accent); }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: .8rem; margin: 0; }
.metric-card, .card { padding: 1rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--panel); }
.metric-card dt, .muted, footer, .notice { color: var(--muted); }
.metric-card dd { margin: .35rem 0 0; font-size: 1.7rem; font-weight: 700; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); gap: .8rem; }
.stage-card { border-inline-start: 3px solid var(--accent); }
.card h3 { margin: 0 0 .5rem; }
.card p { margin: .4rem 0; }
.compact-list { margin: .5rem 0; padding-inline-start: 1.25rem; }
.approval { font-size: .92rem; }
.empty, .notice { padding: .8rem 1rem; border-inline-start: 3px solid var(--accent); background: #121c24; }
footer { margin-top: 2.5rem; font-size: .92rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.note-form { display: grid; gap: .55rem; margin-bottom: 1rem; }
.note-form label { font-weight: 700; }
.note-form input, .note-form textarea, .note-toolbar input { width: 100%; min-width: 0; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: .65rem; background: #0c1218; color: var(--ink); font: inherit; }
.note-form textarea { resize: vertical; }
.note-form button, .note-toolbar button, .runbook-action, .note-dialog-actions button { padding: .55rem .8rem; border: 1px solid var(--line); border-radius: .65rem; background: #202d38; color: var(--ink); font: inherit; font-weight: 700; }
.card > #google-docs-export, .calendar-form button { padding: .7rem 1rem; border: 1px solid var(--accent); border-radius: .65rem; background: var(--accent); color: #071c18; font: inherit; font-weight: 800; }
.card > #google-docs-export:disabled, .calendar-form button:disabled { border-color: var(--line); background: #202d38; color: var(--muted); cursor: not-allowed; }
.calendar-form { display: grid; gap: .55rem; }
.calendar-form label { font-weight: 700; }
.calendar-form input { width: min(100%, 22rem); min-width: 0; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: .65rem; background: #0c1218; color: var(--ink); font: inherit; }
.calendar-form button { justify-self: start; }
.google-chat-export { display: grid; gap: .65rem; }
.google-chat-export input, .google-chat-export textarea { width: 100%; min-width: 0; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: .65rem; background: #0c1218; color: var(--ink); font: inherit; }
.google-chat-export input { direction: ltr; text-align: left; }
.google-chat-export textarea { resize: vertical; direction: rtl; }
.google-chat-export button { justify-self: start; padding: .7rem 1rem; border: 1px solid var(--accent); border-radius: .65rem; background: var(--accent); color: #071c18; font: inherit; font-weight: 800; }
.google-chat-export button:disabled { border-color: var(--line); background: #202d38; color: var(--muted); cursor: not-allowed; }
.google-gmail-summary { display: grid; gap: .65rem; }
.google-gmail-summary input, .google-gmail-summary textarea { width: 100%; min-width: 0; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: .65rem; background: #0c1218; color: var(--ink); font: inherit; }
.google-gmail-summary input { direction: ltr; text-align: left; }
.google-gmail-summary textarea { resize: vertical; direction: rtl; }
.google-gmail-summary button { justify-self: start; padding: .7rem 1rem; border: 1px solid var(--accent); border-radius: .65rem; background: var(--accent); color: #071c18; font: inherit; font-weight: 800; }
.google-gmail-summary button:disabled { border-color: var(--line); background: #202d38; color: var(--muted); cursor: not-allowed; }
.note-form button:hover, .note-toolbar button:hover, .runbook-action:hover, .note-dialog-actions button:hover { border-color: var(--accent); }
.note-form button[type="submit"] { justify-self: start; color: #071c18; background: var(--accent); border-color: var(--accent); }
.note-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin: 1rem 0; }
.note-toolbar label { margin-inline-start: auto; font-size: .9rem; }
.note-toolbar input { width: min(100%, 18rem); }
.note-toolbar button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.runbook-card { min-width: 0; }
.runbook-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.runbook-heading h3 { overflow-wrap: anywhere; }
.runbook-pinned { flex-shrink: 0; padding: .1rem .5rem; border: 1px solid #806a38; border-radius: 999px; color: #f1d28b; font-size: .75rem; }
.runbook-date { font-size: .78rem; }
.runbook-content { white-space: pre-wrap; overflow-wrap: anywhere; }
.runbook-actions, .note-dialog-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
#runbook-archive-dialog { width: min(32rem, calc(100% - 2rem)); border: 1px solid var(--line); border-radius: 1rem; background: var(--panel); color: var(--ink); padding: 1.25rem; }
#runbook-archive-dialog::backdrop { background: #000b; }
#runbook-archive-dialog h2 { margin: 0; }
#runbook-archive-description { color: var(--muted); }

@media (max-width: 560px) {
  .note-toolbar label { margin-inline-start: 0; width: 100%; }
  .note-toolbar input { width: 100%; }
  .note-form button[type="submit"] { width: 100%; }
}
