/* core-01 Minecraft panel. Dark navy with an orange accent, after the Dathost panel. */
@font-face {
  font-family: "Inter";
  src: url("vendor/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0b1119;
  --side: #0e1520;
  --card: #141d29;
  --card2: #192433;
  --input: #0f1722;
  --line: #213042;
  --line2: #2b3b50;
  --text: #e8eef5;
  --muted: #95a3b4;
  --dim: #6a798b;
  --accent: #f7931e;
  --accent-h: #ffa53d;
  --accent-soft: rgba(247, 147, 30, .13);
  --on-accent: #1d1206;
  --green: #22c55e;
  --green-t: #4ade80;
  --green-soft: rgba(34, 197, 94, .13);
  --red: #ef4444;
  --red-t: #f87171;
  --red-soft: rgba(239, 68, 68, .13);
  --amber: #f59e0b;
  --amber-t: #fbbf24;
  --amber-soft: rgba(245, 158, 11, .13);
  --blue-t: #60a5fa;
  --blue-soft: rgba(96, 165, 250, .13);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); }
button { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: .9em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.ok-t { color: var(--green-t); }
.bad-t { color: var(--red-t); }
.warn-t { color: var(--amber-t); }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }

/* ------------------------------------------------------------- icons */
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 15px; height: 15px; }
.ic-lg { width: 22px; height: 22px; }

/* ------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--side); border-right: 1px solid var(--line);
  padding: 22px 18px 18px; display: flex; flex-direction: column; gap: 18px;
}
.main { padding: 30px 44px 120px; min-width: 0; }
.main-inner { max-width: 1180px; margin: 0 auto; }
.topbar { display: none; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.brand-name { font-weight: 700; letter-spacing: .01em; }
.brand-sub { font-size: 12px; color: var(--dim); }

.side-actions { display: flex; gap: 8px; }
.side-actions .btn { flex: 1; justify-content: center; }

.server-title { font-size: 21px; font-weight: 700; line-height: 1.2; word-break: break-word; }
.server-game { display: flex; align-items: center; gap: 8px; color: var(--muted); margin-top: 6px; font-size: 14px; }

.addr { display: flex; flex-direction: column; gap: 10px; }
.addr-label { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.addr-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.addr-value { font-weight: 600; font-size: 15px; }

.side-stats {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; display: grid; gap: 8px; font-size: 13.5px;
}
.side-stats div { display: flex; justify-content: space-between; gap: 10px; }
.side-stats span:first-child { color: var(--muted); }
.side-stats span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }

.state-bar {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 10px;
  font-weight: 600; font-size: 14px;
}
.state-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.state-online { background: var(--green-soft); color: var(--green-t); }
.state-offline { background: var(--red-soft); color: var(--red-t); }
.state-busy { background: var(--amber-soft); color: var(--amber-t); }
.state-busy .dot { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px;
  color: var(--text); font-weight: 500; border-left: 3px solid transparent;
}
.nav a:hover { background: var(--card); color: var(--text); }
.nav a.on { background: var(--card); border-left-color: var(--accent); }
.nav a .ic { color: var(--muted); }
.nav a.on .ic { color: var(--accent); }

.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between;
  color: var(--dim); font-size: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------- page header */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h1 { margin: 0 0 6px; font-size: 28px; line-height: 1.2; letter-spacing: -.01em; }
.page-head p { margin: 0; color: var(--muted); max-width: 720px; }
.clock {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; white-space: nowrap;
}
.clock b { color: var(--text); font-variant-numeric: tabular-nums; }
.clock .ic { color: var(--accent); }

