  @font-face {
    font-family: 'Barlow Condensed';
    src: url('/assets/fonts/barlow-condensed-400.ttf') format('truetype');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
  }

  @font-face {
    font-family: 'Barlow Condensed';
    src: url('/assets/fonts/barlow-condensed-600.ttf') format('truetype');
    font-style: normal;
    font-weight: 600;
    font-display: swap;
  }

  @font-face {
    font-family: 'Barlow Condensed';
    src: url('/assets/fonts/barlow-condensed-800.ttf') format('truetype');
    font-style: normal;
    font-weight: 800;
    font-display: swap;
  }

:root {
    --bg: #f5f4f0;
    --fg: #1a1a1a;
    --fg-muted: #666;
    --accent: #1a1a1a;
    --accent-inv: #f5f4f0;
    --accent-dim: rgba(26,26,26,0.07);
    --border: rgba(0,0,0,0.1);
    --card-bg: #ffffff;
    --shadow:
      0 18px 36px rgba(0,0,0,0.08),
      0 4px 10px rgba(0,0,0,0.06);
    --highlight: #e8ff47;
    --green: #4cd98a;
    --green-dim: rgba(76,217,138,0.12);
    --font-main: 'Barlow Condensed', sans-serif;
    --font-jp: 'M PLUS 1p', sans-serif;
    --radius: 6px;
    --nav-px: 28px; /* nav overlay horizontal padding — matches header padding-right */
  }



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

  button,
  a,
  label,
  input,
  textarea {
    -webkit-tap-highlight-color: transparent;
  }

  button,
  .tab,
  .expiry-tab,
  .onetime-label,
  .install-chip {
    -webkit-user-select: none;
    user-select: none;
  }

  html, body {
    min-height: 100%;
    background:
      radial-gradient(ellipse at 10% 15%, #ffffff 0%, transparent 52%),
      radial-gradient(ellipse at 85% 5%,  #e4e3de 0%, transparent 48%),
      radial-gradient(ellipse at 55% 45%, #f5f4f0 0%, transparent 55%),
      radial-gradient(ellipse at 5%  75%, #dddcd8 0%, transparent 50%),
      radial-gradient(ellipse at 90% 65%, #ececE8 0%, transparent 48%),
      radial-gradient(ellipse at 40% 90%, #e8e7e2 0%, transparent 52%),
      radial-gradient(ellipse at 92% 92%, #ffffff 0%, transparent 45%),
      #f0efe9;
    background-attachment: fixed;
    color: var(--fg);
    font-family: var(--font-main);
    transition: background 0.3s, color 0.3s;
  }

  body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top);
    background: var(--highlight);
    pointer-events: none;
    z-index: 50;
  }

  /* ── HEADER ── */
  header {
    position: sticky;
    top: 0;
    z-index: 100;
    overflow: visible;
    transform: translateY(-1px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    background: #fffefa;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding-top: calc(18px + env(safe-area-inset-top));
  }

  header::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--highlight);
    pointer-events: none;
  }

  .logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    line-height: 0;
    position: relative;
    margin-top: 8px;
    height: 36px; /* locks header height — EN logo centers inside, JP fills exactly */
  }

  #logo-img,
  .logo-img {
    height: 30px;
    width: auto;
    display: block;
  }

  .site-title {
    position: absolute;
    left: 0;
    top: -17px;
    width: max-content;
    max-width: none;
    white-space: nowrap;
    color: var(--fg-muted);
    font-size: 8px;
    font-family: var(--font-main);
    font-weight: 600;
    letter-spacing: 0.16em;
    line-height: 1;
    text-transform: uppercase;
    opacity: 0.72;
  }

  .hero-logo {
    display: block;
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 0 auto 20px;
  }

  @media (min-width: 768px) {
    .hero-logo { max-width: 380px; }
  }

  .header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .ctrl-about {
    font-size: 12px;
    font-family: var(--font-main);
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--fg-muted);
    text-transform: uppercase;
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    transition: color 0.2s;
    margin-right: 4px;
  }

  .ctrl-about:hover { color: var(--fg); }

  .lang-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: var(--accent-dim);
    border: none;
    box-shadow: none;
    border-radius: 999px;
    width: fit-content;
    max-width: 100%;
    min-width: 116px;
    padding: 0 10px;
    height: 34px;
  }

  .lang-toggle:focus-within {
    border: none;
    box-shadow: none;
  }

  .lang-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: none;
    outline: none;
    box-shadow: none;
    background: transparent;
    width: 100%;
    min-width: 82px;
    white-space: nowrap;
    color: var(--fg-muted);
    font-size: 11px;
    font-family: var(--font-main);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding-right: 24px;
    padding-left: 10px;
    cursor: pointer;
  }

  .lang-toggle__icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fg-muted);
    pointer-events: none;
  }

  @media (max-width: 768px) {
    .ctrl-about {
      display: none;
    }

    .lang-toggle {
      min-width: 108px;
      height: 32px;
      padding: 0 9px;
    }

    .site-title {
      font-size: 7px;
      letter-spacing: 0.12em;
    }
  }

  /* ── BACKGROUND CANVAS ── */
  #heroBg {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
  }

  /* ── HERO ── */
  .hero {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 36px 24px 28px;
  }

  .hero-eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg-muted);
    margin-bottom: 32px;
  }

  .hero-title {
    font-size: clamp(48px, 10vw, 96px);
    font-weight: 800;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    line-height: 0.9;
    margin-bottom: 20px;
  }

  .hero-kana {
    display: block;
    font-size: clamp(11px, 1.6vw, 14px);
    font-weight: 400;
    letter-spacing: 0.25em;
    color: var(--fg-muted);
    font-family: var(--font-jp);
    margin-bottom: -4px;
    background: none;
    padding: 0;
    line-height: 1.2;
  }

  .hero-title span:not(.hero-kana) {
    background: var(--highlight);
    color: #1a1a1a;
    padding: 0 6px;
    display: inline-block;
  }

  .hero-sub {
    font-size: 15px;
    color: var(--fg-muted);
    letter-spacing: 0.04em;
    font-family: var(--font-jp);
    font-weight: 400;
    line-height: 1.7;
  }

  .hero-trust {
    margin-top: 20px;
    padding: 10px 16px;
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--fg-muted);
    font-family: var(--font-jp);
    background: rgba(26,26,24,0.04);
    border-radius: 999px;
    line-height: 1.5;
  }

  /* ── MAIN ── */
  main {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 24px 80px;
  }

  /* ── TABS ── */
  .tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
    width: 100%;
    max-width: 520px;
    background: var(--bg);
  }

  .tab {
    flex: 1;
    padding: 18px 12px;
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--fg-muted);
    transition: background 0.2s, color 0.2s;
  }

  .tab.active {
    background: var(--fg);
    color: var(--accent-inv);
  }

  #tabSend.active {
    background: #e8ff47;
    color: #111111;
  }

  #tabReceive.active {
    background: #4cd98a;
    color: #111111;
  }

  .tab { transition: background 0.2s, color 0.2s, transform 0.12s cubic-bezier(0.4, 0, 0.2, 1); }
  .tab:active { transform: scale(0.97); }

  .tab:not(.active):hover {
    background: var(--accent-dim);
    color: var(--fg);
  }

  /* ── CARD ── */
  .card {
    width: 100%;
    max-width: 520px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 24px 28px;
    box-shadow: var(--shadow);
  }

  .panel { display: none; }
  .panel.active { display: block; }

  /* ── FIELDS ── */
  .field-label {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-muted);
    margin-bottom: 10px;
    display: block;
  }

  input[type="url"], input[type="text"]:not(.digit-input) {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 13px 16px;
    font-family: var(--font-jp);
    font-size: 16px;
    font-weight: 400;
    color: var(--fg);
    outline: none;
    transition: border-color 0.2s;
  }

  input[type="url"]:focus,
  input[type="text"]:not(.digit-input):focus { border-color: var(--fg); }
  input::placeholder { color: var(--fg-muted); opacity: 0.5; }

  textarea#contentInput {
    width: 100%;
    min-height: 140px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 13px 16px;
    font-family: var(--font-jp);
    font-size: 16px;
    font-weight: 400;
    color: var(--fg);
    outline: none;
    resize: vertical;
    line-height: 1.7;
    transition: border-color 0.2s;
  }

  textarea#contentInput:focus {
    border-color: var(--highlight);
    box-shadow: 0 0 0 3px rgba(232,255,71,0.25), 0 0 16px rgba(232,255,71,0.2);
    outline: none;
  }
  textarea#contentInput::placeholder { color: var(--fg-muted); opacity: 0.5; }

  .char-count {
    text-align: right;
    font-size: 11px;
    color: var(--fg-muted);
    letter-spacing: 0.05em;
    margin-top: 6px;
  }

  .char-count.warn { color: #e2041b; }

  .expiry-row {
    display: block;
    margin: 16px 0 24px;
  }

  .expiry-row .field-label {
    margin-bottom: 10px;
    white-space: nowrap;
  }

  .expiry-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .expiry-tab {
    min-width: 0;
    min-height: 34px;
    padding: 7px 8px;
    background: rgba(26,26,26,0.04);
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--fg-muted);
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
  }

  .expiry-tab__num {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    vertical-align: baseline;
  }

  .expiry-tab__unit {
    font-family: var(--font-jp);
    font-size: 0.86em;
    font-weight: 500;
    line-height: 1;
    margin-left: 3px;
    vertical-align: baseline;
  }

  html[lang="ja"] .expiry-tab__num {
    font-size: 15px;
  }

  html[lang="ja"] .expiry-tab__unit {
    font-size: 10px;
    letter-spacing: 0;
  }

  .expiry-tab { transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.12s cubic-bezier(0.4, 0, 0.2, 1); }
  .expiry-tab:active { transform: scale(0.93); }

  .expiry-tab:hover {
    background: rgba(26,26,26,0.07);
    color: var(--fg);
  }

  .expiry-tab.active {
    background: var(--fg);
    color: var(--highlight);
    border-color: var(--fg);
    text-shadow: none;
    box-shadow:
      0 0 10px rgba(232,255,71,0.45),
      0 0 28px rgba(232,255,71,0.22),
      inset 0 0 18px rgba(232,255,71,0.12);
  }

  .btn-primary {
    width: 100%;
    padding: 15px;
    background: var(--fg);
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-inv);
    cursor: pointer;
    transition: opacity 0.2s, transform 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .btn-primary:hover { opacity: 0.82; }
  .btn-primary:active { transform: scale(0.96); }
  .btn-primary:disabled { opacity: 0.25; cursor: not-allowed; }

  #generateBtn {
    background: var(--highlight);
    color: #1a1a18;
  }

  #generateBtn:disabled { opacity: 0.3; }

  .btn-primary.btn-green {
    background: var(--green);
    color: #111111;
  }

  .btn-primary.btn-green:hover { opacity: 0.88; }
  .btn-primary.btn-green:disabled { background: var(--green); }
  .btn-primary.btn-green.is-loading {
    opacity: 1;
    cursor: wait;
  }

  /* ── ONE-TIME TOGGLE ── */
  .onetime-row {
    margin: 0 0 20px;
  }

  .onetime-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
  }

  .onetime-label input[type="checkbox"] { display: none; }

  .toggle-track {
    width: 36px;
    height: 20px;
    background: var(--border);
    border-radius: 20px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
    border: 1px solid var(--border);
  }

  .toggle-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  }

  #onetimeToggle:checked + .toggle-track {
    background: var(--green);
    border-color: var(--green);
  }

  #onetimeToggle:checked + .toggle-track .toggle-thumb {
    transform: translateX(16px);
  }

  .onetime-text {
    font-size: 15px;
    font-family: var(--font-main);
    font-weight: 500;
    color: var(--fg-muted);
    letter-spacing: 0.04em;
    transition: color 0.2s;
  }

  html[data-page-lang="jp"] .onetime-text {
    font-family: var(--font-jp);
  }

  #onetimeToggle:checked ~ .onetime-text,
  .onetime-label:has(#onetimeToggle:checked) .onetime-text {
    color: var(--green);
  }

  /* ── CODE DISPLAY ── */
  .code-display {
    display: none;
    text-align: center;
    padding: 28px 0 4px;
    animation: fadeUp 0.4s ease both;
  }

  .code-display.visible { display: block; }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .code-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fg-muted);
    margin-bottom: 24px;
  }

  .code-digits {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
  }

  .digit-group {
    display: flex;
    gap: 8px;
  }

  .digit-box {
    width: 56px;
    height: 72px;
    background: var(--highlight);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 800;
    color: #1a1a1a;
    animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
  }

  #codeDisplay .code-digits,
  #codeReadyDisplay .code-digits {
    gap: clamp(10px, 4vw, 18px);
  }

  #codeDisplay .code-digits {
    display: flex;
    width: max-content;
    margin-left: auto;
    margin-right: auto;
  }

  /* Give the sender view a readable 3+3 rhythm without changing the raw code value. */
  #codeDisplay .digit-box,
  #codeReadyDisplay .digit-box {
    width: clamp(40px, 12vw, 58px);
    height: clamp(58px, 16vw, 76px);
    font-size: clamp(30px, 8.8vw, 42px);
  }

  #codeDisplay .digit-group,
  #codeReadyDisplay .digit-group {
    gap: 6px;
  }

  .digit-box:nth-child(1) { animation-delay: 0.04s; }
  .digit-box:nth-child(2) { animation-delay: 0.08s; }
  .digit-box:nth-child(3) { animation-delay: 0.12s; }
  .digit-box:nth-child(4) { animation-delay: 0.16s; }
  .digit-box:nth-child(5) { animation-delay: 0.20s; }
  .digit-box:nth-child(6) { animation-delay: 0.24s; }

  @keyframes popIn {
    from { opacity: 0; transform: scale(0.6) rotate(-4deg); }
    to   { opacity: 1; transform: scale(1) rotate(0deg); }
  }

  .expiry-note {
    font-size: 12px;
    color: var(--fg-muted);
    letter-spacing: 0.06em;
    font-family: var(--font-jp);
    margin: 16px 0 24px;
  }

  .btn-copy-code {
    background: var(--highlight);
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 11px 32px;
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg);
    cursor: pointer;
    transition: opacity var(--transition), background var(--transition);
    margin-bottom: 16px;
  }

  .btn-copy-code { transition: opacity 0.2s, background 0.2s, transform 0.12s cubic-bezier(0.4, 0, 0.2, 1); }
  .btn-copy-code:hover { opacity: 0.82; }
  .btn-copy-code:active { transform: scale(0.96); }
  .btn-copy-code.copied { background: var(--green-dim); border-color: var(--green); color: var(--green); }
  .btn-copy-code--green {
    background: var(--green);
    color: #111111;
  }

  .btn-reset {
    background: none;
    border: 1px solid rgba(180, 60, 60, 0.28);
    border-radius: var(--radius);
    padding: 9px 24px;
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #b04040;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
  }

  .btn-reset { transition: border-color 0.2s, color 0.2s, transform 0.12s cubic-bezier(0.4, 0, 0.2, 1); }
  .btn-reset:hover { border-color: #b04040; color: #b04040; }
  .btn-reset:active { transform: scale(0.96); }

  /* ── RECEIVE ── */
  .btn-paste {
    display: block;
    margin: 4px auto 28px;
    min-width: 124px;
    padding: 11px 24px;
  }
  .btn-paste.pasted {
    background: var(--green-dim);
    border-color: var(--green);
    color: var(--green);
  }

  .paste-tooltip {
    position: absolute;
    left: 50%;
    top: calc(100% - 12px);
    transform: translateX(-50%) translateY(-4px);
    background: rgba(38, 42, 44, 0.94);
    color: #fff;
    border-radius: 6px;
    padding: 10px 14px;
    font-family: var(--font-jp);
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 5;
  }

  .paste-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    width: 12px;
    height: 12px;
    background: rgba(38, 42, 44, 0.94);
    transform: translateX(-50%) rotate(45deg);
    border-radius: 2px;
  }

  .paste-tooltip.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  .code-input-row {
    --receive-digit-width: clamp(40px, 12vw, 58px);
    --receive-digit-height: clamp(58px, 16vw, 76px);
    --receive-digit-font-size: clamp(30px, 8.8vw, 42px);
    --receive-digit-gap: 6px;
    --receive-digit-split-gap: clamp(16px, 4vw, 24px);
    display: inline-grid;
    grid-template-columns:
      var(--receive-digit-width)
      var(--receive-digit-width)
      var(--receive-digit-width)
      var(--receive-digit-split-gap)
      var(--receive-digit-width)
      var(--receive-digit-width)
      var(--receive-digit-width);
    column-gap: var(--receive-digit-gap);
    justify-content: center;
    width: auto;
    max-width: 100%;
    margin-bottom: 18px;
  }

  .digit-input {
    width: var(--receive-digit-width);
    height: var(--receive-digit-height);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    font-family: var(--font-main);
    font-size: var(--receive-digit-font-size);
    font-weight: 800;
    color: var(--fg);
    caret-color: transparent;
    outline: none;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, color 0.15s;
    -moz-appearance: textfield;
    appearance: textfield;
  }

  .digit-input:nth-child(1) { grid-column: 1; }
  .digit-input:nth-child(2) { grid-column: 2; }
  .digit-input:nth-child(3) { grid-column: 3; }
  .digit-input:nth-child(4) { grid-column: 5; }
  .digit-input:nth-child(5) { grid-column: 6; }
  .digit-input:nth-child(6) { grid-column: 7; }

  .digit-input::-webkit-outer-spin-button,
  .digit-input::-webkit-inner-spin-button { -webkit-appearance: none; }

  .digit-input:focus {
    border-color: var(--green);
    background: #f0fff8;
    color: #111111;
    box-shadow: 0 0 0 1px var(--green), 0 0 12px rgba(76,217,138,0.25), 0 0 28px rgba(76,217,138,0.12);
  }

  .digit-input.filled {
    background: var(--green);
    color: #111111;
    border-color: var(--green);
    box-shadow: none;
  }

  .digit-box.digit-box--green {
    background: var(--green);
    color: #111111;
  }

  /* 入力/完了モード 高さ固定スタック */
  #receiveSwap {
    display: grid;
    grid-template-areas: "swap";
  }
  #receiveInputArea,
  #codeReadyDisplay {
    grid-area: swap;
  }
  #receiveInputArea {
    position: relative;
    padding-top: 34px; /* 少し広めにして入力枠の上下に空気を足す */
    text-align: center;
  }

  #receiveInputArea .field-label {
    font-size: 16px;
    margin-bottom: 24px;
  }

  #codeReadyDisplay + #lookupBtn,
  #receiveSwap + #lookupBtn {
    margin-top: 0;
  }

  #lookupBtn {
    display: none;
  }

  .code-edit-hint {
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--fg-muted);
    opacity: 0.5;
    margin-top: 20px;
    margin-bottom: 8px;
  }

  #codeReadyDisplay:hover .code-edit-hint { opacity: 1; }

  .receive-status {
    min-height: 18px;
    margin: 6px 0 0;
    color: var(--fg-muted);
    font-family: var(--font-jp);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-align: center;
  }

  .receive-status.is-loading {
    color: var(--green);
  }

  .receive-status.is-loading::after {
    content: '';
    display: inline-block;
    width: 1.8em;
    text-align: left;
    animation: statusDots 1.2s steps(4, end) infinite;
  }

  @keyframes statusDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75%, 100% { content: '...'; }
  }

  @media (max-width: 480px) {
    .hero {
      padding-top: 24px;
      padding-bottom: 22px;
    }

    .hero-logo {
      display: none;
    }

    .hero-eyebrow {
      margin-bottom: 14px;
    }

    .hero-sub {
      font-size: 13px;
      line-height: 1.65;
    }

    main {
      padding-left: 18px;
      padding-right: 18px;
    }

    .card {
      padding-left: 18px;
      padding-right: 18px;
    }

    .code-input-row {
      --receive-digit-width: min(50px, calc((100vw - 92px) / 6.35));
      --receive-digit-height: 64px;
      --receive-digit-font-size: 34px;
      --receive-digit-gap: 4px;
      --receive-digit-split-gap: min(14px, calc((100vw - 92px) / 18));
    }

    .digit-input {
      max-width: var(--receive-digit-width);
    }

    /* code-display の digit-box を digit-input と同サイズに合わせる */
    .code-digits {
      gap: 5px;
    }

    .digit-box {
      flex: 0 0 auto;
      max-width: 46px;
      width: 46px;
      height: 56px;
      font-size: 26px;
    }

    #codeDisplay .code-digits,
    #codeReadyDisplay .code-digits {
      gap: 10px;
    }

    #codeDisplay .code-digits {
      width: max-content;
      margin-left: auto;
      margin-right: auto;
    }

    #codeDisplay .digit-box,
    #codeReadyDisplay .digit-box {
      max-width: 50px;
      width: 50px;
      height: 64px;
      font-size: 34px;
    }

    #codeDisplay .digit-group,
    #codeReadyDisplay .digit-group {
      gap: 4px;
    }
  }

  /* ── RECEIVED ── */
  .received-wrap {
    display: none;
    text-align: center;
    padding: 28px 0 4px;
    animation: fadeUp 0.4s ease both;
  }

  .received-wrap.visible { display: block; }

  .received-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fg-muted);
    margin-bottom: 24px;
  }

  .received-url {
    background: rgba(0, 0, 0, 0.04);
    border: none;
    border-radius: var(--radius);
    padding: 16px 18px;
    font-family: var(--font-jp);
    font-size: 15px;
    font-weight: 400;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.8;
    color: var(--fg);
    text-align: left;
    margin-bottom: 28px;
  }

  .btn-open-url {
    display: block;
    text-decoration: none;
    width: fit-content;
    margin: 0 auto 12px;
  }

  .received-wrap .btn-copy-code {
    display: block;
    width: fit-content;
    margin: 0 auto 12px;
  }

  .received-wrap .btn-reset {
    display: block;
    width: fit-content;
    margin: 0 auto;
  }

  .error-msg {
    display: none;
    font-size: 13px;
    color: #e2041b;
    letter-spacing: 0.04em;
    font-family: var(--font-jp);
    text-align: center;
    margin-top: 14px;
    animation: fadeUp 0.3s ease both;
  }

  .error-msg.visible { display: block; }

  .btn-error-reset {
    display: none;
    margin: 10px auto 0;
    padding: 8px 20px;
    background: none;
    border: 1px solid rgba(180,60,60,0.35);
    border-radius: var(--radius);
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #b04040;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, transform 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .btn-error-reset:hover { border-color: #b04040; }
  .btn-error-reset:active { transform: scale(0.95); }
  .error-msg.visible + .btn-error-reset { display: block; }

  /* ── HOW IT WORKS ── */
  .how-section {
    margin-top: 48px;
    width: 100%;
    max-width: 520px;
  }

  .how-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fg-muted);
    margin-bottom: 20px;
  }

  .how-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .how-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
  }

  .step-num {
    font-size: 15px;
    font-weight: 800;
    color: var(--fg-muted);
    letter-spacing: 0.1em;
    min-width: 20px;
    padding-top: 2px;
  }

  .step-text {
    font-size: 13px;
    color: var(--fg-muted);
    line-height: 1.65;
    font-family: var(--font-jp);
    font-weight: 400;
  }

  /* ── SAFETY NOTICE ── */
  .safety-notice {
    width: 100%;
    max-width: 520px;
    margin-top: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(226,4,27,0.06);
    border: 1px solid rgba(226,4,27,0.18);
    border-radius: var(--radius);
    padding: 12px 16px;
  }

  .safety-icon {
    font-size: 14px;
    line-height: 1.6;
    flex-shrink: 0;
  }

  .safety-text {
    font-size: 12px;
    color: var(--fg-muted);
    font-family: var(--font-jp);
    font-weight: 400;
    line-height: 1.7;
  }

  .safety-text strong {
    color: #c0001a;
    font-weight: 500;
  }

  /* ── FOOTER ── */
  footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 24px;
    font-size: 11px;
    color: #1a1a18;
    letter-spacing: 0.1em;
    background: var(--highlight);
    margin-top: 48px;
  }

  .install-chip {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 60;
    width: 40px;
    height: 40px;
    background: rgba(245,244,240,0.92);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--fg-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.2s, transform 0.12s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s;
  }

  .install-chip:hover { color: var(--fg); }
  .install-chip:active { transform: scale(0.92); }
  .install-chip.is-hidden { display: none; }

  .install-hint {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 48px);
    z-index: 61;
    display: none;
    width: min(360px, calc(100vw - 32px));
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--fg-muted);
    font-family: var(--font-jp);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.7;
    padding: 12px 14px;
  }

  .install-hint.visible { display: block; animation: fadeUp 0.25s ease both; }

  @media (max-width: 480px) {
    .install-hint {
      right: max(12px, env(safe-area-inset-right));
      bottom: calc(max(12px, env(safe-area-inset-bottom)) + 46px);
      width: min(280px, calc(100vw - 24px));
      font-size: 11px;
      line-height: 1.6;
      padding: 10px 12px;
    }
  }

  /* ── DIVIDER ── */
  .divider {
    width: 100%;
    max-width: 520px;
    height: 1px;
    background: var(--border);
    margin: 28px 0;
  }
