:root {
  --bg: #06101c; --panel: rgba(8, 18, 32, 0.86); --line: rgba(120, 160, 200, 0.18);
  --ink: #d8e3ee; --dim: #8aa0b6; --acc: #ffb347; --bad: #ff6b5c; --ok: #7ad13c; --blue: #4aa3ff;
  --font: "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 13px/1.4 var(--font); overflow: hidden; }
#globe { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#top { position: fixed; left: 0; right: 0; top: 0; height: 44px; display: flex; align-items: center; gap: 14px; padding: 0 12px;
  background: linear-gradient(rgba(6,16,28,0.95), rgba(6,16,28,0.6)); z-index: 5; }
.brand { font-weight: 800; letter-spacing: 0.12em; font-size: 15px; color: var(--ink); }
.brand span { color: var(--acc); }
.clock { font-variant-numeric: tabular-nums; color: var(--dim); }
.clock b { color: var(--ink); font-weight: 600; }
.spacer { flex: 1; }
#topbtns { display: flex; gap: 6px; }
button { font: inherit; color: var(--ink); background: rgba(70, 110, 160, 0.25); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; cursor: pointer; }
button:hover { background: rgba(70, 110, 160, 0.45); }
button.primary { background: var(--acc); color: #201200; border-color: transparent; font-weight: 600; }
button.primary:hover { background: #ffc46a; }
button.danger { border-color: rgba(255, 107, 92, 0.5); color: #ffb0a6; }
button.small { padding: 2px 7px; font-size: 12px; }
button.on { border-color: var(--acc); color: var(--acc); }
button:disabled { opacity: 0.4; cursor: default; }
input, textarea, select { font: inherit; color: var(--ink); background: rgba(0,0,0,0.35); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; width: 100%; }
textarea { font: 12px/1.35 Consolas, "Cascadia Mono", Menlo, monospace; min-height: 260px; resize: vertical; white-space: pre; }
input[type=color] { padding: 0; height: 32px; width: 48px; }
.panel { position: fixed; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; z-index: 4; backdrop-filter: blur(6px); overflow: auto; }
#left { left: 10px; top: 54px; width: 270px; max-height: calc(100% - 200px); }
#right { right: 10px; top: 54px; width: 300px; max-height: calc(100% - 200px); }
#log { left: 10px; bottom: 10px; width: 420px; max-height: 130px; font-size: 12px; color: var(--dim); padding: 6px 10px; }
#log div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#log div b { color: var(--ink); font-weight: 500; }
#log div.mine { color: var(--ink); }
#log div.bad { color: var(--bad); }
#hint { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: rgba(255, 179, 71, 0.92); color: #201200; padding: 6px 14px; border-radius: 20px; font-weight: 600; z-index: 6; display: none; }
#hint.show { display: block; }
h3 { margin: 0 0 6px; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
h3 .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 4px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 4px 0 8px; }
.kv span:nth-child(odd) { color: var(--dim); }
.kv b { font-weight: 600; }
.res { display: flex; gap: 10px; margin: 6px 0 8px; }
.res div { flex: 1; background: rgba(0,0,0,0.3); border-radius: 6px; padding: 5px 7px; }
.res small { display: block; color: var(--dim); font-size: 11px; }
.res b { font-size: 14px; }
.res i { font-style: normal; color: var(--ok); font-size: 11px; }
.res i.neg { color: var(--bad); }
.list { max-height: 200px; overflow: auto; margin: 4px 0; }
.list .it { display: flex; gap: 6px; align-items: center; padding: 3px 4px; border-radius: 5px; cursor: pointer; }
.list .it:hover { background: rgba(255,255,255,0.06); }
.list .it.sel { background: rgba(255, 179, 71, 0.18); }
.list .it .n { flex: 1; }
.list .it .d { color: var(--dim); font-size: 11px; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 10px; background: rgba(255,255,255,0.08); font-size: 11px; color: var(--dim); }
.tag.warn { background: rgba(255, 107, 92, 0.2); color: #ffb0a6; }
.tag.ok { background: rgba(122, 209, 60, 0.18); color: #b6f08a; }
.sect { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.muted { color: var(--dim); }
.big { font-size: 16px; font-weight: 600; }
#modal { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 20; display: flex; align-items: center; justify-content: center; }
#modalbox { background: #0b1828; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; width: min(640px, 92vw); max-height: 88vh; overflow: auto; }
#modalbox h2 { margin: 0 0 10px; font-size: 18px; }
#modalbox p { margin: 6px 0; color: var(--dim); }
#modalbox code, .panel code { background: rgba(0,0,0,0.4); padding: 1px 5px; border-radius: 4px; font: 12px Consolas, Menlo, monospace; word-break: break-all; }
#modalbox pre { background: rgba(0,0,0,0.4); padding: 8px 10px; border-radius: 6px; overflow: auto; font: 12px/1.4 Consolas, Menlo, monospace; }
.prog-log { background: rgba(0,0,0,0.4); border-radius: 6px; padding: 6px 8px; height: 120px; overflow: auto; font: 11px/1.4 Consolas, Menlo, monospace; color: var(--dim); white-space: pre-wrap; }
.tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.tabs button { border-radius: 6px 6px 0 0; }
#toast { position: fixed; top: 54px; left: 50%; transform: translateX(-50%); background: rgba(255, 107, 92, 0.95); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 30; font-weight: 500; max-width: 80vw; }
#toast.ok { background: rgba(122, 209, 60, 0.95); color: #0b1a00; }
#verdict { position: fixed; left: 0; bottom: 0; font: 11px monospace; color: transparent; pointer-events: none; }
table.lb { width: 100%; border-collapse: collapse; font-size: 12px; }
table.lb td, table.lb th { padding: 3px 4px; text-align: left; border-bottom: 1px solid var(--line); }
table.lb th { color: var(--dim); font-weight: 500; }
table.lb td.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  #left { width: 46vw; left: 6px; max-height: 40vh; font-size: 12px; }
  #right { width: 50vw; right: 6px; max-height: 40vh; font-size: 12px; }
  #log { width: calc(100vw - 12px); left: 6px; max-height: 84px; }
  .brand { font-size: 12px; }
}
