/* amp-webinterface — dark dashboard */
:root {
  --bg: #07090d;
  --panel: rgba(17, 21, 29, .74);
  --panel-solid: #0f131a;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #e8eef5;
  --muted: #8b98a9;
  --dim: #5f6b7a;
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, .14);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, .13);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, .13);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, .13);
  --purple: #c084fc;
  --accent: #5eead4;
  --radius: 22px;
  --shadow: 0 24px 70px -28px rgba(0, 0, 0, .9);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
a { color: var(--accent); }

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---- ambient background ------------------------------------------------ */
.aurora {
  position: fixed;
  inset: -20vmax;
  z-index: -1;
  pointer-events: none;
  filter: blur(90px);
  opacity: .55;
}
.aurora span {
  position: absolute;
  display: block;
  border-radius: 50%;
  mix-blend-mode: screen;
  animation: drift 26s var(--ease) infinite alternate;
}
.aurora span:nth-child(1) {
  width: 46vmax; height: 46vmax; left: 4%; top: 2%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 46%, transparent), transparent 68%);
}
.aurora span:nth-child(2) {
  width: 40vmax; height: 40vmax; right: 2%; top: 18%;
  background: radial-gradient(circle, rgba(99, 102, 241, .38), transparent 70%);
  animation-delay: -9s;
}
.aurora span:nth-child(3) {
  width: 36vmax; height: 36vmax; left: 32%; bottom: -6%;
  background: radial-gradient(circle, rgba(192, 132, 252, .22), transparent 70%);
  animation-delay: -17s;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255,255,255,.035), transparent 70%),
    linear-gradient(180deg, rgba(7,9,13,.2), var(--bg) 70%);
}
@keyframes drift {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to { transform: translate3d(4%, 3%, 0) scale(1.12); }
}

/* ---- poll progress ----------------------------------------------------- */
.pollbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
  overflow: hidden;
}
.pollbar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent));
  transform-origin: left;
  transform: scaleX(0);
  opacity: .7;
}
.pollbar.run i { animation: pollbar var(--poll-ms, 5000ms) linear forwards; }
@keyframes pollbar { to { transform: scaleX(1); } }

/* ---- layout ------------------------------------------------------------ */
.shell {
  width: min(1180px, 100% - 40px);
  margin: 0 auto;
  padding: 30px 0 10px;
}

.topbar {
  width: min(1180px, 100% - 40px);
  margin: 0 auto;
  padding: 26px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mark {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 15px;
  color: var(--accent);
  background: linear-gradient(150deg, rgba(255,255,255,.09), rgba(255,255,255,.02));
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 12px 30px -16px var(--accent);
}
.mark .icon { width: 26px; height: 26px; stroke-width: 1.5; }
.brand-text h1 { font-size: 19px; font-weight: 650; letter-spacing: -.02em; }
.brand-text p { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.live {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10, 13, 18, .55);
  backdrop-filter: blur(14px);
  min-width: 168px;
}
.live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(251,191,36,.5);
  animation: pulse 2s infinite;
}
.live[data-state="live"] .live-dot { background: var(--green); box-shadow: 0 0 0 0 rgba(52,211,153,.55); }
.live[data-state="down"] .live-dot { background: var(--red); box-shadow: 0 0 0 0 rgba(248,113,113,.5); }
.live-copy { display: flex; flex-direction: column; line-height: 1.15; }
.live-label { font-size: 12.5px; font-weight: 600; letter-spacing: .01em; }
.live-sub { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52,211,153,.5); }
  70% { box-shadow: 0 0 0 7px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}

/* ---- buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  text-decoration: none;
  transition: background .18s, border-color .18s, transform .12s, color .18s, box-shadow .18s;
  position: relative;
}
.btn:hover:not(:disabled) { background: rgba(255,255,255,.085); border-color: var(--line-strong); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn .icon { width: 16px; height: 16px; }
.btn.ghost { background: transparent; }
.btn.ghost:hover:not(:disabled) { background: rgba(255,255,255,.06); }
.btn.small { height: 32px; padding: 0 11px; font-size: 12px; border-radius: 9px; }
.btn.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 26%, transparent), color-mix(in srgb, var(--accent) 12%, transparent));
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: color-mix(in srgb, var(--accent) 40%, white);
  box-shadow: 0 10px 30px -14px var(--accent);
}
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.btn .count {
  min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  font-size: 10.5px; font-weight: 700;
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  color: color-mix(in srgb, var(--accent) 55%, white);
}

/* ---- summary ----------------------------------------------------------- */
.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 18px;
}
.sum {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 17px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  backdrop-filter: blur(12px);
  min-width: 0;
}
.sum-icon {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.05);
  color: var(--muted);
  border: 1px solid var(--line);
}
.sum-icon .icon { width: 18px; height: 18px; }
.sum.green .sum-icon { color: var(--green); background: var(--green-soft); border-color: rgba(52,211,153,.18); }
.sum.purple .sum-icon { color: var(--purple); background: rgba(192,132,252,.12); border-color: rgba(192,132,252,.18); }
.sum.blue .sum-icon { color: var(--blue); background: var(--blue-soft); border-color: rgba(96,165,250,.18); }
.sum.amber .sum-icon { color: var(--amber); background: var(--amber-soft); border-color: rgba(251,191,36,.18); }
.sum-body { min-width: 0; }
.sum-value {
  font-size: 20px; font-weight: 650; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sum-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; margin-top: 1px; }

