:root {
  --navy: #0b1f3a;
  --navy-deep: #071527;
  --gold: #d4a94a;
  --paper: #f4f6f9;
  --ink: #1c2733;
  --muted: #6b7684;
  --line: #e1e6ec;
  --white: #ffffff;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

.topbar {
  background: var(--navy);
  background-image: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--white);
  padding: 28px 24px;
}
.brand {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.brand span { color: var(--gold); }
.topbar-sub {
  color: #b9c3d4;
  font-size: 13px;
  margin-top: 2px;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.panel h2 {
  margin: 0 0 16px;
  font-size: 17px;
  color: var(--navy);
}

.success-panel {
  border-color: var(--gold);
  background: #fffaf0;
}
.short-url { font-size: 15px; margin: 0 0 16px; }
.short-url a { color: var(--navy); font-weight: 600; }

.preview-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.preview-card {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.preview-swatch {
  width: 160px;
  height: 160px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  border: 1px solid var(--line);
}
.preview-light { background: #ffffff; }
.preview-dark { background: #14181f; }
.preview-swatch img { width: 130px; height: 130px; }

.create-form { display: flex; flex-direction: column; gap: 18px; }
.create-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}
.create-form input[type="url"],
.create-form input[type="text"] {
  font-weight: 400;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
}
.create-form input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

.option-group { display: flex; flex-direction: column; gap: 8px; }
.option-label { font-size: 13px; font-weight: 600; color: var(--navy); }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
}
.radio-pill:has(input:checked) {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}
.radio-pill input { accent-color: var(--gold); }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--navy);
  background: var(--white);
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary {
  background: var(--navy);
  color: var(--white);
  align-self: flex-start;
}
.btn-small { padding: 7px 12px; font-size: 12px; }

.link-list { display: flex; flex-direction: column; gap: 0; }
.link-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.link-row:last-child { border-bottom: none; }
.link-thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.link-thumb img { width: 48px; height: 48px; }
.link-info { flex: 1; min-width: 0; }
.link-label { font-weight: 600; font-size: 14px; }
.link-short a { color: var(--navy); font-size: 13px; text-decoration: none; }
.link-short a:hover { text-decoration: underline; }
.link-dest { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.link-actions { display: flex; gap: 8px; flex-shrink: 0; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: #b3261e; font-size: 13px; }

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--navy);
}
.login-card {
  background: var(--white);
  padding: 32px;
  border-radius: var(--radius);
  width: 280px;
  text-align: center;
}
.login-card h1 { color: var(--navy); font-size: 20px; margin: 0 0 4px; }
.login-card input {
  width: 100%;
  padding: 10px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.login-card button {
  width: 100%;
  padding: 10px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 520px) {
  .link-row { flex-wrap: wrap; }
  .link-actions { width: 100%; }
  .link-dest { max-width: 100%; }
}
