:root {
  --bg: #eff6ff;
  --bg-deep: #dbeafe;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --surface-dark: #172b4d;
  --ink: #172b4d;
  --muted: #52647a;
  --line: rgba(23, 43, 77, 0.12);
  --line-strong: rgba(23, 43, 77, 0.2);
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #dbeafe;
  --teal-soft: #dbeafe;
  --success: #1e815a;
  --danger: #a13843;
  --shadow: 0 24px 60px rgba(23, 43, 77, 0.10);
  --shadow-soft: 0 14px 34px rgba(23, 43, 77, 0.08);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 26%),
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.10), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 52%, #e8f1ff 100%);
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(8px);
  z-index: 0;
}

body::before {
  top: 72px;
  left: -90px;
  width: 240px;
  height: 240px;
  background: rgba(37, 99, 235, 0.10);
}

body::after {
  right: -80px;
  bottom: 60px;
  width: 280px;
  height: 280px;
  background: rgba(23, 43, 77, 0.08);
}

.site-main {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.72);
  outline-offset: 3px;
}

img {
  max-width: 100%;
}

code {
  padding: 0.2rem 0.48rem;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.08);
  font-size: 0.92em;
}

h1,
h2,
h3,
strong {
  font-family: Georgia, "Times New Roman", serif;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.flash-wrap {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(720px, calc(100% - 24px));
  display: grid;
  gap: 10px;
}

.flash {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.flash-success {
  border-color: rgba(30, 129, 90, 0.26);
}

.flash-error {
  border-color: rgba(161, 56, 67, 0.26);
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.muted-copy,
label span,
.empty-state-inline {
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

.button-link,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-pill);
  font: 700 0.96rem/1 "Trebuchet MS", "Segoe UI", sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.button-link:hover,
button:hover {
  transform: translateY(-2px);
}

.button-link,
button {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

[hidden] {
  display: none !important;
}

.button-link-light,
button.secondary {
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button:disabled:hover {
  transform: none;
}

button.danger {
  background: linear-gradient(135deg, #b0464f, #932f3d);
}

.button-link-wide {
  width: 100%;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: rgba(37, 99, 235, 0.42);
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
}

.stack {
  display: grid;
  gap: 14px;
}

.compact {
  margin-top: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check input {
  width: auto;
  margin: 0;
}

.badge,
.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-on {
  background: rgba(30, 129, 90, 0.14);
  color: var(--success);
}

.badge-off {
  background: rgba(161, 56, 67, 0.12);
  color: var(--danger);
}

.meta-pill {
  background: rgba(37, 99, 235, 0.07);
  color: var(--muted);
}

.empty-state {
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.12rem;
}

.page-footnote {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.public-search {
  margin-top: 18px;
  margin-bottom: 18px;
}

.public-search-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.links-page,
.error-page,
.admin-login-page,
.admin-shell {
  padding: 42px 16px 72px;
}

.links-shell,
.error-shell,
.admin-login-shell {
  width: min(100%, 720px);
  margin: 0 auto;
}

.profile-card,
.error-card,
.admin-login-card,
.admin-panel,
.stat-card,
.admin-link-card {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.94));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.profile-card,
.error-card,
.admin-login-card,
.admin-panel {
  border-radius: var(--radius-xl);
}

.profile-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
}

.profile-card::after,
.error-card::after,
.admin-login-card::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.10), transparent 68%);
}

.profile-card-top,
.error-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-status,
.profile-domain,
.error-code {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(23, 43, 77, 0.1);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.profile-brand {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 24px 0 18px;
  text-align: center;
}

.profile-logo,
.admin-brand-mark,
.error-brand-mark {
  width: 108px;
  height: 108px;
  border-radius: 32px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.14);
  background:
    radial-gradient(circle at top left, rgba(147, 197, 253, 0.5), transparent 42%),
    linear-gradient(145deg, #ffffff, #dbeafe);
  box-shadow: 0 18px 34px rgba(23, 43, 77, 0.12);
}

.profile-logo img,
.admin-brand-mark img,
.error-brand-mark img {
  width: 74%;
  height: 74%;
  object-fit: contain;
}

.profile-logo-fallback,
.admin-brand-fallback,
.error-brand-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: #172b4d;
  color: #fff;
  font: 700 1.8rem/1 Georgia, serif;
}

.profile-kicker,
.error-kicker {
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.profile-brand h1,
.error-copy h1,
.admin-login-head h1,
.admin-topbar-copy h1 {
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.profile-copy,
.error-copy p {
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.profile-actions,
.error-actions,
.admin-topbar-actions,
.admin-inline-options,
.admin-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mini-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.mini-pill-dark {
  background: rgba(23, 43, 77, 0.94);
  color: #fff;
  border-color: transparent;
}

.links-groups {
  margin-top: 18px;
  display: grid;
  gap: 20px;
}

.links-group {
  display: grid;
  gap: 12px;
}

.links-group-head {
  display: flex;
  justify-content: center;
}

.links-group-head span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.links-list {
  display: grid;
  gap: 14px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(239, 246, 255, 0.96));
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.link-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 24px 42px rgba(23, 43, 77, 0.14);
}

.link-card-media {
  flex: 0 0 68px;
  width: 68px;
  height: 68px;
  border-radius: 22px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #bfdbfe, #dbeafe);
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.link-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-card-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: rgba(23, 43, 77, 0.92);
  color: #fff;
  font: 700 1.3rem/1 Georgia, serif;
}

.link-card-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 4px;
}

.link-card-copy strong {
  font-size: 1.14rem;
}

.link-card-copy span {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.link-card-end {
  display: grid;
  justify-items: end;
  gap: 8px;
  flex: 0 0 auto;
}

.link-card-path {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: rgba(37, 99, 235, 0.07);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.link-card-arrow {
  font-size: 1.2rem;
  color: var(--accent-dark);
}

.error-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
}

.interstitial-page {
  padding: 56px 16px 72px;
}

.interstitial-shell {
  width: min(100%, 760px);
  margin: 0 auto;
}

.interstitial-card {
  padding: 30px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.94));
  box-shadow: var(--shadow);
  text-align: center;
}

.interstitial-brand {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.interstitial-copy {
  display: grid;
  gap: 12px;
}

.interstitial-copy h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1;
}

.interstitial-copy p,
.interstitial-destination {
  color: var(--muted);
  line-height: 1.6;
}

.interstitial-loader {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0;
}

.interstitial-loader span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  animation: interstitial-pulse 1s infinite ease-in-out;
}

.interstitial-loader span:nth-child(2) {
  animation-delay: 0.16s;
}

.interstitial-loader span:nth-child(3) {
  animation-delay: 0.32s;
}

.interstitial-actions {
  min-height: 50px;
}

.interstitial-destination {
  margin-top: 16px;
  word-break: break-all;
}

@keyframes interstitial-pulse {
  0%, 80%, 100% {
    transform: scale(0.7);
    opacity: 0.45;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.error-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.error-brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
}

.error-brand-fallback {
  width: 28px;
  height: 28px;
  font-size: 1rem;
  border-radius: 10px;
}

.error-brand-copy {
  display: grid;
  gap: 2px;
}

.error-brand-copy span {
  color: var(--muted);
  font-size: 0.9rem;
}

.error-copy {
  margin: 26px 0;
  display: grid;
  gap: 12px;
}

.error-panels {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.error-panel,
.note-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
}

.error-panel p,
.note-card p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.admin-login-shell {
  display: grid;
  place-items: center;
}

.admin-login-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
}

.admin-login-head {
  display: grid;
  gap: 14px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-brand-mark {
  width: 84px;
  height: 84px;
  border-radius: 28px;
}

.admin-login-actions {
  margin-top: 20px;
  display: grid;
  gap: 16px;
}

.admin-login-notes {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-form {
  width: 100%;
}

.admin-shell {
  padding-top: 36px;
}

.admin-dashboard-wrap {
  width: min(1380px, 100%);
  margin: 0 auto;
}

.admin-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.admin-topbar-copy {
  max-width: 760px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 18px 20px;
  border-radius: 24px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 2rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 28px;
}

.admin-panel {
  padding: 22px;
}

.admin-panel-head {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.admin-panel-head h2 {
  font-size: 1.5rem;
}

.admin-panel-head p {
  color: var(--muted);
  line-height: 1.55;
}

.admin-content-panel {
  min-height: 100%;
}

.admin-search-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.admin-subsection + .admin-subsection {
  margin-top: 28px;
}

.admin-subsection-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-subsection-head p {
  color: var(--muted);
  font-size: 0.92rem;
}

.admin-entry-list {
  display: grid;
  gap: 12px;
}

.admin-entry {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.admin-entry[open] {
  background: rgba(239, 246, 255, 0.96);
}

.admin-entry-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
}

.admin-entry-summary::-webkit-details-marker {
  display: none;
}

.admin-entry-summary-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.admin-entry-summary-copy strong {
  font-size: 1.08rem;
}

.admin-entry-summary-copy span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.admin-entry-summary-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-entry-body {
  padding: 0 18px 18px;
  border-top: 1px solid rgba(23, 43, 77, 0.1);
}

.admin-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.admin-link-list {
  display: grid;
  gap: 16px;
}

.admin-link-card {
  padding: 20px;
  border-radius: 28px;
}

.admin-link-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.admin-link-title {
  display: grid;
  gap: 6px;
}

.admin-link-title strong {
  font-size: 1.26rem;
}

.admin-link-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 12px;
}

.destination {
  word-break: break-all;
  color: var(--muted);
  line-height: 1.5;
}

.admin-thumb {
  display: block;
  width: min(220px, 100%);
  max-height: 160px;
  margin: 16px 0;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.admin-delete-form {
  margin-top: 12px;
}

@media (max-width: 980px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .form-row,
  .admin-search-grid,
  .admin-login-notes,
  .error-panels {
    grid-template-columns: 1fr;
  }

  .admin-topbar,
  .admin-topbar-actions,
  .admin-subsection-head,
  .admin-entry-summary,
  .profile-card-top,
  .error-card-top {
    align-items: stretch;
    flex-direction: column;
  }

  .link-card-media {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 18px;
  }

  .link-card {
    align-items: center;
    flex-direction: row;
    padding: 14px;
    gap: 12px;
  }

  .link-card-copy strong {
    font-size: 1rem;
  }

  .link-card-copy span {
    font-size: 0.9rem;
  }

  .link-card-end {
    justify-items: start;
  }

  .profile-card,
  .error-card,
  .admin-login-card,
  .admin-panel,
  .admin-link-card {
    padding: 20px;
    border-radius: 26px;
  }

  .profile-brand h1,
  .error-copy h1,
  .admin-login-head h1,
  .admin-topbar-copy h1 {
    font-size: clamp(2.3rem, 10vw, 3.5rem);
  }
}