/* ---- banner ------------------------------------------------------------ */
.banner {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  margin-bottom: 18px;
  border-radius: 14px;
  border: 1px solid rgba(251,191,36,.24);
  background: linear-gradient(90deg, rgba(251,191,36,.12), rgba(251,191,36,.04));
  color: #f8e3b0;
}
.banner > .icon { color: var(--amber); width: 20px; height: 20px; }
.banner-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.banner-copy strong { font-size: 13px; }
.banner-copy span { font-size: 12.5px; color: rgba(248,227,176,.75); overflow-wrap: anywhere; }

/* ---- cards ------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr));
  gap: 18px;
}
.grid:has(.card:only-child) {
  grid-template-columns: minmax(0, 780px);
  justify-content: center;
}
.card {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel-solid);
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow);
  min-height: 356px;
  display: flex;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
  animation: cardIn .6s var(--ease) both;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 34px 80px -30px rgba(0,0,0,.95); }
.card:nth-child(2) { animation-delay: .07s; }
.card:nth-child(3) { animation-delay: .14s; }
.card:nth-child(4) { animation-delay: .21s; }
.card:nth-child(5) { animation-delay: .28s; }
.card:nth-child(6) { animation-delay: .35s; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(.99); }
  to { opacity: 1; transform: none; }
}

.art, .art-blur {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: filter .5s, opacity .5s, transform .8s var(--ease);
}
.art-blur {
  transform: scale(1.18);
  filter: blur(34px) saturate(1.35) brightness(.75);
  opacity: .62;
}
.art {
  opacity: .58;
  filter: saturate(1.05) contrast(1.02);
}
.card:hover .art { transform: scale(1.035); }
.card.no-art .art, .card.no-art .art-blur {
  background-image:
    radial-gradient(120% 120% at 20% 0%, hsl(var(--hue, 190) 70% 30% / .85), transparent 62%),
    linear-gradient(135deg, hsl(var(--hue, 190) 55% 16%), #0b0e13 70%);
  filter: none;
  opacity: 1;
}
.card.no-art .art-blur { opacity: .5; filter: blur(40px); transform: scale(1.2); }
.card.no-art .art::after {
  content: attr(data-mono);
  position: absolute;
  top: 18px;
  left: 26px;
  font-size: 84px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  color: rgba(255, 255, 255, .07);
  text-transform: uppercase;
  pointer-events: none;
}

.scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6,8,11,.12) 0%, rgba(6,8,11,.42) 46%, rgba(9,12,16,.93) 82%, #0b0e13 100%),
    linear-gradient(90deg, rgba(6,8,11,.55), transparent 55%);
}
.card.offline .art { filter: grayscale(1) brightness(.55); opacity: .4; }
.card.offline .art-blur { filter: grayscale(1) blur(34px) brightness(.5); opacity: .35; }
.card.pending .art { filter: saturate(.8) brightness(.8); }

.inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 20px 20px 18px;
  min-height: 356px;
}

.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 25px; padding: 0 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: rgba(255,255,255,.8);
  background: rgba(9,12,16,.55);
  border: 1px solid rgba(255,255,255,.13);
  backdrop-filter: blur(10px);
  max-width: 55%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.status {
  display: inline-flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 11px 0 9px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 650; letter-spacing: .03em; text-transform: uppercase;
  background: rgba(9,12,16,.55);
  border: 1px solid rgba(255,255,255,.13);
  backdrop-filter: blur(10px);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.online { color: var(--green); border-color: rgba(52,211,153,.3); background: rgba(7,24,19,.6); }
.status.offline { color: var(--red); border-color: rgba(248,113,113,.28); background: rgba(26,10,12,.55); }
.status.pending { color: var(--amber); border-color: rgba(251,191,36,.3); background: rgba(26,20,7,.55); }
.status.error { color: var(--red); border-color: rgba(248,113,113,.34); background: rgba(28,9,12,.62); }
.status.idle { color: var(--blue); border-color: rgba(96,165,250,.28); background: rgba(8,15,26,.55); }
.status.suspended { color: var(--muted); border-color: rgba(255,255,255,.14); }
.status.pending .status-dot {
  background: transparent;
  border: 2px solid currentColor;
  border-right-color: transparent;
  width: 10px; height: 10px;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.card-head { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.title {
  font-size: clamp(21px, 2.4vw, 26px);
  font-weight: 680;
  letter-spacing: -.025em;
  line-height: 1.12;
  text-shadow: 0 2px 18px rgba(0,0,0,.5);
  overflow-wrap: anywhere;
}
.sub {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12px; color: rgba(214, 224, 235, .62);
  font-variant-numeric: tabular-nums;
}
.sub .sep { color: var(--dim); }
.sub .addr { color: rgba(232,238,245,.8); font-weight: 550; }
.copy {
  width: 24px; height: 24px;
  display: inline-grid; place-items: center;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .16s, color .16s;
}
.copy:hover { background: rgba(255,255,255,.08); color: var(--text); }
.copy .icon { width: 14px; height: 14px; }

/* ---- stats ------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.stat {
  padding: 10px 11px 9px;
  border-radius: 12px;
  background: rgba(7, 10, 14, .55);
  border: 1px solid rgba(255,255,255,.07);
  backdrop-filter: blur(8px);
  min-width: 0;
}
.stat-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.stat-top .icon { width: 14px; height: 14px; color: var(--muted); }
.stat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat-value {
  margin-top: 3px;
  font-size: 15px; font-weight: 650;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bar {
  height: 4px;
  margin-top: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--muted);
  transition: width .7s var(--ease), background .3s;
}
.stat-cpu .bar i { background: linear-gradient(90deg, #2dd4bf, #5eead4); }
.stat-memory .bar i { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-players .bar i { background: linear-gradient(90deg, #a855f7, #d8b4fe); }
.stat-cpu .stat-top .icon { color: #5eead4; }
.stat-memory .stat-top .icon { color: #60a5fa; }
.stat-players .stat-top .icon { color: #c084fc; }

.note {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px;
  border-radius: 11px;
  background: rgba(255,255,255,.035);
  border: 1px dashed rgba(255,255,255,.1);
  color: var(--muted);
  font-size: 12px;
}
.note .icon { width: 15px; height: 15px; }
.note.error { color: #fca5a5; border-color: rgba(248,113,113,.2); background: rgba(248,113,113,.06); }

/* ---- controls ---------------------------------------------------------- */
.controls { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.controls .btn { height: 34px; padding: 0 11px; font-size: 12px; border-radius: 10px; }
.controls .btn .icon { width: 14px; height: 14px; }
.controls .spacer { flex: 1; }

.btn.start { color: #86efac; background: var(--green-soft); border-color: rgba(52,211,153,.24); }
.btn.start:hover:not(:disabled) { background: rgba(52,211,153,.22); }
.btn.stop { color: #fca5a5; background: var(--red-soft); border-color: rgba(248,113,113,.22); }
.btn.stop:hover:not(:disabled) { background: rgba(248,113,113,.2); }
.btn.restart { color: #fcd34d; background: var(--amber-soft); border-color: rgba(251,191,36,.2); }
.btn.restart:hover:not(:disabled) { background: rgba(251,191,36,.19); }
.btn.update { color: #93c5fd; background: var(--blue-soft); border-color: rgba(96,165,250,.2); }
.btn.update:hover:not(:disabled) { background: rgba(96,165,250,.19); }
.btn.join {
  color: #c7d7f5;
  background: linear-gradient(180deg, rgba(102,192,244,.18), rgba(102,192,244,.08));
  border-color: rgba(102,192,244,.3);
}
.btn.join:hover { background: rgba(102,192,244,.24); border-color: rgba(102,192,244,.45); }

.btn.lockbtn {
  margin-left: auto;
  background: rgba(255,255,255,.04);
  border-color: var(--line);
  color: var(--muted);
}
.btn.lockbtn.unlocked { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.btn.lockbtn.locked { color: #fcd34d; border-color: rgba(251,191,36,.2); background: rgba(251,191,36,.08); }
.btn.lockbtn.readonly { color: var(--dim); }

.btn.busy { color: transparent !important; pointer-events: none; }
.btn.busy::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  color: var(--text);
  animation: spin .7s linear infinite;
}
.card.busy { pointer-events: none; }
.card.busy .art { filter: saturate(.7) brightness(.7); }

/* ---- empty / footer ---------------------------------------------------- */
.empty {
  margin: 60px auto;
  max-width: 420px;
  text-align: center;
  color: var(--muted);
}
.empty-mark {
  width: 64px; height: 64px; margin: 0 auto 16px;
  border-radius: 20px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
}
.empty-mark .icon { width: 30px; height: 30px; }
.empty h2 { color: var(--text); font-size: 18px; margin-bottom: 4px; }
.empty p { font-size: 13px; }

.footer {
  width: min(1180px, 100% - 40px);
  margin: 26px auto 0;
  padding: 18px 0 26px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--dim);
}
.footer .grow { flex: 1; }
.footer .hint { display: inline-flex; align-items: center; gap: 6px; }
.footer .hint .icon { width: 13px; height: 13px; }
.dot-sep { opacity: .5; }

/* ---- modal ------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 5, 8, .66);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity .2s;
}
.modal-backdrop.open { opacity: 1; }
.modal {
  width: min(430px, 100%);
  position: relative;
  padding: 26px 26px 22px;
  border-radius: 22px;
  background: linear-gradient(180deg, #121722, #0b0f15);
  border: 1px solid var(--line-strong);
  box-shadow: 0 40px 120px -30px rgba(0,0,0,1), inset 0 1px 0 rgba(255,255,255,.06);
  transform: translateY(10px) scale(.97);
  opacity: 0;
  transition: transform .26s var(--ease), opacity .26s;
}
.modal-backdrop.open .modal { transform: none; opacity: 1; }
.modal.shake { animation: shake .4s; }
@keyframes shake {
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
.modal-x {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.modal-x:hover { background: rgba(255,255,255,.07); color: var(--text); }
.modal-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 13px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  margin-bottom: 14px;
}
.modal-icon.danger { color: var(--red); background: var(--red-soft); border-color: rgba(248,113,113,.24); }
.modal-icon .icon { width: 22px; height: 22px; }
.modal h2 { font-size: 19px; letter-spacing: -.02em; }
.modal p { margin-top: 5px; font-size: 13px; color: var(--muted); }
.modal p strong { color: var(--text); }
.modal form { margin-top: 18px; }
.field { position: relative; }
.field input {
  width: 100%;
  height: 44px;
  padding: 0 42px 0 14px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgba(0,0,0,.35);
  color: var(--text);
  font-size: 14px;
  letter-spacing: .02em;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.field input:focus { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.reveal {
  position: absolute; right: 5px; top: 5px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  cursor: pointer;
}
.reveal:hover { color: var(--text); background: rgba(255,255,255,.06); }
.modal-error {
  min-height: 18px;
  margin: 8px 2px 2px;
  font-size: 12px;
  color: #fca5a5;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.modal-actions .btn { height: 40px; padding: 0 16px; }
.modal-actions .btn.danger {
  background: rgba(248,113,113,.16);
  border-color: rgba(248,113,113,.34);
  color: #fecaca;
}
.modal-actions .btn.danger:hover:not(:disabled) { background: rgba(248,113,113,.24); }

/* ---- toasts ------------------------------------------------------------ */
.toasts {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(360px, calc(100vw - 40px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: rgba(14, 18, 25, .94);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px -18px rgba(0,0,0,.9);
  font-size: 12.5px;
  color: var(--text);
  animation: toastIn .3s var(--ease) both;
}
.toast.out { animation: toastOut .25s ease forwards; }
.toast .icon { width: 17px; height: 17px; margin-top: 1px; }
.toast.ok { border-color: rgba(52,211,153,.25); }
.toast.ok .icon { color: var(--green); }
.toast.error { border-color: rgba(248,113,113,.28); }
.toast.error .icon { color: var(--red); }
.toast.info .icon { color: var(--blue); }
.toast-body { min-width: 0; }
.toast-body strong { display: block; font-size: 12.5px; font-weight: 620; }
.toast-body span { display: block; margin-top: 1px; color: var(--muted); overflow-wrap: anywhere; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px) scale(.98); } }

/* ---- responsive -------------------------------------------------------- */
@media (max-width: 900px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .shell, .topbar, .footer { width: calc(100% - 28px); }
  .topbar { padding-top: 18px; flex-wrap: wrap; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .live { min-width: 0; }
  .brand-text h1 { font-size: 17px; }
  .summary { gap: 9px; }
  .sum { padding: 12px 13px; gap: 10px; }
  .sum-value { font-size: 17px; }
  .card, .inner { min-height: 330px; }
  .inner { padding: 17px 16px 15px; }
  .stats { gap: 7px; }
  .stat { padding: 9px 9px 8px; }
  .controls .btn span { display: none; }
  .controls .btn { width: 38px; padding: 0; }
  .controls .btn.lockbtn { width: auto; padding: 0 11px; }
  .controls .btn.lockbtn span { display: inline; }
  .footer .hint { display: none; }
  .footer .grow { display: none; }
  .footer { flex-wrap: wrap; }
  .toasts { right: 14px; bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
