/* SallyLabs temp-link editor */

:root {
  --bg: #17111b;
  --bg-2: #1c1521;
  --card: #231a29;
  --card-2: #2a2031;
  --card-3: #33283b;
  --line: #3a2e43;
  --line-soft: #2e2436;
  --text: #f3e9f0;
  --muted: #a99aa6;
  --faint: #7d6f7a;
  --pink-1: #ffafd3;
  --pink-2: #f374ac;
  --accent: #f78fc0;
  --accent-grad: linear-gradient(135deg, var(--pink-1), var(--pink-2));
  --on-accent: #2a1222;
  --ok: #7ee2a8;
  --warn: #ffd27f;
  --err: #ff7a8a;
  --info: #9cc8ff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 1px 0 rgba(255, 255, 255, .03) inset;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(243, 116, 172, .10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255, 175, 211, .06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(247, 143, 192, .35); }
a { color: var(--pink-1); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
code, kbd { font-family: var(--mono); font-size: .9em; }
kbd {
  background: var(--card-3); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; padding: 0 .35em;
}
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stack { display: grid; gap: 12px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.noscript { padding: 24px; text-align: center; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--pink-1);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ── Boot / ended ── */
.boot, .ended {
  min-height: 100vh; display: grid; place-items: center; padding: var(--gutter);
}
.boot-card { display: grid; justify-items: center; gap: 14px; }
.ended-card {
  max-width: 440px; text-align: center; background: var(--card);
  border: 1px solid var(--line-soft); border-radius: 22px; padding: 36px 28px;
  box-shadow: var(--shadow); display: grid; gap: 14px; justify-items: center;
}
.ended-card .logo { width: 56px; height: 56px; }
.ended-card h1 { font-size: 1.4rem; }
.ended-card code {
  background: var(--card-3); border-radius: 8px; padding: 3px 8px; color: var(--pink-1); white-space: nowrap;
}

/* ── Spinner / skeleton ── */
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .18); border-top-color: currentColor;
  animation: spin .8s linear infinite; display: inline-block; flex: none;
}
.spinner-lg { width: 34px; height: 34px; border-width: 3px; color: var(--pink-1); }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton {
  border-radius: 8px; min-height: 14px;
  background: linear-gradient(90deg, var(--card-2) 0%, var(--card-3) 50%, var(--card-2) 100%);
  background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite;
}
.skel-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ── Buttons ── */
button { font: inherit; color: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 14px; border-radius: 11px;
  background: var(--card-2); border: 1px solid var(--line); color: var(--text);
  font-weight: 600; font-size: .92rem; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s, opacity .15s, box-shadow .15s;
}
.btn:hover:not(:disabled) { background: var(--card-3); border-color: #4a3c55; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary {
  background: var(--accent-grad); border-color: transparent; color: var(--on-accent);
  box-shadow: 0 6px 18px rgba(243, 116, 172, .25);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-grad); filter: brightness(1.06); border-color: transparent; }