/* ------------------------------------------------------------- cards and grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card + .card { margin-top: 18px; }
.grid2 > .card, .grid3 > .card, .grid4 > .card, .stack > .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { margin: 0; font-size: 17px; }
.card-head .sub { color: var(--muted); font-size: 13px; font-weight: 400; margin-left: 8px; }
.stack { display: grid; gap: 18px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }

.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.tile-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.tile-label .ic { color: var(--accent); }
.tile-value { font-size: 26px; font-weight: 700; margin-top: 8px; font-variant-numeric: tabular-nums; }
.tile-note { color: var(--dim); font-size: 13px; margin-top: 2px; }

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 14px;
  cursor: pointer; background: var(--card2); color: var(--text); white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: #213045; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-h); }
.btn-ghost { background: transparent; border-color: var(--line2); }
.btn-ghost:hover { background: var(--card2); }
.btn-danger { background: var(--red-soft); color: var(--red-t); border-color: rgba(239, 68, 68, .25); }
.btn-danger:hover { background: rgba(239, 68, 68, .22); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; background: transparent; color: var(--muted); }
.btn-icon:hover { background: var(--card2); color: var(--text); }
.btn-icon.danger:hover { color: var(--red-t); background: var(--red-soft); }
.linkish { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-weight: 500; }
.linkish:hover { color: var(--accent-h); }

/* ------------------------------------------------------------- forms */
.field { display: grid; gap: 8px; }
.field label, .label { font-size: 13.5px; font-weight: 600; }
.input, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2);
  background: var(--input); color: var(--text); font: inherit; outline: none;
}
textarea.input { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--dim); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 19px, calc(100% - 15px) 19px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 38px; }
.input-sm, .input.input-sm, select.input.input-sm { height: 36px; font-size: 14px; }
select.input.input-sm { background-position: calc(100% - 20px) 15px, calc(100% - 15px) 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
.form-grid .full { grid-column: 1 / -1; }

.switch { position: relative; width: 46px; height: 26px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span {
  position: absolute; inset: 0; border-radius: 999px; background: #2a3647; cursor: pointer; transition: background .18s;
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #cfd8e3; transition: transform .18s;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); background: #fff; }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch input:disabled + span { opacity: .5; cursor: not-allowed; }

.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; background: var(--input); }
.stepper button { width: 40px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }
.stepper button:hover { background: var(--card2); color: var(--text); }
.stepper input { width: 96px; border: 0; background: transparent; color: var(--text); text-align: center; font: inherit; font-weight: 600; outline: none; }

/* ------------------------------------------------------------- badges and callouts */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--card2); color: var(--muted); white-space: nowrap; }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-green { background: var(--green-soft); color: var(--green-t); }
.badge-red { background: var(--red-soft); color: var(--red-t); }
.badge-amber { background: var(--amber-soft); color: var(--amber-t); }
.badge-blue { background: var(--blue-soft); color: var(--blue-t); }

.callout { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); }
.callout .ic { margin-top: 2px; color: var(--accent); }
.callout.warn { background: var(--amber-soft); border-color: rgba(245, 158, 11, .3); }
.callout.warn .ic { color: var(--amber-t); }
.callout.info .ic { color: var(--blue-t); }
.callout.danger { background: var(--red-soft); border-color: rgba(239, 68, 68, .3); }
.callout.danger .ic { color: var(--red-t); }
.callout-body { flex: 1; min-width: 0; }
.callout-title { font-weight: 600; }
.callout-text { color: var(--muted); font-size: 14px; }
.callout .btn { flex: none; }
.banner-stack { display: grid; gap: 12px; margin-bottom: 18px; }

/* ------------------------------------------------------------- tables / lists */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--dim); text-transform: uppercase;
  letter-spacing: .06em; padding: 0 12px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: rgba(255, 255, 255, .02); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .actions { text-align: right; white-space: nowrap; }
.row-actions { display: inline-flex; gap: 6px; align-items: center; }

