  :root{
    --bg:        #0a0a0b;
    --surface:   #131315;
    --surface-2: #1b1b1e;
    --line:      #26262a;
    --line-soft: #1d1d20;
    --text:      #f1f1ef;
    --text-dim:  #d1d1d1;
    --text-faint:#b3b3b3;
    --accent:    #9d6fff;
    --accent-dim:#6b46c2;
    --accent-wash:#1c1626;
    --danger:    #e5484d;
    --warn:      #f5b942;

    --font-ui:   'Instrument Sans', -apple-system, sans-serif;
    --font-mono: 'Space Mono', ui-monospace, monospace;

    --radius: 3px;
    --radius-pill: 999px;
    --nav-w: 280px;
    --side-w: 280px;
  }

  *{ box-sizing:border-box; margin:0; padding:0; }
  /* スクロールバーの領域を常に確保しておく(左右両方)。一覧の高さが変わって
     縦スクロールバーが出たり消えたりする度にレイアウト全体が左右にガクガク
     動くのを防ぐ(shellは中央寄せなので、右側だけ確保すると中央がズレるため
     both-edgesで左右対称に確保する) */
  html{ color-scheme: dark; scrollbar-gutter: stable both-edges; }
  body{
    background:var(--bg);
    color:var(--text);
    font-family:var(--font-ui);
    font-size:15px;
    line-height:1.55;
    -webkit-font-smoothing:antialiased;
  }
  a{ color:inherit; text-decoration:none; }
  button{ font-family:inherit; cursor:pointer; }
  button:disabled{ opacity:.45; cursor:not-allowed; }
  ::selection{ background:var(--accent); color:#0a0a0b; }
  :focus-visible{ outline:1.5px solid var(--accent); outline-offset:2px; }

  .shell{
    display:grid;
    grid-template-columns: var(--nav-w) minmax(0,600px) var(--side-w);
    justify-content:center;
    gap:0 32px;
    max-width:1200px;
    margin:0 auto;
    min-height:100vh;
    padding:0 24px;
  }

  .nav{
    position:sticky;
    top:0;
    align-self:start;
    height:100vh;
    display:flex;
    flex-direction:column;
    padding:28px 8px 24px;
  }
  .brand{
    font-family:"Stack Sans Notch", var(--font-mono);
    font-size:20px;
    font-weight:700;
    letter-spacing:0.05rem;
    margin-bottom:36px;
    display:flex;
    align-items:center;
    gap:8px;
  }
  .brand .dot{ width:6px; height:6px; background:var(--accent); border-radius:50%; }

  .nav-list{ list-style:none; display:flex; flex-direction:column; gap:2px; }
  /* PC幅では.sideに検索フォームが常設されるため不要、タブレット幅の@media内でのみ表示する */
  .tablet-search-toggle{ display:none; }
  .nav-link{
    display:flex;
    align-items:center;
    gap:14px;
    padding:11px 12px;
    border-radius:var(--radius);
    color:var(--text-dim);
    font-size:15px;
    font-weight:500;
    position:relative;
    /* #mobile-search-toggleのように<button>で.nav-linkを使う場合でも<a>と
       見た目が完全に一致するよう、ブラウザ既定のbutton装飾を明示的に打ち消す */
    background:none;
    border:none;
    width:100%;
    text-align:left;
    font-family:inherit;
  }
  .nav-link svg{ width:19px; height:19px; flex-shrink:0; }
  /* 通知の未読バッジ(#3)。アイコンだけの表示幅でも見えるようアイコンの右上に重ねる */
  .nav-badge{
    position:absolute; top:4px; left:24px;
    min-width:17px; height:17px; padding:0 5px;
    border-radius:var(--radius-pill); background:var(--accent); color:#fff;
    font-size:10.5px; font-weight:700; line-height:17px; text-align:center;
  }
  .mobile-topbar-bell{ width:auto; padding:6px; }
  .mobile-topbar-bell[hidden]{ display:none; }
  .mobile-topbar-bell .nav-badge{ top:0; left:18px; }
  .nav-link:hover{ color:var(--text); }
  .nav-link.active{ color:var(--text); }
  .nav-link.active::before{
    content:"";
    position:absolute;
    left:-8px; top:50%;
    width:3px; height:14px;
    background:var(--accent);
    transform:translateY(-50%);
  }

  .login-banner{
    margin-top:16px;
    padding:12px;
    border:1px solid var(--line);
    border-radius:var(--radius);
    font-size:12.5px;
    color:var(--text-faint);
    line-height:1.6;
  }
  .login-banner a{ color:var(--accent); font-weight:700; }

  .nav-user{
    margin-top:auto;
    display:flex;
    align-items:center;
    gap:10px;
    padding:12px;
    border:1px solid var(--line-soft);
    border-radius:var(--radius);
  }
  .avatar{
    display:inline-block;
    width:34px; height:34px;
    border-radius:50%;
    background:var(--surface-2);
    border:1px solid var(--line);
    flex-shrink:0;
    overflow:hidden;
  }
  .avatar-img{
    display:block;
    width:100%; height:100%;
    object-fit:cover;
  }
  .avatar-fallback-icon{
    display:flex;
    align-items:center;
    justify-content:center;
    width:100%; height:100%;
    background:var(--surface-2);
    color:var(--text-faint);
  }
  .avatar-fallback-icon .material-symbols-outlined{
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-size: 70%; /* .avatarの大きさに対する比率。user-profile-avatar(80px)側でも自然に大きくなる */
  }
  .nav-user .who{ font-size:13.5px; font-weight:600; line-height:1.3; }
  .nav-user .handle{ font-family:var(--font-mono); font-size:11.5px; color:var(--text-faint); }

  /* モバイル幅(<=720px)専用のヘッダー/下部タブバー。.nav/.sideごと非表示になる代わりに
     表示する。PC幅ではdisplay:noneのまま(@media内でのみdisplayを与える) */
  .mobile-topbar{
    display:none;
    align-items:center;
    justify-content:space-between;
    padding:14px 16px;
    border-bottom:1px solid var(--line-soft);
  }
  .mobile-topbar .brand{ margin-bottom:0; font-size:17px; cursor:pointer; }
  .mobile-topbar-right{ display:flex; align-items:center; gap:10px; }
  .mobile-topbar-who{ font-size:13px; font-weight:600; color:var(--text-dim); }
  .mobile-tabbar{
    display:none;
    align-items:center;
    justify-content:space-around;
    height:60px;
    background:rgba(10,10,11,.92);
    backdrop-filter:blur(10px);
    border-top:1px solid var(--line-soft);
  }
  .mobile-tabbar .nav-link{
    flex-direction:column;
    gap:2px;
    padding:0;
    font-size:10px;
    line-height:1.2;
    flex:1;
    height:100%;
    justify-content:center;
  }
  .mobile-tabbar .nav-link svg{ width:20px; height:20px; }
  .mobile-tabbar .nav-link.active{ color:var(--accent); }
  .mobile-tabbar .nav-link.active::before{ content:none; } /* サイドバー用の左端インジケーターは付けない */

  .feed{
    border-left:1px solid var(--line-soft);
    border-right:1px solid var(--line-soft);
    min-height:100vh;
  }
  .feed-header{
    position:sticky;
    top:0;
    background:rgba(10,10,11,.88);
    backdrop-filter:blur(10px);
    border-bottom:1px solid var(--line-soft);
    padding:16px 20px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    z-index:10;
  }
  .feed-header h1{ font-size:17px; font-weight:700; cursor:pointer; }
  .feed-header .count{ font-family:var(--font-mono); font-size:11px; color:var(--text-faint); }
  /* ホームの「新しい投稿」ピル。見出しのすぐ下にスクロールしても付いてくる(X/Twitterの新着ピルに寄せた) */
  .new-posts-pill-wrap{
    position:sticky;
    top:62px; /* .feed-header(sticky)の高さぶん下げる */
    z-index:9;
    height:0; /* 一覧を押し下げない */
    display:flex;
    justify-content:center;
  }
  .new-posts-pill-wrap[hidden]{ display:none; }
  .new-posts-pill{
    display:flex; align-items:center; gap:8px;
    margin-top:10px;
    padding:6px 16px 6px 12px;
    background:var(--accent);
    color:#fff;
    border:none;
    border-radius:var(--radius-pill);
    font-size:14px; font-weight:700;
    box-shadow:0 4px 12px rgba(0,0,0,.4);
  }
  .new-posts-pill:hover{ opacity:.9; }
  .new-posts-pill svg{ width:16px; height:16px; }
  .new-posts-pill-avatars{ display:flex; }
  .new-posts-pill-avatars .avatar{ width:22px; height:22px; border:2px solid var(--accent); }
  .new-posts-pill-avatars .avatar + .avatar{ margin-left:-8px; }

  .composer{
    padding:18px 20px;
    border-bottom:1px solid var(--line-soft);
  }
  .composer-head{ display:flex; align-items:center; gap:10px; margin-bottom:12px; }
  .composer-head .who{ font-size:13.5px; font-weight:600; }
  .drop-zone{
    display:flex;
    flex-direction:column;
    align-items:center;
    width:100%;
    border:1.5px dashed var(--line);
    border-radius:var(--radius);
    padding:28px 16px;
    text-align:center;
    color:var(--text-faint);
    margin-top:14px;
    cursor:pointer;
    transition:border-color .15s ease, color .15s ease, background .15s ease;
  }
  .drop-zone:hover, .drop-zone.dragover{ border-color:var(--accent); color:var(--text-dim); background:var(--accent-wash); }
  .drop-zone svg{ width:26px; height:26px; margin-bottom:8px; stroke:currentColor; }
  .drop-zone .hint{ font-size:13px; font-weight:600; }
  .drop-zone .sub{ font-family:var(--font-mono); font-size:11px; margin-top:3px; color:var(--text-faint); }
  .drop-zone .filename{ font-family:var(--font-mono); font-size:11.5px; margin-top:6px; color:var(--accent); word-break:break-all; }

  /* 画像選択後: Twitter/Xの投稿プレビューに寄せた16:9の角丸カード表示に切り替える */
  .drop-zone.has-image{
    display:block;
    border:none;
    border-radius:16px;
    padding:0;
    background:var(--surface-2);
    overflow:hidden;
  }
  .preview-frame{
    position:relative;
    width:100%;
    aspect-ratio:16/9;
    overflow:hidden;
    border-radius:16px;
  }
  .preview-frame .preview-img{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    object-fit:cover;
  }
  .preview-remove{
    position:absolute;
    top:8px; right:8px;
    width:32px; height:32px;
    display:flex; align-items:center; justify-content:center;
    background:rgba(15,20,25,.75);
    backdrop-filter:blur(4px);
    border:none;
    border-radius:50%;
    color:#fff;
  }
  .preview-remove:hover{ background:rgba(15,20,25,.9); }
  .preview-remove svg{ width:16px; height:16px; margin:0; }
  .drop-zone.has-image .filename{ padding:8px 12px 10px; margin-top:0; text-align:left; }
  /* テキストエリアと同じグリッドセルに重ねて表示することで、絶対配置のずれ(パディング差等)を
     気にせず高さを常に一致させる(grid-areaで重ね書きする定番テクニック) */
  .desc-highlight-wrap{ display:grid; }
  .desc-highlight, .description-input{ grid-area:1/1/2/2; }
  .desc-highlight{
    margin:0;
    padding:0;
    font-family:var(--font-ui);
    font-size:15px;
    line-height:1.4;
    white-space:pre-wrap;
    word-wrap:break-word;
    overflow:hidden;
    pointer-events:none;
    color:var(--text);
  }
  .desc-highlight .hashtag{ color:var(--accent); }
  .description-input{
    width:100%;
    background:transparent;
    border:none;
    color:transparent;
    caret-color:var(--text);
    font-family:var(--font-ui);
    font-size:15px;
    line-height:1.4;
    resize:none;
    overflow:hidden; /* 高さはJS側でscrollHeightに合わせて自動調整するのでスクロールバー不要 */
    min-height:calc(1em * 1.4 * 1.5); /* 初期表示は1.5行分 */
  }
  .description-input::placeholder{ color:var(--text-faint); }
  .description-counter{
    text-align:right;
    font-family:var(--font-mono);
    font-size:11px;
    color:var(--text-faint);
    margin-top:2px;
  }
  .description-counter.over-limit{ color:var(--danger); }
  .visibility-row{
    display:flex;
    align-items:center;
    gap:6px;
    margin-top:10px;
    color:var(--text-faint);
  }
  .visibility-row svg{ width:14px; height:14px; flex-shrink:0; }
  .visibility-select{
    background:var(--surface-2);
    border:1px solid var(--line);
    color:var(--text-dim);
    font-family:var(--font-mono);
    font-size:12px;
    padding:4px 8px;
    border-radius:var(--radius-pill);
    cursor:pointer;
  }
  .visibility-select:hover{ border-color:var(--accent); color:var(--text); }
  .folder-key-btn{
    background:none; border:1px solid var(--line);
    border-radius:var(--radius-pill);
    padding:5px 12px;
    font-family:var(--font-mono); font-size:11px;
    color:var(--text-dim);
  }
  .folder-key-btn:hover{ border-color:var(--accent); color:var(--text); }
  .world-display{
    display:flex;
    align-items:center;
    gap:6px;
    color:var(--text-dim);
    font-family:var(--font-mono);
    font-size:12.5px;
    margin-top:10px;
  }
  .world-display svg{ width:14px; height:14px; flex-shrink:0; color:var(--text-faint); }
  .visibility-row-checkbox{
    display:flex; align-items:center; gap:6px;
    color:var(--text-dim); font-size:13px;
    margin-left:auto; cursor:pointer;
  }
  .visibility-row-checkbox input{ flex-shrink:0; width:16px; height:16px; cursor:pointer; }
  /* 公開範囲とフォルダの組み合わせから「実際に見られる人」を出す1行(#6) */
  .audience-note{ margin-top:6px; font-size:12px; color:var(--text-faint); }
  .audience-note-warn{ color:var(--warn); font-weight:600; }
  /* 編集回数の案内(#10) */
  .edit-limit-note{ margin-top:6px; font-size:12px; color:var(--text-faint); }
  .edited-label{ color:var(--text-faint); }
  .composer-row{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 20px 16px; border-bottom:1px solid var(--line-soft); }
  .composer-error{ font-size:12.5px; color:var(--danger); }
  .composer-error.is-info{ color:var(--text-faint); }
  .post-btn{
    padding:8px 18px;
    background:var(--accent);
    color:var(--text);
    border:none;
    border-radius:var(--radius-pill);
    font-weight:700;
    font-size:13.5px;
    margin-left:auto;
  }
  .post-btn:hover:not(:disabled){ opacity:.9; }

  /* カード表示順: アイコン|ユーザー名|時刻 → タイトル → 説明文 → 画像 → アクション行 */
  .post{
    border-bottom:1px solid var(--line-soft);
    position:relative;
  }
  .post.is-clipped{ max-height:90vh; overflow:hidden; }
  .post-head{ display:flex; align-items:center; gap:10px; padding:14px 20px 12px; }
  .post-head .avatar{ display:inline-block; width:32px; height:32px; overflow:hidden; }
  .post-head .avatar img{ width:100%; height:100%; object-fit:cover; display:block; }
  .post-meta{ display:flex; flex-direction:column; line-height:1.25; }
  .post-meta .name{ font-weight:700; font-size:13.5px; }
  /* 名前と称号のタグ(#5)を横に並べる */
  .post-name-row{ display:flex; align-items:center; gap:6px; min-width:0; }
  .title-tag{
    display:inline-flex; align-items:center; gap:3px; flex-shrink:0;
    padding:1px 7px; border:1px solid var(--line); border-radius:var(--radius-pill);
    background:var(--surface-2); color:var(--text-dim);
    font-family:inherit; font-size:11px; font-weight:600; line-height:1.5; cursor:pointer;
  }
  .title-tag:hover{ border-color:var(--accent); color:var(--text); }
  .title-icon{ display:inline-flex; width:14px; height:14px; align-items:center; justify-content:center; font-size:12px; object-fit:cover; border-radius:2px; }
  .title-detail-name{ display:flex; align-items:center; gap:8px; font-size:16px; font-weight:700; }
  .title-detail-name .title-icon{ width:24px; height:24px; font-size:20px; }
  .title-detail-desc{ margin-top:8px; font-size:13.5px; color:var(--text-dim); }
  .title-detail-photo img{ display:block; margin-top:10px; max-width:100%; border-radius:var(--radius); }
  .title-detail-meta{ margin-top:8px; font-size:12px; color:var(--text-faint); }
  .post-meta .time{ color:var(--text-faint); font-family:var(--font-mono); font-size:11px; }

  .post-menu{ position:relative; margin-left:auto; }
  /* 三点リーダーの左の公開範囲・フォルダの印(#7) */
  .post-marks{ display:flex; align-items:center; gap:6px; margin-left:auto; color:var(--text-faint); }
  .post-marks + .post-menu{ margin-left:0; }
  .post-mark{ display:inline-flex; align-items:center; }
  .post-mark .material-symbols-outlined{ font-size:16px; }
  .kebab-btn{
    display:flex; align-items:center; justify-content:center;
    width:28px; height:28px;
    background:none; border:none; border-radius:50%;
    color:var(--text-faint);
  }
  .kebab-btn svg{ width:18px; height:18px; }
  .kebab-btn:hover{ background:var(--surface-2); color:var(--text); }
  .kebab-dropdown{
    position:absolute; top:32px; right:0; z-index:5;
    min-width:120px;
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:var(--radius);
    overflow:hidden;
  }
  .kebab-item{
    display:block; width:100%;
    padding:9px 14px;
    background:none; border:none;
    color:var(--text-dim);
    font-size:13px; text-align:left;
  }
  .kebab-item:hover{ background:var(--surface-2); color:var(--text); }
  .kebab-item.danger{ color:var(--danger); }
  .kebab-item.danger:hover{ background:var(--surface-2); color:var(--danger); }

  .post-text{ padding:0 20px; }
  .post-desc{ font-size:14px; line-height:1.55; color:var(--text); white-space:pre-wrap; word-break:break-word; }
  .post-desc.is-text-clipped{
    display:-webkit-box;
    -webkit-line-clamp:4;
    -webkit-box-orient:vertical;
    overflow:hidden;
  }
  .post-desc .hashtag{ color:var(--accent); }
  .show-more-row{ padding:6px 20px 0; }
  .show-more-btn{
    background:none; border:none; color:var(--accent);
    font-size:12.5px; font-weight:700; padding:0;
  }
  .show-more-btn:hover{ text-decoration:underline; }

  .post-photo{
    width:100%;
    margin-top:12px;
    background:var(--surface-2);
    text-align:center;
    overflow:hidden;
  }
  .photo-frame{
    display:inline-block;
    position:relative;
    overflow:hidden;
    vertical-align:top;
    /* width/heightはJS側(renderPost)でwindow.innerHeightと実画像の縦横判定から
       px値を直接計算して設定する。flexのstretch解決+aspect-ratioの組み合わせは
       ブラウザによって挙動が割れ、縦画像でも横スペースが空かないことがあったため */
  }
  .photo-frame img{ width:100%; height:100%; object-fit:cover; display:block; }
  .photo-frame::after{
    content:"";
    position:absolute; inset:0;
    background:linear-gradient(180deg, transparent 60%, rgba(0,0,0,.35) 100%);
    pointer-events:none;
  }
  .photo-tag{
    position:absolute; left:12px; bottom:12px; z-index:1;
    font-family:var(--font-mono); font-size:10.5px;
    color:rgba(255,255,255,.75);
    letter-spacing:.03em;
  }

  .r18-tag{
    flex-shrink:0;
    background:var(--danger);
    color:#fff;
    font-weight:700;
    font-size:10.5px;
    letter-spacing:.03em;
    padding:2px 6px;
    border-radius:var(--radius-pill);
  }

  .post-actions{ display:flex; align-items:center; gap:20px; padding:14px 20px 18px; }
  .post-actions button, .post-actions a{
    display:flex; align-items:center; gap:6px;
    background:none; border:none; color:var(--text-dim);
    font-family:var(--font-mono); font-size:12px;
  }
  .post-actions button.liked{ color:var(--accent); }
  .post-actions svg{ width:20px; height:20px; }
  .post-actions .like-count{ font-size:12px; }
  .post-actions button:hover:not(:disabled), .post-actions a:hover{ color:var(--text); }
  .post-actions button:disabled{ opacity:.4; cursor:not-allowed; }
  .post-actions .like-btn{margin:0 10px 0 auto; }

  .feed-empty, .feed-loading{ padding:40px 20px; color:var(--text-faint); text-align:center; font-size:13.5px; }

  /* 汎用ダイアログ(ブラウザ標準のalert/confirmは使わない) */
  .modal-overlay{
    position:fixed; inset:0; z-index:100;
    background:rgba(0,0,0,.6);
    display:flex; align-items:center; justify-content:center;
    padding:20px;
  }
  .modal_box{
    width:100%; max-width:360px;
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:8px;
    padding:20px;
  }
  /* 投稿編集など、本文入力欄が要るダイアログ用の広めのバリアント(ボタン等の見た目は共通のまま幅だけ広げる) */
  .modal_box--wide{
    max-width:520px;
  }
  .modal_title{ font-size:16px; font-weight:700; margin-bottom:8px; }
  .modal_message{ font-size:13.5px; line-height:1.6; color:var(--text-dim); white-space:pre-wrap; }
  .modal_content{ margin-top:12px; }
  .modal_content a{ color:var(--accent); text-decoration:underline; }
  .modal_actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:20px; }
  .modal_btn{
    padding:8px 18px;
    border:none; border-radius:var(--radius-pill);
    background:var(--surface-2);
    color:var(--text);
    font-size:13.5px; font-weight:700;
  }
  .modal_btn:hover{ opacity:.85; }
  .modal_btn--primary{ background:var(--accent); }
  .modal_btn--danger{ background:var(--danger); }

  /* 投稿詳細モーダル(画像をクリックすると開く。X/Twitterの画像モーダルを参考にした
     左:画像ビューア(75%) / 右:投稿詳細パネル(25%)の2カラム構成) */
  .modal_box--detail{
    position:relative;
    display:flex;
    width:92vw; max-width:1180px;
    height:88vh; max-height:88vh;
    padding:0;
    overflow:hidden;
    background:#000;
  }
  .detail-viewer{
    position:relative;
    width:75%;
    display:flex;
    flex-direction:column;
    background:#000;
    min-width:0;
  }
  .detail-close{
    position:absolute;
    top:12px; left:12px;
    z-index:2;
    width:36px; height:36px;
    display:flex; align-items:center; justify-content:center;
    background:rgba(15,20,25,.75);
    backdrop-filter:blur(4px);
    border:none; border-radius:50%;
    color:#fff;
  }
  .detail-close:hover{ background:rgba(15,20,25,.9); }
  .detail-close svg{ width:18px; height:18px; }
  .detail-canvas-wrap{
    position:relative;
    flex:1;
    min-height:0;
    overflow:hidden;
  }
  .detail-canvas-wrap canvas{
    position:absolute; inset:0;
    width:100%; height:100%;
    display:block;
    cursor:zoom-in;
  }
  .detail-canvas-wrap.is-zoomed canvas{ cursor:grab; }
  .detail-canvas-wrap.is-panning canvas{ cursor:grabbing; }
  .detail-rotate-bar{
    height:50px;
    flex-shrink:0;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:20px;
    background:rgba(255,255,255,.03);
    border-top:1px solid rgba(255,255,255,.08);
  }
  .detail-rotate-btn{
    width:34px; height:34px;
    display:flex; align-items:center; justify-content:center;
    background:none; border:none; border-radius:50%;
    color:rgba(255,255,255,.75);
  }
  .detail-rotate-btn:hover{ background:rgba(255,255,255,.1); color:#fff; }
  .detail-rotate-btn svg{ width:19px; height:19px; }

  .detail-side{
    width:25%;
    min-width:260px;
    display:flex;
    flex-direction:column;
    background:var(--surface);
    border-left:1px solid var(--line-soft);
    overflow-y:auto;
  }
  .detail-side-head{ display:flex; align-items:center; gap:10px; padding:14px 16px; }
  .detail-side-head .post-meta{ display:flex; flex-direction:column; line-height:1.25; min-width:0; }
  .detail-side-head .name{ font-weight:700; font-size:13.5px; }
  .detail-side-head .time{ color:var(--text-faint); font-family:var(--font-mono); font-size:11px; }
  .detail-side-head .post-menu{ margin-left:auto; }
  .detail-side-head .post-marks + .post-menu{ margin-left:0; }
  .detail-side-desc{
    padding:0 16px 14px;
    font-size:14px; line-height:1.55;
    color:var(--text);
    white-space:pre-wrap;
    word-break:break-word;
  }
  .detail-side-desc .hashtag{ color:var(--accent); }
  .detail-side-actions{
    display:flex; align-items:center; gap:20px;
    padding:12px 16px;
    border-top:1px solid var(--line-soft);
    border-bottom:1px solid var(--line-soft);
  }
  .detail-side-actions button, .detail-side-actions a{
    display:flex; align-items:center; gap:6px;
    background:none; border:none;
    color:var(--text-faint);
    font-family:var(--font-mono); font-size:12px;
  }
  .detail-side-actions button.liked{ color:var(--accent); }
  .detail-side-actions button:hover:not(:disabled), .detail-side-actions a:hover{ color:var(--text); }
  .detail-side-actions button:disabled{ opacity:.4; cursor:not-allowed; }
  .detail-side-actions svg{ width:20px; height:20px; }
  .detail-side-world{ padding:14px 16px; }
  .detail-world-name{
    display:block;
    font-weight:700; font-size:13.5px;
    color:var(--text);
    background:none; border:none; text-align:left;
    padding:0;
  }
  .detail-world-name:hover{ color:var(--accent); }
  .detail-world-desc{
    margin-top:6px;
    font-size:12.5px; line-height:1.6;
    color:var(--text-dim);
    white-space:pre-wrap;
    word-break:break-word;
  }

  @media (max-width: 760px){
    .modal_box--detail{
      flex-direction:column;
      width:96vw; height:92vh; max-height:92vh;
    }
    .detail-viewer{ width:100%; height:55%; }
    .detail-side{ width:100%; min-width:0; height:45%; border-left:none; border-top:1px solid var(--line-soft); }
  }

  .side{ padding:28px 8px; display:flex; flex-direction:column; gap:20px; }
  .panel{ border:1px solid var(--line-soft); border-radius:var(--radius); overflow:hidden; }
  .panel h2{ font-size:14.5px; font-weight:700; padding:14px 16px; border-bottom:1px solid var(--line-soft); }
  .panel .note{ padding:14px 16px; font-size:12.5px; color:var(--text-faint); line-height:1.7; }
  .panel .note a{ color:var(--accent); font-weight:700; }
  .panel .note ul{ margin:6px 0 0; padding-left:1.2em; }

  .footer-links{ font-size:11.5px; color:var(--text-faint); line-height:1.9; padding:0 8px; }

  @media (max-width: 1024px){
    /* ナビ項目はアイコンのみに畳むが、サイト名(.brand)は消さずに収まる幅を確保する。
       .sideの中身はtips的な補足情報でしかないため、タブレット幅では丸ごと非表示にし、
       空いた分は中央カラムへ譲る(600px上限を外しminmax(0,1fr)にする) */
    :root{ --nav-w: 128px; --side-w: 0; }
    .shell{ grid-template-columns: var(--nav-w) minmax(0,1fr); }
    .nav .brand{ justify-content:center; }
    .nav .nav-link span{ display:none; }
    .nav .nav-link span.nav-badge:not([hidden]){ display:block; }
    .nav .nav-link{ justify-content:center; }
    .nav-user .who, .nav-user .handle{ display:none; }
    .nav-user{ justify-content:center; }
    .login-banner{ display:none; }
    .side{ display:none; }
    .tablet-search-toggle{ display:flex; }
  }
  @media (max-width: 720px){
    :root{ --nav-w: 0; --side-w: 0; }
    .shell{ grid-template-columns: minmax(0,1fr); padding:0; gap:0; }
    .nav, .side{ display:none; }
    .mobile-topbar{ display:flex; }
    .mobile-tabbar{
      display:flex;
      position:fixed; left:0; right:0; bottom:0; z-index:20;
    }
    /* 下部タブバーの実際の高さぶん、最後の投稿等が隠れないよう常に余白を確保する */
    .feed{ border:none; padding-bottom:60px; }
    .feed-header{ padding:14px 16px; }
    .new-posts-pill-wrap{ top:56px; }
    .composer{ padding:16px; }
    .post-head{ padding:12px 16px 10px; }
    .post-actions{ padding:12px 16px 16px; }
    .post-text{ padding:0 16px; }
    .show-more-row{ padding:2px 16px 0; }
  }

  /* ログイン/新規登録ページ(login.html)用。ナビ・サイドが無い単独ページなので中央寄せカード1枚 */
  .auth-shell{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
  }
  .auth-card{
    width:100%; max-width:400px;
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:8px;
    padding:28px 28px 24px;
  }
  .auth-brand{
    font-family:"Stack Sans Notch", var(--font-mono);
    font-size:20px;
    font-weight:700;
    letter-spacing:0.05rem;
    display:flex;
    align-items:center;
    gap:8px;
    margin-bottom:24px;
  }
  .auth-brand .dot{ width:6px; height:6px; background:var(--accent); border-radius:50%; }
  .auth-tabs{ display:flex; gap:4px; margin-bottom:20px; border-bottom:1px solid var(--line-soft); }
  .auth-tab{
    flex:1;
    background:none; border:none;
    padding:10px 0;
    font-size:14px; font-weight:700;
    color:var(--text-faint);
    border-bottom:2px solid transparent;
    margin-bottom:-1px;
  }
  .auth-tab.active{ color:var(--text); border-bottom-color:var(--accent); }
  .auth-tab:hover:not(.active){ color:var(--text-dim); }
  .auth-panel[hidden]{ display:none; }
  .auth-field{ margin-bottom:14px; }
  .auth-field label{ display:block; font-size:12.5px; color:var(--text-faint); margin-bottom:5px; }
  .auth-field input{
    width:100%;
    background:var(--surface-2);
    border:1px solid var(--line);
    border-radius:var(--radius-pill);
    color:var(--text);
    font-size:14px;
    padding:9px 12px;
  }
  .auth-field input:focus{ border-color:var(--accent); }
  .auth-hint{ font-size:11.5px; color:var(--text-faint); margin-top:4px; line-height:1.5; }
  .auth-field-checkbox label{ display:flex; align-items:center; gap:6px; font-size:12.5px; color:var(--text-dim); margin-bottom:0; }
  .auth-field-checkbox input[type="checkbox"]{ width:auto; margin:0; }
  .auth-field-checkbox a{ color:var(--accent); font-weight:700; }
  .auth-submit{
    width:100%;
    padding:10px 0;
    background:var(--accent);
    color:var(--text);
    border:none;
    border-radius:var(--radius-pill);
    font-weight:700;
    font-size:14px;
    margin-top:6px;
  }
  .auth-submit:hover:not(:disabled){ opacity:.9; }
  .auth-error{ font-size:12.5px; color:var(--danger); margin-top:10px; line-height:1.6; }
  .auth-success{ font-size:12.5px; color:var(--accent); margin-top:10px; line-height:1.6; }
  .auth-links{ margin-top:16px; text-align:center; font-size:12.5px; }
  .auth-links a, .auth-links button.link{
    color:var(--accent); font-weight:700;
    background:none; border:none; font-size:inherit; padding:0;
  }
  .auth-links a:hover, .auth-links button.link:hover{ text-decoration:underline; }
