:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(42, 67, 108, 0.72);
  --panel-strong: rgba(37, 59, 98, 0.92);
  --line: rgba(173, 204, 255, 0.24);
  --text: #eef4ff;
  --muted: #b6c4dd;
  --mint: #8ff0d2;
  --pink: #f2b8cf;
  --blue: #93bcff;
  --danger: #ff9aae;
  --warning: #f6cb83;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 8%, rgba(75, 112, 194, .32), transparent 32%),
    radial-gradient(circle at 82% 24%, rgba(142, 82, 153, .22), transparent 28%),
    linear-gradient(rgba(4, 14, 29, .45), rgba(5, 14, 27, .88)),
    linear-gradient(145deg, #15294c 0%, #0a1830 48%, #07101d 100%);
  background-attachment: fixed;
}

body::before, body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}
body::before {
  opacity: .56;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.85) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(149,193,255,.7) 0 1px, transparent 1.5px);
  background-position: 0 0, 37px 53px;
  background-size: 83px 83px, 127px 127px;
}
body::after {
  background: linear-gradient(to top, rgba(4,10,20,.68), transparent 45%);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }

.shell { position: relative; z-index: 1; width: min(1040px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 54px; }
.topbar { display: flex; align-items: center; gap: 14px; min-height: 54px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; font-family: Georgia, "Noto Serif SC", serif; letter-spacing: .24em; font-size: 20px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: linear-gradient(145deg,#e9f8ff,#9cd8ea); color: #2b4b70; box-shadow: 0 8px 25px rgba(131, 206, 234, .28); }
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.pill, .icon-button, .button { border: 1px solid var(--line); background: rgba(66, 91, 132, .5); box-shadow: inset 0 1px rgba(255,255,255,.08); transition: .18s ease; cursor: pointer; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 999px; font-size: 14px; }
.pill:hover, .button:hover, .icon-button:hover { transform: translateY(-1px); border-color: rgba(173, 204, 255, .48); background: rgba(80, 108, 153, .7); }
.status-strip { display: flex; justify-content: center; margin: 18px 0 28px; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; background: rgba(55, 91, 120, .76); color: #dbe9fb; font-size: 13px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #45dcad; box-shadow: 0 0 13px #45dcad; }

.hero { text-align: center; padding: 14px 12px 26px; }
.hero h1 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-weight: 500; letter-spacing: .15em; font-size: clamp(29px, 5vw, 48px); text-shadow: 0 5px 24px rgba(0,0,0,.35); }
.hero h1 em { color: var(--pink); font-style: normal; }
.hero p { max-width: 720px; margin: 18px auto 0; color: var(--muted); line-height: 1.9; }

.glass { border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(145deg, rgba(50, 78, 123, .78), rgba(32, 53, 89, .78)); box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.07); backdrop-filter: blur(18px); }
.stats { padding: 28px; margin-bottom: 22px; }
.card-title { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; font-family: Georgia, "Noto Serif SC", serif; font-size: 25px; letter-spacing: .08em; }
.card-title .tiny { margin-left: auto; font: 12px Inter, sans-serif; letter-spacing: 0; color: var(--mint); }
.result-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 9px; min-height: 38px; }
.result-grid > .muted { grid-column: 1 / -1; align-self: center; }
.result-dot { display: grid; place-items: center; aspect-ratio: 1; border-radius: 9px; background: rgba(133, 180, 216, .15); border: 1px solid rgba(167,205,235,.14); color: var(--muted); font-weight: 800; }
.result-dot.success { color: var(--mint); background: rgba(71, 180, 160, .16); }
.result-dot.failed { color: var(--pink); background: rgba(194, 116, 144, .15); }
.scoreboard { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 22px; align-items: center; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.score { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.score strong { font: italic 44px Georgia, serif; }
.score.success strong { color: var(--mint); }
.score.failed strong { color: var(--pink); }
.scoreboard .divider { height: 48px; background: var(--line); }
.subline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 18px; color: var(--muted); font-size: 13px; }

.steps { padding: 28px; margin-bottom: 22px; }
.step-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; list-style: none; padding: 0; margin: 0; }
.step { position: relative; padding: 18px 16px 17px 52px; border: 1px solid var(--line); border-radius: 16px; background: rgba(34, 58, 96, .5); }
.step-index { position: absolute; left: 16px; top: 18px; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: linear-gradient(145deg, #8dded2, #769bdc); color: #12223c; font-size: 13px; font-weight: 800; }
.step strong { display: block; margin-bottom: 5px; }
.step span { color: var(--muted); font-size: 13px; }
.hours { margin-top: 18px; padding: 15px 17px; border-radius: 15px; background: rgba(16, 35, 62, .42); color: var(--muted); line-height: 1.65; }
.hours b { color: var(--text); }

.form-card { padding: 30px; max-width: 760px; margin: 0 auto; }
.section-title { margin: 0 0 7px; font: 500 28px Georgia, "Noto Serif SC", serif; letter-spacing: .08em; }
.section-copy { margin: 0 0 24px; color: var(--muted); line-height: 1.7; }
.field { margin-bottom: 17px; }
.field label { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 700; font-size: 14px; }
.field small { color: var(--muted); font-weight: 400; }
.input { width: 100%; padding: 14px 15px; border: 1px solid var(--line); border-radius: 13px; outline: none; color: var(--text); background: rgba(9, 24, 47, .65); transition: .18s ease; }
.input:focus { border-color: rgba(143, 240, 210, .66); box-shadow: 0 0 0 4px rgba(89, 204, 174, .1); }
textarea.input { min-height: 100px; resize: vertical; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 13px; font-weight: 800; }
.button.primary { width: 100%; color: #11233a; background: linear-gradient(135deg, #a7f0da, #93bfff); border: none; }
.button.primary:hover { background: linear-gradient(135deg, #b6f5e2, #a4caff); }
.button.secondary { background: rgba(63, 89, 133, .62); }
.button.danger { background: rgba(166, 71, 94, .44); }
.button:disabled { opacity: .58; cursor: wait; transform: none; }
.notice { display: none; margin: 16px 0; padding: 13px 15px; border-radius: 13px; line-height: 1.55; }
.notice.show { display: block; }
.notice.error { color: #ffd8df; background: rgba(151, 50, 75, .32); border: 1px solid rgba(255,154,174,.28); }
.notice.success { color: #d8fff3; background: rgba(45, 135, 113, .28); border: 1px solid rgba(143,240,210,.28); }
.verified { display: none; margin: 0 0 20px; padding: 13px 15px; border-radius: 14px; border: 1px solid rgba(143,240,210,.3); background: rgba(63, 160, 137, .16); }
.verified.show { display: flex; justify-content: space-between; gap: 14px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.query-link { display: block; text-align: center; margin-top: 18px; color: var(--muted); }
.query-link a { color: var(--mint); }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 16px; background: rgba(9,23,44,.4); }
.tab { min-height: 48px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; cursor: pointer; font: 17px Georgia, serif; letter-spacing: .08em; }
.tab.active { color: var(--text); background: rgba(64, 91, 139, .7); box-shadow: inset 0 1px rgba(255,255,255,.06); }
.result-card { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: rgba(10,27,52,.45); }
.result-card h3 { margin: 0 0 12px; }
.result-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(173,204,255,.12); }
.result-row:last-child { border: 0; }
.status-badge { display: inline-flex; width: fit-content; padding: 5px 10px; border-radius: 999px; background: rgba(109,137,182,.3); }
.status-badge.success { color: var(--mint); }
.status-badge.failed, .status-badge.invalid_link { color: var(--danger); }
.status-badge.unknown { color: var(--warning); }

.explain { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.explain > div { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(43,68,108,.5); }
.explain b { display: block; margin-bottom: 6px; }

.modal { position: fixed; z-index: 20; inset: 0; display: none; place-items: center; padding: 20px; background: rgba(1,8,18,.72); backdrop-filter: blur(8px); }
.modal.show { display: grid; }
.modal-card { width: min(520px, 100%); padding: 26px; }
.modal-card h2 { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; margin-top: 20px; }

.footer { display: flex; justify-content: space-between; gap: 16px; padding: 24px 4px 0; color: #8fa0bb; font-size: 13px; }

.admin-layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
.admin-side, .admin-main { padding: 22px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.summary-item { padding: 15px; border-radius: 14px; background: rgba(23,46,82,.58); border: 1px solid var(--line); }
.summary-item span { display: block; color: var(--muted); font-size: 12px; }
.summary-item strong { display: block; margin-top: 5px; font-size: 26px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.toolbar .input { flex: 1; min-width: 180px; }
.order-list { display: grid; gap: 12px; }
.order { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(13,31,59,.52); }
.order-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.order-head strong { margin-right: auto; }
.order-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; font-size: 13px; color: var(--muted); }
.order-grid b { color: var(--text); }
.link-box { grid-column: 1 / -1; padding: 10px; border-radius: 10px; background: rgba(4,17,36,.62); overflow-wrap: anywhere; color: var(--blue); }
.order-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.mini { min-height: 34px; padding: 0 10px; border-radius: 9px; font-size: 12px; }

@media (max-width: 800px) {
  .topbar { align-items: flex-start; }
  .nav { max-width: 62%; }
  .step-list, .admin-layout { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: repeat(8, 1fr); }
  .summary-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .shell { width: min(100% - 20px, 1040px); padding-top: 14px; }
  .topbar { flex-direction: column; }
  .nav { max-width: none; width: 100%; justify-content: flex-start; }
  .hero { padding-top: 28px; }
  .stats, .steps, .form-card { padding: 20px; border-radius: 20px; }
  .result-grid { grid-template-columns: repeat(6, 1fr); }
  .scoreboard { gap: 12px; }
  .score strong { font-size: 36px; }
  .explain, .order-grid { grid-template-columns: 1fr; }
  .result-row { grid-template-columns: 86px 1fr; }
  .footer { flex-direction: column; }
}
