/* Общий стиль сайта радара: лента, архив, админка, вход */
:root {
  --bg: #f6f5f2; --surface: #ffffff; --text: #1b1b1a; --muted: #6d6b66; --faint: #9a978f;
  --line: #e5e2dc; --hover: #f0eee9; --mark: #fdeba8;
  --news: #c4372f; --maybe: #b3730c; --no: #9a978f;
  --took: #1f7a4d; --took-soft: #e7f4ed; --focus: #2a62c9;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.03);
  --primary: #1b1b1a; --on-primary: #ffffff; --danger: #b42318; --toast-bg: #1b1b1a; --toast-fg: #f6f5f2;
  /* шрифты — пара, выбранная в Claude Design для радара */
  --f-ui: "Golos Text", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --f-mono: "PT Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --f-news: "Source Serif 4", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161615; --surface: #1f1f1e; --text: #ecebe7; --muted: #a3a09a; --faint: #7a776f;
    --line: #34332f; --hover: #2a2a28; --mark: #5a4a12;
    --news: #ef6b61; --maybe: #e0a23f; --no: #7a776f;
    --took: #4cc38a; --took-soft: #1a3328; --focus: #7aa6ff; --shadow: none;
    --primary: #ecebe7; --on-primary: #1f1f1e; --danger: #f97066; --toast-bg: #ecebe7; --toast-fg: #161615;
  }
}
:root[data-theme="dark"] {
  --bg: #161615; --surface: #1f1f1e; --text: #ecebe7; --muted: #a3a09a; --faint: #7a776f;
  --line: #34332f; --hover: #2a2a28; --mark: #5a4a12;
  --news: #ef6b61; --maybe: #e0a23f; --no: #7a776f;
  --took: #4cc38a; --took-soft: #1a3328; --focus: #7aa6ff; --shadow: none;
  --primary: #ecebe7; --on-primary: #1f1f1e; --danger: #f97066; --toast-bg: #ecebe7; --toast-fg: #161615;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--f-ui);
}
/* служебное — моноширинным, как на старой странице: статус, счётчики, подписи разделов */
.status, h2, .found, .chip .n, .meta .time { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.status, .meta .time { font-size: 12px; }
h2, .found { font-size: 12px; font-weight: 400; letter-spacing: .08em; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.wrap { max-width: 800px; margin: 0 auto; padding: 0 16px; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }

/* шапка: одна на обеих страницах */
header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 14px; padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.brand svg { width: 18px; height: 18px; flex: none; }
.tabs { display: flex; gap: 2px; margin-right: auto; }
.tabs a { text-decoration: none; padding: 5px 10px; border-radius: 8px; color: var(--muted); font-weight: 550; }
.tabs a:hover { background: var(--hover); color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); background: var(--hover); }
.search { flex: 0 1 260px; margin: 0; }
.search input { width: 100%; height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 0 10px; }
.search input::placeholder { color: var(--faint); }

/* строка заголовка страницы и статус */
.pagehead { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; padding: 16px 0 0; }
.pagehead h1 { font: 600 26px/1.15 var(--f-news); margin: 0; letter-spacing: -.015em; }
.status { font-size: 13px; color: var(--muted); display: flex; gap: 4px 14px; flex-wrap: wrap; }
.status .warn { color: var(--news); }

/* чипы разделов и фильтры */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 0; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chip:hover { background: var(--hover); }
.chip .n { color: var(--faint); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .65; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.filters select { height: 32px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 0 8px; font-size: 14px; max-width: 100%; }

/* разделы ленты */
section { margin: 26px 0 0; }
h2 { font-size: 13px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
h2 .n { color: var(--faint); font-weight: 550; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot.news { background: var(--news); } .dot.maybe { background: var(--maybe); } .dot.no { background: var(--no); }
.fold { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; letter-spacing: inherit;
  text-transform: inherit; display: inline-flex; align-items: center; gap: 8px; }
.fold .chev { transition: transform .15s; display: inline-block; }
.fold[aria-expanded="true"] .chev { transform: rotate(90deg); }
.empty { color: var(--faint); font-size: 15px; padding: 4px 0 2px; margin: 0; }

/* карточки */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin: 0 0 10px; position: relative; scroll-margin-top: 80px; }
.card.news { border-left: 3px solid var(--news); }
.card.took { border-left: 3px solid var(--took); }
.card.wrong { opacity: .55; }
.card.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 3px var(--focus); } to { box-shadow: var(--shadow); } }
.meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.meta .sep { color: var(--faint); }
.meta .new { color: var(--news); font-weight: 600; }
.tag { font-size: 12px; line-height: 18px; padding: 0 8px; border-radius: 999px; background: var(--hover); color: var(--muted);
  white-space: nowrap; text-decoration: none; }
a.tag:hover { color: var(--text); }
.hl { font-size: 17px; line-height: 1.4; font-weight: 620; margin: 4px 0 0; letter-spacing: -.005em; }
.row .hl { font-size: 16px; font-weight: 560; }
.row { cursor: pointer; }
.row:hover { background: var(--hover); }
.row.open { cursor: default; background: var(--surface); }
.lead { margin: 8px 0 0; }
.snippet { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.hooks { margin: 10px 0 0; padding: 0; list-style: none; }
.hooks li { position: relative; padding-left: 16px; margin: 4px 0 0; }
.hooks li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--maybe); }
.reason { color: var(--muted); }
.more { display: none; }
.open .more, .card.news .more { display: block; }
.actions { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; flex-wrap: wrap; }
.btn { height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 550; }
.btn:hover { background: var(--hover); }
.btn.take[aria-pressed="true"] { background: var(--took-soft); border-color: var(--took); color: var(--took); }
.btn.skip[aria-pressed="true"] { background: var(--hover); color: var(--muted); }
.links { margin-left: auto; display: flex; gap: 14px; font-size: 14px; }
.links a { color: var(--muted); text-decoration: none; }
.links a:hover { color: var(--text); text-decoration: underline; }
.note { width: 100%; margin: 10px 0 0; min-height: 38px; resize: vertical; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; background: var(--bg); font-size: 15px; }
.note::placeholder { color: var(--faint); }
.notetext { margin: 8px 0 0; font-size: 14px; color: var(--took); }
.fresh { display: block; width: 100%; margin: 12px 0 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); cursor: pointer; text-align: center; font-weight: 550; }
.fresh:hover { background: var(--hover); }
.moreBtn { display: block; margin: 6px auto 0; }
footer { color: var(--faint); font-size: 13px; padding: 36px 0 40px; }

