/* HourLedger — OPYEB. No external fonts, no images, no network in the calculator. */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #f6f1e7;
  --bg2: #efe7d6;
  --panel: #fffdf8;
  --panel2: #faf5ea;
  --ink: #17202a;
  --ink2: #2c3743;
  --muted: #6d6a61;
  --line: #ded4c1;
  --line2: #c7baa2;
  --accent: #1f4e79;
  --accent-ink: #173c5e;
  --accent-soft: #e4edf6;
  --amber: #96610f;
  --amber-soft: #f7e9d0;
  --red: #9c3327;
  --red-soft: #f8e4e0;
  --shadow: 0 1px 0 rgba(60, 45, 20, .05), 0 18px 40px -30px rgba(50, 35, 10, .5);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Nanum Myeongjo", "Batang", "Apple SD Gothic Neo", "Hiragino Mincho ProN", "Noto Serif TC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Hiragino Sans", "Noto Sans TC", "Microsoft JhengHei", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 14px;
}

html[data-theme="dark"] {
  --bg: #10151b;
  --bg2: #141b22;
  --panel: #171f27;
  --panel2: #1d262f;
  --ink: #eee8dc;
  --ink2: #ded7c9;
  --muted: #9ba3ac;
  --line: #29333d;
  --line2: #3d4a56;
  --accent: #8fb9de;
  --accent-ink: #b6d4ef;
  --accent-soft: #17293a;
  --amber: #e2b473;
  --amber-soft: #2d2418;
  --red: #f09a8c;
  --red-soft: #311c19;
  --shadow: 0 1px 0 rgba(0, 0, 0, .4), 0 24px 50px -34px rgba(0, 0, 0, .9);
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

section[id], #calc { scroll-margin-top: 76px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: -0.005em;
  text-rendering: optimizeLegibility;
  word-break: keep-all;
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; }

a { color: var(--accent); text-underline-offset: 2px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: max(16px, 4.2vw);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--panel);
  color: var(--ink);
  padding: 10px 16px;
  z-index: 60;
  border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- header ---------- */
.site-head {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, var(--panel));
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(6px);
}
.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding-block: 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  min-width: 0;
}
.brand .mark { display: inline-flex; color: var(--accent); flex: none; }
.brand-name { font-size: 1.06rem; }
.brand-sub {
  font-size: .6rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  border-left: 1px solid var(--line2);
  padding-left: 9px;
  margin-left: 2px;
  font-weight: 600;
  white-space: nowrap;
}
.head-tools { display: flex; align-items: center; gap: 8px; flex: none; }

.langs { display: flex; gap: 2px; }
.langs a {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.langs a[aria-current="page"] {
  color: var(--ink);
  background: var(--panel2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.langs a:hover { color: var(--ink); }

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  flex: none;
}
.icon-btn:hover { border-color: var(--line2); }
.icon-btn .i-sun { display: none; }
html[data-theme="dark"] .icon-btn .i-sun { display: block; }
html[data-theme="dark"] .icon-btn .i-moon { display: none; }

/* ---------- hero ---------- */
.hero { padding-block: clamp(30px, 5vw, 56px) clamp(18px, 3vw, 28px); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--accent);
  display: inline-block;
}
.hero h1 {
  font-size: clamp(1.72rem, 5.2vw, 3.05rem);
  margin: 0 0 16px;
  max-width: 26ch;
  text-wrap: balance;
}
.hero .lede {
  margin: 0;
  max-width: 62ch;
  color: var(--ink2);
  font-size: clamp(.94rem, 2.3vw, 1.04rem);
}
.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 20px 0 0;
}
.chip {
  font-size: .77rem;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink2);
  white-space: nowrap;
}
.basis-strip {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 12px 14px;
  border: 1px dashed var(--line2);
  border-radius: 10px;
  background: var(--panel2);
  font-size: .79rem;
  color: var(--muted);
  max-width: 860px;
}
.basis-strip b { color: var(--ink); font-weight: 600; margin-right: 4px; }

@media (max-width: 600px) {
  .brand-sub { display: none; }
  .langs a { padding: 5px 5px; font-size: .73rem; }
  .head-inner { gap: 6px; }
  .brand-name { font-size: 1rem; }
}

