:root {
  --bg: #faf7f2; --card: #fff; --fg: #23201c; --muted: #6d665c; --line: #e6dfd3;
  --accent: #b4532a; --accent-ink: #8f3f1d; --soft: #f3e7dc; --green: #3d5a4c;
  --err-bg: #fbeaea; --err: #8a1f1f;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1b1916; --card: #24211d; --fg: #eee8de; --muted: #a9a094; --line: #3a352e;
          --accent: #e07a4b; --accent-ink: #f09a6f; --soft: #2f2620; --err-bg: #3a1f1f; --err: #f3b0b0; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); line-height: 1.6;
       min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent-ink); }
.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 1rem; }
.top { border-bottom: 1px solid var(--line); background: var(--card); }
.top-inner { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
             align-items: center; padding-top: .8rem; padding-bottom: .8rem; }
.brand { display: flex; gap: .55rem; align-items: center; font-weight: 750; font-size: 1.15rem;
         color: var(--fg); text-decoration: none; }
.top nav { display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.top nav a:hover, .top nav a[aria-current] { color: var(--accent); }
main.wrap { flex: 1; padding-top: 2.5rem; padding-bottom: 3rem; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.15; margin: 0 0 .75rem; letter-spacing: -.01em; }
h2 { line-height: 1.25; }
.hero { max-width: 680px; margin-bottom: 2rem; }
.hero h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); }
.hero p { color: var(--muted); font-size: 1.15rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.25rem;
        border-top: 4px solid var(--accent); }
.card h2 { font-size: 1.2rem; margin: 0 0 .3rem; }
.card h2 a { color: var(--fg); text-decoration: none; }
.card h2 a:hover { color: var(--accent); }
.card p { margin: .3rem 0; color: var(--muted); }
.sizes { display: flex; flex-wrap: wrap; gap: .35rem; font-size: .88rem; align-items: center; }
.sizes span { margin-right: .2rem; }
.sizes a { background: var(--soft); border-radius: 999px; padding: .1rem .6rem; text-decoration: none; }
.guide { margin-top: 3rem; max-width: 720px; }
.guide li { margin-bottom: .5rem; }
.button, .tool-form button { display: inline-block; background: var(--accent); color: #fff; border: 0;
          padding: .7rem 1.4rem; border-radius: 8px; text-decoration: none; cursor: pointer;
          font: inherit; font-weight: 600; justify-self: start; }
.button:hover, .tool-form button:hover { background: var(--accent-ink); }
form { display: grid; gap: 1rem; max-width: 560px; }
.tool-form { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); max-width: none;
             background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem; }
.tool-form button { grid-column: 1 / -1; }
label { display: grid; align-content: start; gap: .3rem; font-size: .95rem; font-weight: 500; }
input, textarea, select { font: inherit; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px;
                          background: var(--bg); color: var(--fg); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.tool-form small { color: var(--muted); font-weight: 400; }
.check { display: flex; gap: .5rem; align-items: center; align-self: end; padding-bottom: .6rem; }
.check input { width: auto; }
.tool-intro { color: var(--muted); max-width: 720px; font-size: 1.05rem; }
.tool-result { background: var(--soft); border-radius: 12px; padding: 1.25rem 1.4rem; margin: 1.5rem 0; }
.tool-value { font-size: clamp(1.4rem, 4vw, 1.9rem); font-weight: 750; margin: 0 0 .9rem; color: var(--accent-ink); }
.tool-result dl, .facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.5rem; margin: 0; }
.tool-result dt, .facts dt { color: var(--muted); }
.tool-result dd, .facts dd { margin: 0; font-weight: 600; word-break: break-word; }
.facts dd { font-weight: 400; }
.notes { margin: 1rem 0 0; padding-left: 1.2rem; color: var(--muted); font-size: .92rem; }
.back { margin: .8rem 0 0; }
.tool-error { background: var(--err-bg); color: var(--err); padding: .8rem 1rem; border-radius: 8px; }
.faq { margin-top: 2.5rem; max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); padding: .8rem 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.tool-api { margin-top: 2rem; color: var(--muted); }
.page { max-width: 720px; }
.notice { background: var(--soft); padding: 1rem; border-radius: 8px; }
.ad { max-width: 960px; margin: 1rem auto; padding: 0 1rem; min-height: 90px; }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; background: var(--card); }
.foot { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; padding-top: 1.5rem; padding-bottom: 1.5rem; }
.foot p { margin: .25rem 0 0; max-width: 420px; }
.foot nav { display: flex; gap: 1rem; flex-wrap: wrap; align-items: start; }
@media (max-width: 560px) {
  .tool-result dl, .facts { grid-template-columns: 1fr; gap: 0; }
  .tool-result dd, .facts dd { margin-bottom: .5rem; }
}
