@font-face { font-family: 'Montserrat'; font-weight: 800; font-display: swap; src: url('fonts/Montserrat-800.ttf') format('truetype'); }
@font-face { font-family: 'Montserrat'; font-weight: 900; font-display: swap; src: url('fonts/Montserrat-900.ttf') format('truetype'); }
@font-face { font-family: 'Oswald'; font-weight: 500; font-display: swap; src: url('fonts/Oswald-500.ttf') format('truetype'); }
@font-face { font-family: 'Oswald'; font-weight: 600; font-display: swap; src: url('fonts/Oswald-600.ttf') format('truetype'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url('fonts/IBMPlexSans-400.ttf') format('truetype'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-style: italic; font-display: swap; src: url('fonts/IBMPlexSans-400i.ttf') format('truetype'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url('fonts/IBMPlexSans-600.ttf') format('truetype'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; font-display: swap; src: url('fonts/IBMPlexSans-700.ttf') format('truetype'); }

:root {
  --navy: #0B2236; --deep: #021326; --red: #CC0405; --red-hi: #F0241C; --cream: #FBF4DF; --cream-2: #F3E6C4;
  --ink: #1A1F2B; --muted: #5A6270; --line: #D9DDE3; --page: #F5F2EA; --card: #FFFFFF; --green: #2E7D4A;
  --amber: #B86E00; --radius: 10px; --shadow: 0 1px 2px rgba(2, 19, 38, .06), 0 6px 18px rgba(2, 19, 38, .06);
  --head: 'Montserrat', 'Arial Black', sans-serif; --label: 'Oswald', 'Arial Narrow', sans-serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--page); font-size: 16px; line-height: 1.5; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; }

/* ---------- hero ---------- */
.hero { color: var(--cream); background: radial-gradient(120% 140% at 85% 0%, #17406a 0%, var(--navy) 45%, var(--deep) 100%); border-bottom: 5px solid var(--red); }
.hero-in { display: flex; gap: 28px; align-items: center; padding-top: 34px; padding-bottom: 30px; }
.hero-txt { flex: 1; min-width: 0; }
.kick { display: inline-block; font-family: var(--label); font-weight: 600; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; background: var(--red); color: var(--cream); padding: 3px 14px; transform: skewX(-12deg); }
.kick, .step { -webkit-font-smoothing: antialiased; }
.hero h1 { font-family: var(--head); font-weight: 900; font-size: clamp(30px, 5.4vw, 50px); line-height: 1.02; text-transform: uppercase; margin: 14px 0 12px; letter-spacing: -.01em; }
.hero h1 span { color: var(--red-hi); display: block; }
.hero p { margin: 0; max-width: 560px; color: #D9DFE7; font-size: 16px; }
.hero-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.cover { width: 190px; height: auto; flex: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .55); border-radius: 2px; }

/* ---------- tabs ---------- */
.tabs { position: sticky; top: 0; z-index: 20; background: var(--navy); box-shadow: 0 2px 10px rgba(2, 19, 38, .25); }
.tabs-in { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs-in::-webkit-scrollbar { display: none; }
.tabs button { background: none; border: 0; color: #B9C4D1; font-family: var(--label); font-weight: 500; font-size: 16px; letter-spacing: .1em; text-transform: uppercase; padding: 14px 16px 12px; cursor: pointer; border-bottom: 4px solid transparent; white-space: nowrap; }
.tabs button:hover { color: var(--cream); }
.tabs button[aria-selected="true"] { color: var(--cream); border-bottom-color: var(--red); }
.tabs button:focus-visible { outline: 2px solid var(--cream); outline-offset: -4px; }

/* ---------- sections ---------- */
main { padding-top: 8px; padding-bottom: 40px; }
.panel { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.sec-head { display: flex; gap: 14px; align-items: flex-start; margin: 30px 0 14px; }
.step { flex: none; width: 40px; height: 40px; display: grid; place-items: center; background: var(--navy); color: var(--cream); font-family: var(--head); font-weight: 900; font-size: 19px; border-bottom: 4px solid var(--red); }
.sec-head h2 { font-family: var(--head); font-weight: 800; font-size: clamp(21px, 3vw, 26px); color: var(--navy); margin: 0 0 4px; line-height: 1.15; }
.sec-head p { margin: 0; color: var(--muted); max-width: 720px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin: 12px 0; }
.card.flush { padding: 0; }
.small { color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); font-style: italic; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px; text-align: center; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--navy); color: var(--cream); border: 0; border-radius: 8px; padding: 10px 16px; font-family: var(--label); font-weight: 500; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; transition: background .15s, transform .05s; }
.btn:hover { background: #163a5a; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--navy); }
.btn.ghost:hover { background: rgba(11, 34, 54, .06); }
.btn.cream { background: var(--cream); color: var(--navy); }
.btn.ghost-light { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 1.5px rgba(251, 244, 223, .7); }
.btn:focus-visible, input:focus-visible, select:focus-visible, .seg button:focus-visible { outline: 3px solid rgba(204, 4, 5, .45); outline-offset: 2px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.toolbar .grow { flex: 1; }
.toolbar select { min-width: 260px; flex: 1 1 260px; max-width: 460px; }
input, select { background: #FFFDF6; border: 1.5px solid #D8C79E; border-radius: 8px; padding: 9px 11px; width: 100%; font-weight: 600; color: var(--navy); min-height: 44px; }
input::placeholder { color: #A39C8A; font-weight: 400; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%), linear-gradient(135deg, var(--navy) 50%, transparent 50%); background-position: calc(100% - 18px) 19px, calc(100% - 12px) 19px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 34px; }
input:focus, select:focus { border-color: var(--navy); }
input.narrow { width: 80px; display: inline-block; margin: 0 6px; }
label.inline { display: inline-flex; align-items: center; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; font-family: var(--label); font-weight: 500; letter-spacing: .05em; text-transform: uppercase; font-size: 13.5px; color: var(--navy); }
.field input, .field select { font-family: var(--body); text-transform: none; letter-spacing: 0; font-size: 16px; }
.field .hint { font-family: var(--body); text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--muted); font-weight: 400; }
.form-end { justify-content: flex-end; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1.5px solid #D8C79E; background: var(--cream); color: var(--navy); border-radius: 999px; padding: 4px 11px; font-family: var(--body); font-weight: 600; font-size: 13px; cursor: pointer; text-transform: none; letter-spacing: 0; }
.chips button.on { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.seg { display: inline-flex; border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1.5px var(--navy); width: fit-content; }
.seg button { border: 0; background: transparent; color: var(--navy); padding: 9px 18px; font-family: var(--body); font-weight: 700; font-size: 16px; cursor: pointer; min-height: 44px; }
.seg button + button { box-shadow: inset 1.5px 0 0 var(--navy); }
.seg button[aria-checked="true"] { background: var(--navy); color: var(--cream); }

/* ---------- item cards ---------- */
.items { display: grid; gap: 10px; }
.item { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; border-left: 5px solid var(--navy); }
.item.ess { border-left-color: var(--red); }
.item-top { display: flex; gap: 10px; align-items: center; }
.item-top input.name { flex: 1; font-family: var(--body); font-weight: 700; font-size: 17px; border-color: transparent; background: transparent; padding-left: 4px; }
.item-top input.name:hover, .item-top input.name:focus { border-color: #D8C79E; background: #FFFDF6; }
.x { flex: none; width: 40px; height: 40px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.x:hover { background: #F4E3E3; color: var(--red); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 14px; margin-top: 8px; }
.fields label { font-family: var(--label); font-weight: 500; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.fields input { font-family: var(--body); font-size: 16px; }
.item-foot { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 10px; }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 15px; user-select: none; }
.chk input { width: 22px; height: 22px; min-height: 0; accent-color: var(--red); margin: 0; }
.result { margin-left: auto; font-size: 15px; color: var(--muted); }
.result b { font-family: var(--head); font-weight: 800; font-size: 20px; color: var(--navy); margin-right: 4px; }
.note { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 16px 0 8px; }
.tile { background: var(--navy); color: var(--cream); border-radius: var(--radius); padding: 14px 16px 13px; position: relative; overflow: hidden; border-bottom: 4px solid var(--red); }
.tile .lab { font-family: var(--label); font-weight: 500; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: #B9C4D1; }
.tile .val { font-family: var(--head); font-weight: 900; font-size: 32px; line-height: 1.05; margin-top: 4px; }
.tile .val small { font-family: var(--label); font-weight: 500; font-size: 15px; letter-spacing: .04em; margin-left: 4px; color: var(--cream-2); }
.tile .sub { font-size: 13px; color: #B9C4D1; margin-top: 4px; }
.tile.light { background: var(--card); color: var(--navy); box-shadow: var(--shadow); border-bottom-color: var(--navy); }
.tile.light .lab, .tile.light .sub { color: var(--muted); }
.tile.light .val small { color: var(--muted); }
.banner-msg { border-radius: var(--radius); padding: 12px 16px; font-weight: 600; margin: 10px 0; display: flex; gap: 10px; align-items: center; }
.banner-msg:empty { display: none; }
.banner-msg.ok { background: #E7F3EC; color: #1E5A35; }
.banner-msg.bad { background: #FBE6E6; color: #8E0A0A; }
.banner-msg.info { background: var(--cream); color: var(--navy); }
.safety { display: flex; margin: 22px 0 6px; border: 1.5px solid var(--navy); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.safety b { background: var(--red); color: var(--cream); font-family: var(--label); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; display: flex; align-items: center; padding: 0 14px; font-size: 14px; }
.safety span { padding: 12px 16px; font-size: 14.5px; }

/* ---------- chart & tables ---------- */
.chart-head { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; justify-content: space-between; }
.chart-head h3, .about h3 { font-family: var(--label); font-weight: 600; font-size: 17px; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); margin: 0 0 6px; }
.legend { font-size: 13.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 14px; height: 10px; margin-left: 8px; }
.lg-bar { background: var(--navy); }
.lg-line { height: 3px !important; background: var(--red); }
.chart svg { width: 100%; height: auto; display: block; }
details.card summary { cursor: pointer; font-family: var(--label); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 10px; }
.card.flush .tbl { margin-top: 0; }
.tbl th { font-family: var(--label); font-weight: 500; font-size: 13px; letter-spacing: .07em; text-transform: uppercase; background: var(--navy); color: var(--cream); text-align: right; padding: 10px 10px; border-bottom: 3px solid var(--red); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.tbl tbody tr:nth-child(even) td { background: #FBFAF6; }
.tbl tfoot td { font-weight: 700; background: var(--cream); border-top: 2px solid var(--navy); }
.tbl input { width: 92px; min-height: 38px; padding: 6px 8px; text-align: right; }
.shop td:first-child { min-width: 210px; }
.shop .unit { color: var(--muted); font-size: 13px; margin-left: 3px; }

/* ---------- weeks ---------- */
.weeks { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.week { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.week h3 { margin: 0; background: var(--navy); color: var(--cream); font-family: var(--label); font-weight: 600; font-size: 16px; letter-spacing: .08em; text-transform: uppercase; padding: 10px 14px; display: flex; justify-content: space-between; border-bottom: 3px solid var(--red); }
.week h3 span { color: #B9C4D1; font-weight: 500; }
.week.done h3 { background: var(--green); border-bottom-color: #1E5A35; }
.week ul { list-style: none; margin: 0; padding: 6px 14px 12px; }
.week li { border-bottom: 1px solid var(--line); }
.week li:last-child { border-bottom: 0; }
.week label { display: flex; gap: 10px; align-items: center; padding: 7px 0; cursor: pointer; font-size: 15px; }
.week label input { width: 20px; height: 20px; min-height: 0; accent-color: var(--green); flex: none; margin: 0; }
.week label .amt { margin-left: auto; font-weight: 700; color: var(--navy); white-space: nowrap; font-variant-numeric: tabular-nums; }
.week input:checked + span { text-decoration: line-through; color: var(--muted); }

/* ---------- rotation ---------- */
.rot { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; border-left: 5px solid var(--green); }
.rot.due { border-left-color: var(--red); background: #FFF6F6; }
.rot.soon { border-left-color: var(--amber); }
.rot .what { flex: 1; min-width: 0; }
.rot .what b { display: block; font-size: 16px; }
.rot .what span { color: var(--muted); font-size: 14px; }
.badge { font-family: var(--label); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge.ok { background: #E7F3EC; color: #1E5A35; }
.badge.soon { background: #FFF0D6; color: #7A4A00; }
.badge.due { background: var(--red); color: var(--cream); }

/* ---------- downloads ---------- */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.dl { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-decoration: none; color: var(--ink); border-bottom: 4px solid var(--navy); transition: transform .12s, box-shadow .12s; }
.dl:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(2, 19, 38, .12); border-bottom-color: var(--red); }
.dl b { display: block; font-family: var(--head); font-weight: 800; color: var(--navy); font-size: 17px; margin-bottom: 4px; }
.dl span { font-size: 14.5px; color: var(--muted); }
.dl-ico { flex: none; width: 52px; height: 62px; display: grid; place-items: center; font-family: var(--label); font-weight: 600; font-size: 13px; letter-spacing: .06em; color: #fff !important; border-radius: 4px; }
.dl-ico.pdf { background: var(--red); }
.dl-ico.xls { background: var(--green); }
.about p { margin: 6px 0; }

/* ---------- footer & toast ---------- */
.foot { background: var(--deep); color: #AEB9C6; padding: 28px 0 40px; font-size: 14px; border-top: 5px solid var(--red); }
.foot p { max-width: 760px; }
.brand-line { display: flex; align-items: center; gap: 12px; font-family: var(--head); font-weight: 800; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--cream); }
.brand-line::before, .brand-line::after { content: ''; width: 34px; border-top: 2px solid var(--red); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); opacity: 0; background: var(--navy); color: var(--cream); padding: 12px 18px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); transition: all .25s; z-index: 50; pointer-events: none; max-width: 92vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .wrap { padding: 0 14px; }
  .hero-in { padding-top: 22px; padding-bottom: 22px; gap: 14px; align-items: flex-start; }
  .cover { width: 92px; margin-top: 34px; }
  .hero p { font-size: 15px; }
  .tabs button { font-size: 15px; padding: 13px 12px 11px; }
  .tile .val { font-size: 28px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 12px 12px 11px; }
  .tile .lab { font-size: 12px; }
  .toolbar select { min-width: 0; flex-basis: 100%; max-width: none; }
  .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
  .fields label { font-size: 11.5px; }
  .item { padding: 12px 12px; }
  .shop td:first-child, .shop th:first-child { position: sticky; left: 0; z-index: 1; min-width: 150px; max-width: 150px; white-space: normal; }
  .shop td:first-child { background: #fff; box-shadow: 1px 0 0 var(--line); }
  .shop tbody tr:nth-child(even) td:first-child { background: #FBFAF6; }
  .shop tfoot td:first-child { background: var(--cream); }
  .result { margin-left: 0; width: 100%; }
  .safety { flex-direction: column; }
  .safety b { padding: 6px 14px; }
}

/* ---------- print ---------- */
@media print {
  body { background: #fff; font-size: 12px; }
  .hero, .tabs, .toolbar, .x, #toast, .hero-actions, form, .foot p:first-of-type { display: none !important; }
  .panel[hidden] { display: none !important; }
  .card, .item, .tile, .week, .rot { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .tile { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tbl th, .week h3, .step { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .foot { background: #fff; color: #333; border: 0; }
  .brand-line { color: var(--navy); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
