/* Measure Sieve
   Düzen: çalışan bir araç. Üstte sonuç cümlesi ve elek ızgarası, altında öğe listesi ve yapışkan temizlik paneli,
   en altta dosya rehberi. İmza öğesi elek: kalan öğeler dolu kare, elekten düşenler boş delik. */
:root {
  --bg: #EDF2F4; --surface: #FFFFFF; --sunken: #E2EAEE; --ink: #14262F; --muted: #526771; --line: #CAD6DC;
  --accent: #0B6478; --accent-ink: #FFFFFF;
  --used: #0B726D; --indirect: #5EAAA5; --review: #8A5A0B; --cand: #B5390D;
  --code: #F3F7F8;
  --f-display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0E1A20; --surface: #16262E; --sunken: #1E323C; --ink: #E5EFF2; --muted: #9BB0BA; --line: #2D444F;
  --accent: #58C3D3; --accent-ink: #06232A;
  --used: #3CC2B8; --indirect: #2C7D78; --review: #E3AE48; --cand: #F4825A;
  --code: #101E25; color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #0E1A20; --surface: #16262E; --sunken: #1E323C; --ink: #E5EFF2; --muted: #9BB0BA; --line: #2D444F;
  --accent: #58C3D3; --accent-ink: #06232A;
  --used: #3CC2B8; --indirect: #2C7D78; --review: #E3AE48; --cand: #F4825A;
  --code: #101E25; color-scheme: dark;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--f-body); margin: 0 }
.wrap { max-width: 1160px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 20px 40px; display: grid; gap: 28px }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0 }
button, select { font: inherit; color: inherit; cursor: pointer }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
a { color: var(--accent) }
.muted { color: var(--muted) }
.m0 { margin: 0 }
.mt12 { margin-top: 12px }
.fs13 { font-size: 13px }
.fs135 { font-size: 13.5px }
.fs125 { font-size: 12.5px }
.minw0 { min-width: 0 }

/* üst */
.bar { display: flex; justify-content: flex-end; gap: 14px; font-size: 13.5px }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; font-weight: 500 }
.top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 28px; align-items: stretch }
.brand h1 { font-size: clamp(34px, 5vw, 50px); font-weight: 700; line-height: 1.02; letter-spacing: -.02em }
.brand p { margin: 12px 0 0; color: var(--muted); max-width: 46ch }
.drop { border: 1.5px dashed var(--line); border-radius: 6px; background: var(--surface); padding: 18px; display: grid; gap: 12px; align-content: center; transition: border-color .15s, background .15s }
.drop.over { border-color: var(--accent); background: var(--sunken) }
.drop-title { font-weight: 600 }
.drop-hint { color: var(--muted); font-size: 13.5px }
.btns { display: flex; flex-wrap: wrap; gap: 8px }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 4px; padding: 8px 13px; font-weight: 500; font-size: 14px }
.btn:hover { border-color: var(--accent); color: var(--accent) }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink) }
.btn.primary:hover { color: var(--accent-ink); filter: brightness(1.08) }
.btn:disabled { opacity: .5; cursor: not-allowed }
.sources { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px }
.source { background: var(--sunken); border-radius: 3px; padding: 3px 8px; overflow-wrap: anywhere }
.source.sample { background: transparent; border: 1px solid var(--review); color: var(--review); font-weight: 500 }

/* sonuç */
.verdict { display: grid; gap: 14px }
.vhead { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between }
.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); padding: 3px; gap: 2px; flex-wrap: wrap }
.tab { border: 0; background: transparent; border-radius: 3px; padding: 6px 12px; font-weight: 500; font-size: 14px; font-variant-numeric: tabular-nums }
.tab b { font-weight: 600; margin-left: 4px; color: var(--muted) }
.tab[aria-selected="true"] { background: var(--ink); color: var(--bg) }
.tab[aria-selected="true"] b { color: inherit; opacity: .75 }
.modelpick { display: flex; gap: 8px; align-items: center; font-size: 14px }
.modelpick select { border: 1px solid var(--line); background: var(--surface); border-radius: 4px; padding: 6px 8px; max-width: 260px }
.verdict h2 { font-size: clamp(23px, 3.2vw, 32px); font-weight: 500; line-height: 1.16; letter-spacing: -.01em; max-width: 32ch }
.verdict h2 b { font-weight: 700; color: var(--cand) }
.scope { color: var(--muted); margin: 0; max-width: 80ch }
.notices { display: grid; gap: 8px }
.notice { border-left: 3px solid var(--review); background: var(--surface); padding: 10px 14px; display: grid; gap: 4px; min-width: 0 }
.notice b { color: var(--review) }
.notice.err { border-color: var(--cand) }
.notice.err b { color: var(--cand) }
.notice.info { border-color: var(--accent) }
.notice.info b { color: var(--accent) }
.notice .links { margin-top: 2px }

/* elek */
.sieve { display: flex; flex-wrap: wrap; gap: 5px }
.cell { width: 26px; height: 26px; padding: 0; border-radius: 3px; border: 2px solid transparent; background: var(--c) }
.sieve.dense .cell { width: 16px; height: 16px; border-width: 1.5px; border-radius: 2px }
.cell.small { width: 14px; height: 14px; border-width: 1.5px }
.cell[data-s=used] { --c: var(--used) }
.cell[data-s=indirect] { --c: var(--indirect) }
.cell[data-s=unknown] { --c: var(--line) }
.cell[data-s=review] { background: repeating-linear-gradient(135deg, var(--review) 0 3px, transparent 3px 6px); border-color: var(--review) }
.cell[data-s=chain] { background: transparent; border: 2px dashed var(--cand) }
.cell[data-s=unused] { background: transparent; border-color: var(--cand) }
.cell.small[data-s=chain], .cell.small[data-s=unused], .sieve.dense .cell[data-s=chain], .sieve.dense .cell[data-s=unused] { border-width: 1.5px }
.chips { display: flex; flex-wrap: wrap; gap: 6px }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); border-radius: 4px; padding: 5px 10px; font-size: 13.5px }
.chip b { font-weight: 600; font-variant-numeric: tabular-nums }
.chip[aria-pressed=true] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink) }
.chip .cell { pointer-events: none }

