:root {
  color-scheme: light;
  --ink: #192822;
  --muted: #53645c;
  --accent: #11674e;
  --accent-hover: #0a523e;
  --line: #dbe4df;
  --paper: #fff;
  --background: #f4f7f5;
  --radius: 12px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; display: grid; grid-template-columns: 212px minmax(0, 1fr); min-height: 100vh; }
body.guest { display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button:not(:disabled) { cursor: pointer; }
:focus-visible { outline: 3px solid #409574; outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 2.65rem); line-height: 1.12; letter-spacing: -.055em; overflow-wrap: anywhere; }
h2 { font-size: 1.12rem; line-height: 1.3; letter-spacing: -.024em; overflow-wrap: anywhere; }
p { line-height: 1.55; }
.muted { color: var(--muted); }
.mono, code { font: .83rem/1.5 ui-monospace, "SFMono-Regular", Consolas, monospace; overflow-wrap: anywhere; }
.strong { font-weight: 650; }

.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 23px 16px; border-right: 1px solid var(--line); background: #eaf0ec; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 1.12rem; letter-spacing: -.035em; font-weight: 750; }
.sidebar .brand { padding-inline: 8px; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 8px; background: var(--accent); color: white; font-size: 1.4rem; line-height: 1; }
.sidebar nav { display: grid; gap: 4px; margin-top: 36px; }
.sidebar nav a { color: var(--muted); border-radius: 8px; padding: 10px 12px; font-size: .9rem; font-weight: 650; text-decoration: none; }
.sidebar nav a:is(:hover, .selected) { color: #164a39; background: #dceae2; }
.profile { margin-top: auto; padding: 14px 7px 0; border-top: 1px solid #d6e1d9; display: grid; gap: 8px; }
.profile-email { overflow: hidden; text-overflow: ellipsis; font-size: .8rem; color: var(--muted); white-space: nowrap; }

.main { padding: 53px 44px; }
.content { max-width: 1120px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 18px; margin-bottom: 26px; }
.page-head p { margin-top: 9px; color: var(--muted); overflow-wrap: anywhere; }
.page-head > .button, .page-head > .button-row { margin-top: 3px; }
.back-link { display: inline-block; margin-bottom: 16px; font-size: .85rem; font-weight: 650; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.divider { padding: 0 4px; color: #718078; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 41px; padding: 8px 15px; border: 1px solid transparent; border-radius: 8px; text-decoration: none; font-size: .875rem; font-weight: 650; line-height: 1.2; }
.primary { color: white; background: var(--accent); }
.primary:hover { background: var(--accent-hover); }
.secondary { color: var(--ink); border-color: #cbd8d0; background: var(--paper); }
.secondary:hover { background: #edf3ef; }
.button:disabled { cursor: default; color: #476154; background: #e6eee9; }
.text-button { border: 0; padding: 0; background: none; color: var(--muted); font-size: .85rem; font-weight: 600; }
.text-button:hover { text-decoration: underline; }
.text-button.danger { color: #942b36; }
.button.danger { background: #942b36; border-color: #942b36; color: #fff; }
.lifecycle-controls { margin-bottom: 16px; }
.text-button.accent { color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.surface { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.deployment-card, .component, .form-section { padding: 22px; }
.component { display: flex; flex-direction: column; }
.component-actions { margin-top: auto; }
.version-tools { display: flex; justify-content: flex-end; margin-top: 10px; }
.card-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.card-title h2 a { color: var(--ink); text-decoration: none; }
.card-title h2 a:hover { text-decoration: underline; }
.card-title .mono { display: inline-block; margin-top: 4px; }
.icon-link { display: grid; place-items: center; width: 33px; height: 33px; flex: 0 0 33px; border-radius: 7px; color: var(--accent); background: #edf3ef; text-decoration: none; }
.icon-link:hover { background: #dceae2; }
.component-summary { padding: 12px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: .85rem; }
.component-summary:last-child { padding-bottom: 0; }
.component-summary code { margin-left: 5px; color: var(--muted); }
.component-summary > :last-child { flex-shrink: 0; }
.details { display: grid; gap: 12px; margin: 0 0 20px; }
.details > div { display: grid; gap: 3px; }
.details dt { font-size: .8rem; color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; font-size: .9rem; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 20px; color: #46594e; background: #eef1ef; font-size: .73rem; font-weight: 650; white-space: nowrap; }
.badge.succeeded { background: #dff2e7; color: #07543a; }
.badge.failed { background: #f9e6e8; color: #8d2732; }
.badge.in-progress { background: #f7eed6; color: #6c4c09; }
.empty { display: grid; justify-items: start; padding: 27px; gap: 8px; }
.empty p { color: var(--muted); overflow-wrap: anywhere; }
.empty .button { margin-top: 8px; }
.empty.compact { padding: 18px 22px; }
.section { margin-top: 29px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 13px; }
.section-head .muted { font-size: .8rem; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; }
th, td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
th { padding-block: 10px; background: #f8faf9; color: var(--muted); font-size: .78rem; font-weight: 650; }
tr:last-child td { border-bottom: 0; }
td small { display: block; margin-top: 4px; color: var(--muted); }
td .run-error { min-width: 110px; color: #942b36; }
td code { display: block; min-width: 80px; }
td.actions { text-align: right; }
time { white-space: nowrap; }

.log-query-form { display: grid; gap: 10px; }
.log-query-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.6fr) auto; align-items: end; gap: 12px; }
.log-query-fields > .field { margin: 0; }
.log-entries { list-style: none; padding: 0; margin: 0; }
.log-entry { padding: 13px 16px; }
.log-entry + .log-entry { border-top: 1px solid var(--line); }
.log-entry-meta { display: flex; flex-wrap: wrap; gap: 3px 12px; color: var(--muted); font: .76rem/1.5 ui-monospace, "SFMono-Regular", Consolas, monospace; overflow-wrap: anywhere; }
.log-entry-message { margin: 5px 0 0; font: .8rem/1.55 ui-monospace, "SFMono-Regular", Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.log-volume :is(th, td):last-child { text-align: right; }

.data-actions { align-items: start; }
.data-actions form > .button { margin-top: 16px; }
.data-fixture-help { margin-bottom: 14px; }
.data-confirm { display: flex; align-items: baseline; gap: 8px; }
.data-confirm input[type="checkbox"] { flex-shrink: 0; width: auto; accent-color: var(--accent); }

.config-form { display: grid; gap: 16px; justify-items: start; }
.config-form > .grid, .config-form > section { width: 100%; }
.form-section h2 { margin-bottom: 12px; }
.field { min-width: 0; display: grid; gap: 6px; }
.field + .field { margin-top: 15px; }
.grid > .field { margin-top: 0; }
.field label { font-size: .84rem; font-weight: 650; }
.field :is(input, textarea, select) { min-width: 0; width: 100%; border-radius: 7px; border: 1px solid #aebfb5; padding: 9px 11px; background: var(--paper); color: var(--ink); }
.field textarea { font: .82rem/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace; resize: vertical; }
.hint { font-size: .8rem; color: var(--muted); line-height: 1.45; }
.allowed-settings summary { cursor: pointer; color: var(--accent); }
.allowed-settings ul { margin: 6px 0 0; padding-inline-start: 18px; }
.allowed-settings pre { max-width: 100%; overflow: auto; }
.settings-editor { container-type: inline-size; gap: 9px; }
.editor-heading, .editor-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.editor-heading { justify-content: space-between; }
.editor-title { font-size: .84rem; font-weight: 650; }
.editor-controls { gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--background); }
.editor-toggle { border: 0; border-radius: 5px; padding: 5px 8px; color: var(--muted); background: transparent; font-size: .8rem; font-weight: 650; }
.editor-toggle[aria-pressed="true"] { color: var(--accent); background: var(--paper); box-shadow: 0 1px 2px #19282220; }
.editor-list { display: grid; gap: 8px; }
.editor-list:empty { display: none; }
.editor-item { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #f8faf9; }
.editor-item > .field { margin-top: 0; }
.editor-fields { gap: 8px; }
.editor-add { justify-self: start; min-height: 34px; padding: 5px 10px; font-size: .8rem; }
.editor-remove { justify-self: end; }
.editor-config { border-top: 1px solid var(--line); margin-top: 3px; padding-top: 9px; }
.editor-error { color: #942b36; font-size: .8rem; }
.settings-editor [hidden] { display: none; }
.inline-form { display: grid; grid-template-columns: minmax(140px, 2fr) minmax(100px, 1fr) auto; gap: 12px; align-items: end; margin-top: 14px; }
.inline-form .field { margin-top: 0; }
.notices { display: grid; gap: 6px; margin-bottom: 16px; }
.notice { border: 1px solid #cbdfd3; border-radius: 8px; background: #ebf5ef; color: #164a39; padding: 10px 13px; font-size: .85rem; }
.notice.error { color: #8d2732; border-color: #f1cbd0; background: #fbebed; }
.errorlist { margin: 0; padding-inline-start: 18px; color: #942b36; font-size: .8rem; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 13px; margin-top: 16px; font-size: .83rem; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.guest .main { min-height: 100vh; display: grid; place-items: center; }
.guest .content { width: min(100%, 440px); }
.sign-in { display: grid; align-items: start; gap: 15px; padding: 32px; }
.sign-in .brand { margin-bottom: 9px; }
.sign-in p, .sign-in .notice { font-size: .92rem; }
.password-sign-in { display: grid; gap: 14px; }
.password-sign-in > .field + .field { margin-top: 0; }
.password-sign-in .button, .google-sign-in .button { width: 100%; }
.account-form { max-width: 520px; }
.account-form form > .button { margin-top: 16px; }

@container (max-width: 350px) {
  .editor-fields { grid-template-columns: 1fr; }
}

@media (max-width: 970px) {
  body { grid-template-columns: 170px minmax(0, 1fr); }
  .main { padding: 33px 24px; }
  .log-query-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .log-query-search { grid-column: span 2; }
}
@media (max-width: 730px) {
  body { display: block; }
  .sidebar { position: static; height: auto; display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 12px 18px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { padding: 0; }
  .sidebar nav { grid-row: 2; grid-column: 1 / -1; display: flex; margin-top: 9px; }
  .sidebar nav a { padding: 7px 10px; }
  .profile { border-top: 0; margin-top: 0; padding: 0; }
  .profile-email { display: none; }
  .grid { grid-template-columns: 1fr; }
  .main { padding: 24px 16px; }
}
@media (max-width: 450px) {
  .inline-form { grid-template-columns: 1fr; justify-items: stretch; }
  .log-query-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .log-query-view, .log-query-fields > .button { grid-column: span 2; }
}
