/* Halitozis Araştırma Merkezi — mobil öncelikli arayüz */
:root {
  --bg: #f5f7f7; --surface: #ffffff; --surface-2: #eef3f3; --text: #172024; --muted: #56656b; --line: #d8e1e3;
  --brand: #0f766e; --brand-2: #115e59; --brand-ink: #ffffff; --link: #0b6a8f;
  --ok: #157f3b; --warn: #a15c00; --err: #b42318; --reddit: #c2410c;
  --ev-strong: #157f3b; --ev-mid: #2f6db5; --ev-low: #8a5a00; --ev-vlow: #9a3412; --ev-none: #5b6670; --ev-conflict: #7c3aed;
  --s1: #257de0; --s2: #f47230; --s3: #00b894;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --fs: 16px; color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1417; --surface: #141e22; --surface-2: #1b282d; --text: #e7eef0; --muted: #9db0b6; --line: #2a3a40;
  --brand: #2bb3a5; --brand-2: #5fd0c3; --brand-ink: #062522; --link: #6cc5ec;
  --ok: #4ccf7a; --warn: #f0a845; --err: #ff7b72; --reddit: #fb923c;
  --ev-strong: #4ccf7a; --ev-mid: #7fb2f0; --ev-low: #e0b45a; --ev-vlow: #fb923c; --ev-none: #9aa7b0; --ev-conflict: #b9a2ff;
  --s1: #338ced; --s2: #e76624; --s3: #00a888;
  --shadow: none; color-scheme: dark;
}
:root[data-font="large"] { --fs: 18px; }
:root[data-font="xlarge"] { --fs: 20px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs)/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; overflow-x: hidden; }
a { color: var(--link); }
h1 { font-size: 1.5em; line-height: 1.25; margin: .6em 0 .4em; }
h2 { font-size: 1.2em; margin: 1.1em 0 .5em; }
h3 { font-size: 1.05em; margin: .8em 0 .35em; }
h4 { margin: .4em 0; font-size: 1em; }
h5 { margin: .8em 0 .3em; font-size: .92em; color: var(--muted); }
p { margin: .45em 0; }
code { font-size: .85em; background: var(--surface-2); padding: .1em .35em; border-radius: 6px; word-break: break-word; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 0; } .skip:focus { left: 8px; z-index: 99; background: var(--surface); padding: 8px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* üst çubuk + menü */
header.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 6px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { flex: 1; font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand span { color: var(--brand); font-weight: 600; }
.icon-btn { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; border: 0; background: transparent; color: var(--text); font-size: 1.15em; border-radius: 10px; cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); }
.burger, .burger::before, .burger::after { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; position: relative; content: ""; }
.burger::before { position: absolute; top: -7px; } .burger::after { position: absolute; top: 7px; }
#scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
#drawer { position: fixed; top: 0; left: 0; bottom: 0; width: min(86vw, 340px); background: var(--surface); z-index: 50; transform: translateX(-102%); transition: transform .22s ease; overflow-y: auto; padding-bottom: 40px; border-right: 1px solid var(--line); }
body.menu-open #drawer { transform: none; } body.menu-open #scrim { opacity: 1; pointer-events: auto; } body.menu-open { overflow: hidden; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
#drawer-nav a { display: block; padding: 11px 16px; color: var(--text); text-decoration: none; border-radius: 8px; margin: 1px 6px; }
#drawer-nav a.active, #drawer-nav a:hover { background: var(--surface-2); }
#drawer-nav a.sub { padding: 8px 16px 8px 34px; font-size: .92em; color: var(--muted); }
#drawer-nav details summary { padding: 10px 16px; cursor: pointer; margin: 0 6px; }
.menu-sep { margin: 14px 16px 4px; font-size: .78em; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

main { max-width: 860px; margin: 0 auto; padding: 8px 14px 60px; outline: none; }
.foot { text-align: center; font-size: .8em; color: var(--muted); padding: 18px 12px 30px; }
.boot { padding: 40px 0; color: var(--muted); }

/* düğmeler ve form */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--surface-2); } .btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); } .btn-primary:hover { background: var(--brand-2); }
.btn-ghost { background: transparent; } .btn-danger { color: var(--err); border-color: var(--err); background: transparent; }
.btn-sm { min-height: 38px; padding: 6px 12px; font-size: .9em; } .btn-xs { min-height: 30px; padding: 3px 9px; font-size: .8em; border-radius: 8px; }
.btn-wide { width: 100%; } .btn.on { border-color: var(--brand); color: var(--brand); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-height: 44px; width: 100%; }
textarea { min-height: 0; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; }
input[type="range"] { padding: 0; accent-color: var(--brand); }
label { display: block; margin: 8px 0; font-size: .93em; }
.row { display: flex; gap: 8px; align-items: center; } .row.wrap { flex-wrap: wrap; } .row input[type="number"] { max-width: 120px; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 0 12px; } .grid3 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 10px; }
@media (min-width: 620px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } }
fieldset { border: 0; padding: 0; margin: 10px 0; } legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
.switch { display: flex; gap: 10px; align-items: flex-start; } .switch input { margin-top: 4px; }

