[hidden] { display: none !important; }
:root {
  --bg: #f5f6f8; --card: #fff; --text: #1d2330; --muted: #6b7385; --line: #e3e6ec;
  --accent: #2f6fde; --accent-soft: #e7efff; --ok: #1f8a4c; --warn: #b7791f; --err: #c53030;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
header { display: flex; align-items: center; gap: 24px; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
h1 { font-size: 17px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 10px; }
nav { display: flex; gap: 4px; }
.tab { border: 0; background: none; padding: 8px 14px; border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--muted); }
.tab.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
main { padding: 16px 20px; }
.grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .grid { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.muted { color: var(--muted); font-weight: normal; }
.hint { color: var(--muted); font-size: 12.5px; margin-bottom: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.toolbar input[type=search] { flex: 1 1 260px; }
.spacer { flex: 1; }
button { font: inherit; padding: 5px 11px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.link { border: 0; background: none; color: var(--accent); padding: 4px 6px; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; padding: 8px 18px; }
button.danger { color: var(--err); border-color: #f0c4c4; }
input, select { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
input[type=number] { width: 80px; }
.row { display: flex; gap: 8px; }
.msg { margin-top: 8px; min-height: 1em; }
.msg.err { color: var(--err); }
.msg.ok { color: var(--ok); }

.tree { max-height: calc(100vh - 230px); overflow: auto; border-top: 1px solid var(--line); padding-top: 6px; }
.muni { border-bottom: 1px solid #f0f1f4; }
.muni-head { display: flex; align-items: center; gap: 6px; padding: 5px 2px; }
.muni-head .toggle { width: 20px; border: 0; background: none; padding: 0; color: var(--muted); }
.muni-head label { font-weight: 600; cursor: pointer; flex: 1; }
.kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 10px; padding: 0 0 8px 28px; }
.kids label { display: flex; gap: 6px; align-items: center; padding: 2px 0; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: 11.5px; color: var(--muted); background: #f0f2f5; border-radius: 9px; padding: 0 6px; margin-left: auto; }
.badge.has { color: var(--accent); background: var(--accent-soft); }

.pill { margin-left: auto; padding: 3px 10px; border-radius: 12px; font-size: 12.5px; background: #eef0f3; color: var(--muted); }
.pill.running { background: #fff4e0; color: var(--warn); }
.progress { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 10px; background: #fffaf0; border: 1px solid #f6e3b8; border-radius: 8px; }
.spinner { width: 22px; height: 22px; border: 3px solid #f2d79b; border-top-color: var(--warn); border-radius: 50%; animation: spin 0.9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 12.5px; }
table.runs td { font-size: 12.5px; }
.st-done { color: var(--ok); } .st-running, .st-queued, .st-stopping { color: var(--warn); }
.st-error, .st-interrupted { color: var(--err); } .st-stopped { color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 12px; }
.filters label { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.filters .check { color: var(--text); }
.table-wrap { overflow: auto; max-height: calc(100vh - 290px); border: 1px solid var(--line); border-radius: 8px; }
#grid th { position: sticky; top: 0; background: #fafbfc; cursor: pointer; white-space: nowrap; user-select: none; }
#grid th.sorted { color: var(--accent); }
#grid td { white-space: nowrap; font-size: 13px; }
#grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
#grid td.desc { white-space: normal; min-width: 320px; max-width: 520px; font-size: 12.5px; }
#grid tr:hover td { background: #f7f9ff; }
#grid tr.inactive td { color: #a0a6b3; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 10px; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: 110%; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; z-index: 10; max-height: 60vh; overflow: auto; box-shadow: 0 6px 20px rgba(0,0,0,.08); min-width: 230px; }
.dropdown-menu label { display: flex; gap: 6px; padding: 2px 0; white-space: nowrap; }
a { color: var(--accent); }

.sources { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.sources label { display: flex; gap: 8px; align-items: baseline; }
.sources .off { color: var(--muted); }
.sources .reason { font-size: 12px; color: var(--err); }
/* price columns: long-term rent (green tint) / short-term nightly (amber tint) */
#grid th.price-lt, #grid td.price-lt { background: #eef7f0; }
#grid th.price-st, #grid td.price-st { background: #fdf4e3; }
#grid tr:hover td.price-lt { background: #e2f0e6; }
#grid tr:hover td.price-st { background: #f9ead0; }
/* tab 3: method description */
.doc { max-width: 900px; line-height: 1.55; }
.doc h3 { font-size: 14.5px; margin: 18px 0 6px; }
.doc ul { margin: 4px 0; padding-left: 22px; }
.doc li { margin: 3px 0; }
.doc table.mini { width: auto; margin: 6px 0; }
.doc pre { background: #f3f4f7; padding: 8px 12px; border-radius: 6px; display: inline-block; }
.up { color: var(--ok); font-weight: 600; }
.down { color: var(--err); }
.filters label.basis { font-weight: 600; }
