:root {
  --teal: #0f766e;
  --teal-strong: #115e59;
  --teal-soft: #ccfbf1;
  --on-teal: #ffffff;
  --bg: #f6f8f8;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #5b6b70;
  --border: #dfe6e6;
  --danger: #b42318;
  --warn-bg: #fff7e6;
  --warn-text: #7a4b00;
  --ok-bg: #ecfdf5;
  --ok-text: #065f46;
  --err-bg: #fef3f2;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --teal: #2dd4bf;
    --teal-strong: #5eead4;
    --teal-soft: #134e4a;
    --on-teal: #04201d;
    --bg: #0b1214;
    --surface: #121c1f;
    --text: #e6eef0;
    --muted: #93a5aa;
    --border: #22333a;
    --danger: #f97066;
    --warn-bg: #2b2111;
    --warn-text: #fcd38d;
    --ok-bg: #0f2a22;
    --ok-text: #a6f4c5;
    --err-bg: #2d1514;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--teal); }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; font-weight: 600; margin: 2rem 0 0.75rem; }

.page { width: 100%; max-width: 560px; margin: 0 auto; padding: 3rem 16px 2rem; flex: 1; }
.page.narrow { max-width: 420px; }
.page.wide { max-width: 760px; padding-top: 1.5rem; }

/* Public link page */
.hero { text-align: center; margin-bottom: 2rem; }
.hero h1 { font-size: 2rem; margin-bottom: 0.25rem; }
.hero p { margin: 0; color: var(--muted); font-weight: 500; }
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.link {
  display: block;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1.5px solid var(--teal);
  color: var(--text);
  text-align: center;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.link:hover, .link:focus-visible { background: var(--teal); color: var(--on-teal); transform: translateY(-1px); }
.link:focus-visible { outline: 3px solid var(--teal-soft); outline-offset: 2px; }
.empty { text-align: center; color: var(--muted); }

/* Footer */
.footer { padding: 1.5rem 16px 2rem; text-align: center; font-size: 0.85rem; }
.footer a { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); }
.footer strong { font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
.mark { color: #0f766e; flex-shrink: 0; }

/* Admin */
.nav {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between;
  padding: 0.75rem 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.nav-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.nav a[aria-current="page"] { color: var(--teal); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.form { display: grid; gap: 1rem; padding: 1.25rem; }
label { display: grid; gap: 0.35rem; font-weight: 500; font-size: 0.95rem; }
label small { font-weight: 400; color: var(--muted); }
input[type="email"], input[type="password"], input[type="text"], input[type="url"] {
  width: 100%; padding: 0.65rem 0.75rem; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
}
input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
button {
  font: inherit; font-weight: 600; cursor: pointer; padding: 0.65rem 1rem; border-radius: 10px;
  border: 1px solid var(--teal); background: var(--teal); color: var(--on-teal);
}
button:hover { background: var(--teal-strong); }
button:disabled { opacity: 0.35; cursor: default; }
button.small { padding: 0.3rem 0.65rem; font-size: 0.85rem; background: transparent; color: var(--text); border-color: var(--border); }
button.small:hover:not(:disabled) { border-color: var(--teal); }
button.danger { color: var(--danger); }
button.danger:hover { border-color: var(--danger); }
.link-button { background: none; border: none; padding: 0; color: var(--teal); font-weight: 500; white-space: nowrap; }
.link-button:hover { background: none; text-decoration: underline; }
.admin .link-button { color: var(--teal); }
form.inline { display: inline-flex; gap: 0.75rem; align-items: center; margin: 0; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; padding: 0.85rem 1.25rem; }
.row + .row { border-top: 1px solid var(--border); }
.row-main { min-width: 0; flex: 1 1 260px; display: grid; }
.url { font-size: 0.85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--teal-soft); color: var(--teal-strong); }
.muted { color: var(--muted); }
.notice { padding: 0.75rem 1rem; border-radius: 10px; margin: 0 0 1rem; background: var(--ok-bg); color: var(--ok-text); }
.notice p { margin: 0 0 0.5rem; }
.notice-error { background: var(--err-bg); color: var(--danger); }
.notice-warn { background: var(--warn-bg); color: var(--warn-text); }
.secret code { font-size: 1.15rem; font-weight: 600; letter-spacing: 0.04em; user-select: all; }