.searchbar { display: flex; gap: 8px; margin: 12px 0; } .searchbar input { flex: 1; font-size: 1.05em; min-height: 52px; } .searchbar .btn { min-height: 52px; }
.chips, .pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-size: .9em; cursor: pointer; font-family: inherit; }
.chip:hover { border-color: var(--brand); } .chip.static { cursor: default; }
.pill { margin: 0; } .pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-flex; align-items: center; min-height: 38px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: .9em; }
.pill input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.pill input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }

.hero { padding: 10px 0 4px; } .hero h1 { font-size: 1.7em; margin-bottom: .2em; }
.lead { color: var(--muted); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; box-shadow: var(--shadow); }
.tile .ti { font-size: 1.5em; } .tile small { color: var(--muted); font-size: .82em; line-height: 1.35; }
.disclaimer { font-size: .85em; color: var(--muted); border-left: 3px solid var(--warn); padding-left: 10px; }

/* kartlar */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 12px 0; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.card .title { margin: 6px 0; font-size: 1.04em; line-height: 1.35; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-block; font-size: .72em; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); letter-spacing: .01em; }
.b-type { color: var(--ev-mid); } .b-oa { color: var(--ok); } .b-warn { color: var(--warn); } .b-new { background: var(--brand); color: var(--brand-ink); }
.b-reddit { background: color-mix(in srgb, var(--reddit) 15%, transparent); color: var(--reddit); }
.meta { font-size: .88em; color: var(--muted); } .meta.warn { color: var(--warn); font-weight: 600; }
.ids { font-size: .82em; } .ids a { white-space: nowrap; }
.trdesc { font-size: .92em; background: var(--surface-2); padding: 8px 10px; border-radius: 10px; }
.lbl { font-weight: 700; font-size: .85em; }
.tr-out { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-size: .93em; }
.facts { display: grid; grid-template-columns: 1fr; gap: 4px 14px; margin: 10px 0; font-size: .88em; }
@media (min-width: 620px) { .facts { grid-template-columns: 1fr 1fr; } }
.facts div { display: flex; flex-direction: column; } .facts dt { color: var(--muted); font-size: .85em; } .facts dd { margin: 0; }
.ev { font-weight: 700; } .ev-strong { color: var(--ev-strong); } .ev-mid { color: var(--ev-mid); } .ev-low { color: var(--ev-low); } .ev-vlow { color: var(--ev-vlow); } .ev-none, .ev-na { color: var(--ev-none); } .ev-conflict { color: var(--ev-conflict); }
.ev::before { content: "● "; }
.rel { font-weight: 700; } .rel-yuksek { color: var(--brand); } .rel-orta { color: var(--ev-mid); } .rel-dusuk, .rel-yok { color: var(--muted); }
details.abs { margin: 8px 0; } details summary { cursor: pointer; font-weight: 600; min-height: 32px; display: list-item; }
.abs-text { font-size: .92em; margin-top: 6px; white-space: normal; }
.ft { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; } .chip-link { font-size: .85em; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fine { font-size: .8em; color: var(--muted); }
.why { font-size: .9em; }
.card.rd { border-left: 4px solid var(--reddit); }
.card.trial { border-left: 4px solid var(--ev-mid); }
.notice-reddit { background: color-mix(in srgb, var(--reddit) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--reddit) 40%, transparent); padding: 10px 12px; border-radius: 12px; font-size: .9em; margin: 10px 0; }
.notice-warn { background: color-mix(in srgb, var(--warn) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); padding: 10px 12px; border-radius: 12px; font-size: .92em; margin: 10px 0; }
.cmt { border-left: 2px solid var(--line); padding-left: 10px; margin: 8px 0; font-size: .9em; }

