:root {
    --green: #339933; --green-deep: #548135; --green-light: #A9D18E; --green-pale: #EAF5E4;
    --ink: #1f2a1f; --ink-2: #4e5a4e; --paper: #ffffff; --paper-2: #f6f9f4; --line: #d6e3d0;
    --red: #d32d1f; --note-bg: #fff8d6; --note-line: #d9b400;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
    --ink: #e8efe6; --ink-2: #b3c0b0; --paper: #141a14; --paper-2: #1b231b; --line: #2f3d2e;
    --green-pale: #1f2e1e; --green-light: #6f9a5c; --note-bg: #3a3410; --note-line: #c9a800; color-scheme: dark;
  } }
  :root[data-theme="dark"] {
    --ink: #e8efe6; --ink-2: #b3c0b0; --paper: #141a14; --paper-2: #1b231b; --line: #2f3d2e;
    --green-pale: #1f2e1e; --green-light: #6f9a5c; --note-bg: #3a3410; --note-line: #c9a800; color-scheme: dark;
  }
  html { scroll-padding-top: calc(64px + env(safe-area-inset-top, 0px)); }
  *, *::before, *::after { box-sizing: inherit; }
  body { margin: 0; background: var(--paper); color: var(--ink); font-family: "BIZ UDPGothic", "UD Digi Kyokasho NK-R", "Hiragino Sans", "Noto Sans JP", sans-serif; font-size: 17px; line-height: 1.85; }
  body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--paper); z-index: 10; }
  a { color: var(--green-deep); }
  img { max-width: 100%; }

  /* header */
  header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9; background: var(--paper); border-bottom: 2px dotted var(--green); }
  .bar { max-width: 1040px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
  .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; }
  .brand .mark { width: 30px; height: 30px; border-radius: 50%; background: var(--green); position: relative; }
  .brand .mark::after { content: ""; position: absolute; left: 13px; top: 15px; width: 4px; height: 12px; background: var(--paper); }
  .brand small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-2); line-height: 1.2; }
  .logo-mark { height: 40px; width: auto; border-radius: 4px; background: #fff; }
  .logo-fig { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin: 16px 0 8px; }
  .logo-fig img { width: 140px; height: auto; border-radius: 6px; background: #fff; }
  .logo-fig p { flex: 1 1 260px; margin: 0; }
  .photo { border: 2px dashed var(--line); border-radius: 6px; aspect-ratio: 16 / 7; display: grid; place-items: center; color: var(--ink-2); font-size: 14px; text-align: center; padding: 12px; margin: 18px 0; background: var(--paper-2); max-width: 760px; }
  nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 14px; }
  nav a { text-decoration: none; color: var(--ink-2); padding: 4px 0; border-bottom: 2px solid transparent; }
  nav a.on { color: var(--green-deep); border-color: var(--green-light); }

  main { max-width: 1040px; margin: 0 auto; padding: 24px 20px 80px; }
  
  h1 { font-size: clamp(28px, 4.4vw, 42px); line-height: 1.35; margin: 24px 0 8px; }
  h2 { font-size: 24px; margin: 48px 0 14px; padding-bottom: 6px; border-bottom: 6px solid var(--green-light); display: inline-block; }
  h3 { font-size: 18px; margin: 26px 0 8px; color: var(--green-deep); }
  p { margin: 0 0 14px; max-width: 42em; }
  .lead { font-size: 19px; color: var(--ink-2); max-width: 36em; }

  /* 事実ブロック：このサイトで一番大事な部品 */
  .facts { border: 3px solid var(--green); border-radius: 6px; background: var(--paper-2); padding: 18px 22px; margin: 28px 0 8px; }
  .facts-title { font-weight: 700; color: var(--green-deep); margin-bottom: 8px; }
  .facts dl { display: grid; grid-template-columns: 11em 1fr; gap: 6px 14px; margin: 0; font-size: 15.5px; }
  .facts dt { color: var(--ink-2); } .facts dd { margin: 0; }
  .facts .updated { font-size: 13px; color: var(--ink-2); margin-top: 10px; }
  @media (max-width: 560px) { .facts dl { grid-template-columns: 1fr; gap: 2px; } .facts dt { margin-top: 8px; } }

  .chk { color: var(--red); font-weight: 700; font-size: 0.85em; }
  .boss { border: 2px dashed var(--note-line); background: var(--note-bg); padding: 12px 16px; border-radius: 4px; margin: 16px 0; max-width: 42em; }
  .boss b { color: #7a5f00; }
  .msg { border: 3px solid var(--green-light); border-radius: 6px; padding: 14px 20px; font-size: 20px; font-weight: 700; margin: 24px 0; max-width: 40em; }
  .msg em { font-style: normal; color: var(--red); }

  .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 18px 0; }
  .tile { background: var(--green-pale); padding: 16px 18px; border-left: 6px solid var(--green); }
  .tile b { display: block; font-size: 17px; margin-bottom: 4px; }
  .tile span { font-size: 15px; color: var(--ink-2); }

  .steps { counter-reset: s; list-style: none; padding: 0; margin: 10px 0; max-width: 44em; }
  .steps li { counter-increment: s; position: relative; padding: 10px 0 10px 52px; min-height: 56px; border-bottom: 1px solid var(--line); }
  .steps li::before { content: counter(s); position: absolute; left: 0; top: 10px; width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 700; display: grid; place-items: center; }
  .steps b { display: block; }

  table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
  th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
  th { color: var(--green-deep); font-weight: 700; background: var(--paper-2); }
  .scroll { overflow-x: auto; }

  details { border-bottom: 1px solid var(--line); padding: 10px 0; max-width: 44em; }
  summary { cursor: pointer; font-weight: 700; }
  details p { margin-top: 8px; }

  .src { font-size: 13px; color: var(--ink-2); }
  .btn { display: inline-block; background: var(--green); color: #fff; text-decoration: none; padding: 12px 22px; border-radius: 4px; font-weight: 700; }
  .btn.alt { background: transparent; color: var(--green-deep); border: 2px solid var(--green); }
  .row { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0; }

  footer { border-top: 2px dotted var(--green); margin-top: 40px; }
  .foot { max-width: 1040px; margin: 0 auto; padding: 22px 20px; font-size: 14px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 8px 28px; }
  .proto { position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--note-bg); border: 1px solid var(--note-line); color: var(--ink); font-size: 12px; padding: 6px 10px; border-radius: 4px; z-index: 20; }
    @keyframes in { from { opacity: 0; } to { opacity: 1; } }

  /* 日本語を文節で改行する（ことばの途中で折り返さない） */
  body { word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }
  h1, h2, h3, .lead, .msg, summary { text-wrap: balance; }
  p, dd, li, td, .tile span { text-wrap: pretty; }

  .artlist { list-style: none; padding: 0; max-width: 44em; }
  .artlist li { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .artlist a { font-weight: 700; text-decoration: none; }
  .artlist small { display: block; color: var(--ink-2); }
