/* Test4All: оформление сайта. Светлая и тёмная темы по настройке системы. */
:root {
  --bg: #f6f7f9; --card: #fff; --text: #16191d; --muted: #667085; --line: #e4e7ec;
  --brand: #12b76a; --brand-dark: #0e9558; --brand-soft: #e7f8f0; --warn: #f79009; --bad: #d92d20; --bad-soft: #fee4e2;
  --radius: 14px; --shadow: 0 1px 2px rgba(16, 24, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101214; --card: #191c20; --text: #eceef0; --muted: #98a2b3; --line: #2a2f36;
    --brand: #32d583; --brand-dark: #6ce9a6; --brand-soft: #12281e; --bad: #f97066; --bad-soft: #3a1512; --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand-dark); }
h1 { font-size: 28px; line-height: 1.2; margin: 8px 0 12px; letter-spacing: -.01em; }
h2 { font-size: 20px; margin: 32px 0 12px; }
h3 { font-size: 17px; margin: 0; }
p { margin: 8px 0; }
code { font: 13px ui-monospace, Menlo, Consolas, monospace; color: var(--muted); overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 20px; padding-bottom: 40px; min-height: 70vh; }
.narrow { max-width: 440px; margin: 0 auto; }
.muted { color: var(--muted); }
.pre { white-space: pre-wrap; }

.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.logo img { border-radius: 7px; }
.top nav { display: flex; gap: 4px; flex: 1; white-space: nowrap; }
.top .wrap { max-width: 1120px; }
@media (max-width: 1119px) {
  .top .wrap { max-width: 880px; }
  .top nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .right { margin-left: auto; }
}
.top nav { scrollbar-width: none; }
.top nav::-webkit-scrollbar { display: none; }
@media (max-width: 560px) {
  .top .wide-only { display: none; }
  /* меню листается вбок: край растворяется, чтобы было видно, что дальше есть ещё */
  .top nav { padding-right: 28px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .board th:nth-child(5), .board td:nth-child(5) { display: none; }
}
.top nav a { padding: 6px 10px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 500; }
.top nav a.on, .top nav a:hover { color: var(--text); background: var(--bg); }
.right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill { background: var(--brand-soft); color: var(--brand-dark); padding: 4px 12px; border-radius: 99px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.lang { border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 13px; cursor: pointer; }
footer { padding: 24px 16px 40px; font-size: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 10px; cursor: pointer; text-decoration: none; }
@media (prefers-color-scheme: dark) { .btn { color: #06200f; } }
.btn:hover { filter: brightness(.95); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: none; color: var(--text); border-color: var(--line); }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn.big { padding: 12px 22px; font-size: 17px; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost.danger { background: none; color: var(--bad); border-color: var(--line); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.card.accent { background: var(--brand-soft); border-color: transparent; }
.card.empty { text-align: center; padding: 32px 16px; }
.card.linked { display: block; color: inherit; text-decoration: none; }
.card.linked:hover { border-color: var(--brand); }
.list { display: grid; gap: 0; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.row.between { justify-content: space-between; }
.grid2, .grid3, .grid4 { display: grid; gap: 12px; }
@media (min-width: 640px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: repeat(3, 1fr); }
  .grid4 { grid-template-columns: repeat(4, 1fr); }
}
.grid2 > .card, .grid3 > .card { margin: 0; }
.num { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; margin-bottom: 10px; }

.hero { padding: 36px 0 12px; }
.hero h1 { font-size: clamp(30px, 5vw, 44px); max-width: 18em; }
.lead { font-size: 18px; color: var(--muted); max-width: 40em; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 500; background: var(--bg); color: var(--text); border: 1px solid var(--line); white-space: nowrap; }
.badge.soft { color: var(--muted); }
.badge.pf { background: none; }
.badge.st-active, .badge.st-open { background: var(--brand-soft); color: var(--brand-dark); border-color: transparent; }
.badge.st-report_due, .badge.st-review { background: #fef0c7; color: #93370d; border-color: transparent; }
.badge.st-done { background: var(--brand); color: #fff; border-color: transparent; }
.badge.st-dropped, .badge.st-rejected { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.reward { font-weight: 700; color: var(--brand-dark); white-space: nowrap; }

.form { display: grid; gap: 12px; }
.form.inset { background: var(--bg); border-radius: 12px; padding: 14px; margin: 10px 0; }
.field { display: grid; gap: 4px; }
.label { font-size: 14px; font-weight: 600; }
.hint { font-size: 13px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%; }
textarea { resize: vertical; }
input:disabled { color: var(--muted); background: var(--bg); }
.cost { font-weight: 600; margin: 0; }
.cost.bad { color: var(--bad); }

.progress { display: grid; gap: 4px; }
.progress p { margin: 0; }
progress { width: 100%; height: 10px; border: 0; border-radius: 99px; overflow: hidden; background: var(--line); accent-color: var(--brand); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--brand); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--brand); }
.dots { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.dot { width: 18px; height: 18px; border-radius: 50%; background: var(--line); }
.dot.part { background: var(--warn); }
.dot.ok { background: var(--brand); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.chip { font-size: 13px; padding: 2px 8px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.chip.ok { background: var(--brand-soft); border-color: transparent; color: var(--brand-dark); }
.stars { color: var(--warn); letter-spacing: 2px; }
.report { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 6px; }
.card > .report:first-of-type, h3 + .report { border-top: 0; margin-top: 0; }

.orders { display: grid; gap: 6px; margin-top: 10px; }
.order { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; }
.order:hover { border-color: var(--brand); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: 15px; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.amount { text-align: right; font-weight: 700; white-space: nowrap; }
.amount.plus { color: var(--brand-dark); }
.amount.minus { color: var(--muted); }
.balance { display: flex; justify-content: space-between; align-items: baseline; }
.balance strong { font-size: 30px; }
ol { margin: 8px 0; padding-left: 22px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #16191d; color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); z-index: 20; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--bad); color: #fff; }

/* Обзор, рейтинг, панель владельца */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 12px 0; }
.tile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: inherit; text-decoration: none; box-shadow: var(--shadow); }
a.tile:hover { border-color: var(--brand); }
.tile .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile .v { font-size: 30px; font-weight: 700; line-height: 1.25; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tile .s { font-size: 13px; color: var(--muted); min-height: 1.5em; }
.todo { display: grid; gap: 8px; }
.todo a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: inherit; text-decoration: none; box-shadow: var(--shadow); }
.todo a:hover { border-color: var(--brand); }
.todo a.hot { border-left: 4px solid var(--warn); }
.todo .go { color: var(--brand-dark); font-weight: 600; white-space: nowrap; }
.row.head { margin: 32px 0 0; }
.row.head h2 { margin: 0; }
.row.tight { margin: 0; }
.grow { flex: 1; min-width: 160px; }
.orders.flat { margin-top: 0; }
.notice { background: var(--brand-soft); border-radius: 10px; padding: 8px 12px; }
.notice.warn { background: #fef0c7; color: #93370d; }
.notice.warn a { color: inherit; }
div.notice { margin: 12px 0; }
.notice > p { margin: 4px 0; }
progress + p { margin-top: 6px; }

.badge.lv { font-weight: 600; }
.badge.lv-new { color: var(--muted); }
.badge.lv-low { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.lv-reliable { background: var(--brand-soft); color: var(--brand-dark); border-color: transparent; }
.badge.lv-trusted { background: var(--brand); color: #fff; border-color: transparent; }
.badge.lv-expert { background: #6941c6; color: #fff; border-color: transparent; }
.rate { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
h3 .rate { font-size: 15px; margin-left: 4px; }
h3 small { font-weight: 400; font-size: 14px; }
.big-score { font-size: 46px; font-weight: 800; line-height: 1.1; margin: 4px 0 8px; }
.big-score small { font-size: 16px; font-weight: 500; color: var(--muted); }
.meter { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 10px 0; font-size: 15px; }
.meter progress { grid-column: 1 / -1; }
.tabs { display: flex; gap: 4px; margin: 12px 0 16px; box-shadow: inset 0 -1px 0 var(--line); overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; }
.tabs a.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--brand); }
tr.me td { background: var(--brand-soft); }
td.place { font-weight: 700; width: 4em; }
.scroll { overflow-x: auto; }
a.chip, button.chip { color: inherit; text-decoration: none; cursor: pointer; font: inherit; font-size: 14px; padding: 4px 12px; border-radius: 99px; }
a.chip:hover, button.chip:hover { border-color: var(--brand); }
.chip.on { background: var(--brand); color: #fff; border-color: transparent; }
ul.rules { margin: 8px 0 0; padding-left: 20px; }
ul.rules li { margin: 6px 0; }