/* çalışma alanı */
.work { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start }
.listhead { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px }
.search { flex: 1 1 200px; max-width: 320px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 4px; padding: 7px 10px; font: inherit; font-size: 14px }
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 6px }
.row { border-top: 1px solid var(--line) }
.row:first-child { border-top: 0 }
.rowhead { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 12px; align-items: start }
.rowhead input { margin: 4px 0 0; width: 16px; height: 16px; accent-color: var(--accent) }
.rowmain { background: none; border: 0; padding: 0; text-align: left; min-width: 0; display: grid; gap: 1px }
.rowname { font-weight: 600; overflow-wrap: anywhere }
.rowmain:hover .rowname { color: var(--accent) }
.rowwhy { color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere }
.tag { font-size: 11.5px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; margin-left: 6px; white-space: nowrap }
.tag.dup { color: var(--review); border-color: var(--review) }
.pill { font-size: 12px; font-weight: 600; border-radius: 3px; padding: 2px 7px; white-space: nowrap; color: var(--pc); background: color-mix(in srgb, var(--pc) 13%, transparent) }
.pill[data-s=used], .pill[data-s=indirect] { --pc: var(--used) }
.pill[data-s=review] { --pc: var(--review) }
.pill[data-s=chain], .pill[data-s=unused] { --pc: var(--cand) }
.pill[data-s=unknown] { --pc: var(--muted) }
.detail { padding: 2px 12px 14px 38px; display: grid; gap: 12px }
.detail h3 { font: 600 12px/1.3 var(--f-body); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px }
pre.dax { margin: 0; background: var(--code); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; font: 400 13px/1.55 var(--f-mono); overflow-x: auto; white-space: pre; max-height: 320px }
.dax .cm { color: var(--muted); font-style: italic }
.dax .st { color: var(--review) }
.dax .rf { color: var(--muted) }
.jump { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; text-align: left }
.links { display: flex; flex-wrap: wrap; gap: 4px 12px }
.uses { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 14px }
.uses span { color: var(--muted) }
.members { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14px }
.members li { display: flex; gap: 8px; align-items: center; min-width: 0 }
.members .jump { overflow-wrap: anywhere }
.empty { padding: 22px 14px; color: var(--muted); text-align: center }
.morebtn { margin-top: 10px }

/* panel */
.panel { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 14px); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 16px; display: grid; gap: 12px }
.panel h2 { font-size: 20px; font-weight: 700 }
.panel p { margin: 0; font-size: 14px }
.order { margin: 0; padding: 0 0 0 26px; font-size: 14px; display: grid; gap: 3px; max-height: 220px; overflow: auto; font-variant-numeric: tabular-nums }
.order li { overflow-wrap: anywhere }
.impact { font-size: 13.5px; padding: 9px 11px; border-radius: 4px; background: color-mix(in srgb, var(--pc) 11%, transparent); --pc: var(--used); display: grid; gap: 4px }
.impact.warn { --pc: var(--cand) }
.impact b { color: var(--pc) }
.impact ul { margin: 0; padding-left: 17px; display: grid; gap: 2px }
.panel .btns { display: grid; gap: 6px }
.panel .btn { text-align: left }
#out { width: 100%; min-height: 110px; font: 400 12px/1.5 var(--f-mono); background: var(--code); color: var(--ink); border: 1px solid var(--line); border-radius: 4px; padding: 8px; resize: vertical }
.copied { font-size: 13px; color: var(--used); font-weight: 500; min-height: 20px }

/* temizlenmiş kopya */
.cleanbox { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px }
.cleanbox h2 { font-size: 17px }
.cleanbox .btn { text-align: center; text-decoration: none }
.checks { list-style: none; padding: 0 !important; margin: 2px 0 0 }
.checks li[data-ok="true"] span { color: var(--used); font-weight: 700 }
.checks li[data-ok="false"] span { color: var(--cand); font-weight: 700 }
.skipped { font-size: 13px }
.skipped summary { cursor: pointer; font-weight: 500 }
.skipped ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; max-height: 220px; overflow: auto }

/* rehber */
.guide { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; border-top: 1px solid var(--line); padding-top: 24px }
.guide h2 { font-size: 20px; font-weight: 700; margin-bottom: 10px }
.guide h2 + p { margin-top: 0 }
.tablewrap { overflow-x: auto }
table { border-collapse: collapse; width: 100%; font-size: 14px }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: left; font-weight: 600 }
th, td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top }
.guide ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 14px }
.guide p { font-size: 14px; margin: 10px 0 0; max-width: 62ch }
.guide .mcp { margin-top: 22px }
kbd { font: 500 12.5px var(--f-mono); background: var(--sunken); border-radius: 3px; padding: 1px 5px }
footer .privacy { flex-basis: 100%; margin: 0 }
footer { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted) }

@media (max-width: 880px) {
  .top, .work, .guide { grid-template-columns: minmax(0, 1fr) }
  .panel { position: static }
  .detail { padding-left: 12px }
  .rowhead { grid-template-columns: auto minmax(0, 1fr) }
  .pill { grid-column: 2; justify-self: start }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important } }