.btn-primary:disabled { background: var(--card-3); color: var(--muted); border-color: var(--line); box-shadow: none; opacity: .75; }
.btn-ok { color: var(--ok); }
.btn-warn { color: var(--warn); }
.btn-danger { color: var(--err); }
.btn-danger-solid { background: var(--err); border-color: transparent; color: #2b0b10; }
.btn-danger-solid:hover:not(:disabled) { background: #ff8f9c; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--card-2); border-color: var(--line-soft); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: .85rem; border-radius: 9px; }
.btn-sm svg { width: 15px; height: 15px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer; flex: none;
  transition: background .15s, color .15s;
}
.icon-btn:hover:not(:disabled) { background: var(--card-3); color: var(--text); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.danger:hover:not(:disabled) { color: var(--err); }

/* ── Inputs ── */
.input, select.input, textarea.input {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  font: inherit; transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; line-height: 1.45; }
.input.mono { font-family: var(--mono); font-size: .9rem; }
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(247, 143, 192, .18); outline: none; }
.input:disabled { opacity: .6; cursor: not-allowed; }
select.input {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.input-icon .input { padding-left: 36px; }

.switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span {
  position: absolute; inset: 0; border-radius: 99px; background: var(--card-3); border: 1px solid var(--line);
  transition: background .15s;
}
.switch span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--muted); transition: transform .18s, background .18s;
}
.switch input:checked + span { background: var(--accent-grad); border-color: transparent; }
.switch input:checked + span::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + span { outline: 2px solid var(--pink-1); outline-offset: 2px; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + span { opacity: .5; }

.seg {
  display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; justify-self: start; max-width: 100%;
  background: var(--bg-2); border: 1px solid var(--line);
}
.seg button {
  display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent;
  color: var(--muted); padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: .9rem;
}
.seg button svg { width: 16px; height: 16px; }
.seg button[aria-pressed="true"] { background: var(--card-3); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.05) inset; }
.seg button:disabled { cursor: not-allowed; opacity: .55; }

/* ── Shell layout ── */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(23, 17, 27, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 12px var(--gutter);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.srv-icon {
  width: 46px; height: 46px; border-radius: 12px; flex: none; overflow: hidden;
  background: var(--card-3); display: grid; place-items: center; image-rendering: pixelated;
  border: 1px solid var(--line); font-weight: 700; color: var(--pink-1); font-size: 1.2rem;
}
.srv-icon img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block; }
.srv-id { min-width: 0; flex: 1 1 200px; }
.srv-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.srv-name h1 { font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.srv-addr { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: .88rem; min-width: 0; }
.srv-addr span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: .85rem; }
.srv-addr .icon-btn { width: 28px; height: 28px; }
.srv-addr .icon-btn svg { width: 15px; height: 15px; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.countdown { font-size: .8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.countdown svg { width: 14px; height: 14px; }
.countdown.idle { color: var(--warn); }

.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px;
  border-radius: 99px; font-size: .8rem; font-weight: 650; letter-spacing: .01em;
  background: var(--card-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.pill.ok { color: var(--ok); background: rgba(126, 226, 168, .08); border-color: rgba(126, 226, 168, .25); }
.pill.ok .dot { box-shadow: 0 0 0 0 rgba(126, 226, 168, .6); animation: pulse 2s infinite; }
.pill.warn { color: var(--warn); background: rgba(255, 210, 127, .08); border-color: rgba(255, 210, 127, .25); }
.pill.warn .dot { animation: blink 1.2s ease-in-out infinite; }
.pill.err { color: var(--err); background: rgba(255, 122, 138, .08); border-color: rgba(255, 122, 138, .28); }
.pill.accent { color: var(--pink-1); background: rgba(247, 143, 192, .1); border-color: rgba(247, 143, 192, .3); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(126, 226, 168, .55); } 70% { box-shadow: 0 0 0 7px rgba(126, 226, 168, 0); } 100% { box-shadow: 0 0 0 0 rgba(126, 226, 168, 0); } }
@keyframes blink { 50% { opacity: .35; } }

.strip {
  max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter);
}
.warn-strip {
  display: flex; align-items: center; gap: 10px; font-size: .82rem; color: #e9c9d8;
  padding: 8px 0;
}
.warn-strip svg { width: 15px; height: 15px; color: var(--pink-1); flex: none; }
.warn-strip-wrap { border-bottom: 1px solid var(--line-soft); background: rgba(243, 116, 172, .06); }

.ro-banner {
  margin: 14px auto 0; max-width: 1280px; padding: 0 var(--gutter);
}
.ro-banner-inner {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-radius: var(--radius); border: 1px solid rgba(255, 210, 127, .35);
  background: linear-gradient(135deg, rgba(255, 210, 127, .12), rgba(243, 116, 172, .10));
}
.ro-banner-inner .ro-icon {
  width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center;
  background: rgba(255, 210, 127, .16); color: var(--warn);
}
.ro-banner-inner .ro-icon svg { width: 20px; height: 20px; }
.ro-banner-inner p { flex: 1 1 0; min-width: 0; }
.ro-banner-inner strong { color: var(--warn); }
.ro-banner-inner .chat-btn {
  display: inline-block; padding: 0 6px; border-radius: 5px; background: rgba(126, 226, 168, .14);
  color: var(--ok); font-weight: 700; white-space: nowrap;
}
.ro-wait { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); white-space: nowrap; }

.layout {
  flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 18px var(--gutter) 40px;
  display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 22px; align-items: start;
}
.nav { position: sticky; top: 92px; display: grid; gap: 3px; }
.nav button {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border-radius: 11px;
  background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer;
  font-weight: 600; font-size: .93rem; text-align: left; transition: background .15s, color .15s;
}
.nav button svg { width: 18px; height: 18px; flex: none; }
.nav button:hover { background: var(--card); color: var(--text); }
.nav button[aria-selected="true"] {
  background: var(--card); color: var(--text); border-color: var(--line-soft);
  box-shadow: inset 3px 0 0 var(--pink-2);
}
.nav button[aria-selected="true"] svg { color: var(--pink-1); }
.nav .badge {
  margin-left: auto; font-size: .7rem; padding: 1px 7px; border-radius: 99px; background: var(--card-3); color: var(--muted);
}
.main { min-width: 0; }
.panel { display: grid; gap: 18px; animation: fade .18s ease-out; }
@keyframes fade { from { transform: translateY(4px); } to { transform: none; } }
.panel-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: 1.3rem; }
.panel-head .sub { color: var(--muted); font-size: .9rem; }

