:root {
  --bg: #0d0f10; --bg-2: #121518; --surface: #181c20; --surface-2: #20252a; --line: #2b3137;
  --text: #e9e6df; --muted: #949aa1; --accent: #e0301e; --accent-2: #ff5a3c; --ok: #3ccf6e; --warn: #f2b33d; --err: #ff6b5a;
  --display: "Oswald", "Arial Narrow", sans-serif; --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-2); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }
[hidden] { display: none !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: 600 .88rem/1.1 var(--body); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #3d444b; background: #262c32; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-danger { color: var(--err); }
.btn-danger:hover { border-color: var(--err); background: rgba(255,107,90,.08); }
.btn-sm { padding: 6px 10px; font-size: .8rem; }
.btn-ghost { background: transparent; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 5px; }
input, select, textarea { width: 100%; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 400 .93rem var(--body); }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.check { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 14px; }
.error { color: var(--err); font-size: .88rem; min-height: 1.2em; margin: 4px 0 10px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(800px 400px at 85% 0%, rgba(224,48,30,.16), transparent 60%), var(--bg); }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 30px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand svg { width: 30px; height: 30px; }

/* Layout */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 58px; padding: 0 20px; background: rgba(13,15,16,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .brand { font: 700 1.05rem/1 var(--display); letter-spacing: .08em; color: var(--text); text-decoration: none; }
.topbar .brand small { color: var(--muted); font-weight: 500; }
.who { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--muted); }
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; width: min(1180px, 100% - 32px); margin: 24px auto 120px; }
.side { position: sticky; top: 82px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.side button { text-align: left; border: 0; background: transparent; color: var(--muted); padding: 10px 14px; border-radius: 6px; font: 500 .93rem var(--body); cursor: pointer; }
.side button:hover { color: var(--text); }
.side button[aria-current="true"] { background: var(--surface-2); color: var(--text); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head p { margin: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px; margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.tools { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { font: 600 .72rem/1 var(--body); text-transform: uppercase; letter-spacing: .08em; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); margin-left: 8px; vertical-align: middle; }
.pill.live { color: var(--ok); border-color: rgba(60,207,110,.4); }
.pill.soon { color: var(--warn); border-color: rgba(242,179,61,.4); }

details.server { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; }
details.server > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; }
details.server > summary::-webkit-details-marker { display: none; }
details.server > summary h3 { margin: 0; font-size: 1.05rem; }
details.server[open] > summary { border-bottom: 1px solid var(--line); }
details.server .body { padding: 20px; }
.rowline { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 8px; margin-bottom: 8px; }
.step { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.step:first-of-type { border-top: 0; }
.step .num { font: 700 1.3rem/1 var(--display); color: var(--accent); padding-top: 8px; }
.step input { margin-bottom: 8px; }
.step textarea { min-height: 60px; }

.preview { border: 1px solid rgba(224,48,30,.4); background: linear-gradient(90deg, rgba(224,48,30,.22), rgba(224,48,30,.08)); border-radius: 8px; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
td, th { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
td:last-child { text-align: right; }

.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; padding: 12px 16px; background: rgba(18,21,24,.96); border-top: 1px solid var(--line); backdrop-filter: blur(8px); transform: translateY(100%); transition: transform .2s; }
.savebar.show { transform: none; }
.savebar-inner { width: min(1180px, 100%); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.savebar .msg { color: var(--warn); font-weight: 600; font-size: .9rem; }
.savebar .err { color: var(--err); font-weight: 500; font-size: .9rem; }

.toast { position: fixed; bottom: 86px; left: 50%; transform: translate(-50%, 20px); background: var(--surface-2); border: 1px solid var(--line); padding: 10px 18px; border-radius: 6px; opacity: 0; transition: .2s; pointer-events: none; font-size: .88rem; z-index: 200; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: var(--err); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 16px; }
  .side { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .side button { white-space: nowrap; padding: 8px 12px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .rowline { grid-template-columns: 1fr; }
  .who .name { display: none; }
}
