/* roddom.km.ua — mobile-first, white */
:root {
  --ink: #1c1c1e; --muted: #6a6a70; --line: #e6e6e1; --soft: #f6f6f3; --bg: #fff;
  --brand: #0d7a66; --brand-d: #0a6252; --brand-l: #e5f3ef;
  --p: #1f9d5c; --p-l: #e6f5ec; --m: #b98a00; --m-l: #fbf3dc; --n: #d4463f; --n-l: #fbe9e7;
  --mem: #6d62a3; --mem-l: #efedf7;
  --r: 14px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 10px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--soft); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); }
h1, h2 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.wrap { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 560px; }
.i { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }

/* header / footer */
.top { background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.05rem; }
.brand b { color: var(--brand); font-weight: 700; }
.brand-i { width: 28px; height: 28px; color: var(--brand); }
main { flex: 1 0 auto; }
.foot { margin-top: 48px; padding: 24px 0 40px; background: var(--bg); border-top: 1px solid var(--line); font-size: .9rem; }
.foot p { margin: .3em 0; }
.foot .i { color: var(--brand); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--brand); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--brand-d); }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #8fd3c4; outline-offset: 2px; }
.btn-ghost { background: var(--bg); color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.btn-ghost:hover { background: var(--brand-l); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: .92rem; }
.btn-block { width: 100%; margin-top: 14px; }
.btn-danger { background: var(--n); } .btn-danger:hover { background: #b73a34; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; }
.link.danger { color: var(--n); }
.inline { display: inline; }
.top .btn span { display: none; }
@media (min-width: 520px) { .top .btn span { display: inline; } }

/* hero + search */
.hero { background: var(--bg); border-bottom: 1px solid var(--line); padding: 28px 0 24px; margin-bottom: 20px; }
.hero h1 { font-size: 1.75rem; }
.lead { color: var(--muted); font-size: 1.02rem; }
.search { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 6px 6px 6px 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--bg); box-shadow: var(--shadow); }
.search:focus-within { border-color: var(--brand); }
.search .i { color: var(--muted); width: 22px; height: 22px; }
.search input[type=search] { flex: 1; min-width: 0; border: 0; border-radius: 0; outline: 0; font: inherit; font-size: 1.05rem; padding: 8px 0; background: none; -webkit-appearance: none; }
.search .btn { min-height: 42px; }

/* lists */
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.row-head h2, .row-head h1 { margin: 0; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.doc { padding: 0; }
.doc-link { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: inherit; text-decoration: none; }
.doc-link:hover .doc-name { color: var(--brand); }
.doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.doc-name { font-weight: 650; }
.chev { color: var(--muted); }
.avatar { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--brand-l); color: var(--brand); font-weight: 700; font-size: 1.1rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.6rem; }
.avatar-sm { width: 32px; height: 32px; font-size: .9rem; background: var(--soft); color: var(--muted); }
.avatar-mem { background: var(--mem-l); color: var(--mem); }
.score { font-size: .9rem; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.score b { color: var(--ink); }
.meter { width: 64px; height: 6px; border-radius: 3px; background: var(--n-l); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--p); }
.memory { color: var(--mem); font-size: .92rem; }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }

