:root {
  --bg: #eef3f7;
  --card: #fff;
  --ink: #19334b;
  --muted: #617589;
  --line: #d8e1e9;
  --brand: #122a43;
  --accent: #126b67;
  --warn-bg: #fff2dd;
  --warn-ink: #855300;
  --err-bg: #ffe4e4;
  --err-ink: #a12a2a;
  --ok-bg: #e5f5ee;
  --ok-ink: #17614a;
  --info-bg: #e8f0fb;
  --info-ink: #24508a;
  --field: #f7f9fb;
  --tabs-h: 58px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 12px);
}
a { color: var(--accent); }

header.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--brand); color: #fff;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
}
.top-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.top-row strong { font-size: 17px; letter-spacing: .3px; }
.save { font-size: 12px; padding: 4px 8px; border-radius: 8px; background: #ffffff1f; color: #cfe2ef; text-align: right; }
.save.saved { background: #2e8b57; color: #fff; }
.save.saving { background: #ffffff33; color: #fff; }
.save.error { background: #c62828; color: #fff; font-weight: 700; }
.update { margin-top: 8px; font-size: 13px; display: flex; gap: 8px; align-items: center; }

main { max-width: 760px; margin: 0 auto; padding: 12px 12px 0; }
.banner { max-width: 760px; margin: 8px auto 0; padding: 10px 12px; font-size: 13px; border-radius: 10px; line-height: 1.4; }
#banners { padding: 0 12px; }
.banner.warn { background: var(--warn-bg); color: var(--warn-ink); }
.banner.error { background: var(--err-bg); color: var(--err-ink); }

.card { display: block; background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 8px #122a4312; color: inherit; text-decoration: none; }
h2 { margin: 0 0 10px; font-size: 16px; }
.muted { font-size: 13px; color: var(--muted); line-height: 1.5; }
.center { text-align: center; }
.warnline { background: var(--warn-bg); color: var(--warn-ink); padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.okline { background: var(--ok-bg); color: var(--ok-ink); padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.warntext { color: var(--err-ink); }

label { display: block; font-size: 12px; font-weight: 650; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px; /* 16px: iOS nem nagyít */
  background: var(--field); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 10px; min-height: 46px;
}
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; min-height: 0; margin: 0 8px 0 0; vertical-align: middle; accent-color: var(--accent); }
input.ro { background: #eef1f4; color: var(--muted); }
textarea { min-height: 80px; resize: vertical; }
label.check { display: flex; align-items: center; font-size: 15px; font-weight: 500; color: var(--ink); padding: 8px 0; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; padding: 6px 10px; }
fieldset:disabled { opacity: .45; }
legend { font-size: 12px; font-weight: 650; color: var(--muted); }

.btn {
  display: inline-block; font: inherit; font-size: 15px; font-weight: 650; text-align: center; text-decoration: none;
  border: 0; border-radius: 11px; padding: 12px 14px; min-height: 46px; cursor: pointer;
  background: #e6edf4; color: #173651;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.danger { background: #ffeded; color: #a53333; }
.btn.small { font-size: 13px; padding: 8px 10px; min-height: 38px; }
.btn.block { display: block; width: 100%; margin: 4px 0 16px; }
.btn:disabled { opacity: .4; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }

nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs a { display: flex; align-items: center; justify-content: center; height: var(--tabs-h); font-size: 14px; font-weight: 650; color: var(--muted); text-decoration: none; }
nav.tabs a.active { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }

/* Lista */
.filters input { margin-bottom: 8px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.row3 select { font-size: 14px; padding: 8px 6px; }
.list-count { margin: 0 4px 8px; }
.offer-card small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.offer-card small.follow { color: var(--info-ink); }
.oc-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.oc-top b { font-size: 15px; }
.oc-nums { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 8px; font-size: 13px; }

.chip { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 4px 8px; border-radius: 12px; white-space: nowrap; }
.st-incomplete { background: var(--err-bg); color: var(--err-ink); }
.st-review { background: var(--warn-bg); color: var(--warn-ink); }
.st-indicative { background: var(--info-bg); color: var(--info-ink); }
.st-verified { background: var(--ok-bg); color: var(--ok-ink); }
.d-missing { background: #f1f1f1; color: #555; }
.d-duty { background: var(--warn-bg); color: var(--warn-ink); }
.d-no { background: var(--err-bg); color: var(--err-ink); }
.d-yes { background: var(--ok-bg); color: var(--ok-ink); }

/* Szerkesztő */
.offer-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.offer-head .spacer { flex: 1; }
.offer-id { font-size: 14px; }
.sticky-summary { position: sticky; top: calc(env(safe-area-inset-top) + 50px); z-index: 5; margin-bottom: 10px; }
.summary { background: #fff; border-radius: 12px; padding: 10px; box-shadow: 0 2px 10px #122a4322; }
.sum-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.sum-grid small { display: block; font-size: 11px; color: var(--muted); }
.sum-grid b { font-size: 13.5px; }
details.sec > summary { font-weight: 700; font-size: 15px; cursor: pointer; padding: 4px 0; list-style-position: inside; }
details.sec[open] > summary { margin-bottom: 10px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field.wide { grid-column: 1 / -1; }
.field .hint { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.field .err { display: block; font-size: 12px; color: var(--err-ink); font-weight: 650; }
.field.invalid input, .asm.invalid input { border-color: #d33; background: #fff6f6; }
.req { color: #c0392b; font-style: normal; }
.xl { font-size: 10px; font-weight: 700; color: #7d93a6; background: #edf2f6; padding: 1px 5px; border-radius: 5px; margin-left: 4px; }
.xl.js { color: #6c5a9c; background: #f0ecf8; }
.suffix { display: flex; align-items: center; gap: 6px; }
.suffix span { font-size: 14px; color: var(--muted); min-width: 28px; }

/* Eredmény */
.status-box { border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.status-title { margin-bottom: 6px; }
.reasons { font-size: 13px; margin-top: 6px; }
.reasons ul { margin: 4px 0 0; padding-left: 18px; }
.reasons li { margin: 2px 0; }
table.res { width: 100%; border-collapse: collapse; font-size: 14px; }
table.res th { text-align: left; font-weight: 500; color: var(--muted); padding: 6px 4px; }
table.res td { text-align: right; padding: 6px 4px; white-space: nowrap; }
table.res tr { border-bottom: 1px solid #eef2f5; }
table.res tr.sec th { color: var(--ink); font-weight: 700; padding-top: 14px; }
table.res tr.total td, table.res tr.total th { color: var(--ink); font-weight: 700; }
table.res tr.pending th { color: #8a6d00; }

/* Feltételezések */
.asm { border-left: 4px solid var(--line); padding: 8px 0 8px 10px; margin-bottom: 8px; }
.asm.illustrative { border-color: #e2a33c; }
.asm.confirmed { border-color: #2e8b57; }
.asm.policy { border-color: #9fb3c4; }
.asm-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-top: 6px; }
.asm-row input[type="date"] { min-width: 140px; }
.tag { font-size: 11px; color: var(--muted); background: #edf2f6; padding: 3px 7px; border-radius: 6px; }

/* Mentés */
.preview { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 10px; }
.plan { background: var(--field); border-radius: 8px; padding: 2px 10px; margin: 8px 0; font-size: 13px; }
ul.snaps { list-style: none; margin: 0; padding: 0; }
ul.snaps li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #eef2f5; }
ol.steps li { margin-bottom: 4px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(20px);
  bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 12px);
  max-width: calc(100% - 32px); z-index: 20;
  background: #1f3b55; color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.warn { background: #8a5a00; }
.toast.error { background: #b3261e; }

@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr; }
  .sum-grid { grid-template-columns: repeat(2, 1fr); }
}
