:root {
  --brand: #e5383b; --brand-dark: #c1272d; --brand-soft: #fdecec;
  --bg: #ffffff; --bg-alt: #f6f7f9; --card: #ffffff; --text: #1f2430; --muted: #6a7282;
  --border: #e3e6eb; --footer: #1c2230; --footer-text: #c9ced8; --ad: #f1f2f4;
  --radius: 10px;
}
:root { color-scheme: light; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; margin: 0; font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--brand); }
img { max-width: 100%; }

/* ---------- header / mega menu ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--card); box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.nav-wrap { max-width: 1320px; margin: 0 auto; display: flex; align-items: center; gap: 32px; padding: 0 20px; height: 68px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 24px; text-decoration: none; color: var(--text); white-space: nowrap; }
.logo svg { width: 30px; height: 30px; }
.logo b { color: var(--brand); font-weight: 800; }
.menu { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex: 1; }
.menu > li { position: relative; }
.menu > li > button, .menu > li > a { background: none; border: 0; font: inherit; font-size: 17px; color: var(--text); padding: 22px 14px; cursor: pointer; text-decoration: none; display: flex; align-items: center; gap: 6px; }
.menu > li > button::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-3px); }
.menu > li:hover > button, .menu > li > a:hover { color: var(--brand); }
.mega { display: none; position: absolute; top: 100%; left: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.12); padding: 24px; gap: 32px; min-width: 560px; }
.menu > li:hover .mega, .menu > li.open .mega { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.mega h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mega a { display: block; padding: 4px 0; color: var(--text); text-decoration: none; font-size: 15px; }
.mega a:hover { color: var(--brand); }
.nav-right { display: flex; gap: 12px; align-items: center; }
.btn-outline { border: 1px solid var(--brand); color: var(--brand); padding: 8px 14px; border-radius: 6px; text-decoration: none; font-size: 15px; }
.burger { display: none; background: none; border: 0; font-size: 26px; color: var(--text); cursor: pointer; margin-left: auto; }

@media (max-width: 960px) {
  .burger { display: block; }
  .nav-right { display: none; }
  .menu { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; background: var(--card); border-top: 1px solid var(--border); max-height: calc(100vh - 68px); overflow: auto; padding: 8px 16px 24px; }
  .menu.show { display: flex; }
  .menu > li > button, .menu > li > a { padding: 14px 4px; width: 100%; justify-content: space-between; }
  .mega, .menu > li:hover .mega { display: none; position: static; min-width: 0; box-shadow: none; border: 0; padding: 0 4px 12px; }
  .menu > li.open .mega { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* ---------- page layout with ad rails ---------- */
.page { display: grid; grid-template-columns: 160px minmax(0, 1fr) 160px; gap: 32px; max-width: 1400px; margin: 0 auto; padding: 32px 20px; }
.rail { position: relative; }
.rail .ad-slot { position: sticky; top: 92px; }
.ad-slot { background: var(--ad); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.ad-slot.banner { margin: 24px auto; max-width: 970px; }
.ad-slot.live { background: transparent; overflow: hidden; }
.ad-slot iframe { display: block; margin: 0 auto; max-width: 100%; }
.ad-native { margin: 40px 0 0; min-height: 120px; }
#cr-consent { position: fixed; z-index: 1000; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.18); padding: 16px 20px; font-size: 15px; }
#cr-consent p { margin: 0 0 12px; }
#cr-consent div { display: flex; gap: 10px; justify-content: flex-end; }
@media (max-width: 1099px) { .page { grid-template-columns: minmax(0, 1fr); } .rail { display: none; } }
main { min-width: 0; max-width: 1000px; margin: 0 auto; width: 100%; }

h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.15; text-align: center; margin: 8px 0 12px; }
.lead { text-align: center; color: var(--muted); font-size: 19px; margin: 0 0 8px; }
.crumbs { font-size: 14px; color: var(--muted); text-align: center; }
.crumbs a { color: var(--muted); }

/* ---------- tool box ---------- */
.tool { border: 2px dashed #d7b7b8; background: var(--brand-soft); border-radius: 14px; padding: 40px 20px; text-align: center; }
.tool.solid { border-style: solid; border-color: var(--border); background: var(--card); text-align: left; }
.tool.over { border-color: var(--brand); }
.btn { display: inline-flex; align-items: center; gap: 10px; background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: 16px 32px; font: inherit; font-size: 20px; font-weight: 700; cursor: pointer; text-decoration: none; box-shadow: 0 6px 16px rgba(229,56,59,.28); }
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.btn.sm { font-size: 15px; padding: 9px 16px; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.hint { color: var(--muted); font-size: 15px; margin-top: 12px; }
.fine { color: var(--muted); font-size: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: center; margin: 20px 0 0; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
select, input[type=number], input[type=date], input[type=time], input[type=text] { font: inherit; font-size: 17px; color: var(--text); padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); min-width: 0; }
.files { list-style: none; padding: 0; margin: 20px 0 0; text-align: left; }
.files li { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
.files img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; flex: none; }
.files .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .meta { color: var(--muted); font-size: 13px; }
.files .ok { color: #1a9d5b; font-weight: 700; }
.files .err { color: var(--brand); }

/* converters (time / unit) */
.conv { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: end; }
.conv .swap { font-size: 22px; padding: 10px 14px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; text-decoration: none; line-height: 1; margin-bottom: 4px; }
.big-out { font-size: clamp(26px, 4vw, 38px); font-weight: 800; }
.clocks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.clock { background: var(--bg-alt); border-radius: var(--radius); padding: 16px; text-align: center; }
.clock .t { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.clock .z { color: var(--muted); font-size: 14px; }
@media (max-width: 640px) { .conv { grid-template-columns: 1fr; } .conv .swap { justify-self: center; } .clocks { grid-template-columns: 1fr; } }

/* ---------- content ---------- */
.content { margin-top: 48px; }
.content h2 { font-size: 28px; margin: 40px 0 12px; }
.content h3 { font-size: 20px; margin: 24px 0 8px; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 16px 52px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center; }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th, table.data td { border-bottom: 1px solid var(--border); padding: 8px 12px; text-align: left; }
table.data th { background: var(--bg-alt); }
.table-scroll { overflow-x: auto; }
details { border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; margin-bottom: 10px; background: var(--card); }
summary { font-weight: 700; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; text-decoration: none; color: var(--text); font-size: 15px; background: var(--card); }
.chips a:hover { border-color: var(--brand); color: var(--brand); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--text); background: var(--card); }
.card:hover { border-color: var(--brand); }
.card strong { display: block; font-size: 18px; margin-bottom: 4px; }
.card span { color: var(--muted); font-size: 14px; }

/* ---------- footer ---------- */
.site-footer { background: var(--footer); color: var(--footer-text); margin-top: 64px; padding: 56px 20px 24px; }
.foot-grid { max-width: 1320px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 32px; }
.foot-grid h4 { color: #fff; font-size: 18px; font-weight: 600; margin: 0 0 12px; }
.foot-grid a { display: block; color: var(--footer-text); text-decoration: none; padding: 5px 0; font-size: 15px; }
.foot-grid a:hover { color: #fff; }
.foot-bottom { max-width: 1320px; margin: 40px auto 0; padding-top: 20px; border-top: 1px solid #333b4b; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; font-size: 14px; }
.foot-bottom a { color: var(--footer-text); text-decoration: none; }
.foot-bottom > div:first-child { display: flex; flex-wrap: wrap; gap: 8px 20px; min-width: 0; }
