:root {
  --bg: #f6f7f9; --card: #fff; --text: #1d2330; --muted: #6b7385; --line: #e3e6ec;
  --accent: #2f6fed; --ok: #1f9d55; --no: #d64545; --warn-bg: #fff4e5; --warn: #9a5b00;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171d; --card: #1c2029; --text: #e6e9ef; --muted: #98a0b3; --line: #2c3240; --warn-bg: #3a2c12; --warn: #f0b45a; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
.top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
nav a { margin-left: 16px; }
main { max-width: 1000px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; margin-bottom: 16px; }
.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
h1 { font-size: 22px; margin: 0 0 8px; } h2 { font-size: 17px; margin: 16px 0 8px; }
.muted { color: var(--muted); } .small { font-size: 13px; margin-left: 8px; }
.warn { background: var(--warn-bg); color: var(--warn); padding: 8px 12px; border-radius: 6px; }
label { display: block; margin: 10px 0; } label.check { display: flex; gap: 6px; align-items: center; }
input, select, textarea { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
input[type=checkbox] { width: auto; }
.row { display: flex; gap: 12px; flex-wrap: wrap; } .row label { flex: 1 1 180px; }
button { padding: 8px 16px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font: inherit; cursor: pointer; }
button.ok { background: var(--ok); } button.no { background: var(--no); }
form.inline { display: inline; } form.inline select { width: auto; }
table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
pre { white-space: pre-wrap; background: var(--bg); padding: 12px; border-radius: 6px; border: 1px solid var(--line); overflow-x: auto; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); margin-left: 4px; }
.tag-esc { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.tag-act { background: #e6f0ff; color: #2f5fcf; border-color: transparent; }
.tag-hermes { background: #efe6ff; color: #6a3fc8; border-color: transparent; }
.approval { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.approval > div { flex: 1 1 300px; }
.spend .bar { height: 8px; background: var(--bg); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.spend .bar div { height: 100%; background: var(--accent); }
.tree .node { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.tree .owner { font-weight: 700; }
.st { font-size: 13px; padding: 1px 8px; border-radius: 10px; background: var(--bg); }
.st-done { color: var(--ok); } .st-failed, .st-rejected, .st-blocked_budget { color: var(--no); } .st-awaiting_approval { color: var(--warn); }
.lvl-0 { color: var(--no); } .lvl-1 { color: var(--warn); } .lvl-2 { color: var(--accent); } .lvl-3 { color: var(--ok); }
@media (max-width: 600px) { nav a { margin-left: 10px; } table { font-size: 13px; } }
.info { background: #e8f5ec; color: #1d6b3a; padding: 8px 12px; border-radius: 6px; }
@media (prefers-color-scheme: dark) { .info { background: #163323; color: #8fd5a6; } }
.code-box { border: 1px dashed var(--line); border-radius: 8px; padding: 12px 16px; margin: 8px 0 16px; }
.code { font: 700 32px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 3px; margin: 6px 0; }
.company-switch { font-weight: 600; }
.code-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.switcher { position: relative; margin-right: auto; margin-left: 16px; }
.switcher summary { cursor: pointer; font-weight: 600; list-style: none; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; }
.switcher summary::-webkit-details-marker { display: none; }
.switcher-menu { position: absolute; top: 110%; left: 0; z-index: 10; min-width: 240px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.switcher-menu form { margin: 0; }
.switch-item { display: block; width: 100%; text-align: left; background: none; color: var(--text); padding: 8px 10px; border-radius: 6px; }
.switch-item:hover { background: var(--bg); }
.switch-item.current { font-weight: 700; }
a.switch-item { color: var(--accent); }
.bell { position: relative; }
.badge { position: absolute; top: -8px; right: -10px; background: var(--no); color: #fff; font-size: 11px; line-height: 1; padding: 3px 6px; border-radius: 10px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.notif { display: flex; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--line); color: var(--text); border-radius: 6px; }
.notif:hover { background: var(--bg); }
.notif.unread { font-weight: 600; background: rgba(47,111,237,.06); }
.notif-icon { flex: 0 0 auto; }