/* listeler */
.list-summary { margin: 10px 0; font-size: .9em; } .sum-row { margin: 3px 0; } .src-err { color: var(--err); }
.loader { display: flex; align-items: center; gap: 10px; padding: 14px; color: var(--muted); }
.spin { width: 20px; height: 20px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.5s; } #drawer, #scrim { transition: none; } }
.errbox { background: color-mix(in srgb, var(--err) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--err) 40%, transparent); color: var(--text); border-radius: 12px; padding: 12px; margin: 10px 0; }
.errbox strong { color: var(--err); }
.empty { padding: 16px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; }
.end { text-align: center; color: var(--muted); font-size: .85em; }
.ok { color: var(--ok); font-weight: 600; }
.list-more { margin: 10px 0; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 14px 0 6px; overflow-x: auto; scrollbar-width: none; }
.tab { flex: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 10px 12px; min-height: 44px; border-bottom: 3px solid transparent; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
details.filters { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 8px 0; }
.h-search span { color: var(--brand); }
.crumbs { font-size: .85em; color: var(--muted); margin-top: 10px; }

.topiclist { list-style: none; padding: 0; margin: 0; } .topiclist li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .95em; }
.topic-grid { display: grid; gap: 10px; } @media (min-width: 620px) { .topic-grid { grid-template-columns: 1fr 1fr; } }
.topic-tile { display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none; margin: 0; } .topic-tile small { color: var(--muted); }
.topic-info section { border-bottom: 1px solid var(--line); padding-bottom: 6px; } .topic-info section:last-child { border: 0; }
.txdl { display: grid; gap: 6px; } .txdl dt { font-weight: 700; font-size: .88em; } .txdl dd { margin: 0 0 4px; font-size: .92em; }
.prof-links { font-size: .9em; } .prof-links .q { color: var(--muted); font-size: .9em; }
.tx-table-wrap { overflow-x: auto; } .tx-table, .mini { width: 100%; border-collapse: collapse; font-size: .85em; } .tx-table th, .tx-table td, .mini th, .mini td { border-bottom: 1px solid var(--line); padding: 6px; text-align: left; vertical-align: top; }
.mini.edit input { min-height: 36px; padding: 4px 6px; font-size: .9em; } .mini.edit td:first-child { text-align: center; }

/* sihirbaz */
.wq { border-bottom: 1px solid var(--line); padding-bottom: 10px; } .wq:last-child { border: 0; }
.wnote { margin-top: 6px; font-size: .9em; }
.wz-bar { position: sticky; bottom: 0; padding: 10px 0 max(10px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); z-index: 5; }
.wz-progress { font-weight: 600; }
.area .note { font-size: .88em; background: var(--surface-2); padding: 8px; border-radius: 8px; }
.missing li { margin: 4px 0; }
.hist-edit { list-style: none; padding: 0; } .hist-edit li { display: flex; gap: 6px; margin: 4px 0; }
.summary { font-family: ui-monospace, monospace; font-size: .8em; }
.hist { padding-left: 18px; } .hist li { margin: 8px 0; }
.linklist li { margin: 8px 0; } .linklist small { color: var(--muted); }
.saved-wrap { margin-bottom: 18px; } .note-lbl textarea { margin-top: 4px; }

/* takip ve grafikler */
.rec-list { list-style: none; padding: 0; } .rec-list li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; font-size: .92em; }
.ocr-text { white-space: pre-wrap; font-size: .8em; max-height: 260px; overflow: auto; background: var(--surface-2); padding: 8px; border-radius: 8px; }
.chart-wrap { position: relative; } .chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; } .chart .axis { fill: var(--muted); font-size: 11px; }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { stroke: var(--surface); stroke-width: 2; cursor: pointer; }
.chart .band { fill: var(--brand); opacity: .09; } .chart .band-lbl { fill: var(--muted); font-size: 10px; }
.s1.ln { stroke: var(--s1); } .s1.pt, i.s1 { fill: var(--s1); background: var(--s1); }
.s2.ln { stroke: var(--s2); } .s2.pt, i.s2 { fill: var(--s2); background: var(--s2); }
.s3.ln { stroke: var(--s3); } .s3.pt, i.s3 { fill: var(--s3); background: var(--s3); }
.legend { display: flex; gap: 14px; font-size: .85em; color: var(--text); flex-wrap: wrap; } .legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: absolute; top: 4px; right: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: .8em; color: var(--text); box-shadow: var(--shadow); }

/* sistem testi */
.tests li { margin: 8px 0; } .tests .st { display: inline-block; width: 1.5em; } .tests li.fail { color: var(--err); } .tests li.pass .td { color: var(--muted); }
.sumline { font-weight: 700; }

#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 6px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; font-size: .92em; transition: opacity .4s; }
.toast-warn { background: var(--warn); color: #fff; } .toast-error { background: var(--err); color: #fff; } .toast.out { opacity: 0; }
