:root { --ink: #1d2140; --ink2: #555b7a; --muted: #8a90ab; --line: #e3e6f0; --bg: #f5f6fa; --card: #fff; --accent: #2f6fdb; --accent-soft: #e6eefc;
  --good: #1f8a4c; --bad: #c0392b; --warn: #b7791f; }
[hidden] { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 12px; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.danger { color: var(--bad); }
button.ghost { background: transparent; }
button:disabled { opacity: .5; cursor: default; }
select, input[type=search], input[type=text], input[type=password], textarea { border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; background: #fff; }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px; width: min(360px, 92vw); display: flex; flex-direction: column; gap: 14px; }
.box h1 { margin: 0; font-size: 20px; }
.box label { display: flex; flex-direction: column; gap: 6px; }
.msg { margin: 0; color: var(--bad); min-height: 1.2em; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { font-size: 16px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
nav button { border: 0; background: transparent; padding: 7px 11px; }
nav button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.period { display: flex; gap: 6px; align-items: center; color: var(--ink2); }
.link { color: var(--accent); text-decoration: none; }
main { padding: 16px; max-width: 1280px; margin: 0 auto; }
h2 { font-size: 17px; margin: 22px 0 10px; } h2:first-child { margin-top: 0; }
h3 { font-size: 14px; margin: 0 0 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tile .v { font-size: 24px; font-weight: 650; }
.tile .k { color: var(--ink2); }
.tile .s { color: var(--muted); font-size: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-width: 0; }
.muted { color: var(--muted); }
.note { color: var(--ink2); margin: 4px 0 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink2); font-weight: 600; font-size: 12px; white-space: nowrap; }
td.n, th.n { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f7f9ff; }
tr.sel td { background: var(--accent-soft); }
.scroll { overflow-x: auto; }
/* bars: one series, one hue; the value is written beside each bar */
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 8px; align-items: center; padding: 3px 0; }
.hbar .lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .trk { height: 12px; }
.hbar .fill { height: 12px; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar .val { color: var(--ink2); font-variant-numeric: tabular-nums; min-width: 3em; text-align: end; }
.cols { display: flex; align-items: flex-end; gap: 2px; height: 160px; border-bottom: 1px solid var(--muted); padding-top: 8px; }
.cols .c { flex: 1; display: flex; align-items: flex-end; height: 100%; min-width: 3px; }
.cols .c i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 1px; }
.cols .c:hover i { background: #1d4fa8; }
.axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 4px; }
.tip { position: fixed; z-index: 20; pointer-events: none; background: var(--ink); color: #fff; padding: 6px 9px; border-radius: 8px; font-size: 12px; white-space: pre-line; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input[type=search] { min-width: 240px; flex: 1; max-width: 420px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #eef0f6; color: var(--ink2); font-size: 12px; }
.pill.good { background: #e3f5ea; color: var(--good); } .pill.bad { background: #fbe9e7; color: var(--bad); } .pill.warn { background: #fdf3e1; color: var(--warn); }
.detail { margin-top: 14px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; }
.kv b { color: var(--ink2); font-weight: 600; }
/* texts */
.tgroup { margin-bottom: 18px; }
.trow { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(200px, 2fr) minmax(200px, 2fr) auto; gap: 8px; align-items: start; padding: 7px 0; border-bottom: 1px solid var(--line); }
.trow .key { color: var(--ink2); font-size: 12px; word-break: break-word; }
.trow textarea { width: 100%; min-height: 34px; resize: vertical; }
.trow .orig { color: var(--muted); font-size: 12px; margin-top: 2px; }
.trow.changed textarea.ch { border-color: var(--warn); background: #fffaf0; }
.trow [dir=rtl] { font-family: "Segoe UI", Tahoma, system-ui, sans-serif; }
.savebar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 10px 16px; margin: 0 -16px; display: flex; gap: 12px; align-items: center; }
.switch { display: flex; gap: 10px; align-items: center; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 10px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.on { opacity: 1; }
.toast.err { background: var(--bad); }
@media (max-width: 760px) { .trow { grid-template-columns: 1fr; } .hbar { grid-template-columns: 110px 1fr auto; } }