/* ── Cards ── */
.card {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius);
  box-shadow: var(--shadow); min-width: 0;
}
.card-pad { padding: 18px; }
.card-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap;
}
.card-head h3 { display: flex; align-items: center; gap: 9px; }
.card-head h3 svg { width: 18px; height: 18px; color: var(--pink-1); }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.card.danger { border-color: rgba(255, 122, 138, .28); }
.card.danger .card-head h3 svg { color: var(--err); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

.stat { padding: 16px; display: grid; gap: 8px; }
.stat-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .82rem; font-weight: 600; }
.stat-top svg { width: 16px; height: 16px; color: var(--pink-1); }
.stat-val { font-size: 1.55rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-val small { font-size: .85rem; color: var(--muted); font-weight: 600; margin-left: 4px; }
.bar { height: 7px; border-radius: 99px; background: var(--card-3); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent-grad); transition: width .5s ease; }
.bar.warn > i { background: var(--warn); }
.bar.err > i { background: var(--err); }
.bar.indet > i { width: 35% !important; animation: indet 1.3s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

.job { display: grid; gap: 10px; }
.job-top { display: flex; align-items: center; gap: 10px; }
.job-top strong { flex: 1; }
.alert {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius); align-items: flex-start;
  border: 1px solid rgba(255, 122, 138, .3); background: rgba(255, 122, 138, .08);
}
.alert svg { width: 20px; height: 20px; color: var(--err); flex: none; margin-top: 1px; }
.alert pre { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: .82rem; color: #ffc9d0; }

.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.quick button {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 12px; text-align: left;
  background: var(--card-2); border: 1px solid var(--line-soft); cursor: pointer; transition: border-color .15s, background .15s, transform .15s;
}
.quick button:hover { border-color: rgba(247, 143, 192, .45); background: var(--card-3); transform: translateY(-1px); }
.quick .qi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(247, 143, 192, .12); color: var(--pink-1); flex: none; }
.quick .qi svg { width: 18px; height: 18px; }
.quick b { display: block; font-size: .9rem; }
.quick span { display: block; font-size: .78rem; color: var(--muted); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }

/* ── Empty states ── */
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 36px 18px; color: var(--muted); }
.empty .ei { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; background: var(--card-2); color: var(--pink-1); margin-bottom: 4px; }
.empty .ei svg { width: 24px; height: 24px; }
.empty b { color: var(--text); font-size: 1rem; }

/* ── Console ── */
.console-card { display: flex; flex-direction: column; overflow: hidden; }
.console {
  height: min(62vh, 640px); min-height: 280px; overflow: auto; padding: 12px 14px;
  background: #0f0b12; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; color: #e7dce4;
  overscroll-behavior: contain;
}
.console .ln { white-space: pre-wrap; word-break: break-word; min-height: 1.55em; }
.console .ln.sent { color: var(--pink-1); }
.console-wrap { position: relative; }
.jump {
  position: absolute; right: 14px; bottom: 14px; z-index: 2;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5);
}
.console-input {
  display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line-soft); background: var(--card);
}
.console-input .prompt { display: grid; place-items: center; color: var(--pink-1); font-family: var(--mono); font-weight: 700; padding: 0 2px 0 6px; }
.console-input .input { font-family: var(--mono); font-size: .9rem; }

