:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #1c2430;
  --muted: #5e6b7c;
  --line: #d8dfe8;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --mine: #e3edff;
  --theirs: #ffffff;
  --ok: #1e7f4f;
  --warn: #9a6200;
  --err: #b42318;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --surface: #182029;
    --surface-2: #1f2934;
    --text: #e6ebf1;
    --muted: #9aa7b6;
    --line: #2c3845;
    --accent: #4c8dff;
    --accent-text: #0b1220;
    --mine: #1d3357;
    --theirs: #1f2934;
    --ok: #4cc38a;
    --warn: #e0a340;
    --err: #ff7b72;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
[hidden] { display: none !important; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; }
.who { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 14px; }
main { max-width: 920px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
}
.card.narrow { max-width: 460px; margin: 32px auto; }
.card.ok { border-color: var(--ok); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.note { background: var(--surface-2); padding: 8px 10px; border-radius: 8px; }
.error { color: var(--err); }
label { display: block; font-size: 14px; margin: 10px 0 4px; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button { font: inherit; cursor: pointer; }
button.primary {
  background: var(--accent); color: var(--accent-text); border: 0; border-radius: 8px; padding: 9px 16px; margin-top: 10px;
}
button.secondary {
  background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; margin-top: 10px;
}
button[disabled] { opacity: .55; cursor: not-allowed; }
button.link { background: none; border: 0; color: var(--accent); padding: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row input { flex: 1 1 220px; }
.row button.primary { margin-top: 0; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; color: var(--muted); white-space: nowrap;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.toolbar { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px;
}
.list li > button, .list li > a {
  display: block; width: 100%; text-align: left; background: none; border: 0; padding: 12px 14px; color: inherit; text-decoration: none;
}
.req-line { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.req-topic { font-weight: 600; }
.badge {
  display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.badge.st-client { color: var(--warn); }
.badge.st-done { color: var(--ok); }
.badge.st-dev, .badge.st-operator { color: var(--accent); }
.req-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.back { margin-bottom: 10px; }
.feed { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.msg {
  max-width: 85%; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--theirs);
  white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
}
.msg.mine { align-self: flex-end; background: var(--mine); }
.msg .meta { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.msg .atts { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.msg img { max-width: 100%; max-height: 320px; border-radius: 8px; display: block; }
.msg a { color: var(--accent); }
.composer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.file-btn {
  display: inline-block; margin: 10px 0 0; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); cursor: pointer;
}
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 8px; padding: 8px 12px;
}
.choice.active { border-color: var(--accent); outline: 1px solid var(--accent); }
.hints { margin-top: 12px; background: var(--surface-2); border-radius: 8px; padding: 8px 12px; }
.hints ul { margin: 4px 0 0; padding-left: 18px; }
.hints a { color: var(--accent); }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: calc(100% - 32px);
  background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; z-index: 10;
}
@media (max-width: 600px) {
  main { padding: 12px; }
  .msg { max-width: 100%; }
  .card.narrow { margin: 16px auto; }
}