/* день ленты: ‹ дата › и «Сегодня» */
.day { display: flex; align-items: center; gap: 2px; margin-left: -8px; }
.day button:not(.btn) { border: 0; background: none; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 22px; line-height: 1; color: var(--muted); }
.day button:not(.btn):hover:not(:disabled) { background: var(--hover); color: var(--text); }
.day button:disabled { opacity: .3; cursor: default; }
.day .btn { margin-left: 8px; }

/* архив */
.found { font-size: 13px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }
.hint { font-size: 13px; color: var(--faint); margin: 10px 0 0; }
.card .date { font-weight: 600; color: var(--text); }
.links.left { margin-left: 0; }

/* кнопки и поля */
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn.primary:hover { opacity: .9; background: var(--primary); }
.btn.danger { color: var(--danger); }
.btn.small { height: 32px; padding: 0 12px; font-size: 14px; }
.btn.big { height: 48px; padding: 0 22px; font-size: 17px; display: inline-flex; align-items: center; text-decoration: none; }
.btn.wide { width: 100%; margin: 4px 0 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.hide { color: var(--muted); }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--muted); cursor: pointer; font-size: 14px; }
.linkbtn:hover { color: var(--text); text-decoration: underline; }
input[type=text], input[type=email], textarea, select { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 16px; }
input[type=text], input[type=email] { height: 44px; padding: 0 10px; width: 100%; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin: 8px 0; }
.field textarea { padding: 8px 10px; resize: vertical; color: var(--text); }
.field select { height: 44px; padding: 0 8px; color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.msg { margin: 12px 0; }
.msg.warn, .warn { color: var(--danger); }

/* «В работе», заметки, новое */
.taken { font-size: 12px; line-height: 18px; padding: 0 8px; border-radius: 999px; background: var(--took-soft); color: var(--took); white-space: nowrap; }
.takenfull { margin: 8px 0 0; font-size: 14px; color: var(--took); }
.notehint { font-size: 12px; color: var(--faint); margin: 4px 0 0; }
.empty.big { font-size: 16px; padding: 20px 0; }
.skeleton { height: 64px; border-radius: var(--radius); background: var(--hover); margin: 10px 0; animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .5; } to { opacity: 1; } }
.offline { background: var(--danger); color: #fff; text-align: center; padding: 6px 12px; font-size: 14px; }
.devbar { background: var(--danger); color: #fff; text-align: center; padding: 6px 12px; font-size: 14px; font-weight: 600; }
.onboard { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--focus); border-radius: var(--radius);
  padding: 12px 16px; margin: 14px 0 0; font-size: 15px; }
.onboard p { margin: 0 0 6px; }
.onboard .btn { white-space: nowrap; }

/* тост */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 20;
  max-width: min(560px, calc(100% - 32px)); background: var(--toast-bg); color: var(--toast-fg); border-radius: 10px;
  padding: 10px 12px 10px 16px; display: flex; align-items: center; gap: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.25); font-size: 15px; }