/* ── Files ── */
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-width: 0; font-size: .92rem; }
.crumbs button {
  border: 0; background: transparent; color: var(--muted); padding: 4px 7px; border-radius: 7px; cursor: pointer; font-weight: 600;
}
.crumbs button:hover { background: var(--card-3); color: var(--text); }
.crumbs button[aria-current="page"] { color: var(--text); }
.crumbs .sep { color: var(--faint); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.flist { list-style: none; margin: 0; padding: 0; position: relative; }
.flist-head, .frow {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) 90px 150px 76px; gap: 10px; align-items: center; padding: 0 14px;
}
.flist-head { font-size: .75rem; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; padding-top: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.frow { min-height: 48px; border-bottom: 1px solid var(--line-soft); transition: background .12s; }
.frow:last-child { border-bottom: 0; }
.frow:hover { background: rgba(255, 255, 255, .02); }
.frow.selected { background: rgba(247, 143, 192, .07); }
.frow input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--pink-2); margin: 0; cursor: pointer; }
.fname { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fname svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.fname.dir svg { color: var(--pink-1); }
.fname button, .fname > span.nm {
  border: 0; background: transparent; padding: 4px 0; cursor: pointer; text-align: left; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550;
}
.fname > span.nm { cursor: default; color: var(--muted); }
.fname button:hover { color: var(--pink-1); text-decoration: underline; text-underline-offset: 3px; }
.lock {
  display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 650; color: var(--warn);
  background: rgba(255, 210, 127, .1); border-radius: 99px; padding: 1px 8px; flex: none; max-width: 50%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lock svg { width: 12px !important; height: 12px !important; color: var(--warn) !important; }
.fsize, .fmod { color: var(--muted); font-size: .84rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.factions { display: flex; justify-content: flex-end; gap: 2px; }
.dropzone {
  position: absolute; inset: 0; z-index: 5; display: none; place-items: center; border-radius: var(--radius);
  border: 2px dashed var(--pink-2); background: rgba(23, 17, 27, .85); color: var(--pink-1); font-weight: 700;
}
.dropzone.on { display: grid; }
.dropzone div { display: grid; justify-items: center; gap: 8px; }
.dropzone svg { width: 34px; height: 34px; }
.uploads { display: grid; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); background: var(--card-2); }
.up-item { display: grid; gap: 5px; font-size: .85rem; }
.up-item .row span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-item.done .bar > i { background: var(--ok); }
.up-item.fail .bar > i { background: var(--err); }
.selbar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: rgba(247, 143, 192, .08); border-bottom: 1px solid var(--line-soft); font-size: .88rem; }

/* ── Code editor ── */
.editor-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.editor-path { font-family: var(--mono); font-size: .88rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 160px; }
.dirty-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pink-2); flex: none; box-shadow: 0 0 0 3px rgba(243,116,172,.2); }
.code {
  display: grid; grid-template-columns: auto minmax(0, 1fr); height: min(66vh, 720px); min-height: 300px;
  background: #110c14; font-family: var(--mono); font-size: 13px; line-height: 1.6; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden;
}
.gutter {
  margin: 0; padding: 12px 10px 12px 14px; text-align: right; color: #5f5160; user-select: none; overflow: hidden;
  border-right: 1px solid var(--line-soft); background: #140e17; white-space: pre; min-width: 46px; font: inherit;
}
.code textarea {
  margin: 0; border: 0; resize: none; padding: 12px 14px; background: transparent; color: #f1e6ee; font: inherit;
  white-space: pre; overflow: auto; tab-size: 4; outline: none; width: 100%; height: 100%;
}
.code textarea:focus-visible { outline: none; box-shadow: inset 0 0 0 2px rgba(247, 143, 192, .35); }
.editor-foot { display: flex; gap: 14px; padding: 8px 14px; font-size: .78rem; color: var(--faint); border-top: 1px solid var(--line-soft); flex-wrap: wrap; }

.props { display: grid; gap: 0; }
.props-search { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.prop {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 14px; align-items: center;
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft);
}
.prop:last-child { border-bottom: 0; }
.prop-key b { display: block; font-weight: 600; font-size: .92rem; }
.prop-key code { color: var(--faint); font-size: .76rem; overflow-wrap: anywhere; }
.prop-val { display: flex; justify-content: flex-end; }
.prop-val .input { min-height: 36px; padding: 6px 10px; font-family: var(--mono); font-size: .86rem; }
.prop.changed { background: rgba(247, 143, 192, .05); box-shadow: inset 3px 0 0 var(--pink-2); }
.props-scroll { max-height: min(66vh, 720px); overflow: auto; }

