:root {
  --bg: #f2f0eb; --card: #ffffff; --ink: #16202a; --muted: #5d6a76; --line: #dcd8cf;
  --brand: #1b4668; --brand-ink: #ffffff; --accent: #ff6a13; --steel: #10181f; --steel2: #1a252f;
  --ok: #1b7f3b; --ok-bg: #e6f4ea; --warn: #8a5a00; --warn-bg: #fff4d6; --err: #b3261e; --err-bg: #fde7e5; --info: #35566f; --info-bg: #e7eff5;
  --bar1: #0f4c81; --bar2: #3b86c4; --bar3: #7fb3de; --bar4: #f5a623; --bar5: #c7d3df; --bar6: #8a9bab;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1318; --card: #151d25; --ink: #e8edf2; --muted: #9bacbb; --line: #27323d;
    --brand: #6ab4f2; --brand-ink: #0b1620; --accent: #ff7a2b; --steel: #0a0f14; --steel2: #131c24;
    --ok: #6fd28d; --ok-bg: #16301f; --warn: #f2c765; --warn-bg: #33290f; --err: #ff8f86; --err-bg: #3a1b19; --info: #9cc3de; --info-bg: #1b2b38;
    --bar1: #5aa5e6; --bar2: #4688c2; --bar3: #2f648f; --bar4: #f5b34a; --bar5: #55677a; --bar6: #7e90a2;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 "IBM Plex Sans", system-ui, "Segoe UI", Arial, sans-serif; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--brand); color: var(--brand-ink); padding: 18px 0 16px; }
.top h1 { margin: 0; font-size: 1.45rem; letter-spacing: .2px; }
.top p { margin: 4px 0 0; opacity: .85; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 20px; padding-bottom: 20px; }
@media (min-width: 1000px) { .layout { grid-template-columns: minmax(0, 480px) minmax(0, 1fr); align-items: start; } .results { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; padding-right: 4px; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.card h2 { margin: 0 0 10px; font-size: 1.02rem; color: var(--brand); }
.card h3 { margin: 12px 0 6px; font-size: .92rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 3px; }
.field .unit { color: var(--muted); font-weight: 400; }
.field input, .field select { width: 100%; font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 7px; padding: 8px 9px; min-height: 40px; }
.field input:focus, .field select:focus, .btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.field input.invalid { border-color: var(--err); }
.hint { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.partbox { border: 1px dashed var(--line); border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.partbox.off { opacity: .55; }
.partbox .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 600; }
.partbox .head label { font-weight: 400; font-size: .85rem; display: flex; gap: 6px; align-items: center; }
details.adv { margin-top: 10px; }
details.adv summary { cursor: pointer; color: var(--brand); font-size: .88rem; padding: 4px 0; }

.btn { font: inherit; font-weight: 600; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 8px; padding: 10px 16px; cursor: pointer; min-height: 40px; }
.btn.secondary { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.actions { display: flex; gap: 10px; margin: 8px 0 14px; }

.notice { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; background: var(--info-bg); color: var(--info); }
.notice.error { background: var(--err-bg); color: var(--err); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (min-width: 1300px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: 10px 12px; }
.tile .k { font-size: .78rem; color: var(--muted); }
.tile .v { font-size: 1.45rem; font-weight: 700; line-height: 1.2; }
.tile .v small { font-size: .8rem; font-weight: 400; color: var(--muted); }
.tile .s { font-size: .78rem; color: var(--muted); }
.tile.err { border-left-color: var(--err); } .tile.warn { border-left-color: var(--accent); }

.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.checks li:last-child { border-bottom: 0; }
.chip { flex: none; min-width: 22px; height: 22px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.error { background: var(--err-bg); color: var(--err); } .chip.info { background: var(--info-bg); color: var(--info); }

table.t { width: 100%; border-collapse: collapse; font-size: .88rem; table-layout: fixed; }
table.t td:nth-child(1) { width: 42%; } table.t td:nth-child(2) { width: 26%; } table.t td:nth-child(3) { width: 32%; }
table.t td { overflow-wrap: anywhere; }
table.t td { padding: 5px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t td:first-child { color: var(--muted); }
table.t td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
table.t tr.strong td { font-weight: 700; color: var(--ink); }
table.t td.note { font-size: .78rem; color: var(--muted); font-weight: 400; }

.bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--bar5); margin: 6px 0 4px; }
.bar span { display: block; height: 100%; min-width: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.c1 { background: var(--bar1); } .c2 { background: var(--bar2); } .c3 { background: var(--bar3); } .c4 { background: var(--bar4); } .c5 { background: var(--bar5); } .c6 { background: var(--bar6); }

.disclaimer, .foot { font-size: .8rem; color: var(--muted); }
.foot { padding-bottom: 24px; }
.loading { opacity: .6; transition: opacity .15s; }

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .top { background: #fff; color: #000; border-bottom: 2px solid #000; padding: 4px 0; }
  .inputs, .no-print, .foot { display: none !important; }
  .layout { display: block; } .results { position: static; max-height: none; overflow: visible; }
  .card, .tile { break-inside: avoid; border-color: #999; }
}

#status { position: sticky; top: 0; z-index: 5; }
#out.stale { opacity: .4; filter: grayscale(1); pointer-events: none; }
@media print { #out.stale { opacity: 1; filter: none; } }

/* ---- üst çubuk, giriş, sekmeler ---- */
.top .wrap { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; }
.auth { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .88rem; }
.auth .who { display: flex; align-items: center; gap: 8px; }
.auth img { width: 28px; height: 28px; border-radius: 50%; background: #fff; }
.auth .btn { padding: 5px 10px; }
.auth input { padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); width: 170px; }
.tabs { display: flex; gap: 4px; padding-top: 12px; }
.tab { padding: 8px 18px; border-radius: 8px 8px 0 0; text-decoration: none; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-bottom: 0; font-weight: 600; }
.tab.active { background: var(--card); color: var(--brand); }
[hidden] { display: none !important; }

/* ---- makineye girilecek degerler ---- */
.mv { --mv-g: #e3f3e8; --mv-gi: #1b7f3b; --mv-y: #fff1c9; --mv-yi: #8a5a00; --mv-b: #dcebf9; --mv-bi: #0f4c81; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mv { --mv-g: #16301f; --mv-gi: #6fd28d; --mv-y: #33290f; --mv-yi: #f2c765; --mv-b: #1b2b38; --mv-bi: #8cc4f2; } }
.mv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 4px; }
.mv-title { font-size: 1.12rem; font-weight: 800; letter-spacing: .2px; color: var(--ink); }
.mv-sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.mv-g { margin-top: 12px; }
.mv-gn { font-size: .72rem; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.mv-gn::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.mv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.mv-c { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; }
.mv-c.tone-g { background: var(--mv-g); border-color: color-mix(in srgb, var(--mv-gi) 25%, transparent); --ac: var(--mv-gi); }
.mv-c.tone-y { background: var(--mv-y); border-color: color-mix(in srgb, var(--mv-yi) 30%, transparent); --ac: var(--mv-yi); }
.mv-c.tone-b { background: var(--mv-b); border-color: color-mix(in srgb, var(--mv-bi) 25%, transparent); --ac: var(--mv-bi); }
.mv-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 800; background: var(--ac); color: var(--card); }
.mv-t { flex: 1; min-width: 0; }
.mv-k { font-weight: 700; font-size: .92rem; color: var(--ink); line-height: 1.2; }
.mv-h { font-size: .74rem; color: var(--muted); margin-top: 2px; line-height: 1.25; }
.mv-v { flex: none; font-size: 1.55rem; font-weight: 800; color: var(--ac); font-variant-numeric: tabular-nums; line-height: 1; text-align: right; }
.mv-v small { font-size: .78rem; font-weight: 700; opacity: .85; }
.mv.compact .mv-head { margin-bottom: 0; } .mv.compact .mv-title { font-size: .9rem; }
.mv.compact .mv-g { margin-top: 8px; } .mv.compact .mv-grid { grid-template-columns: 1fr; gap: 5px; }
.mv.compact .mv-c { padding: 6px 9px; } .mv.compact .mv-v { font-size: 1.1rem; } .mv.compact .mv-k { font-size: .82rem; } .mv.compact .mv-n { width: 20px; height: 20px; font-size: .7rem; }
.fix { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.fix-h { font-size: .72rem; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; padding: 7px 12px; background: var(--info-bg); color: var(--info); }
.fix ul { list-style: none; margin: 0; padding: 0; }
.fix li { display: flex; gap: 9px; align-items: flex-start; padding: 8px 12px; font-size: .86rem; border-top: 1px solid var(--line); }
.fix li.warn { background: var(--warn-bg); } .fix li.error { background: var(--err-bg); } .fix li.ok { background: var(--ok-bg); }
.mv-head .btn { padding: 6px 12px; min-height: 0; font-size: .82rem; }

/* ---- kaydet çubuğu, makineler ---- */
.savebar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 14px; padding: 10px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--card); }
.savebar input { flex: 1 1 200px; padding: 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.savebar .msg { flex-basis: 100%; font-size: .85rem; color: var(--muted); }
.btn.danger { background: var(--err-bg); color: var(--err); border-color: var(--err); }
.mhead { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 16px 0 8px; }
.mhead h2 { margin: 0; }
.mtools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.mtools input[type=search], .mtools input[type=text] { padding: 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); min-width: 220px; }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; padding-bottom: 24px; }
.rcard h3 { margin: 0 0 2px; font-size: 1.02rem; }
.rcard .meta { font-size: .78rem; color: var(--muted); margin-bottom: 8px; }
.rcard .acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.rcard .warns { font-size: .78rem; color: var(--warn); margin-top: 6px; }
.invite { font-family: ui-monospace, Consolas, monospace; font-size: 1.1rem; letter-spacing: 2px; background: var(--info-bg); color: var(--info); padding: 2px 8px; border-radius: 6px; }
.onb { max-width: 560px; margin: 24px auto; }
.onb .row { display: flex; gap: 8px; margin: 8px 0 16px; }
.onb input { flex: 1; padding: 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
@media print { .tabs, .auth, .savebar, #view-makineler { display: none !important; } .mv-c { border: 1px solid #000 !important; background: #fff !important; } .mv-v, .mv-n { color: #000 !important; } .mv-n { background: #fff !important; border: 1px solid #000; } }
.top .auth .btn { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.55); }
.top .auth { color: #fff; }

/* Standart degerler ve acilir bolumler (sonuc paneli) */
details.sec-more { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
details.sec-more > summary { cursor: pointer; padding: 12px 16px; color: var(--brand); font-size: .95rem; }
details.sec-more > summary .meta { color: var(--muted); font-size: .8rem; font-weight: 400; }
details.sec-more[open] > summary { border-bottom: 1px solid var(--line); }
details.sec-more > .card { margin: 12px; }
.as-list { display: grid; gap: 2px; }
.as-row { padding: 9px 0; border-bottom: 1px solid var(--line); }
.as-row:last-child { border-bottom: 0; }
.as-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.as-k { font-weight: 600; font-size: .9rem; }
.as-v { font-family: "IBM Plex Mono", ui-monospace, monospace; font-weight: 600; }
.as-v small { font-weight: 400; color: var(--muted); }
.as-src { margin-left: 8px; font: 500 .7rem "IBM Plex Sans", system-ui, sans-serif; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; }
.as-src.own { color: var(--accent); border-color: var(--accent); }
.as-why { margin: 3px 0 0; font-size: .8rem; color: var(--muted); }
.as-ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.as-ctl input, .as-ctl select { font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; min-height: 36px; min-width: 140px; }
.btn.as-btn { padding: 3px 12px; min-height: 0; font-size: .8rem; }
.as-h { margin: 16px 0 4px; font-size: .95rem; color: var(--brand); }
@media print { details.sec-more:not([open]) { display: none; } .as-ctl { display: none; } }
