[hidden] { display: none !important; }
input[type="checkbox"] { width: auto; }
.first-screen { align-content: start; }
.span-all { grid-column: 1 / -1; }

:root {
  --ink: #1c1915;
  --muted: #5e584f;
  --paper: #efeae2;
  --card: #fcfbf8;
  --card-2: #f4f0e8;
  --line: #e3dcd0;
  --accent: #a33b22;
  --accent-ink: #fff8f4;
  --good: #1e6b45;
  --good-bg: #e7f3ec;
  --nav: #1c1915;
  --nav-text: #f6f1e8;
  --sans: "Segoe UI", "Helvetica Neue", "PingFang SC", "Hiragino Sans", "Hiragino Sans GB", "Yu Gothic UI", "Yu Gothic", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans CJK SC", "Noto Sans CJK JP", "Noto Sans CJK KR", "Microsoft YaHei", "Meiryo", system-ui, sans-serif;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, "Songti SC", "Hiragino Mincho ProN", "Yu Mincho", serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.35;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { max-width: 100%; }

.skip {
  position: absolute;
  left: 8px;
  top: -40px;
  background: white;
  color: var(--ink);
  padding: 6px 10px;
  z-index: 50;
}
.skip:focus { top: 8px; }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  background: var(--nav);
  color: var(--nav-text);
  box-shadow: inset 0 -2px 0 #a33b22;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex: none;
}
.brand svg { width: 22px; height: 22px; display: block; }

.lang-menu { position: relative; flex: none; }
.lang-menu summary {
  list-style: none;
  cursor: pointer;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid rgba(246, 241, 232, 0.35);
  border-radius: 8px;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu ul {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 148px;
  z-index: 40;
}
.lang-menu a {
  display: block;
  padding: 6px 8px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
}
.lang-menu a[aria-current="page"] { background: var(--ink); color: var(--nav-text); }
.lang-menu a:hover { background: var(--card-2); }
.lang-menu a[aria-current="page"]:hover { background: var(--ink); }

.first-screen {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  column-gap: 14px;
  row-gap: 8px;
  width: min(1280px, calc(100% - 24px));
  margin: 0 auto;
  padding: 8px 0 6px;
  flex: 1 0 auto;
  min-width: 0;
}
.first-screen > * { min-width: 0; }
.page-head h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
  white-space: nowrap;
}
.lede { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.banner {
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f8efe4;
  color: #6d4216;
  font-size: 13px;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px 10px;
  min-width: 0;
}
fieldset { border: 0; margin: 0 0 8px; padding: 0; min-inline-size: 0; }
legend {
  padding: 0;
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
}
.hint { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.segment {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.segment label {
  text-align: center;
  padding: 6px 8px;
  cursor: pointer;
  font-weight: 650;
}
.segment input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.segment label:has(input:checked) { background: var(--ink); color: var(--nav-text); }
.segment label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.tier { display: grid; gap: 4px; }
.tier label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  cursor: pointer;
}
.tier label:has(input:checked) { border-color: var(--ink); background: #f7f1e8; }
.tier input { margin: 0; }
.tier-price { font-variant-numeric: tabular-nums; color: var(--muted); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.slider { display: flex; flex-direction: column; gap: 2px; font-size: 12px; font-weight: 700; }
.slider-top { display: flex; justify-content: space-between; align-items: baseline; }
.slider output { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--accent); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.cloud-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-weight: 650;
}
.money { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
input[type="number"] {
  width: 100%;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: white;
}
.price-panel { border-top: 1px solid var(--line); padding-top: 6px; }
.price-panel summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 8px;
  cursor: pointer;
  font-weight: 700;
}
.price-date { color: var(--muted); font-weight: 500; font-size: 12px; }
.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.price-grid label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); }

.results-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.results-head h2 { margin: 0; font-size: 16px; letter-spacing: -0.02em; }
.export {
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  font-weight: 700;
  padding: 0 10px;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 6px 0;
  padding: 0;
  list-style: none;
}
.kpis li { background: var(--card-2); border-radius: 8px; padding: 5px 7px; min-width: 0; }
.kpis span, .kpis em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpis strong {
  display: block;
  margin: 1px 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.sheet-wrap { overflow-x: auto; }
.sheet { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12.5px; }
.sheet th, .sheet td { padding: 3px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.sheet thead th { font-size: 11px; color: var(--muted); font-weight: 700; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.is-best { background: var(--good-bg); }
tr.is-unavailable { color: var(--muted); }
.lowest {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--good);
  color: white;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  vertical-align: 1px;
}
.method { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; }
.chart-block { margin-top: 6px; }
.chart-block h3 { margin: 0 0 4px; font-size: 13px; }
.chart-canvas {
  width: 100%;
  height: 148px;
  display: block;
  background: #fcfbf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  font-size: 11.5px;
  color: var(--muted);
}
.legend li { display: inline-flex; align-items: center; gap: 5px; }
.swatch::before {
  content: "";
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--swatch, currentColor);
}
.swatch.adobe { --swatch: #a33b22; }
.swatch.corel { --swatch: #1d4e89; }
.swatch.affinity { --swatch: #1e6b45; }
.swatch.capture { --swatch: #6a3d9a; }
.swatch.foss { --swatch: #6e675c; }
.swatch.is-off { opacity: 0.4; }
.decision {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 8px;
  margin-top: 6px;
}
.takeaway p, .affiliate p { margin: 0; }
.takeaway .kicker, .affiliate .kicker {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--accent);
}
.savings-line, .aff-versus, .mac-note { margin-top: 3px; font-size: 12.5px; }
.mac-note { color: #6d4216; }
.affiliate {
  border: 1px solid #e7c7bc;
  background: #fff8f4;
  border-radius: 10px;
  padding: 7px 9px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.savings-amount {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.03em;
}
.cta {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 30px;
  margin-top: 2px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 750;
}
.disclosure { font-size: 12px; line-height: 1.35; color: #3a342c; }
.is-stale { opacity: 0.48; }
.site-footer {
  height: 28px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
}
.site-footer p {
  margin: 0;
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.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;
}
.missing { width: min(640px, calc(100% - 32px)); margin: 48px auto; }
.missing h1 { font-size: 32px; letter-spacing: -0.03em; margin: 0 0 8px; white-space: normal; }
.missing ul { padding-left: 18px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 980px) {
  .first-screen { grid-template-columns: 1fr; width: min(720px, calc(100% - 20px)); }
  .page-head h1 { white-space: normal; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .decision, .price-grid, .pair, .cloud-row { grid-template-columns: 1fr; }
  .site-footer { height: auto; padding: 8px 12px; }
  .site-footer p { white-space: normal; }
}

@media (min-width: 981px) {
  .page-head h1 { white-space: nowrap; }
}