/* ── Plugins ── */
.plist { list-style: none; margin: 0; padding: 0; }
.pitem { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.pitem:last-child { border-bottom: 0; }
.pico {
  width: 42px; height: 42px; border-radius: 11px; background: var(--card-3); flex: none; display: grid; place-items: center;
  color: var(--pink-1); overflow: hidden;
}
.pico img { width: 100%; height: 100%; object-fit: cover; }
.pico svg { width: 20px; height: 20px; }
.pmeta { min-width: 0; flex: 1; }
.pmeta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmeta .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 16px; }
.mcard {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: 12px;
  background: var(--card-2); border: 1px solid var(--line-soft); align-content: start;
}
.mcard .pico { width: 48px; height: 48px; }
.mcard h4 { font-size: .96rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard p.desc { font-size: .84rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; }
.mcard .mfoot { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mcard .mfoot .grow { font-size: .78rem; color: var(--faint); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 650; padding: 1px 8px; border-radius: 99px; background: var(--card-3); color: var(--muted); }
.tag svg { width: 12px; height: 12px; flex: none; }
.tag { white-space: nowrap; }
.tag.warn { background: rgba(255, 210, 127, .12); color: var(--warn); }
.tag.ok { background: rgba(126, 226, 168, .12); color: var(--ok); }

/* ── Settings ── */
.mc-preview {
  display: flex; gap: 12px; padding: 12px; border-radius: 6px; align-items: center;
  background: #1e1e1e url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8'><rect width='8' height='8' fill='%23202020'/><rect width='4' height='4' fill='%23242424'/><rect x='4' y='4' width='4' height='4' fill='%23242424'/></svg>");
  border: 1px solid #000; box-shadow: inset 0 0 0 1px #3a3a3a;
  font-family: var(--mono); font-size: 14px; line-height: 1.35; overflow: hidden;
}
.mc-preview .mc-icon { width: 56px; height: 56px; flex: none; background: #333; image-rendering: pixelated; display: grid; place-items: center; color: #aaa; overflow: hidden; }
.mc-preview .mc-icon img { width: 100%; height: 100%; image-rendering: pixelated; object-fit: cover; }
.mc-preview .mc-text { min-width: 0; flex: 1; }
.mc-preview .mc-title { color: #fff; display: flex; justify-content: space-between; gap: 10px; }
.mc-preview .mc-title span:last-child { color: #aaa; white-space: nowrap; }
.mc-preview .mc-motd { color: #aaa; white-space: pre-wrap; word-break: break-word; min-height: 2.7em; text-shadow: 2px 2px 0 rgba(0, 0, 0, .35); }
.mc-obf { filter: blur(2px); }
.codes { display: flex; flex-wrap: wrap; gap: 5px; }
.codes button {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid rgba(0, 0, 0, .4); cursor: pointer; padding: 0;
  font-family: var(--mono); font-size: .75rem; font-weight: 700; color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .7);
}
.codes button.fmt { background: var(--card-3); border-color: var(--line); width: auto; padding: 0 8px; }
.codes button:disabled { opacity: .4; cursor: not-allowed; }
.hint { font-size: .8rem; color: var(--faint); }
.icon-edit { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.icon-frame {
  width: 96px; height: 96px; border-radius: 14px; overflow: hidden; background: var(--card-3); display: grid; place-items: center;
  border: 1px solid var(--line); flex: none; color: var(--faint);
}
.icon-frame img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.icon-frame svg { width: 30px; height: 30px; }
.icon-frame.pending { border-color: var(--pink-2); box-shadow: 0 0 0 3px rgba(243, 116, 172, .2); }
.members { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.members li { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 10px; border-radius: 10px; background: var(--card-2); }
.members li img, .avatar { width: 26px; height: 26px; border-radius: 6px; flex: none; background: var(--card-3); display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: var(--pink-1); }
.members li b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* ── History ── */
.timeline { list-style: none; margin: 0; padding: 6px 18px 18px; }
.tl-day { font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--faint); padding: 16px 0 8px 40px; }
.tl-item { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 6px 0 14px; }
.tl-item::before { content: ""; position: absolute; left: 13.5px; top: 34px; bottom: -4px; width: 1px; background: var(--line); }
.tl-item.last::before { display: none; }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--card-3); color: var(--muted); }
.tl-dot svg { width: 14px; height: 14px; }
.tl-dot.ok { background: rgba(126, 226, 168, .14); color: var(--ok); }
.tl-dot.warn { background: rgba(255, 210, 127, .14); color: var(--warn); }
.tl-dot.err { background: rgba(255, 122, 138, .14); color: var(--err); }
.tl-dot.accent { background: rgba(247, 143, 192, .14); color: var(--pink-1); }
.tl-body { min-width: 0; padding-top: 3px; }
.tl-body .row { justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tl-body b { font-weight: 600; }
.tl-body time { font-size: .8rem; color: var(--faint); white-space: nowrap; }
.tl-detail { font-size: .84rem; color: var(--muted); overflow-wrap: anywhere; margin-top: 2px; }

/* ── Toasts ── */
.toasts {
  position: fixed; z-index: 100; right: 16px; bottom: 16px; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px; border-radius: 13px;
  background: #2c2233; border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
  animation: toast-in .22s cubic-bezier(.2, .9, .3, 1.2); font-size: .9rem;
}
.toast.out { animation: toast-out .2s ease-in forwards; }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.ok svg { color: var(--ok); }
.toast.err { border-color: rgba(255, 122, 138, .35); }
.toast.err svg { color: var(--err); }
.toast.warn svg { color: var(--warn); }
.toast.info svg { color: var(--pink-1); }
.toast p { flex: 1; overflow-wrap: anywhere; }
.toast .icon-btn { width: 24px; height: 24px; margin: -2px -4px 0 0; }
.toast .icon-btn svg { width: 14px; height: 14px; margin: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ── Dialog ── */
dialog.dlg {
  border: 1px solid var(--line); border-radius: 18px; padding: 0; background: var(--card); color: var(--text);
  width: min(440px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
dialog.dlg::backdrop { background: rgba(10, 6, 12, .66); backdrop-filter: blur(3px); }
dialog.dlg[open] { animation: dlg-in .18s ease-out; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dlg form { display: grid; gap: 14px; padding: 22px; }
.dlg h2 { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; }
.dlg h2 svg { width: 20px; height: 20px; color: var(--pink-1); }
.dlg.danger h2 svg { color: var(--err); }
.dlg .dlg-msg { color: var(--muted); font-size: .92rem; white-space: pre-line; overflow-wrap: anywhere; }
.dlg .dlg-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; flex-wrap: wrap; }
.dlg .err-text { color: var(--err); font-size: .82rem; min-height: 1em; }

/* ── Responsive ── */
@media (max-width: 1080px) {
  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 0; gap: 14px; }
  .nav {
    position: sticky; top: var(--topbar-h, 0px); z-index: 15; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
    margin: 0 calc(-1 * var(--gutter)); padding: 8px var(--gutter);
    background: rgba(23, 17, 27, .9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line-soft);
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav button { width: auto; flex: none; padding: 8px 12px; font-size: .88rem; }
  .nav button[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--pink-2); }
  .nav .badge { display: none; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .topbar { position: static; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .topbar-inner { gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .srv-icon { width: 40px; height: 40px; }
  .top-actions { width: 100%; }
  .top-actions .countdown { margin-left: auto; order: 5; }
  .grid-stats { gap: 10px; }
  .stat { padding: 13px; }
  .stat-val { font-size: 1.3rem; }
  .card-head, .card-body { padding-left: 14px; padding-right: 14px; }
  .flist-head { display: none; }
  .frow { grid-template-columns: 24px minmax(0, 1fr) auto; grid-template-rows: auto auto; row-gap: 0; padding: 8px 10px; }
  .frow > :nth-child(1) { grid-row: 1 / 3; }
  .frow .fname { grid-column: 2; }
  .frow .fsize, .frow .fmod { grid-column: 2; grid-row: 2; font-size: .76rem; }
  .frow .fsize { justify-self: start; }
  .frow .fmod { justify-self: end; }
  .frow .factions { grid-column: 3; grid-row: 1 / 3; }
  .prop { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .prop-val { justify-content: stretch; }
  .prop-val .switch { margin-left: 0; }
  .ro-banner-inner { flex-wrap: wrap; }
  .ro-wait { margin-left: 52px; flex-basis: 100%; }
  .results { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .console { height: 58vh; font-size: 11.5px; }
  .toasts { left: 16px; right: 16px; width: auto; bottom: 12px; }
  .pitem { padding: 12px 14px; }
  .timeline { padding: 4px 14px 14px; }
  .warn-strip { font-size: .76rem; }
}
