:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --text: #1b2733;
  --muted: #5b6b7a;
  --border: #d5dde4;
  --accent: #1f5f8b;
  --accent-ink: #ffffff;
  --ok: #1e7a46;
  --ok-bg: #e3f4ea;
  --bad: #b3261e;
  --bad-bg: #fbe5e3;
  --warn: #8a5a00;
  --warn-bg: #fff2d6;
  --check: #9a4d00;
  --check-bg: #ffe8d1;
  --info: #2d5b85;
  --info-bg: #e3eef8;
  --gray: #55606b;
  --gray-bg: #e7eaed;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11171d;
    --surface: #18212a;
    --surface-2: #202b36;
    --text: #e3e9ef;
    --muted: #9aa9b7;
    --border: #2e3b48;
    --accent: #5fa8dc;
    --accent-ink: #0d1620;
    --ok: #6fd39b;
    --ok-bg: #173526;
    --bad: #ff8a80;
    --bad-bg: #3d1c1a;
    --warn: #ffd27a;
    --warn-bg: #3a2e12;
    --check: #ffb36b;
    --check-bg: #3b2814;
    --info: #9cc8ee;
    --info-bg: #1a2c3d;
    --gray: #b4bec8;
    --gray-bg: #2a333c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
}
a { color: var(--accent); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

.top { background: var(--accent); color: var(--accent-ink); padding: 18px 0 16px; }
.top h1 { margin: 0; font-size: 1.45rem; letter-spacing: .2px; }
.top .sub { margin: 4px 0 0; opacity: .92; font-size: .95rem; }

.notice {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--warn-bg);
  color: var(--text);
  border-left: 4px solid var(--warn);
  border-radius: 6px;
  font-size: .9rem;
}

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 6px; }
.tabs button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tabs button .code { font-weight: 700; margin-right: 6px; }
.mode-desc { margin: 4px 0 12px; color: var(--muted); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.toolbar .scenario { display: flex; flex-direction: column; gap: 3px; font-size: .85rem; color: var(--muted); flex: 1 1 300px; max-width: 520px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
  .results { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
}

.card, .results {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card { padding: 12px 14px 14px; margin: 0 0 14px; min-width: 0; }
.card > legend, .card-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-weight: 700; padding: 0 6px; font-size: 1rem;
}
.card-head { padding: 0 0 6px; justify-content: space-between; }
.card-head input { flex: 1 1 160px; max-width: 260px; font-weight: 400; }
.card h4 { margin: 12px 0 6px; font-size: .82rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 12px; }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field .lbl { font-size: .85rem; color: var(--muted); }
.field small { color: var(--muted); font-size: .78rem; line-height: 1.35; }
.field.check { flex-direction: row; align-items: flex-start; gap: 8px; }
.field.check input { margin-top: 3px; }
.field.check .lbl { color: var(--text); }
.inp { display: flex; align-items: stretch; }
.inp input { flex: 1; min-width: 0; }
.inp .unit, .inp select.unit {
  display: flex; align-items: center; padding: 0 8px;
  background: var(--surface-2); border: 1px solid var(--border); border-left: 0;
  border-radius: 0 6px 6px 0; font-size: .85rem; color: var(--muted);
}
.inp input:has(+ .unit) { border-radius: 6px 0 0 6px; }
select.unit { width: auto; color: var(--text); }

input[type="text"], input[type="date"], select {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tag { font-style: normal; font-size: .72rem; color: var(--warn); background: var(--warn-bg); border-radius: 4px; padding: 0 4px; }
.hint { margin: 6px 0 0; font-size: .82rem; color: var(--muted); }
.hint.strong { color: var(--text); background: var(--info-bg); border-radius: 6px; padding: 6px 9px; }

button {
  font: inherit; cursor: pointer; border-radius: 6px; padding: 7px 12px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
}
button.ghost { background: transparent; color: var(--accent); }
button.danger { background: transparent; color: var(--bad); border-color: var(--bad); padding: 3px 9px; font-size: .85rem; }
.add-row { display: flex; gap: 8px; margin: -4px 0 14px; }

details.more { margin-top: 10px; }
details.more > summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
details.settings { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; }
details.settings > summary { cursor: pointer; font-weight: 700; }

/* Sonuçlar */
.results { padding: 14px 16px 18px; min-width: 0; }
.results h3 { margin: 18px 0 8px; font-size: 1rem; }
.results .empty { color: var(--muted); }
.overall { border-radius: 8px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.overall .badge { font-size: 1.05rem; padding: 4px 12px; }
.overall p { margin: 0; flex: 1 1 220px; }

.badge { display: inline-block; font-weight: 700; font-size: .78rem; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.r-ok { background: var(--ok-bg); color: var(--ok); }
.r-bad { background: var(--bad-bg); color: var(--bad); }
.r-warn { background: var(--warn-bg); color: var(--warn); }
.r-check { background: var(--check-bg); color: var(--check); }
.r-info { background: var(--info-bg); color: var(--info); }
.r-gray { background: var(--gray-bg); color: var(--gray); }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: .86rem; }
th, td { padding: 6px 9px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { background: var(--surface-2); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
td.key { font-weight: 700; }
.pt-title { margin: 12px 0 6px; font-weight: 600; font-size: .9rem; }

.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checks li { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.checks .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 3px; font-size: .84rem; color: var(--muted); }
.checks .meta b { color: var(--text); }
.list { margin: 0; padding-left: 20px; }
.list li { margin: 3px 0; }
.disclaimer { margin-top: 18px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; font-size: .86rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.share-out { width: 100%; margin-top: 8px; font-size: .8rem; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; font-size: .92rem; }
.kv .v { text-align: right; font-variant-numeric: tabular-nums; }
.kv .big { font-size: 1.15rem; font-weight: 700; }
.print-only { display: none; }

.foot { margin: 28px auto 40px; color: var(--muted); font-size: .88rem; }
.foot h2 { font-size: 1rem; color: var(--text); }
.foot ul { padding-left: 20px; }

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .top { background: none; color: #000; padding: 0; }
  .notice, .tabs, .toolbar, .form, .foot, .actions, .mode-desc { display: none !important; }
  .layout { display: block; }
  .results { position: static; max-height: none; overflow: visible; border: 0; padding: 0; }
  .print-only { display: block; }
  .tbl-wrap { overflow: visible; }
  th, td { white-space: normal; }
}