.toast .btn { background: transparent; color: inherit; border-color: color-mix(in srgb, var(--toast-fg) 40%, transparent); }

/* пользователь в шапке */
.user { position: relative; }
.userbtn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  font-weight: 650; display: inline-flex; align-items: center; justify-content: center; }
.usermenu { position: absolute; right: 0; top: 46px; z-index: 10; width: 280px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 8px 28px rgba(0,0,0,.18); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.usermenu .who { font-size: 14px; overflow-wrap: anywhere; }

/* вход */
.login { max-width: 520px; padding-top: 48px; padding-bottom: 48px; }
.login h1 { font: 600 30px/1.15 var(--f-news); display: flex; align-items: center; gap: 10px; }
.login h1 svg { width: 26px; height: 26px; }
.login .privacy { font-size: 13px; color: var(--muted); margin-top: 28px; }

/* админка */
.table { display: flex; flex-direction: column; gap: 6px; font-variant-numeric: tabular-nums; }
.trow { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; padding: 8px 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.trow > span:first-child { min-width: 12em; font-weight: 550; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px; }
.person.blocked { opacity: .7; }
.pemail { font-weight: 600; overflow-wrap: anywhere; }
.pname { display: flex; gap: 8px; align-items: center; max-width: 420px; }
.pstats { font-size: 13px; }
.pacts { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 12px; padding: 0 8px; border-radius: 999px; background: var(--hover); color: var(--muted); font-weight: 500; }
.badge.warn { color: var(--danger); }
.bar-chart { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 5.5em 1fr 3em; gap: 4px 8px; align-items: center; font-size: 14px; }
.bar-row .small { grid-column: 2 / -1; }
.bar-track { display: block; background: var(--hover); border-radius: 4px; height: 10px; }
.barfill { display: block; height: 10px; border-radius: 4px; background: var(--news); min-width: 0; }

@media (prefers-reduced-motion: reduce) { .card.flash, .skeleton { animation: none; } }

@media (max-width: 600px) {
  .brand .name { display: none; }
  .bar { gap: 8px; }
  .tabs a { padding: 5px 8px; }
  .search { flex: 1 1 auto; }
  .pagehead h1 { font-size: 21px; }
  .filters { flex-wrap: nowrap; gap: 6px; }
  .filters select { flex: 1 1 0; min-width: 0; padding: 0 4px; }
  .card { padding: 12px 14px; }
  .links { margin-left: 0; width: 100%; }
  .btn { min-height: 44px; }
  .btn.small { min-height: 40px; }
  .chip { min-height: 40px; }
  .day button:not(.btn) { width: 44px; height: 44px; }
  .actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .actions .btn { padding: 0 6px; }
  .links { grid-column: 1 / -1; display: flex; gap: 20px; }
  .links a, .links button { padding: 10px 0; }
  .tag { line-height: 28px; }
  .fold { padding: 10px 0; }
  main { padding-bottom: 80px; }
  header .bar { flex-wrap: wrap; }
  .tabs { flex: 1 1 auto; min-width: 0; margin-right: 0; }
  .user { order: 2; margin-left: auto; }
  .search { order: 3; flex: 1 1 100%; }
  .usermenu { width: min(300px, calc(100vw - 32px)); }
  .trow > span:first-child { min-width: 0; width: 100%; }
}
