@font-face { font-family: "Plex"; font-weight: 400; src: url(/static/fonts/IBMPlexSans-400-cyrillic.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex"; font-weight: 400; src: url(/static/fonts/IBMPlexSans-400-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Plex"; font-weight: 600; src: url(/static/fonts/IBMPlexSans-600-cyrillic.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex"; font-weight: 600; src: url(/static/fonts/IBMPlexSans-600-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "PlexMono"; font-weight: 400; src: url(/static/fonts/IBMPlexMono-400-cyrillic.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PlexMono"; font-weight: 400; src: url(/static/fonts/IBMPlexMono-400-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "PlexMono"; font-weight: 600; src: url(/static/fonts/IBMPlexMono-600-cyrillic.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PlexMono"; font-weight: 600; src: url(/static/fonts/IBMPlexMono-600-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }

:root {
  --ink: #141414;
  --ink-2: #3d3d3d;
  --muted: #6f6f6f;
  --line: #d6d6d6;
  --line-soft: #e9e9e9;
  --paper: #f7f5ef;
  --accent: #f4c62e;
  --accent-deep: #e0b21c;
  --ok: #1b7a3d;
  --bad: #b3261e;
  --warn: #8a5a00;
  --sans: "Plex", "PT Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "PlexMono", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { background: #fff; }
body { margin: 0; color: var(--ink); font: 14px/1.45 var(--sans); }
b, strong { font-weight: 600; }
h1, h2 { font-weight: 600; margin: 0; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: #b5b5b5; }
a:hover { text-decoration-color: var(--ink); }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px 64px; }

.top {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 24px; padding: 18px 28px 14px; border-bottom: 1px solid var(--ink);
  max-width: 1160px; margin: 0 auto;
}
.top-title { font-size: 22px; font-weight: 600; }
.top-nav { display: flex; align-items: baseline; gap: 18px; font-size: 14px; }
.top-nav a { text-decoration: none; color: var(--muted); }
.top-nav a:hover { color: var(--ink); }
.top-nav a.on { color: var(--ink); font-weight: 600; }
.top-nav .who { color: var(--muted); }
.mobile-label { display: none; }
.top-nav form { display: inline; }
.top-nav select { border: 0; background: none; font: inherit; color: var(--muted); padding: 0; width: auto; }

.link { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #b5b5b5; }
.link:hover { text-decoration-color: var(--ink); }
.link.bad { color: var(--bad); }
.link.muted { color: var(--muted); }

.statusbar {
  max-width: 1160px; margin: 0 auto; padding: 14px 28px; background: var(--paper);
  border-bottom: 1px solid var(--line); display: flex; align-items: flex-start;
  justify-content: space-between; gap: 24px;
}
.statusbar dl { margin: 0; display: grid; grid-template-columns: repeat(4, auto); gap: 6px 32px; }
.statusbar dt { color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.statusbar dd { margin: 0; font-size: 14px; }
.statusbar dd b { font-size: 15px; }
.statusbar-actions { display: flex; gap: 8px; flex-shrink: 0; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.notice {
  max-width: 1160px; margin: 0 auto; padding: 10px 28px 10px 25px;
  border-left: 3px solid var(--warn); background: #fff8e1;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.notice.bad { border-left-color: var(--bad); background: #fdeeed; }
.notice.ok { border-left-color: var(--ok); background: #edf7f0; }

.toolbar { display: flex; align-items: center; gap: 16px; padding: 22px 0 12px; flex-wrap: wrap; }
.toolbar h1 .count { color: var(--muted); font-weight: 400; margin-left: 6px; }
.toolbar .spacer { flex: 1; }
.tabs { display: flex; gap: 14px; font-size: 13px; }
.tabs a { text-decoration: none; color: var(--muted); }
.tabs a.on { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="datetime-local"], select, textarea {
  font: inherit; color: inherit; padding: 7px 10px; border: 1px solid #9a9a9a;
  border-radius: 2px; background: #fff; width: 100%; outline: none;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
input::placeholder, textarea::placeholder { color: #9a9a9a; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ink); }

.btn {
  font: inherit; cursor: pointer; white-space: nowrap; padding: 7px 14px;
  border-radius: 2px; border: 1px solid var(--ink); background: #fff; color: var(--ink); line-height: 1.3;
  text-decoration: none; display: inline-block;
}
.btn:hover { background: #f1f1f1; }
.btn.primary { background: var(--accent); border-color: var(--accent-deep); font-weight: 600; }
.btn.primary:hover { background: var(--accent-deep); }
.btn.quiet { border-color: #b5b5b5; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }

table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; font-weight: 600; font-size: 13px; padding: 8px 10px 8px 0; border-bottom: 2px solid var(--ink); white-space: nowrap; }
tbody td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tbody tr:hover td { background: #fbfaf6; }
td.actions, th.actions { text-align: right; white-space: nowrap; }
td.actions .link + .link { margin-left: 12px; }

.name { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: #b5b5b5; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
.dot.warn { background: var(--accent-deep); }
.dot.wait { background: #7d8ea8; }

.empty { padding: 36px 0; color: var(--muted); }
.empty b { color: var(--ink); display: block; margin-bottom: 4px; }

.panel { background: var(--paper); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 18px 20px 20px; margin: 0 0 22px; }
.panel.plain { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; gap: 16px; }
.panel-foot { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cols-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; margin-bottom: 5px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.check input { width: auto; }

.pubtext { white-space: pre-wrap; line-height: 1.5; }
.pubrow { border-bottom: 1px solid var(--line-soft); padding: 14px 0; }
.pubrow:last-child { border-bottom: 0; }
.pubrow-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.pubrow-head .spacer { flex: 1; }

.form-narrow { max-width: 420px; margin: 90px auto 0; }
.form-narrow h1 { margin-bottom: 20px; }
.login-box { border-top: 2px solid var(--ink); padding-top: 24px; }
.login-box h1 { font-size: 28px; margin: 4px 0 8px; }
.login-brand {
  display: inline-grid; place-items: center; min-width: 50px; height: 30px; padding: 0 8px;
  background: var(--accent); font: 600 13px/1 var(--mono);
}
.eyebrow { margin: 18px 0 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.login-intro { margin: 0 0 24px; }
.login-note { border-top: 1px solid var(--line-soft); margin: 24px 0 0; padding-top: 16px; }

.filelist { margin: 0 0 14px; padding: 0; list-style: none; }
.filelist li { display: flex; align-items: baseline; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.filelist .spacer { flex: 1; }

.chatpick { max-height: 280px; overflow-y: auto; border: 1px solid var(--line); background: #fff; padding: 8px 12px; }
.chatpick .check { margin-bottom: 6px; }

details.fold { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 22px; }
details.fold > summary {
  cursor: pointer; list-style: none; padding: 17px 2px; font-weight: 600; display: flex;
  align-items: center; justify-content: space-between; gap: 14px;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "+"; color: var(--muted); font: 400 22px/1 var(--sans); }
details.fold[open] > summary::after { content: "−"; }
details.fold > .fold-body { padding: 2px 2px 20px; }
details.fold.compact { margin: 8px 0 16px; border-color: var(--line-soft); }
details.fold.compact > summary { padding: 12px 2px; font-weight: 400; }
.settings-logout { margin: 24px 0 0; }

.empty-action { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 860px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); font-size: 15px; }
  .top, .statusbar, .notice { padding-left: 16px; padding-right: 16px; }
  .wrap { padding: 0 16px 38px; }
  .top { padding-top: 15px; padding-bottom: 13px; border-bottom-color: var(--line); }
  .top-title { font-size: 19px; }
  .top-nav {
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 0;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.98); border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(0,0,0,.05);
  }
  .top-nav a { min-height: 42px; display: grid; place-items: center; font-size: 12px; border-radius: 8px; }
  .top-nav a.on { background: #fff4c2; text-decoration: none; }
  .top-nav .who, .top-nav form { display: none; }
  .desktop-label { display: none; }
  .mobile-label { display: inline; }
  .toolbar { padding: 18px 0 12px; gap: 10px; }
  .toolbar h1 { width: 100%; font-size: 22px; }
  .toolbar .spacer { display: none; }
  .toolbar > .btn, .toolbar > form, .toolbar > form .btn { width: 100%; }
  .toolbar > form .btn { text-align: center; }
  .tabs { width: 100%; overflow-x: auto; padding: 2px 0 6px; gap: 16px; white-space: nowrap; }
  .statusbar { flex-direction: column; }
  .statusbar.onboarding { gap: 14px; }
  .statusbar dl { width: 100%; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
  .statusbar-actions, .statusbar-actions .btn { width: 100%; text-align: center; }
  .cols, .cols-3 { grid-template-columns: 1fr; }
  .panel { padding: 16px; margin-bottom: 16px; }
  .panel-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .panel-foot { flex-wrap: wrap; }
  input[type="text"], input[type="email"], input[type="password"], input[type="number"],
  input[type="datetime-local"], select, textarea { font-size: 16px; min-height: 46px; }
  textarea { min-height: 130px; }
  .btn { min-height: 44px; padding: 10px 15px; text-align: center; }
  .btn.primary { width: 100%; }
  .form-narrow { margin: 9vh auto 0; }
  .form-narrow .btn { width: 100%; }
  .login-box { margin-top: 5vh; }

  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  tbody td { border: 0; padding: 3px 0; background: none !important; }
  tbody td[data-label]:not([data-label=""])::before {
    content: attr(data-label); display: inline-block; min-width: 88px; margin-right: 8px;
    color: var(--muted); font-size: 12px;
  }
  td.actions { text-align: left; padding-top: 10px; }
  td.actions .link { display: inline-block; padding: 5px 0; }
  .chatpick { max-height: none; }
  details.fold > summary { min-height: 54px; }
  .settings-logout, .settings-logout .btn { width: 100%; }
}