/* ---------- cards and calculator ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.calc {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  gap: clamp(16px, 2.4vw, 26px);
  align-items: start;
  padding-block: clamp(8px, 2vw, 16px) clamp(30px, 5vw, 54px);
}
@media (max-width: 980px) {
  .calc { grid-template-columns: minmax(0, 1fr); }
}

.inputs { padding: clamp(16px, 2.6vw, 26px); }
.inputs h2 {
  font-size: 1.02rem;
  margin: 0;
  font-family: var(--sans);
  font-weight: 700;
}
.inputs .sub { margin: 4px 0 18px; font-size: .84rem; color: var(--muted); }

.field-row.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 18px;
}
@media (max-width: 560px) {
  .field-row.two { grid-template-columns: minmax(0, 1fr); }
}

.field { margin-bottom: 18px; min-width: 0; }
.lbl {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}
.hint { margin: 6px 0 0; font-size: .77rem; color: var(--muted); line-height: 1.55; }

.input-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border-bottom: 2px solid var(--line2);
  padding-bottom: 5px;
}
.input-line:focus-within { border-bottom-color: var(--accent); }
.input-line input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.32rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 2px 0;
  -moz-appearance: textfield;
}
.input-line.small input { font-size: 1.06rem; }
.input-line input::-webkit-outer-spin-button,
.input-line input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-line input:focus { outline: none; }
.input-line .unit { flex: none; font-size: .82rem; color: var(--muted); font-weight: 600; }

select {
  width: 100%;
  font: inherit;
  font-size: .92rem;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: var(--panel2);
  color: var(--ink);
  cursor: pointer;
}
select:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }

.plain-input {
  width: 100%;
  font: inherit;
  font-size: .95rem;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: var(--panel2);
  color: var(--ink);
}

.shifts { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 2px; }
.shifts h3 { font-family: var(--sans); font-size: .95rem; margin: 0 0 3px; font-weight: 700; }
.shift-sub { margin: 0 0 14px; }

.day-head span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-head {
  display: grid;
  grid-template-columns: 52px 78px minmax(0, 1fr) minmax(0, 1fr) 44px 54px;
  gap: 7px;
  padding: 0 8px 6px;
  font-size: .63rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.day-grid { display: flex; flex-direction: column; gap: 6px; }
.day {
  display: grid;
  grid-template-columns: 52px 78px minmax(0, 1fr) minmax(0, 1fr) 44px 54px;
  gap: 7px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel2);
}
.day:focus-within { border-color: var(--accent); }
.day-id { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.day-id b { font-size: .88rem; }
.day-date { font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.d-lbl { display: none; }
.dfield { margin: 0; min-width: 0; display: block; }

.d-type {
  width: 100%;
  padding: 6px 7px;
  font-size: .8rem;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: var(--panel);
}
.d-start, .d-end, .d-break {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: .76rem;
  padding: 6px 3px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: var(--panel);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.d-start:disabled, .d-end:disabled, .d-break:disabled { opacity: .45; }
.d-total-wrap { text-align: right; }
.d-total { font-size: .86rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.d-total.is-zero { color: var(--muted); font-weight: 500; }

@media (max-width: 760px) {
  .day-head span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-head { display: none; }
  .day {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }
  .day-id { grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: 8px; }
  .df-type { grid-column: 1 / -1; }
  .df-total-wrap {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px dashed var(--line2);
    padding-top: 7px;
    text-align: left;
  }
  .d-lbl {
    display: block;
    font-size: .62rem;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 3px;
    font-weight: 700;
  }
}

details.adv { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
details.adv summary {
  cursor: pointer;
  font-size: .82rem;
  font-weight: 700;
  color: var(--accent-ink);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
}
details.adv summary::-webkit-details-marker { display: none; }
details.adv summary::before {
  content: "+";
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 17px;
  text-align: center;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: .8rem;
}
details.adv[open] summary::before { content: "−"; }
details.adv .adv-body { padding-top: 16px; }

.checks { display: grid; gap: 6px; margin: 4px 0 16px; }
.checks label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .84rem;
  color: var(--ink2);
  cursor: pointer;
}
.checks input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }

.note-warn {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--amber-soft);
  border: 1px solid color-mix(in srgb, var(--amber) 34%, transparent);
  color: var(--ink);
  font-size: .81rem;
  line-height: 1.55;
}
.note-warn:empty { display: none; }
.note-warn p { margin: 0; }
.note-warn p + p { margin-top: 4px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.btn {
  font: inherit;
  font-size: .84rem;
  font-weight: 700;
  padding: 10px 15px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--panel);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
html[data-theme="dark"] .btn { color: #0e1318; }
.btn:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; color: var(--accent-ink); border-color: var(--line2); }
.btn.ghost:hover { border-color: var(--accent); filter: none; }
.btn.quiet { color: var(--muted); border-color: var(--line); }

/* ---------- result ---------- */
.result {
  padding: clamp(16px, 2.6vw, 24px);
  position: sticky;
  top: 76px;
}
@media (max-width: 980px) {
  .result { position: static; }
}
.print-brand { display: none; }
.result-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.stamp {
  display: inline-block;
  transform: rotate(-2.5deg);
  border: 3px double var(--accent);
  color: var(--accent-ink);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 800;
  letter-spacing: .08em;
  font-size: .68rem;
  text-transform: uppercase;
  line-height: 1.3;
  max-width: 100%;
}
.stamp.is-none { border-color: var(--line2); color: var(--muted); }
.stamp.is-empty { border-color: var(--line); color: var(--muted); }
.stamp-why { display: block; font-size: .72rem; color: var(--muted); margin-top: 5px; }
.result .tag {
  font-size: .71rem;
  color: var(--muted);
  text-align: right;
  line-height: 1.4;
  flex: 0 1 auto;
  font-variant-numeric: tabular-nums;
}
.amount-wrap { margin: 16px 0 4px; }
.amount-label { font-size: .75rem; color: var(--muted); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.amount {
  font-size: clamp(1.9rem, 8.4vw, 2.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.06;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 0;
  overflow-wrap: break-word;
}
.amount-sub { margin: 6px 0 0; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }

dl.kv { margin: 14px 0 0; font-size: .85rem; }
dl.kv > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dotted var(--line2);
}
dl.kv > div:last-child { border-bottom: 0; }
dl.kv dt { color: var(--muted); flex: 1 1 auto; min-width: 0; }
dl.kv dd {
  margin: 0;
  flex: none;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}
dl.kv dd.zero { color: var(--muted); font-weight: 500; }
dl.kv > div.total dt { color: var(--ink); font-weight: 700; }
dl.kv > div.total dd { font-size: 1rem; }

.hours {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 16px;
}
.hcell {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--panel2);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.hcell span {
  font-size: .6rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.hcell b { font-size: .84rem; font-variant-numeric: tabular-nums; }
.h-paid { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: var(--accent-soft); }

hr.rule { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

.monthly h3 {
  font-family: var(--sans);
  font-size: .74rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}
.monthly dl.kv { margin-top: 0; }
.monthly .hint { margin-top: 8px; }

.eff {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.eff span { font-size: .7rem; font-weight: 700; color: var(--accent-ink); }
.eff b { font-size: .98rem; font-variant-numeric: tabular-nums; }
.eff small { flex-basis: 100%; font-size: .68rem; color: var(--muted); }

/* ---------- statement ---------- */
.sheet {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}
.srow {
  display: grid;
  grid-template-columns: 66px 106px 54px 64px 62px 54px 54px 58px 88px;
  gap: 6px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: .82rem;
}
.srow:last-child { border-bottom: 0; }
.s-head {
  background: var(--panel2);
  border-bottom: 1px solid var(--line2);
  font-size: .63rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.srow.is-off { color: var(--muted); }
.srow.is-total { background: var(--accent-soft); font-weight: 600; }
.srow.is-wh { grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 12px; font-size: .8rem; }
.s-wh-label { color: var(--ink2); }
.s-date { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.s-date b { font-size: .82rem; white-space: nowrap; }
.s-date span { font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.s-shift { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .78rem; }
.s-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.s-pay { font-weight: 600; }
.sheet-note { margin-top: 10px; }

@media (max-width: 700px) {
  .s-head { display: none; }
  .srow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px 8px;
    padding: 10px 12px;
  }
  .s-date { grid-column: 1 / 3; }
  .s-shift { grid-column: 3 / 5; text-align: right; }
  .s-num { text-align: left; display: flex; flex-direction: column; }
  .s-num::before {
    content: attr(data-label);
    font-size: .58rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .s-num:empty { display: none; }
  .s-pay { font-weight: 700; }
}

/* ---------- sections ---------- */
section.sec { padding-block: clamp(30px, 5vw, 54px); border-top: 1px solid var(--line); }
.sec-head { max-width: 66ch; margin-bottom: clamp(18px, 3vw, 26px); }
.sec-eyebrow {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}
.sec h2 { font-size: clamp(1.32rem, 3.3vw, 1.8rem); margin: 0 0 8px; }
.sec-sub { margin: 0; color: var(--muted); font-size: .9rem; }

.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .steps { grid-template-columns: minmax(0, 1fr); } }
.step {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px 16px 54px;
  background: var(--panel);
}
.step-no {
  position: absolute;
  left: 16px;
  top: 16px;
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--accent);
  font-weight: 700;
}
.step h3 { font-family: var(--sans); font-size: .93rem; margin: 0 0 5px; font-weight: 700; }
.step p { margin: 0; font-size: .84rem; color: var(--muted); line-height: 1.6; }

.formula-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .formula-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .formula-grid { grid-template-columns: minmax(0, 1fr); } }
.formula-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 16px;
  background: var(--panel);
}
.formula-card h3 { margin: 0 0 3px; font-size: 1rem; }
.formula-card .cap { font-size: .73rem; color: var(--accent-ink); font-weight: 700; margin: 0 0 10px; }
.formula-card ol { margin: 0; padding-left: 1.1em; font-size: .81rem; color: var(--ink2); }
.formula-card li { margin-bottom: 5px; }

.prose { max-width: 74ch; }
#holiday table { max-width: 640px; }
.prose p { margin: 0 0 12px; font-size: .9rem; color: var(--ink2); }

.table-wrap { overflow-x: auto; margin-top: 18px; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; min-width: 500px; font-size: .83rem; }
caption { text-align: left; font-size: .8rem; color: var(--muted); padding-bottom: 8px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th {
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line2);
  font-weight: 700;
  white-space: nowrap;
}
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: var(--panel2); }
tr.is-total { background: var(--accent-soft); font-weight: 700; }
tr.is-total:hover { background: var(--accent-soft); }
tr.is-off { color: var(--muted); }
.nowrap { white-space: nowrap; }

.sum-table {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  max-width: 560px;
}
.sum-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  font-size: .84rem;
}
.sum-row:last-child { border-bottom: 0; }
.sum-row span { flex: 0 0 auto; color: var(--ink2); }
.sum-row small { flex: 1 1 auto; color: var(--muted); font-size: .72rem; text-align: right; }
.sum-row b { flex: none; font-variant-numeric: tabular-nums; }
.sum-row.total { background: var(--accent-soft); }
.sum-row.total span { color: var(--ink); font-weight: 700; }
.sum-row.total b { font-size: .95rem; }

.notes { margin: 14px 0 0; padding-left: 1.1em; max-width: 76ch; }
.notes li { font-size: .82rem; color: var(--muted); margin-bottom: 7px; }

.converter {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel2);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.converter h3 { font-family: var(--sans); font-size: .84rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.conv-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.conv-field { flex: 1 1 200px; min-width: 0; display: block; }
.conv-field > span:first-child { display: block; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.conv-input { display: flex; align-items: baseline; gap: 6px; border-bottom: 2px solid var(--line2); padding-bottom: 4px; }
.conv-input:focus-within { border-bottom-color: var(--accent); }
.conv-input input {
  flex: 1 1 auto; min-width: 0; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 1.06rem; font-weight: 600; font-variant-numeric: tabular-nums; padding: 2px 0;
  -moz-appearance: textfield;
}
.conv-input input::-webkit-outer-spin-button, .conv-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.conv-input input:focus { outline: none; }
.conv-input i { font-style: normal; font-size: .8rem; color: var(--muted); font-weight: 600; }
.conv-op { flex: none; font-family: var(--mono); font-size: .72rem; color: var(--muted); padding-bottom: 6px; }
.converter .hint { margin-top: 10px; }

.conv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 700px) { .converter {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel2);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.converter h3 { font-family: var(--sans); font-size: .84rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.conv-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.conv-field { flex: 1 1 200px; min-width: 0; display: block; }
.conv-field > span:first-child { display: block; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.conv-input { display: flex; align-items: baseline; gap: 6px; border-bottom: 2px solid var(--line2); padding-bottom: 4px; }
.conv-input:focus-within { border-bottom-color: var(--accent); }
.conv-input input {
  flex: 1 1 auto; min-width: 0; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 1.06rem; font-weight: 600; font-variant-numeric: tabular-nums; padding: 2px 0;
  -moz-appearance: textfield;
}
.conv-input input::-webkit-outer-spin-button, .conv-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.conv-input input:focus { outline: none; }
.conv-input i { font-style: normal; font-size: .8rem; color: var(--muted); font-weight: 600; }
.conv-op { flex: none; font-family: var(--mono); font-size: .72rem; color: var(--muted); padding-bottom: 6px; }
.converter .hint { margin-top: 10px; }

.conv-grid { grid-template-columns: minmax(0, 1fr); } }
.conv-card { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 14px 16px; background: var(--panel); }
.conv-card h3 { font-family: var(--sans); font-size: .9rem; margin: 0 0 5px; font-weight: 700; }
.conv-card p { margin: 0; font-size: .83rem; color: var(--muted); }

.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  padding: 14px 30px 14px 0;
  font-weight: 600;
  font-size: .93rem;
  position: relative;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 12px;
  color: var(--muted);
  font-weight: 400;
  font-size: 1.15rem;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 16px; font-size: .86rem; color: var(--ink2); max-width: 74ch; }

.limits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .limits { grid-template-columns: minmax(0, 1fr); } }
.limit {
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--panel);
}
.limit h3 { font-family: var(--sans); font-size: .9rem; margin: 0 0 5px; font-weight: 700; }
.limit p { margin: 0; font-size: .82rem; color: var(--muted); }

.basis {
  margin-top: 24px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel2);
  font-size: .79rem;
  color: var(--muted);
}
.basis h3 {
  font-family: var(--sans);
  font-size: .74rem;
  margin: 0 0 8px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink2);
}
.basis ul { margin: 0; padding-left: 1.1em; }
.basis li { margin-bottom: 4px; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding-block: 30px 40px; background: var(--bg2); }
.foot-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: flex-start; }
.foot-brand { font-weight: 700; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.foot-brand .opyeb {
  font-size: .62rem;
  letter-spacing: .18em;
  color: var(--muted);
  border: 1px solid var(--line2);
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 700;
}
.foot-note { margin: 0 0 8px; font-size: .81rem; color: var(--muted); max-width: 48ch; }
.operated { margin: 0; font-size: .73rem; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.foot-right { font-size: .82rem; display: flex; flex-direction: column; gap: 8px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.foot-links a { color: var(--ink2); text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.foot-langs { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: .77rem; }
.foot-langs a { color: var(--muted); }
.foot-legal { margin: 22px 0 0; font-size: .73rem; color: var(--muted); line-height: 1.6; }

/* ---------- policy and 404 ---------- */
.page-wrap { max-width: 780px; padding-block: clamp(28px, 5vw, 54px) 64px; }
.page-wrap h1 { font-size: clamp(1.55rem, 4.2vw, 2.25rem); margin: 0 0 8px; }
.page-wrap .updated { font-size: .77rem; color: var(--muted); margin: 0 0 24px; }
.page-wrap h2 { font-size: 1.08rem; margin: 28px 0 8px; }
.page-wrap p, .page-wrap li { font-size: .9rem; color: var(--ink2); }
.page-wrap li { margin-bottom: 6px; }
.page-wrap .back { display: inline-block; margin-top: 30px; font-weight: 600; font-size: .88rem; }
.contact-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: var(--panel);
  margin-top: 22px;
}
.not-found { min-height: 58vh; }
.nf-code { font-family: var(--mono); font-size: .8rem; letter-spacing: .2em; color: var(--muted); margin: 0 0 4px; }
.nf-langs { margin: 18px 0 22px; padding-left: 1.1em; }
.nf-langs li { margin-bottom: 6px; font-size: .88rem; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- print: weekly statement ---------- */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  .site-head, .hero, .inputs, .sec:not(#sheet), .site-foot, .skip, .actions,
  .note-warn, details.adv { display: none !important; }
  main { margin: 0; }
  .calc { display: block; padding: 0; }
  .result {
    position: static;
    border: 1px solid #999;
    border-radius: 0;
    box-shadow: none;
    padding: 10mm 8mm;
    page-break-inside: avoid;
  }
  .print-brand {
    display: block;
    font-size: 8pt;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #444;
    margin-bottom: 4mm;
  }
  .stamp { transform: none; border-width: 1.5pt; }
  #sheet { border: 0; padding: 6mm 0 0; }
  #sheet .sec-head h2 { font-size: 12pt; }
  .s-head { background: #eee; }
  .srow { grid-template-columns: 19mm 23mm 10mm 13mm 15mm 17mm 12mm 14mm 19mm; gap: 3px; font-size: 8pt; }
  .s-head { font-size: 6.4pt; letter-spacing: .01em; }
  .srow.is-total .s-date { font-size: 7.2pt; }
  .s-head span { overflow: visible; }
  .srow.is-total { background: #eee; }
  a { color: #000; text-decoration: none; }
  .sheet, .result { page-break-inside: avoid; }
}