/* doctor page */
.back { display: inline-flex; align-items: center; gap: 6px; margin: 16px 0 10px; text-decoration: none; font-size: .95rem; }
.doc-head { display: grid; gap: 16px; }
.doc-title { display: flex; gap: 14px; align-items: center; }
.doc-title h1 { font-size: 1.4rem; }
.doc-title p { margin: .2em 0 0; }
.is-mem { border-top: 4px solid var(--mem); }
.big-score { display: flex; align-items: baseline; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 14px; }
.big-score b { font-size: 2.2rem; color: var(--p); margin-right: 8px; }
.dist { display: grid; gap: 8px; font-size: .92rem; }
.dist-row { display: grid; grid-template-columns: 120px 1fr 34px; align-items: center; gap: 10px; }
.dist-row span:first-child { white-space: nowrap; }
.dist .num { text-align: right; color: var(--muted); }
.bar { height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.bar i { display: block; height: 100%; }
.bar-p i { background: var(--p); } .bar-m i { background: var(--m); } .bar-n i { background: var(--n); }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.seg a.on { background: var(--brand); color: #fff; }
.tabs { margin-bottom: 14px; flex-wrap: wrap; }

/* reviews */
.reviews { display: grid; gap: 10px; }
.review { display: grid; gap: 8px; scroll-margin-top: 80px; }
.rv-head { display: flex; align-items: center; gap: 10px; }
.rv-author { font-weight: 600; }
.rv-head time { margin-left: auto; font-size: .85rem; }
.rv-body { margin: 0; overflow-wrap: anywhere; }
.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.rv-doc { display: inline-flex; gap: 6px; align-items: center; font-size: .9rem; font-weight: 600; text-decoration: none; }
.rv-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.chip { justify-self: start; display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 650; }
.chip-p { background: var(--p-l); color: #157244; } .chip-m { background: var(--m-l); color: #7d5d00; } .chip-n { background: var(--n-l); color: #a8302a; }
.vote { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--muted); font: inherit; font-size: .9rem; cursor: pointer; }
.vote:hover { border-color: var(--brand); color: var(--brand); }
.vote.done { background: var(--brand-l); border-color: var(--brand); color: var(--brand); cursor: default; }
.vote b { color: var(--ink); }
.vote-captcha { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 9; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 18px 0; }
.pager a, .pager span { min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; text-decoration: none; background: var(--bg); border: 1px solid var(--line); }
.pager .on { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager .gap { border: 0; background: none; }

/* forms */
.write { margin-top: 22px; scroll-margin-top: 70px; }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.field em { font-weight: 400; font-style: normal; }
input[type=text], input:not([type]), input[type=password], input[type=search], textarea {
  width: 100%; font: inherit; font-weight: 400; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); }
textarea { resize: vertical; min-height: 140px; }
input:focus, textarea:focus { border-color: var(--brand); outline: 0; }
.counter { font-weight: 400; text-align: right; font-size: .82rem; }
.sent { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sent legend { font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.sent-opt { display: grid; }
.sent-opt input { position: absolute; opacity: 0; }
.sent-opt span { height: 100%; display: flex; justify-content: center; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 1.5px solid var(--line); border-radius: 12px; font-size: .82rem; font-weight: 600; text-align: center; cursor: pointer; }
.sent-opt .i { width: 22px; height: 22px; }
.sent-p input:checked + span { border-color: var(--p); background: var(--p-l); color: #157244; }
.sent-m input:checked + span { border-color: var(--m); background: var(--m-l); color: #7d5d00; }
.sent-n input:checked + span { border-color: var(--n); background: var(--n-l); color: #a8302a; }
.sent-opt input:focus-visible + span { outline: 3px solid #8fd3c4; }
.check { display: flex; gap: 8px; align-items: center; }
.login-box { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 14px; border-radius: 12px; background: var(--soft); }
.who { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid3 { display: grid; gap: 10px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.flash { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; font-weight: 500; }
.flash-ok { background: var(--p-l); color: #157244; } .flash-err { background: var(--n-l); color: #a8302a; } .flash-wait { background: var(--m-l); color: #6e5300; }
.prose h2 { margin-top: 1.2em; } .prose ul { padding-left: 1.2em; } .prose li { margin-bottom: .5em; }
.empty-page { text-align: center; margin-top: 30px; }
.table-wrap { overflow-x: auto; padding: 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.admin-pill { position: fixed; right: 12px; bottom: 12px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 999px; text-decoration: none; font-size: .85rem; }

@media (min-width: 720px) {
  h1 { font-size: 2rem; }
  .hero { padding: 44px 0 36px; }
  .hero h1 { font-size: 2.3rem; }
  .doc-head { grid-template-columns: 1fr 260px; align-items: start; }
  .doc-title { grid-column: 1 / -1; }
  .doc-head .btn-block { grid-column: 2; margin-top: 0; }
  .dist { grid-row: 2; }
  .big-score { grid-column: 2; grid-row: 2; border: 0; padding: 0; flex-direction: column; align-items: flex-end; }
  .reviews { gap: 12px; }
  .latest .reviews { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: repeat(3, 1fr); }
}

/* doctor list filters */
.wrap-row { flex-wrap: wrap; align-items: center; }
.filters a { font-size: .86rem; padding: 6px 10px; }
.count { margin: 0 0 10px; }
/* Telegram button: clip the iframe to the button radius (avoids dark corners when browser/OS colour schemes differ) */
.tg-btn { display: inline-block; line-height: 0; border-radius: 10px; overflow: hidden; }
.tg-btn iframe { color-scheme: normal; display: block; }
.add-doc { margin-bottom: 12px; }
#doctors, #reviews { scroll-margin-top: 66px; }
.narrow > .card:first-child { margin-top: 24px; }
.more { display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; font-weight: 600; text-decoration: none; justify-self: start; }
.review:target { box-shadow: 0 0 0 3px #8fd3c4; }
a.dist-row { color: inherit; text-decoration: none; border-radius: 8px; padding: 2px 4px; margin: -2px -4px; }
a.dist-row span:first-child { color: var(--brand); font-weight: 600; text-decoration: underline dotted; text-underline-offset: 3px; }
a.dist-row:hover span:first-child, a.dist-row.on span:first-child { text-decoration: underline solid; }
a.dist-row.on { background: var(--brand-l); }
.reset { font-size: .9rem; font-weight: 600; }
@media (max-width: 480px) {
  .filters { display: grid; grid-template-columns: 1fr 1fr; width: 100%; border-radius: 14px; gap: 2px; }
  .filters a { text-align: center; border-radius: 11px; }
}
.foot { text-align: center; }
.sub { margin: .2em 0 0; font-size: .92rem; }
.others { margin-top: 28px; }
.chips-list { list-style: none; padding: 0; margin: 10px 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips-list li { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: .9rem; }
.chips-list a { text-decoration: none; font-weight: 600; }
.about { margin-top: 28px; color: var(--muted); }
.about h2 { color: var(--ink); }
.modal { border: 0; border-radius: 18px; padding: 26px 22px 18px; width: min(92vw, 400px); box-shadow: 0 20px 60px rgba(0,0,0,.25); text-align: center; }
.modal::backdrop { background: rgba(20,20,25,.45); }
.modal p { font-size: 1.08rem; margin: 10px 0 6px; }
.modal-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--p-l); color: var(--p); }
.modal-icon .i { width: 30px; height: 30px; }
.form-error { margin: 0; }
input:user-invalid, textarea:user-invalid { border-color: var(--n); }
[hidden] { display: none !important; }
.field-err { display: block; color: #a8302a; font-weight: 600; font-size: .88rem; margin-top: -4px; }
.sent + .field-err { margin-top: -6px; }
[aria-invalid="true"] { border-color: var(--n) !important; }
.sent:has([aria-invalid]) .sent-opt span { border-color: var(--n); }
.tg-login { background: #2aabee; min-width: 260px; }
.tg-login:hover { background: #1e96d4; }
.tg-login:disabled { opacity: .6; cursor: wait; }
.tg-hint { max-width: 320px; }
