:root {
  --ink: #0b1b2b;
  --muted: #5c6b7a;
  --line: #d9e2e8;
  --paper: #f4f7f8;
  --white: #fff;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --amber: #9a5b00;
  --amber-bg: #fff6df;
  --red: #a11d2b;
  --red-bg: #fff0f1;
  --radius: 12px;
  --shadow: 0 12px 36px rgba(11, 27, 43, .08);
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; }
body { margin: 0; min-height: 100vh; }
a { color: var(--teal-dark); }
a:hover { color: var(--ink); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
small { color: var(--muted); }
code { font-size: .9em; }
.signed-in { display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { background: var(--ink); color: #d8e4ea; padding: 24px 18px; min-height: 100vh; display: flex; flex-direction: column; gap: 24px; }
.brand { color: #fff; font-weight: 750; text-decoration: none; font-size: 1.2rem; letter-spacing: -.03em; }
.brand span { display: block; font-size: .65rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: #8fb7c7; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { color: #c4d5de; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: .92rem; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.account { margin-top: auto; border-top: 1px solid rgba(255,255,255,.14); padding-top: 16px; font-size: .8rem; overflow-wrap: anywhere; }
.account small { display: block; color: #8fb7c7; text-transform: uppercase; letter-spacing: .12em; margin: 2px 0 8px; }
.main { padding: 36px clamp(18px, 4vw, 54px) 70px; max-width: 1160px; width: 100%; }
.signed-out .main { max-width: 460px; margin: 8vh auto; padding: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 24px; }
.page-head p { color: var(--muted); max-width: 72ch; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 22px; }
.panel.narrow { max-width: 520px; margin: 8vh auto; }
.panel h2 { margin-top: 0; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .signed-in { display: block; } .sidebar { min-height: 0; position: static; } .sidebar nav { flex-direction: row; flex-wrap: wrap; } .account { margin-top: 0; border-top: 0; } .grid, .grid.three { grid-template-columns: 1fr; } }
.notice { background: #e7f6f2; border: 1px solid #b8e1d7; color: #134e4a; padding: 12px 14px; border-radius: 10px; margin-bottom: 18px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 800px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-weight: 650; font-size: .84rem; }
.field input, .field textarea, .field select { border: 1px solid #bdcbd4; border-radius: 8px; padding: 9px 10px; font: inherit; background: #fff; width: 100%; }
.field input:focus, .field textarea:focus, .field select:focus, button:focus, a:focus { outline: 3px solid #99d5cb; outline-offset: 2px; }
.field textarea { min-height: 92px; resize: vertical; }
.field input[type="checkbox"] { width: auto; }
.button, button { display: inline-block; border: 1px solid transparent; border-radius: 8px; padding: 9px 13px; background: var(--teal); color: #fff; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; }
.button:hover, button:hover { background: var(--teal-dark); color: #fff; }
.button.secondary, button.secondary { background: #fff; border-color: #b9c8d0; color: var(--ink); }
.button.danger, button.danger { background: var(--red); }
button.link { background: none; color: #d8e4ea; padding: 0; text-align: left; font-weight: 500; }
button.link:hover { color: #fff; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.badge.ok { background: #e7f6f2; color: #115e59; }
.badge.warn { background: var(--amber-bg); color: var(--amber); }
.badge.danger { background: var(--red-bg); color: var(--red); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { text-align: start; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
tr:last-child td { border-bottom: 0; }
.list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.list li { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fbfdfd; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.inline .field { margin-bottom: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.tabs a { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-decoration: none; font-size: .86rem; }
.tabs a.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.editor-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 0 0 12px; background: #fbfdfd; }
.editor-item > legend { font-weight: 700; padding: 0 6px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.muted { color: var(--muted); }
.error { background: var(--red-bg); border: 1px solid #edb8be; color: #74141f; padding: 10px 12px; border-radius: 8px; }
.spacer { height: 20px; }
.media-thumb { max-width: 260px; max-height: 160px; border: 1px solid var(--line); border-radius: 8px; display: block; margin-top: 8px; }
.uri { word-break: break-all; background: #f1f5f6; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: .78rem; }
details summary { cursor: pointer; font-weight: 650; }
