:root {
  --bg: #07111f;
  --panel: rgba(16, 31, 51, .78);
  --panel-strong: #102039;
  --line: rgba(167, 198, 231, .16);
  --text: #eef7ff;
  --muted: #91a7bd;
  --accent: #55d6be;
  --accent-2: #5c9dff;
  --danger: #ff6f7d;
  --shadow: 0 20px 55px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(48, 112, 182, .28), transparent 34rem),
    radial-gradient(circle at 92% 20%, rgba(28, 170, 150, .15), transparent 30rem),
    var(--bg);
}

button, input { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 64px 0 80px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 36px; }
.eyebrow { margin: 0 0 9px; color: var(--accent); font-size: .73rem; font-weight: 800; letter-spacing: .18em; }
h1 { margin: 0; font-size: clamp(2.5rem, 8vw, 5.25rem); line-height: .92; letter-spacing: -.065em; }
h2 { margin: 0 0 24px; font-size: 1.55rem; letter-spacing: -.025em; }
.subtitle { margin: 18px 0 0; color: var(--muted); font-size: 1.05rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); gap: 16px; }
.card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(20, 43, 69, .9), rgba(10, 25, 43, .82));
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease;
}
.card::after { content: ""; position: absolute; width: 120px; height: 120px; right: -45px; bottom: -55px; border-radius: 50%; background: var(--accent); opacity: .09; }
.card:hover { transform: translateY(-3px); border-color: rgba(85, 214, 190, .45); }
.card-top { display: flex; justify-content: space-between; gap: 12px; }
.icon { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 14px; background: rgba(85, 214, 190, .11); color: var(--accent); font-weight: 900; }
.edit { border: 0; border-radius: 10px; padding: 7px 10px; color: var(--muted); background: rgba(255,255,255,.05); }
.edit:hover { color: var(--text); background: rgba(255,255,255,.1); }
.card h3 { margin: 25px 0 8px; font-size: 1.25rem; }
.host { margin: 0; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .84rem; overflow-wrap: anywhere; }
.open { position: absolute; right: 24px; bottom: 22px; z-index: 1; color: var(--text); text-decoration: none; font-weight: 700; }
.open:hover { color: var(--accent); }
.button { border: 1px solid transparent; border-radius: 12px; padding: 11px 17px; color: var(--text); font-weight: 750; }
.button.primary { background: linear-gradient(135deg, #248ea8, #3479db); }
.button.secondary { border-color: var(--line); background: rgba(10, 24, 41, .65); }
.button.danger { margin-right: auto; color: #ffdbe0; border-color: rgba(255,111,125,.28); background: rgba(255,111,125,.12); }
.add-card { width: 100%; margin-top: 18px; padding: 18px; border: 1px dashed rgba(85,214,190,.35); border-radius: 18px; color: var(--accent); background: rgba(85,214,190,.05); font-weight: 800; }
.add-card:hover { background: rgba(85,214,190,.1); }
.notice { margin: -15px 0 24px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: rgba(255,255,255,.035); }
.notice.error-state { color: #ffdbe0; border-color: rgba(255,111,125,.35); }
.hidden { display: none !important; }

dialog { width: min(510px, calc(100% - 24px)); padding: 0; border: 1px solid var(--line); border-radius: 22px; color: var(--text); background: var(--panel-strong); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(2, 8, 15, .76); backdrop-filter: blur(5px); }
.dialog-card { position: relative; display: grid; gap: 17px; padding: 30px; }
.close { position: absolute; top: 16px; right: 18px; border: 0; color: var(--muted); background: none; font-size: 1.6rem; }
label { display: grid; gap: 8px; color: #c9d8e6; font-size: .9rem; font-weight: 680; }
input { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px; outline: none; color: var(--text); background: rgba(2, 10, 20, .48); }
input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(92,157,255,.12); }
.domain-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; background: rgba(2,10,20,.48); }
.domain-input:focus-within { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(92,157,255,.12); }
.domain-input input { min-width: 0; border: 0; background: transparent; box-shadow: none; }
.domain-input span { padding-right: 12px; color: var(--muted); white-space: nowrap; font-size: .82rem; }
.row { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.hint { margin: -2px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.error { min-height: 1.2em; margin: 0; color: var(--danger); font-size: .86rem; }

@media (max-width: 620px) {
  .shell { padding-top: 34px; }
  .hero { align-items: start; flex-direction: column; }
  .row { grid-template-columns: 1fr; }
  .dialog-card { padding: 26px 20px; }
}