.list-row { display: flex; align-items: center; gap: 16px; padding: 16px 4px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; }
.row-desc { font-size: 13.5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 700;
  font-size: 14px; flex: none; color: #fff; }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .ic { width: 34px; height: 34px; color: var(--dim); margin-bottom: 8px; }

/* ------------------------------------------------------------- settings rows */
.setting { display: flex; gap: 32px; align-items: flex-start; justify-content: space-between; padding: 20px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; padding-bottom: 4px; }
.setting:first-child { padding-top: 4px; }
.setting-text { flex: 1; min-width: 0; max-width: 640px; }
.setting-title { font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.setting-desc { color: var(--muted); font-size: 14px; margin-top: 4px; }
.setting-key { color: var(--dim); font-family: var(--mono); font-size: 12px; margin-top: 6px; }
.setting-ctl { flex: none; width: 340px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.setting-ctl .input { max-width: 340px; }
.setting-default { font-size: 12.5px; color: var(--dim); }
.setting-default button { margin-left: 8px; }
.setting.changed .setting-title::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-toc { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; }
.settings-toc a { color: var(--muted); padding: 7px 12px; border-radius: 8px; font-size: 14px; }
.settings-toc a:hover { background: var(--card); color: var(--text); }

.savebar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 20px; border-radius: 14px;
  background: #1b2636; border: 1px solid var(--line2); box-shadow: var(--shadow);
}
.app .savebar { margin-left: 150px; }

/* ------------------------------------------------------------- console */
.term { background: #070b11; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; height: calc(100vh - 250px); min-height: 380px; }
.term-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--card); flex-wrap: wrap; }
.term-out { flex: 1; overflow-y: auto; padding: 14px 16px; font-family: var(--mono); font-size: 12.8px; line-height: 1.6; }
.term-line { white-space: pre-wrap; word-break: break-word; color: #c9d4e0; }
.term-line.warn { color: var(--amber-t); }
.term-line.error { color: var(--red-t); }
.term-line.join { color: var(--green-t); }
.term-line.leave { color: var(--blue-t); }
.term-line.chat { color: #f5d0a9; }
.term-line.mine { color: var(--accent); }
.term-line.reply { color: var(--text); background: rgba(247, 147, 30, .06); border-left: 2px solid var(--accent); padding-left: 8px; }
.term-line.sys { color: var(--dim); font-style: italic; }
.term-in { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); background: var(--card); }
.term-in .prompt { display: grid; place-items: center; width: 34px; color: var(--accent); font-family: var(--mono); font-weight: 700; }
.term-in .input { font-family: var(--mono); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--card2); border: 1px solid var(--line2); color: var(--text); border-radius: 8px; padding: 6px 11px; font-size: 13px; cursor: pointer; font-family: var(--mono); }
.chip:hover { border-color: var(--accent); }
.chip-card { text-align: left; font-family: inherit; padding: 10px 14px; border-radius: 10px; }
.chip-card code { display: block; color: var(--text); }
.chip-card span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ------------------------------------------------------------- drop zone and progress */
.drop {
  border: 2px dashed var(--line2); border-radius: var(--radius); padding: 34px 20px; text-align: center;
  color: var(--muted); transition: border-color .15s, background .15s; cursor: pointer;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .ic { width: 30px; height: 30px; color: var(--accent); margin-bottom: 8px; }
.drop strong { color: var(--text); }
.progress { height: 6px; border-radius: 999px; background: var(--card2); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.progress.indeterminate > div { width: 35%; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; display: inline-block; flex: none; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------- charts */
.chart { width: 100%; max-width: 100%; height: 150px; display: block; min-width: 0; }
.chart-wrap { position: relative; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.chart-head .big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-axis { display: flex; justify-content: space-between; color: var(--dim); font-size: 12px; margin-top: 6px; }

/* ------------------------------------------------------------- info grid (backups) */
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 28px; }
.info-item { display: flex; gap: 12px; }
.info-item .ic { color: var(--muted); margin-top: 3px; }
.info-item b { display: block; margin-bottom: 4px; }
.info-item span { color: var(--muted); font-size: 14px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; text-align: right; }

/* ------------------------------------------------------------- breadcrumbs / files */
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 14px; }
.crumbs button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.crumbs button:hover { color: var(--text); background: var(--card2); }
.crumbs button.cur { color: var(--text); font-weight: 600; }
.crumbs .ic { color: var(--dim); }
.fname { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fname .ic { color: var(--muted); }
.fname .ic.folder { color: var(--accent); }
.fname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-box { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.editor-box .CodeMirror { height: calc(100vh - 290px); min-height: 360px; font-family: var(--mono); font-size: 13px; }

/* ------------------------------------------------------------- toasts and modals */
.toasts { position: fixed; top: 20px; right: 20px; z-index: 100; display: grid; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px;
  background: #1b2636; border: 1px solid var(--line2); box-shadow: var(--shadow); animation: in .18s ease-out; }
.toast .ic { margin-top: 2px; }
.toast.ok .ic { color: var(--green-t); }
.toast.err .ic { color: var(--red-t); }
.toast.info .ic { color: var(--accent); }
.toast-body { flex: 1; font-size: 14px; word-break: break-word; }
@keyframes in { from { opacity: 0; transform: translateY(-6px); } }

.overlay { position: fixed; inset: 0; z-index: 90; background: rgba(3, 6, 10, .66); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px; animation: in .15s ease-out; }
.modal { width: min(540px, 100%); background: var(--card); border: 1px solid var(--line2); border-radius: 16px; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 0; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 14px 22px 4px; color: var(--muted); }
.modal-body p { margin: 0 0 12px; }
.modal-body strong { color: var(--text); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 22px 20px; flex-wrap: wrap; }
.choice { display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; padding: 14px 16px; border-radius: 12px;
  background: var(--card2); border: 1px solid var(--line2); cursor: pointer; margin-bottom: 10px; }
.choice:hover { border-color: var(--accent); }
.choice b { display: block; color: var(--text); }
.choice span { font-size: 13.5px; color: var(--muted); }
.choice .ic { color: var(--accent); margin-top: 2px; }

/* ------------------------------------------------------------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1000px 500px at 50% -10%, rgba(247, 147, 30, .10), transparent 60%), var(--bg); }
.login-card { width: min(400px, 100%); }
.login-card .brand { justify-content: center; margin-bottom: 22px; }
.login-card .card { padding: 28px; }
.login-card h1 { font-size: 20px; margin: 0 0 6px; text-align: center; }
.login-card p { margin: 0 0 20px; color: var(--muted); text-align: center; font-size: 14px; }

/* ------------------------------------------------------------- activity */
.act-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--card2); color: var(--muted); }
.act-icon.good { background: var(--green-soft); color: var(--green-t); }
.act-icon.bad { background: var(--red-soft); color: var(--red-t); }
.act-icon.acc { background: var(--accent-soft); color: var(--accent); }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1150px) {
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-toc { display: none; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 60; left: 0; top: 0; width: 300px; transform: translateX(-105%);
    transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .5); }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30;
    padding: 12px 16px; background: var(--side); border-bottom: 1px solid var(--line); }
  .topbar .name { font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .main { padding: 22px 16px 120px; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .setting { flex-direction: column; gap: 12px; }
  .setting-ctl { width: 100%; }
  .page-head { flex-direction: column; }
  .page-head .clock { display: none; }
  .app .savebar { margin-left: 0; width: calc(100vw - 32px); }
  .term { height: calc(100vh - 230px); }
  .hide-sm { display: none !important; }
}
@media (max-width: 560px) {
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile { padding: 14px; }
  .tile-value { font-size: 21px; }
  .info-grid { grid-template-columns: 1fr; }
  .tbl th.hide-xs, .tbl td.hide-xs { display: none; }
}

/* ------------------------------------------------------------- code editor theme */
.cm-s-core.CodeMirror { background: #0a1018; color: #d6e0ea; }
.cm-s-core .CodeMirror-gutters { background: #0e1520; border-right: 1px solid var(--line); }
.cm-s-core .CodeMirror-linenumber { color: #4b5a6c; }
.cm-s-core .CodeMirror-cursor { border-left: 2px solid var(--accent); }
.cm-s-core div.CodeMirror-selected, .cm-s-core.CodeMirror-focused div.CodeMirror-selected { background: rgba(247, 147, 30, .2); }
.cm-s-core .CodeMirror-line::selection, .cm-s-core .CodeMirror-line > span::selection { background: rgba(247, 147, 30, .2); }
.cm-s-core span.cm-atom, .cm-s-core span.cm-def, .cm-s-core span.cm-property { color: #fbbf24; }
.cm-s-core span.cm-keyword { color: var(--accent); }
.cm-s-core span.cm-string, .cm-s-core span.cm-string-2 { color: #86efac; }
.cm-s-core span.cm-number { color: #93c5fd; }
.cm-s-core span.cm-comment { color: #6a798b; font-style: italic; }
.cm-s-core span.cm-meta, .cm-s-core span.cm-variable-2 { color: #c4b5fd; }
.cm-s-core span.cm-attribute, .cm-s-core span.cm-quote { color: #fca5a5; }
.cm-s-core span.cm-error { color: var(--red-t); }

/* phones: let card headers and list rows wrap instead of squeezing */
@media (max-width: 560px) {
  .card-head { flex-wrap: wrap; }
  .card-head .row-actions { width: 100%; }
  .card-head .row-actions .input { max-width: none !important; flex: 1; }
  .list-row { flex-wrap: wrap; gap: 12px; }
  /* text takes the whole line beside the icon; the buttons drop underneath it */
  .list-row > .row-main { flex-basis: calc(100% - 48px); }
  .list-row > .row-actions { margin-left: 48px; }
  .row-desc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .card { padding: 18px; }
}
