:root {
  color-scheme: dark;
  --bg: #050a16;
  --panel: rgba(8, 15, 30, 0.88);
  --panel-soft: rgba(14, 24, 43, 0.76);
  --line: rgba(137, 164, 204, 0.18);
  --line-strong: rgba(82, 207, 255, 0.3);
  --text: #f1f6ff;
  --muted: #8d9bb2;
  --cyan: #42dbff;
  --blue: #7287ff;
  --green: #36dfa0;
  --red: #ff6d83;
  --amber: #ffc66d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { min-height: 100vh; margin: 0; color: var(--text); background: radial-gradient(circle at 10% 0%, #102653 0, transparent 35%), radial-gradient(circle at 100% 10%, #07343e 0, transparent 28%), var(--bg); }
button, input, textarea { font: inherit; }
button { color: inherit; }

.ambient { position: fixed; z-index: -1; width: 420px; height: 420px; border-radius: 50%; filter: blur(110px); opacity: .16; pointer-events: none; }
.ambient-one { top: 12%; left: -220px; background: #2563eb; }
.ambient-two { right: -220px; bottom: 5%; background: #0dd7c0; }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 46px 0 34px; }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.hero-copy { max-width: 780px; }
.hero-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.language-picker { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.language-picker select { height: 36px; min-width: 142px; padding: 0 32px 0 11px; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: var(--text); background: rgba(12,23,41,.86); }
.language-picker select:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(66,219,255,.08); }
.eyebrow, .status-kicker { display: inline-flex; align-items: center; gap: 9px; color: #9deeff; font-size: 12px; font-weight: 700; letter-spacing: .18em; }
.eyebrow { padding: 8px 13px; border: 1px solid rgba(66,219,255,.28); border-radius: 999px; background: rgba(9,34,57,.6); }
.eyebrow span, .status-kicker span { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
h1 { margin: 15px 0 8px; font-size: clamp(38px, 6vw, 68px); line-height: 1.05; letter-spacing: -.045em; }
.hero p, .status-head p { margin: 0; color: var(--muted); line-height: 1.7; }
.service-card { min-width: 250px; display: flex; align-items: center; gap: 13px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 20px; background: rgba(12,23,41,.72); box-shadow: 0 18px 50px rgba(0,0,0,.2); }
.service-card strong, .service-card small { display: block; }
.service-card small { margin-top: 4px; color: var(--muted); }
.service-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 7px rgba(141,155,178,.08); }
.service-dot.online { background: var(--green); box-shadow: 0 0 18px var(--green), 0 0 0 7px rgba(54,223,160,.1); }
.service-dot.offline { background: var(--red); box-shadow: 0 0 18px rgba(255,109,131,.55), 0 0 0 7px rgba(255,109,131,.1); }

.status-panel, .panel { border: 1px solid var(--line); border-radius: 28px; background: linear-gradient(145deg, rgba(10,17,31,.96), rgba(6,12,25,.9)); box-shadow: 0 26px 80px rgba(0,0,0,.2); }
.status-panel { margin-bottom: 22px; padding: 25px; }
.status-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.status-head h2 { margin: 6px 0 4px; font-size: 27px; }
.legend { display: flex; gap: 17px; color: var(--muted); font-size: 12px; }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend b { font-weight: 400; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend-ok { background: var(--green); box-shadow: 0 0 10px rgba(54,223,160,.65); }
.legend-empty { background: #26364d; }
.status-grid { min-height: 108px; display: grid; grid-template-columns: repeat(48, minmax(6px, 1fr)); grid-auto-flow: column; grid-template-rows: repeat(3, 24px); gap: 5px; margin: 18px 0 13px; padding: 15px; border: 1px solid rgba(141,155,178,.18); border-radius: 18px; background: rgba(129,151,190,.13); overflow: hidden; }
.status-cell { border-radius: 7px; background: #26364d; box-shadow: inset 0 0 0 1px rgba(255,255,255,.03); }
.status-cell.ok { background: linear-gradient(135deg, #2dcf8d, #48e6a7); box-shadow: 0 0 10px rgba(54,223,160,.35); }
.status-cell:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }
.grid-loading { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; place-items: center; color: var(--muted); }
.bucket-detail { min-height: 24px; margin: -2px 2px 10px; color: #9deeff; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }
.metrics div { padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(8,15,30,.55); }
.metrics small { display: block; color: var(--muted); }
.metrics strong { display: block; margin-top: 5px; font-size: 19px; }

.workspace { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 20px; align-items: start; }
.panel { padding: 24px; }
.panel-head, .panel-head > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h2 { margin: 0; font-size: 20px; }
.step { display: inline-grid; place-items: center; min-width: 40px; height: 36px; border: 1px solid rgba(92,180,255,.28); border-radius: 12px; color: #b9e9ff; background: rgba(30,73,121,.45); font-weight: 700; }
.badge, .mini-pill, .zero-pill { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.badge { min-height: 30px; padding: 5px 11px; font-size: 12px; color: var(--muted); }
.badge.ok { color: #8bf0c3; border-color: rgba(54,223,160,.3); background: rgba(54,223,160,.08); }
.badge.running { color: #9deeff; border-color: rgba(66,219,255,.3); background: rgba(66,219,255,.08); }
.badge.bad { color: #ff9aaa; border-color: rgba(255,109,131,.3); background: rgba(255,109,131,.08); }
.field { display: grid; gap: 9px; margin-top: 24px; }
.field > span, .link-block > span { color: #cbd6e8; font-size: 13px; font-weight: 650; }
input, textarea { width: 100%; border: 1px solid var(--line); outline: 0; color: var(--text); background: rgba(3,8,20,.72); transition: border-color .18s, box-shadow .18s; }
input { height: 50px; padding: 0 15px; border-radius: 14px; }
textarea { min-height: 190px; padding: 14px 15px; resize: vertical; border-radius: 16px; line-height: 1.55; }
input:focus, textarea:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(66,219,255,.08); }
input::placeholder, textarea::placeholder { color: #56657b; }
.inline-field { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.field-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.field-meta em { font-style: normal; }
.mini-pill { padding: 4px 9px; color: var(--muted); font-size: 11px; }
.email-card { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 15px; border: 1px solid rgba(66,219,255,.18); border-radius: 17px; background: linear-gradient(120deg, rgba(11,68,87,.38), rgba(9,20,38,.5)); }
.email-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #9deeff; background: rgba(33,139,179,.28); font-size: 20px; }
.email-card div { min-width: 0; flex: 1; }
.email-card small, .email-card strong { display: block; }
.email-card small { color: var(--muted); }
.email-card strong { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.privacy-note { margin: 13px 2px 0; color: #6f7f96; font-size: 11px; line-height: 1.6; }
.button { border: 0; cursor: pointer; transition: transform .16s, opacity .16s, border-color .16s, background .16s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .5; }
.button.primary { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 55px; margin-top: 17px; border-radius: 16px; color: #07101f; background: linear-gradient(100deg, #55e0ef, #6d83ff); font-weight: 800; box-shadow: 0 14px 32px rgba(75,134,255,.18); }
.button.secondary { min-height: 46px; padding: 0 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(14,24,43,.72); }
.button.secondary:hover:not(:disabled), .button.ghost:hover { border-color: var(--line-strong); background: rgba(24,43,68,.8); }
.button.ghost { padding: 7px 11px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); background: transparent; }
.error-box { margin-top: 14px; padding: 12px 14px; border: 1px solid rgba(255,109,131,.3); border-radius: 13px; color: #ffabb8; background: rgba(121,20,45,.16); line-height: 1.5; font-size: 13px; }

.stage-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 24px; padding: 17px; border: 1px solid rgba(66,219,255,.16); border-radius: 17px; background: linear-gradient(110deg, rgba(10,59,78,.4), rgba(9,18,34,.38)); }
.stage-card small, .stage-card strong { display: block; }
.stage-card small { color: var(--muted); }
.stage-card strong { margin-top: 4px; }
.stage-card p { max-width: 54%; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.result-card { margin-top: 18px; padding: 19px; border: 1px solid rgba(54,223,160,.2); border-radius: 20px; background: rgba(7,20,29,.58); }
.result-top, .expiry-card > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.result-top small, .result-top strong { display: block; }
.result-top small { color: var(--muted); }
.result-top strong { margin-top: 3px; }
.zero-pill { padding: 6px 10px; color: #8bf0c3; border-color: rgba(54,223,160,.25); background: rgba(54,223,160,.08); font-size: 11px; }
.qr-layout { display: grid; grid-template-columns: 184px 1fr; gap: 16px; margin-top: 16px; }
.qr-box { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 10px; border-radius: 18px; color: #617088; background: #fff; overflow: hidden; }
.qr-box img { display: none; width: 100%; height: 100%; object-fit: contain; }
.qr-box img.ready { display: block; }
.qr-box img.ready + span { display: none; }
.expiry-card { align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: rgba(5,12,25,.55); }
.expiry-card span, .expiry-card small { color: var(--muted); }
.expiry-card strong { color: #9deeff; font-size: 25px; font-variant-numeric: tabular-nums; }
.countdown-track { height: 7px; margin: 15px 0 12px; border-radius: 99px; background: #1c2a3e; overflow: hidden; }
.countdown-track span { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--blue)); transition: width .8s linear; }
.expiry-card small { line-height: 1.55; }
.link-block { display: grid; gap: 8px; margin-top: 16px; }
.link-block input { height: 44px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.result-actions .button { width: 100%; }

.progress-panel { margin-top: 20px; }
.progress-card { margin-top: 18px; padding: 20px; border: 1px solid rgba(66,219,255,.16); border-radius: 17px; background: linear-gradient(110deg, rgba(10,59,78,.32), rgba(9,18,34,.5)); }
.progress-copy { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.progress-copy small, .progress-copy strong { display: block; }
.progress-copy small { color: var(--muted); }
.progress-copy div strong { margin-top: 4px; font-size: 18px; }
.progress-copy > strong { color: #9deeff; font-size: 28px; font-variant-numeric: tabular-nums; }
.task-progress-track { height: 12px; margin-top: 17px; border-radius: 999px; background: #1c2a3e; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.03); }
.task-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--blue)); box-shadow: 0 0 18px rgba(66,219,255,.3); transition: width .45s ease; }
.progress-card p { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px 4px 0; color: #536279; font-size: 11px; letter-spacing: .04em; }
footer span { color: #7d9aaf; font-weight: 700; letter-spacing: .15em; }
footer p { margin: 0; }
.hidden { display: none !important; }

@media (max-width: 900px) {
  .hero { align-items: flex-start; flex-direction: column; }
  .hero-actions { width: 100%; align-items: stretch; }
  .language-picker { justify-content: flex-end; }
  .service-card { width: 100%; }
  .status-head { flex-direction: column; }
  .status-grid { grid-template-columns: repeat(36, minmax(7px, 1fr)); grid-template-rows: repeat(4, 21px); }
  .workspace { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .shell { width: min(100% - 22px, 1180px); padding-top: 25px; }
  h1 { font-size: 40px; }
  .status-panel, .panel { padding: 17px; border-radius: 21px; }
  .legend { flex-wrap: wrap; }
  .status-grid { grid-template-columns: repeat(24, minmax(6px, 1fr)); grid-template-rows: repeat(6, 18px); gap: 4px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics div { padding: 11px; }
  .inline-field { grid-template-columns: 1fr; }
  .inline-field .button { width: 100%; }
  .field-meta, .stage-card { align-items: flex-start; flex-direction: column; }
  .stage-card p { max-width: none; }
  .qr-layout { grid-template-columns: 1fr; }
  .qr-box { width: min(230px, 100%); margin: 0 auto; }
  .result-actions { grid-template-columns: 1fr; }
  .progress-copy { align-items: flex-start; }
  footer { align-items: flex-start; flex-direction: column; }
}
