  @import url('https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+New:wght@500;700;900&family=Noto+Sans+JP:wght@400;500;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

  :root{
    --bg:#FCF9EF; --surface:#FFFFFF; --surface-2:#EAF6F3;
    --ink:#1F332F; --ink-soft:#5F7D78; --ink-faint:#93AEA9; --line:#D6EAE5;
    --accent:#F2542D; --accent-ink:#FFF6EE; --accent-2:#2E8F82;
    --good:#2E8F62; --good-bg:#E4F1E9; --bad:#D6455B;
    --shadow-color:15,35,32;
    --shadow:10px 14px 0 0 rgba(var(--shadow-color),0.16);
  }
  @media (prefers-color-scheme: dark){
    :root:not([data-theme="light"]){
      --bg:#0E1A17; --surface:#17211F; --surface-2:#1E2B28;
      --ink:#F2EED9; --ink-soft:#9CBAB4; --ink-faint:#5D7B75; --line:#243733;
      --accent:#F5875F; --accent-ink:#3A1408; --accent-2:#4FBDB0;
      --good:#6FBF9A; --good-bg:#1C2E27; --bad:#E88A9B;
      --shadow-color:0,0,0;
      --shadow:10px 14px 0 0 var(--line);
    }
  }
  :root[data-theme="dark"]{
    --bg:#0E1A17; --surface:#17211F; --surface-2:#1E2B28;
    --ink:#F2EED9; --ink-soft:#9CBAB4; --ink-faint:#5D7B75; --line:#243733;
    --accent:#F5875F; --accent-ink:#3A1408; --accent-2:#4FBDB0;
    --good:#6FBF9A; --good-bg:#1C2E27; --bad:#E88A9B;
    --shadow-color:0,0,0;
    --shadow:10px 14px 0 0 var(--line);
  }

  *{ box-sizing:border-box; }
  body{ margin:0; background:var(--bg); color:var(--ink); font-family:"Noto Sans JP", system-ui, sans-serif; font-weight:500; display:flex; justify-content:center; min-height:100vh; }

  .phone{ width:100%; max-width:430px; min-height:100vh; background:var(--surface); position:relative; }
  .phone-screen{ position:relative; width:100%; min-height:100vh; height:100%; background:var(--bg); overflow:hidden; display:flex; flex-direction:column; }
  .screens{ flex:1; min-height:0; position:relative; }
  .screen{ display:none; position:absolute; inset:0; overflow-y:auto; padding:6px 20px 20px; }
  .screen.active{ display:block; }
  .screen::-webkit-scrollbar{ width:0; height:0; }

  .tabbar{ flex-shrink:0; display:flex; justify-content:space-around; align-items:center; padding:10px 8px calc(14px + env(safe-area-inset-bottom,0px)); border-top:1px solid var(--line); background:var(--surface); }
  .tabbar button{ display:flex; flex-direction:column; align-items:center; gap:4px; background:none; border:none; cursor:pointer; color:var(--ink-faint); font-family:"Noto Sans JP"; font-weight:500; font-size:10.5px; padding:4px 10px; border-radius:12px; }
  .tabbar button.active{ color:var(--accent); }
  .tabbar svg{ width:20px; height:20px; }

  h2.screen-title{ font-family:"Zen Kaku Gothic New", sans-serif; font-weight:700; font-size:22px; margin:14px 0 4px; text-wrap:balance; }
  .screen-sub{ color:var(--ink-soft); font-size:13px; margin:0 0 16px; line-height:1.6; }

  .capture-btn{
    display:flex; align-items:center; justify-content:center; gap:8px; width:100%;
    font-family:"Zen Kaku Gothic New",sans-serif; font-weight:700; font-size:17px; padding:20px 18px;
    border-radius:999px; border:none; cursor:pointer; background:var(--accent); color:var(--accent-ink);
    box-shadow:5px 8px 0 0 color-mix(in srgb, var(--accent) 60%, black 25%);
    transform:translateY(0); transition:transform .08s ease, box-shadow .08s ease;
  }
  .capture-btn:active{ transform:translate(4px,7px); box-shadow:1px 1px 0 0 color-mix(in srgb, var(--accent) 60%, black 25%); }
  .link-btn{
    display:block; width:100%; text-align:center; background:none; border:none; cursor:pointer;
    font-family:"Noto Sans JP"; font-weight:500; font-size:12.5px; color:var(--ink-soft); text-decoration:underline;
    padding:12px 0 4px;
  }
  .section-label{ font-family:"IBM Plex Mono",monospace; font-size:11px; letter-spacing:0.06em; text-transform:uppercase; color:var(--ink-faint); margin:22px 0 10px; }

  .snack-carousel{
    display:flex; gap:10px; overflow-x:auto; scroll-snap-type:x mandatory; padding:2px 2px 6px;
    -webkit-mask-image:linear-gradient(to right, black 78%, transparent 100%);
    mask-image:linear-gradient(to right, black 78%, transparent 100%);
  }
  .snack-card{
    flex:0 0 76%; scroll-snap-align:start; text-align:left; border:1px solid var(--line); background:var(--surface);
    border-radius:20px; padding:13px 14px; cursor:pointer; box-shadow:4px 6px 0 0 rgba(var(--shadow-color),0.14);
  }
  .snack-card .sc-tag{ font-family:"IBM Plex Mono",monospace; font-size:10px; color:var(--accent-2); text-transform:uppercase; letter-spacing:0.04em; }
  .snack-card strong{ display:block; font-family:"Zen Kaku Gothic New",sans-serif; font-weight:700; font-size:15px; margin:5px 0 4px; }
  .snack-card span.teaser{ font-size:12px; color:var(--ink-soft); line-height:1.55; display:block; }
  .snack-card.is-read{ background:var(--surface-2); opacity:0.82; box-shadow:none; }
  .snack-card .rread{ font-size:9px; color:var(--accent-2); font-family:"IBM Plex Mono",monospace; margin-left:4px; text-transform:none; }

  .sc-title{ display:block; font-family:"Zen Kaku Gothic New",sans-serif; font-size:14.5px; font-weight:700; margin:5px 0 3px; line-height:1.35; }
  .sc-subtitle{ display:block; font-size:11px; color:var(--ink-faint); }

  .word-cloud-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
  .word-shuffle-btn{ flex-shrink:0; border:1px solid var(--line); background:var(--surface); border-radius:999px; padding:7px 13px; font-family:"Noto Sans JP"; font-weight:500; font-size:12px; color:var(--ink-soft); cursor:pointer; box-shadow:2px 3px 0 0 rgba(var(--shadow-color),0.14); }
  .word-cloud{ display:flex; flex-wrap:wrap; gap:10px; transition:opacity 0.25s ease; }
  .word-cloud.fading{ opacity:0; }
  .word-chip{
    border:1px solid var(--line); background:var(--surface); border-radius:999px; cursor:pointer;
    font-family:"Zen Kaku Gothic New",sans-serif; font-weight:700; color:var(--ink); padding:10px 16px;
    box-shadow:3px 4px 0 0 rgba(var(--shadow-color),0.14);
  }

  .tag{ display:inline-flex; align-items:center; gap:6px; font-family:"IBM Plex Mono",monospace; font-size:10.5px; letter-spacing:0.05em; text-transform:uppercase; padding:4px 10px; border-radius:999px; background:var(--surface-2); color:var(--accent-2); border:1px solid var(--line); }
  .illus{ width:100%; height:120px; border-radius:20px; margin:14px 0; }
  .ep-title{ font-family:"Zen Kaku Gothic New",sans-serif; font-size:21px; font-weight:700; margin:10px 0 2px; text-wrap:balance; }
  .ep-meta{ font-family:"IBM Plex Mono",monospace; font-size:11.5px; color:var(--ink-faint); margin:0 0 12px; }
  .ep-body p{ font-size:14px; line-height:1.85; color:var(--ink); margin:0 0 12px; }

  .quiz-box{ margin-top:16px; padding-top:14px; border-top:1px dashed var(--line); }
  .quiz-icon{
    display:flex; align-items:center; justify-content:center;
    width:30px; height:30px; margin-bottom:8px; border-radius:50%;
    background:var(--accent); color:var(--accent-ink); font-family:"Zen Kaku Gothic New",sans-serif; font-weight:900; font-size:16px;
  }
  .quiz-q{ font-size:13.5px; font-weight:700; margin:0 0 10px; }
  .choice{ display:block; width:100%; text-align:left; padding:11px 15px; margin-bottom:8px; border-radius:999px; border:1px solid var(--line); background:var(--surface); font-family:"Noto Sans JP"; font-weight:500; font-size:13px; color:var(--ink); cursor:pointer; box-shadow:3px 4px 0 0 rgba(var(--shadow-color),0.12); }
  .choice.selected{ border-color:var(--accent); background:var(--surface-2); }
  .choice:disabled{ cursor:default; }
  .quiz-outcome-mini{ display:flex; align-items:center; gap:9px; font-family:"Zen Kaku Gothic New",sans-serif; font-size:24px; font-weight:900; margin:2px 0 10px; }
  .quiz-outcome-mini.good{ color:var(--good); }
  .quiz-outcome-mini.bad{ color:var(--bad); }
  .quiz-point-mini{ font-family:"IBM Plex Mono",monospace; font-size:11px; color:var(--ink-faint); font-weight:500; }
  .quiz-answer-note{ font-size:12.5px; color:var(--ink-soft); font-weight:600; margin:0 0 8px; }


  .wave-divider{
    height:14px; margin:22px 0 18px;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='14' viewBox='0 0 20 14'%3E%3Cpath d='M0 7 Q5 0 10 7 T20 7' fill='none' stroke='%23D6EAE5' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat:repeat-x; background-position:left center; background-size:20px 14px;
  }
  @media (prefers-color-scheme: dark){
    :root:not([data-theme="light"]) .wave-divider{
      background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='14' viewBox='0 0 20 14'%3E%3Cpath d='M0 7 Q5 0 10 7 T20 7' fill='none' stroke='%23243733' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    }
  }
  :root[data-theme="dark"] .wave-divider{
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='14' viewBox='0 0 20 14'%3E%3Cpath d='M0 7 Q5 0 10 7 T20 7' fill='none' stroke='%23243733' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  }

  .related-section{ margin-top:24px; padding:16px 14px; border-radius:20px; background:var(--surface-2); border:1px solid var(--line); }
  .related-label{ font-family:"IBM Plex Mono",monospace; font-size:11px; letter-spacing:0.06em; text-transform:uppercase; color:var(--ink-faint); margin:0 0 8px; }
  .related-item{ display:block; width:100%; text-align:left; padding:12px 13px; border-radius:14px; border:1px solid var(--line); background:var(--surface); cursor:pointer; margin-bottom:8px; box-shadow:3px 4px 0 0 rgba(var(--shadow-color),0.1); }
  .related-item.is-read{ background:var(--surface-2); border-color:var(--accent-2); box-shadow:none; }
  .related-item .rt{ display:block; font-family:"Zen Kaku Gothic New",sans-serif; font-size:14.5px; font-weight:700; }
  .related-item .rtype{ display:block; font-size:10.5px; color:var(--ink-faint); margin-top:2px; }
  .related-item .rread{ font-size:10px; color:var(--accent-2); font-family:"IBM Plex Mono",monospace; margin-left:6px; }
  .snack-next-actions{ margin-top:20px; padding-top:14px; border-top:1px solid var(--line); display:flex; flex-direction:column; gap:8px; }
  .snack-next-actions .btn.dim{ opacity:0.4; cursor:not-allowed; }

  .search-wrap input, .search-wrap textarea{ width:100%; padding:12px 14px; border-radius:14px; border:1px solid var(--line); background:var(--surface); color:var(--ink); font-family:"Noto Sans JP"; font-size:14px; margin-bottom:14px; }
  .search-wrap textarea{ resize:vertical; }
  .search-filter-icons{ display:flex; gap:8px; margin:-6px 0 10px; }
  .search-filter-icon-btn{ display:flex; align-items:center; gap:5px; padding:7px 12px; border-radius:999px; border:1px solid var(--line); background:var(--surface); color:var(--ink-soft); font-size:13px; cursor:pointer; }
  .search-filter-icon-btn span{ font-family:"Noto Sans JP"; font-size:11.5px; }
  .search-filter-icon-btn.active{ background:var(--surface-2); border-color:var(--accent-2); color:var(--accent-2); }
  .search-filter-dropdown{ display:flex; align-items:center; gap:8px; padding:10px 12px; border-radius:14px; border:1px solid var(--line); background:var(--surface-2); margin-bottom:10px; }
  .search-filter-dropdown select, .search-filter-dropdown input[type="date"]{ flex:1; padding:9px 10px; border-radius:10px; border:1px solid var(--line); background:var(--surface); color:var(--ink); font-family:"Noto Sans JP"; font-size:13px; }
  .search-item{ display:flex; justify-content:space-between; align-items:center; width:100%; text-align:left; padding:11px 13px; border-radius:14px; border:1px solid var(--line); background:var(--surface); cursor:pointer; font-family:"Noto Sans JP"; font-size:13.5px; color:var(--ink); margin-bottom:8px; }
  .search-item span{ font-size:11px; color:var(--ink-faint); }
  .empty-note{ text-align:center; color:var(--ink-faint); font-size:13px; padding:20px 10px; }
  .browse-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
  .browse-tile{ display:flex; flex-direction:column; align-items:center; gap:6px; padding:16px 6px; border-radius:20px; border:1px solid var(--line); background:var(--surface); cursor:pointer; font-size:22px; box-shadow:3px 4px 0 0 rgba(var(--shadow-color),0.12); }
  .browse-tile span{ font-family:"Noto Sans JP"; font-size:11.5px; color:var(--ink-soft); line-height:1.3; }
  .app-header{
    flex-shrink:0; position:relative; z-index:7;
    height:52px; padding:0 14px; padding-top:env(safe-area-inset-top,0px);
    display:flex; align-items:center; gap:10px;
    background:var(--bg);
  }
  .global-back-btn{
    width:34px; height:34px; flex-shrink:0; border-radius:50%; border:1px solid var(--line);
    background:var(--surface); color:var(--ink-soft); font-size:16px; line-height:1;
    display:none; align-items:center; justify-content:center; cursor:pointer;
    box-shadow:3px 4px 0 0 rgba(var(--shadow-color),0.14);
  }
  .app-header-title{ font-family:"Zen Kaku Gothic New",sans-serif; font-weight:700; font-size:15px; color:var(--ink); }
  .app-header.has-back .app-header-title{ display:none; }
  .app-header.has-back .global-back-btn{ display:flex; }

  .rank-badge{ position:absolute; right:12px; bottom:76px; z-index:4; background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:8px 10px; box-shadow:4px 6px 0 0 rgba(var(--shadow-color),0.18); min-width:88px; pointer-events:none; }
  .rank-badge-top{ display:flex; justify-content:space-between; align-items:center; gap:8px; font-family:"IBM Plex Mono",monospace; font-size:11px; color:var(--ink-soft); margin-bottom:5px; white-space:nowrap; }
  .rank-badge-rank{ color:var(--accent-2); font-weight:600; }
  .rank-badge-track{ height:5px; border-radius:999px; background:var(--surface-2); overflow:hidden; }
  .rank-badge-fill{ height:100%; background:var(--accent); border-radius:999px; transition:width .3s; }

  .avatar-section{ display:flex; flex-direction:column; align-items:center; margin-bottom:16px; }
  .avatar-btn{ width:72px; height:72px; border-radius:50%; border:2px solid var(--accent-2); background:var(--surface-2); font-size:34px; display:flex; align-items:center; justify-content:center; cursor:pointer; box-shadow:4px 6px 0 0 rgba(var(--shadow-color),0.16); }
  .avatar-picker{ display:flex; flex-wrap:wrap; gap:8px; justify-content:center; padding:12px; border-radius:18px; border:1px solid var(--line); background:var(--surface-2); margin-bottom:16px; }
  .avatar-picker button{ width:44px; height:44px; border-radius:50%; border:1px solid var(--line); background:var(--surface); font-size:20px; cursor:pointer; }
  .avatar-picker button.on{ border-color:var(--accent-2); background:color-mix(in srgb, var(--accent-2) 18%, var(--surface)); }
  .rank-card{ border:1px solid var(--line); background:var(--surface); border-radius:24px; padding:18px; margin-bottom:6px; box-shadow:5px 7px 0 0 rgba(var(--shadow-color),0.16); }
  .rank-card .rank-name{ font-family:"Zen Kaku Gothic New",sans-serif; font-size:20px; font-weight:700; margin:0 0 4px; }
  .rank-card .rank-sub{ font-size:12px; color:var(--ink-soft); margin:0 0 12px; }
  .rank-bar-track{ height:8px; border-radius:999px; background:var(--surface-2); overflow:hidden; }
  .rank-bar-fill{ height:100%; background:var(--accent); border-radius:999px; transition:width .3s; }
  .rank-stats{ display:flex; gap:18px; margin-top:14px; font-family:"IBM Plex Mono",monospace; font-size:11px; color:var(--ink-faint); }
  .rank-stats strong{ display:block; font-size:17px; color:var(--ink); font-family:"Zen Kaku Gothic New",sans-serif; font-weight:700; }
  .label-manage-chip{ display:inline-flex; align-items:center; gap:6px; padding:7px 12px; border-radius:999px; border:1px solid var(--line); background:var(--surface); font-size:12.5px; margin:0 6px 8px 0; cursor:pointer; user-select:none; }

  .label-edit-overlay{ position:absolute; inset:0; z-index:9; background:rgba(0,0,0,0); display:flex; align-items:center; justify-content:center; opacity:0; pointer-events:none; transition:opacity .25s, background .25s; padding:24px; }
  .label-edit-overlay.show{ opacity:1; pointer-events:auto; background:rgba(0,0,0,0.55); }
  .label-edit-card{ background:var(--surface); border-radius:26px; padding:22px; width:100%; max-width:280px; box-shadow:8px 12px 0 0 rgba(var(--shadow-color),0.28); transform:scale(0.85); transition:transform .25s cubic-bezier(.34,1.56,.64,1); }
  .label-edit-overlay.show .label-edit-card{ transform:scale(1); }
  .label-edit-preview{ width:72px; height:72px; border-radius:50%; margin:0 auto 16px; display:flex; align-items:center; justify-content:center; font-size:32px; color:#fff; }
  #labelEditName{ display:block; width:100%; border:1px solid var(--line); background:var(--bg); color:var(--ink); border-radius:12px; padding:10px 12px; font-family:"Noto Sans JP"; font-size:14px; margin-bottom:12px; text-align:center; }
  .btn-delete-soft{ display:block; width:100%; text-align:center; padding:11px; border-radius:999px; border:none; background:color-mix(in srgb, var(--bad) 22%, var(--surface)); color:var(--bad); font-weight:700; font-size:13.5px; cursor:pointer; margin-top:10px; }

  .captured-photo-mock{ position:relative; border-radius:20px; overflow:hidden; margin:10px 0 14px; }
  .captured-photo-mock .illus{ margin:0; height:140px; }
  .captured-photo-badge{ position:absolute; left:10px; bottom:10px; background:rgba(0,0,0,0.55); color:#fff; font-size:10.5px; padding:5px 10px; border-radius:999px; font-family:"Noto Sans JP"; }

  .feature-box{ position:relative; border:1px solid var(--line); border-radius:20px; padding:14px 44px 14px 16px; background:var(--surface); margin:0 0 16px; }
  .feature-row{ display:flex; justify-content:space-between; align-items:center; font-size:13px; padding:5px 0; gap:10px; }
  .feature-label{ color:var(--ink-faint); font-family:"IBM Plex Mono",monospace; font-size:11px; flex-shrink:0; }
  .feature-value{ font-weight:700; text-align:right; }
  .feature-value input{ width:120px; text-align:right; border:1px solid var(--line); border-radius:10px; padding:4px 8px; font-size:13px; background:var(--bg); color:var(--ink); font-family:"Noto Sans JP"; }
  .feature-edit-btn{ position:absolute; right:10px; bottom:10px; width:30px; height:30px; border-radius:50%; border:1px solid var(--line); background:var(--surface-2); cursor:pointer; font-size:13px; color:var(--ink-soft); }
  .feature-edit-btn.editing{ background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }

  #labelComment{ width:100%; border:1px solid var(--line); background:var(--surface); color:var(--ink); border-radius:14px; padding:11px 13px; font-family:"Noto Sans JP"; font-size:13.5px; resize:vertical; margin-top:8px; }
  .comment-hint{ font-size:11px; color:var(--ink-faint); line-height:1.6; margin:6px 0 0; }

  .list-header-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
  .filter-toggle-btn{ flex-shrink:0; width:38px; height:38px; border-radius:14px; border:1px solid var(--line); background:var(--surface); color:var(--ink-soft); font-size:15px; cursor:pointer; margin-top:14px; }
  .filter-toggle-btn.active{ background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }

  .rank-hint{ font-size:11px; color:var(--ink-faint); line-height:1.7; margin:12px 0 0; }

  .prev-record-box{ border:1px solid var(--line); border-radius:20px; padding:16px; background:var(--surface-2); margin-top:8px; }
  .prev-date{ font-family:"IBM Plex Mono",monospace; font-size:11px; color:var(--ink-faint); margin:0 0 8px; }
  .prev-record-name{ font-family:"Zen Kaku Gothic New",sans-serif; font-size:16px; font-weight:700; margin:0 0 8px; }
  .prev-comment{ font-size:13.5px; color:var(--ink); line-height:1.7; margin:0 0 10px; white-space:pre-wrap; }
  .prev-labels{ display:flex; flex-wrap:wrap; gap:6px; }
  .mini-label-chip{ display:inline-flex; align-items:center; gap:4px; padding:4px 10px; border-radius:999px; font-size:11px; background:color-mix(in srgb, var(--chip-color) 18%, var(--surface)); color:var(--chip-color); border:1px solid var(--chip-color); }

  .recorded-confirm{ text-align:center; padding:26px 10px 10px; }
  .recorded-mark{ font-size:46px; margin:0 0 6px; }
  .recorded-count{ font-size:13.5px; color:var(--ink-soft); margin:0; }
  .recorded-count strong{ font-family:"Zen Kaku Gothic New",sans-serif; font-size:21px; color:var(--accent); font-weight:900; }

  .episode-bubble-wrap{ position:relative; }
  .episode-bubble{ position:relative; background:var(--surface-2); border:1px solid var(--line); border-radius:20px; padding:16px; margin-top:12px; text-align:center; }
  .episode-bubble::before{ content:""; position:absolute; top:-9px; left:32px; width:16px; height:16px; background:var(--surface-2); border-left:1px solid var(--line); border-top:1px solid var(--line); transform:rotate(45deg); }
  .episode-bubble-title{ font-family:"Zen Kaku Gothic New",sans-serif; font-size:15px; font-weight:700; line-height:1.5; margin:0; }

  .capture-loading{ text-align:center; padding:50px 20px; }
  .spinner{ width:40px; height:40px; margin:0 auto 18px; border-radius:50%; border:3px solid var(--line); border-top-color:var(--accent); animation:spin .8s linear infinite; }
  @keyframes spin{ to{ transform:rotate(360deg); } }
  .capture-loading p{ color:var(--ink-soft); font-size:13.5px; }
  .loading-icons{ display:flex; justify-content:center; align-items:flex-end; gap:20px; margin-bottom:22px; }
  .loading-icons span{ font-size:46px; display:inline-block; animation:wobble 0.9s ease-in-out infinite; transform-origin:bottom center; }
  .loading-icons span:nth-child(2){ animation-delay:0.32s; }
  @keyframes wobble{
    0%,100%{ transform:rotate(-14deg); }
    50%{ transform:rotate(14deg); }
  }

  .candidate-item{ display:flex; justify-content:space-between; align-items:center; width:100%; text-align:left; padding:13px 15px; border-radius:18px; border:1px solid var(--line); background:var(--surface); cursor:pointer; margin-bottom:10px; box-shadow:3px 4px 0 0 rgba(var(--shadow-color),0.12); }
  .candidate-item strong{ font-family:"Zen Kaku Gothic New",sans-serif; font-weight:700; font-size:15px; }
  .candidate-item span{ font-size:11px; color:var(--ink-faint); display:block; margin-top:2px; }

  .btn{ display:inline-flex; align-items:center; justify-content:center; gap:6px; font-family:"Zen Kaku Gothic New",sans-serif; font-weight:700; font-size:14px; padding:13px 18px; border-radius:999px; border:none; cursor:pointer; width:100%; background:var(--accent); color:var(--accent-ink); box-shadow:4px 6px 0 0 color-mix(in srgb, var(--accent) 60%, black 25%); transform:translateY(0); transition:transform .08s ease, box-shadow .08s ease; }
  .btn:active{ transform:translate(3px,5px); box-shadow:1px 1px 0 0 color-mix(in srgb, var(--accent) 60%, black 25%); }
  .btn.ghost{ background:transparent; border:1.5px solid var(--accent-2); color:var(--accent-2); box-shadow:3px 4px 0 0 color-mix(in srgb, var(--accent-2) 35%, transparent); }
  .btn.ghost:active{ box-shadow:1px 1px 0 0 color-mix(in srgb, var(--accent-2) 35%, transparent); }
  .episode-list-cta{ border:1px solid var(--accent-2); color:var(--accent-2); background:var(--surface-2); font-weight:700; box-shadow:none; }

  .camera-viewfinder{ position:relative; height:340px; border-radius:24px; background:linear-gradient(160deg, #17211f, #1f302c); margin:14px 0 26px; display:flex; align-items:center; justify-content:center; overflow:hidden; }
  .camera-frame{ width:68%; height:52%; border:2px solid rgba(255,255,255,0.55); border-radius:16px; }
  .camera-hint{ position:absolute; bottom:16px; left:0; right:0; text-align:center; color:rgba(255,255,255,0.78); font-size:12px; font-family:"Noto Sans JP"; }
  .shutter-btn{ width:64px; height:64px; border-radius:50%; background:var(--accent); border:5px solid var(--surface-2); box-shadow:0 0 0 2px var(--accent), 4px 6px 0 0 color-mix(in srgb, var(--accent) 60%, black 25%); display:block; margin:0 auto; cursor:pointer; transition:transform .08s ease; }
  .shutter-btn:active{ transform:translate(3px,5px); }

  .title-screen{ position:absolute; inset:0; z-index:10; background:var(--accent); display:flex; align-items:center; justify-content:center; cursor:pointer; transition:opacity .5s ease; }
  .title-screen.hide{ opacity:0; pointer-events:none; }
  .title-screen-inner{ text-align:center; padding:0 30px; }
  .title-eyebrow{ font-family:"IBM Plex Mono",monospace; font-size:11px; letter-spacing:0.16em; text-transform:uppercase; color:rgba(255,255,255,0.75); margin:0 0 10px; }
  .title-main{ font-family:"Zen Kaku Gothic New",sans-serif; font-weight:900; font-size:38px; color:#fff; margin:0 0 10px; }
  .title-sub{ font-size:14px; color:rgba(255,255,255,0.92); margin:0 0 36px; line-height:1.6; }
  .title-tap-hint{ font-family:"IBM Plex Mono",monospace; font-size:11px; letter-spacing:0.08em; color:rgba(255,255,255,0.75); }

  .filter-row{ display:flex; gap:8px; margin-bottom:14px; overflow-x:auto; }
  .filter-chip{ flex-shrink:0; font-family:"IBM Plex Mono",monospace; font-size:11.5px; padding:7px 13px; border-radius:999px; border:1px solid var(--line); background:var(--surface); color:var(--ink-soft); cursor:pointer; }
  .filter-chip.active{ background:var(--ink); color:var(--bg); border-color:var(--ink); }

  /* ホーム（撮影だけの画面） */
  .capture-home{ display:flex; flex-direction:column; justify-content:center; min-height:60vh; gap:10px; }

  /* 飲んだお酒＝棚ビュー（ボトルが並ぶイメージ、仮デザイン） */
  .shelf-row{ display:flex; gap:14px; padding:10px 2px 0; justify-content:flex-start; flex-wrap:nowrap; }
  .shelf-board{
    height:10px; margin:10px -2px 20px; border-radius:4px;
    background:linear-gradient(180deg, #A9723F 0%, #8A5A2E 60%, #6E4423 100%);
    box-shadow:0 3px 0 rgba(0,0,0,0.12), 0 8px 12px -8px rgba(0,0,0,0.4);
  }
  .bottle-item{
    position:relative; flex:0 0 auto; width:64px; display:flex; flex-direction:column; align-items:center; gap:4px;
    background:none; border:none; cursor:pointer; padding:2px; border-radius:12px;
  }
  .bottle-item.selected{ background:var(--surface-2); }
  .bottle-illus{ width:44px; height:80px; display:block; }
  .bottle-illus svg{ width:100%; height:100%; display:block; }
  .bottle-name{ font-size:10px; color:var(--ink-soft); text-align:center; line-height:1.3; max-width:64px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .bottle-badges{ position:absolute; top:0; right:4px; display:flex; flex-direction:column; gap:2px; z-index:2; }
  .bottle-badge{
    width:16px; height:16px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    font-size:9px; color:#fff; box-shadow:0 1px 2px rgba(0,0,0,0.3); border:1px solid rgba(255,255,255,0.6);
  }
  .bottle-detail-card{
    margin-top:8px; border:1px solid var(--line); background:var(--surface); border-radius:18px; padding:14px 16px;
    box-shadow:4px 6px 0 0 rgba(var(--shadow-color),0.12);
  }

  .record-card{ position:relative; border:1px solid var(--line); background:var(--surface); border-radius:20px; padding:13px 14px; margin-bottom:10px; box-shadow:3px 4px 0 0 rgba(var(--shadow-color),0.1); }
  .record-card.is-read{ background:var(--surface-2); box-shadow:none; }
  .record-card-body{ display:flex; gap:12px; align-items:flex-start; }
  .record-thumb{ width:48px; height:48px; border-radius:14px; overflow:hidden; flex-shrink:0; border:1px solid var(--line); }
  .record-thumb svg{ width:100%; height:100%; display:block; }
  .record-main{ flex:1; min-width:0; }
  .record-top{ display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
  .record-top strong{ font-family:"Zen Kaku Gothic New",sans-serif; font-size:15.5px; font-weight:700; }
  .record-type{ font-size:11.5px; color:var(--ink-faint); margin-top:2px; }
  .record-episode-row{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:6px; padding:6px 8px; background:var(--surface-2); border-radius:10px; border:none; width:100%; text-align:left; cursor:pointer; font-family:"Noto Sans JP"; }
  .record-episode-title{ font-size:12px; color:var(--accent-2); font-weight:600; }
  .record-episode-labels{ display:flex; flex-wrap:wrap; gap:4px; }
  .record-source{ font-family:"IBM Plex Mono",monospace; font-size:9.5px; color:var(--ink-faint); margin-top:8px; }

  .label-chip-row{ display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
  .label-chip{ display:inline-flex; align-items:center; gap:6px; padding:8px 12px; border-radius:999px; border:1px solid var(--line); background:var(--surface); color:var(--ink-soft); font-family:"Noto Sans JP"; font-size:12.5px; cursor:pointer; }
  .label-chip .lc-shape{ display:inline-flex; width:16px; height:16px; align-items:center; justify-content:center; border-radius:50%; background:var(--chip-color, var(--accent)); color:#fff; font-size:9px; flex-shrink:0; }
  .label-chip.on{ border-color:var(--chip-color, var(--accent)); background:color-mix(in srgb, var(--chip-color, var(--accent)) 18%, var(--surface)); color:var(--ink); font-weight:600; }
  .label-chip-add{ border-style:dashed; color:var(--ink-faint); background:transparent; }
  .label-chip.static{ cursor:default; }
  .label-collapsible-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
  .label-collapsible-head .label-chip-row.static-chips{ margin-top:0; flex:1; }
  .label-toggle-btn{ flex-shrink:0; width:28px; height:28px; border-radius:10px; border:1px solid var(--line); background:var(--surface); color:var(--ink-soft); cursor:pointer; font-size:10px; }
  .label-collapsible-wrap{ margin-top:8px; }

  .label-create-form{ width:100%; margin-top:10px; padding:12px; border:1px solid var(--line); border-radius:18px; background:var(--surface-2); }
  .label-create-form input{ width:100%; padding:9px 11px; border-radius:12px; border:1px solid var(--line); background:var(--surface); color:var(--ink); font-family:"Noto Sans JP"; font-size:13px; margin-bottom:10px; }
  .label-picker-caption{ font-size:11px; color:var(--ink-faint); margin:0 0 6px; }
  .both-pool-check{ display:flex; align-items:center; gap:6px; font-size:12px; color:var(--ink-soft); margin:12px 0 0; }
  .both-pool-check input{ width:15px; height:15px; }
  .shape-row, .color-row{ display:flex; gap:8px; margin-bottom:10px; }
  .shape-swatch{ width:32px; height:32px; border-radius:50%; border:1px solid var(--line); background:var(--surface); cursor:pointer; font-size:14px; }
  .shape-swatch.on{ border-color:var(--accent); border-width:2px; }
  .color-swatch{ width:26px; height:26px; border-radius:50%; border:2px solid transparent; cursor:pointer; }
  .color-swatch.on{ border-color:var(--ink); }

  .stamp-overlay{ position:absolute; inset:0; background:rgba(0,0,0,0); display:flex; align-items:center; justify-content:center; opacity:0; pointer-events:none; transition:opacity .2s, background .2s; z-index:5; }
  .stamp-overlay.show{ opacity:1; background:rgba(0,0,0,0.5); }
  .stamp-sticker{
    width:96px; height:96px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:44px; color:#fff;
    transform:translateY(-60px) rotate(-10deg) scale(0.9); box-shadow:4px 6px 0 0 rgba(0,0,0,0.35);
    transition:transform .38s cubic-bezier(.3,1.4,.4,1);
  }
  .stamp-overlay.show .stamp-sticker{ transform:translateY(0) rotate(-4deg) scale(1); }

  .toast{ position:absolute; left:20px; right:20px; bottom:86px; text-align:center; background:var(--ink); color:var(--bg); font-family:"Zen Kaku Gothic New",sans-serif; font-weight:700; font-size:13px; padding:11px 14px; border-radius:999px; opacity:0; transform:translateY(6px); transition:opacity .2s, transform .2s; pointer-events:none; z-index:6; }
  .toast.show{ opacity:1; transform:translateY(0); }

  @media (prefers-reduced-motion: reduce){ .spinner{ animation:none; border-top-color:var(--line); } .toast{ transition:none; } .stamp-sticker{ transition:none; } .loading-icons span{ animation:none; } .title-screen{ transition:none; } .capture-btn, .btn, .shutter-btn{ transition:none; } }

  @media (min-width: 431px){
    body{ padding:24px 0; }
    .phone{ min-height:0; width:min(392px, 92vw); height:min(800px, 82vh); border-radius:44px; border:1px solid var(--line); box-shadow:var(--shadow); padding:14px; overflow:hidden; }
    .phone-screen{ min-height:0; height:100%; border-radius:32px; }
  }
