:root {
  color-scheme: light;
  /* Maritime Precision — Porcelain & Deep Ocean */
  --paper: #fbfcfe;
  --paper-elevated: #ffffff;
  --paper-muted: #f2f6fb;
  --panel: #e6eef8;
  --ink: #0c182b;
  --ink-deep: #071120;
  --ink-surface: #0e1d36;
  --ink-surface-2: #142747;
  --ink-border: #1e3557;
  --ink-muted: #8ea7c7;
  --ink-subtle: #c8daef;
  --ocean: #1d56d8;
  --ocean-hover: #1644b0;
  --ocean-soft: #e0ecff;
  --signal: #06b6d4;
  --signal-bright: #22d3ee;
  --signal-deep: #0e7490;
  --signal-soft: #cffafe;
  --emerald: #10b981;
  --emerald-deep: #047857;
  --emerald-soft: #d1fae5;
  /* Backward-compatible semantic aliases */
  --violet: var(--ocean);
  --violet-hover: var(--ocean-hover);
  --lavender: var(--signal-bright);
  --muted: #4b5e76;
  --muted-soft: #647892;
  --line: #dbe4f0;
  --line-strong: #b4c4d8;
  --brand-ring: var(--ocean);
  --brand-sail: var(--ink);
  --brand-signal: var(--signal);
  --radius-sm: 8px;
  --radius-panel: 12px;
  --radius-tile: 18px;
  --radius-input: 24px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 2px rgba(7, 17, 32, .05), 0 1px 3px rgba(7, 17, 32, .04);
  --shadow-md: 0 12px 32px -12px rgba(7, 17, 32, .14), 0 2px 6px rgba(7, 17, 32, .04);
  --shadow-lg: 0 28px 64px -20px rgba(7, 17, 32, .35);
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "PingFang SC", sans-serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "PingFang SC", sans-serif;
  --font-mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 44px);
  --content-width: 1240px;
  font: 15px/1.6 var(--font-ui);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); }
h1 { font-weight: 700; font-size: clamp(2.15rem, 4.2vw, 3.25rem); line-height: 1.08; letter-spacing: -.04em; overflow-wrap: anywhere; }
h2 { font-weight: 680; font-size: clamp(1.45rem, 2.8vw, 2rem); line-height: 1.18; letter-spacing: -.03em; }
h3 { font-weight: 640; font-size: 1.08rem; line-height: 1.35; letter-spacing: -.015em; }
p { color: var(--muted); }
a { color: var(--ink); font-weight: 600; text-underline-offset: 4px; transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease; }
:focus-visible { outline: 2px solid var(--ocean); outline-offset: 3px; }
::selection { background: var(--signal-soft); color: var(--ink); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font: 740 1.45rem/1 var(--font-display);
  letter-spacing: -.04em;
  text-decoration: none;
  width: fit-content;
}
.brand-name { display: inline-flex; align-items: baseline; }
.brand-q { color: var(--brand-signal); }
.brand-mark {
  display: inline-block;
  flex: none;
  width: 1.35em;
  height: 1.35em;
  overflow: visible;
}
.brand-mark .brand-ring { stroke: var(--brand-ring); }
.brand-mark .brand-sail { fill: var(--brand-sail); }
.brand-mark .brand-tail { stroke: var(--brand-signal); }

button, input, textarea, select { font: inherit; }
.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
.primary {
  color: #fff;
  background: var(--ocean);
  border-color: var(--ocean);
  box-shadow: 0 1px 2px rgba(7, 17, 32, .12), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.primary:hover {
  background: var(--ocean-hover);
  border-color: var(--ocean-hover);
  box-shadow: 0 8px 20px -8px rgba(29, 86, 216, .55);
}
.secondary {
  color: var(--ink);
  background: var(--paper-elevated);
  border-color: var(--line-strong);
}
.secondary:hover {
  background: var(--paper-muted);
  border-color: var(--ocean);
  color: var(--ocean);
}
.primary:focus-visible { outline-color: var(--ocean); }
button:disabled { opacity: .55; cursor: wait; }

code, pre { font-family: var(--font-mono); }
code { overflow-wrap: anywhere; }
pre { margin: 0; overflow: auto; padding: clamp(14px, 2.5vw, 22px); font-size: .85rem; line-height: 1.65; }
.terminal {
  background: var(--ink-deep);
  color: #e6f0fb;
  border: 1px solid var(--ink-border);
  border-radius: var(--radius-panel);
}

#view { display: grid; gap: 20px; padding: clamp(28px, 5vw, 56px) 0; min-width: 0; }
#notice:not(:empty) {
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid var(--ocean-soft);
  background: #eff6ff;
  color: var(--ink);
  border-radius: var(--radius-panel);
  font-size: .9rem;
}
.actions { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.card {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding: clamp(18px, 2.5vw, 26px);
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-tile);
  background: var(--paper-elevated);
  box-shadow: var(--shadow-sm);
}
.card > * { max-width: 100%; }
.card > .terminal, .card > .table-wrap { width: 100%; }
form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
label { display: grid; gap: 6px; min-width: 0; font-size: .86rem; font-weight: 600; color: var(--ink); }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--paper-elevated);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--ocean);
  box-shadow: 0 0 0 3px rgba(29, 86, 216, .12);
  outline: none;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .88rem; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
td { overflow-wrap: anywhere; }
td button { white-space: nowrap; }
tr:last-child td, tr:last-child th { border-bottom: 0; }
