  /* ===== タイムテーブル（グリッド） ===== */
  #screen-timetable{ min-height:calc(100dvh - 74px); background:#FCFBF8; }
  #screen-timetable>.topbar{ background:rgba(252,251,248,.96); border-bottom-color:#E8E3DA; }
  #ttGridWrap{ background:#FCFBF8; }
  .grid-wrap{
    display:flex;
    margin:0 16px 16px;
    border:1.5px solid var(--line);
    border-radius:12px;
    overflow:hidden;
    background:#FFFDF9;
  }
  .hour-rail{
    display:flex;
    flex-direction:column;
    flex:0 0 38px;
    background:var(--paper-2);
    border-right:1.5px solid var(--line);
  }
  .hour-rail-spacer{ flex:0 0 30px; border-bottom:1.5px solid var(--line); }
  .hour-rail-marks{ position:relative; }
  .hour-mark{
    position:absolute; left:0; right:0;
    font-family:'JetBrains Mono', monospace;
    font-size:9.5px;
    color:var(--sumi);
    text-align:center;
    border-top:1px dashed var(--line);
    padding-top:2px;
  }
  .now-line{
    position:absolute;
    left:0; right:0;
    z-index:5;
    height:0;
  }
  .now-line-label{
    position:absolute;
    left:1px;
    top:-7px;
    font-family:'JetBrains Mono', monospace;
    font-size:8px;
    font-weight:700;
    color:#fff;
    background:var(--red);
    padding:1px 3px;
    border-radius:4px;
    white-space:nowrap;
  }
  .now-line-inner{
    position:absolute;
    left:0; right:0;
    height:0;
    border-top:2px dashed var(--red);
    z-index:5;
    pointer-events:none;
  }
  .grid-scroll{
    display:flex;
    overflow-x:auto;
    flex:1;
    -webkit-overflow-scrolling:touch;
  }
  .g-column{ flex:0 0 118px; border-right:1px solid var(--line); }
  .g-column.narrow{ flex:0 0 60px; }
  .g-column:last-child{ border-right:none; }
  .g-column-header{
    box-sizing:border-box;
    height:32px;
    font-family:'Zen Maru Gothic', sans-serif;
    font-weight:700;
    font-size:10.5px;
    /* 会場名の固定行は、グリッド(ブロック)の色とは別の落ち着いた色にして見やすくする。
       会場ごとの色線は廃止し、区切りは中立の薄い下線のみにする。 */
    color:var(--ink);
    background:var(--paper-2);
    border-bottom:1px solid var(--line);
    text-align:center;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0 4px;
    overflow:hidden; /* 長い会場名が枠からはみ出さないようにする */
    position:sticky;
    top:0;
    z-index:6; /* ③ 縦スクロール時、ブロックより前面に固定表示 */
  }
  /* 会場名は全文表示。長い場合はJS(fitHeaderText)でフォントを縮めて列内に収める。 */
  .g-column-header > span{
    display:block;
    overflow:hidden;
    line-height:1.15;
    max-width:100%;
    word-break:break-word;
  }

  /* ライブ名の下に出す 開催日・会場・最終更新日 の小さな行 */
  .tt-sub{
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    padding:0 16px 8px; font-size:11.5px; color:var(--sumi);
  }
  .tt-sub > span:first-child{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .tt-sub .tt-updated{ flex:0 0 auto; font-family:'JetBrains Mono', monospace; font-size:10.5px; color:#9a9488; }
  .tt-control-row{ display:flex; align-items:center; gap:8px; padding:0 16px 8px; }
  .tt-control-row .tt-group-search{ flex:1; min-width:0; height:32px; margin:0; padding:5px 9px; border:1px solid #D9DDE4; border-radius:9px; box-sizing:border-box; }
  .tt-control-row .tt-group-search input{ min-width:0; width:100%; font-size:16px; }
  .tt-control-row .tt-group-search .search-icon{ flex:0 0 auto; font-size:12px; }
  .tt-zoom-tools{ flex:0 0 auto; display:flex; align-items:center; justify-content:flex-end; gap:7px; color:#7A8190; font-size:9px; }
  .tt-zoom-tools>span{ display:none; }
  .tt-zoom-tools>div{ display:grid; grid-template-columns:28px 43px 28px; align-items:center; height:30px; overflow:hidden; border:1px solid #D9DDE4; border-radius:9px; background:#fff; box-shadow:0 1px 4px rgba(30,38,59,.04); }
  .tt-zoom-tools button{ height:30px; padding:0; border:0; background:transparent; color:#174C91; font-size:18px; font-weight:700; }
  .tt-zoom-tools button:active{ background:#EDF3FB; }
  .tt-zoom-tools button:disabled{ color:#C7CBD2; }
  .tt-zoom-tools b{ height:18px; border-right:1px solid #E2E5EA; border-left:1px solid #E2E5EA; color:#354052; text-align:center; font:700 10px/18px 'JetBrains Mono',monospace; }

  /* ===== ③-2 ライブ用タイムテーブル：position:sticky を一切使わないJS同期レイアウト =====
     角(左上)・会場ヘッダー(上)・時刻レール(左)をスクロール領域の外に置き、
     JSでスクロールに平行移動させて固定表示する。iOSのWKWebViewでも固定が外れない。 */
  .ttv-paneouter{
    position:relative;
    display:grid;
    grid-template-columns:38px 1fr;   /* 左=時刻レール / 右=本体 */
    grid-template-rows:32px 1fr;       /* 上=会場ヘッダー / 下=本体 */
    height:calc(100dvh - 216px);
    min-height:280px;
    margin:0 16px 16px;
    border:1.5px solid var(--line);
    border-radius:12px;
    overflow:hidden;
    background:#FFFDF9;
  }
  .ttv-corner{
    grid-column:1; grid-row:1; z-index:3;
    background:var(--paper-2);
    border-right:1.5px solid var(--line);
    border-bottom:1px solid var(--line);
  }
  .ttv-header{
    grid-column:2; grid-row:1; z-index:2;
    overflow:hidden;
    background:var(--paper-2);
    border-bottom:1px solid var(--line);
  }
  .ttv-header-row{ display:flex; width:max-content; height:32px; will-change:transform; }
  .ttv-hcell{
    box-sizing:border-box;
    height:32px;
    display:flex; align-items:center; justify-content:center;
    padding:0 4px;
    font-family:'Zen Maru Gothic', sans-serif;
    font-weight:700; font-size:var(--tt-header-font,10.5px); color:var(--ink);
    border-right:1px solid var(--line);
    overflow:hidden;
  }
  @media (min-width:600px){ .tt-zoom-tools>span{ display:inline; } }
  .ttv-hcell > span{ display:block; overflow:hidden; line-height:1.15; max-width:100%; word-break:break-word; text-align:center; }
  .ttv-timerail{
    grid-column:1; grid-row:2; z-index:1;
    overflow:hidden;
    background:var(--paper-2);
    border-right:1.5px solid var(--line);
  }
  .ttv-timerail-body{ position:relative; will-change:transform; }
  .ttv-pane{
    grid-column:2; grid-row:2;
    overflow:auto;
    -webkit-overflow-scrolling:touch;
    touch-action:pan-x pan-y;
    background:#FFFDF9;
  }

  /* ===== ③ ライブタイムテーブルのスクロール枠（会場名・時刻を固定表示） ===== */
  .tt-pane{
    margin:0 16px 16px;
    border:1.5px solid var(--line);
    border-radius:12px;
    overflow:auto;
    /* iOS Safari では -webkit-overflow-scrolling:touch を付けると position:sticky が
       スクロール途中で外れる（7列目以降で時刻列の固定が解除される）ため、あえて外す。
       近年のiOSは既定で慣性スクロールが効くので体感の劣化はほぼ無い。 */
    background:#FFFDF9;
    position:relative;
    /* 画面内に収め、内部スクロールで会場名(列見出し)と時刻列を固定する */
    max-height:calc(100dvh - 196px);
  }
  .tt-row{ display:flex; width:max-content; }
  /* 時刻列（横スクロールしても左に固定） */
  .tt-timecol{
    position:sticky;
    left:0;
    z-index:7;
    flex:0 0 38px;
    background:var(--paper-2);
    border-right:1.5px solid var(--line);
  }
  /* 左上の角（縦横どちらのスクロールでも固定） */
  .tt-timecol-head{
    position:sticky;
    top:0;
    z-index:8;
    height:30px;
    background:var(--paper-2);
    border-bottom:1.5px solid var(--line);
  }
  /* 列（ステージ）ごとの色えらび（新規登録画面） */
  .stage-color-row{ display:flex; align-items:center; gap:5px; flex-wrap:wrap; padding:4px 2px 2px; }
  .stage-color-label{ font-size:11px; font-weight:700; color:var(--sumi); margin-right:2px; }
  .stage-swatch{
    width:20px; height:20px; border-radius:50%; border:2px solid transparent;
    cursor:pointer; padding:0; box-sizing:border-box; position:relative;
  }
  .stage-swatch.sel{ border-color:var(--ink); box-shadow:0 0 0 1.5px #fff inset; }
  .stage-swatch.auto{
    background:conic-gradient(#3A5AAB,#1E9BAA,#2D6A4F,#7A4FB0,#8a6d1a,#3A5AAB);
    font-size:0;
  }
  /* 1枠に複数グループを入れるための行（グループ名入力を縦に並べる） */
  .slot-g-row{ display:flex; align-items:center; gap:5px; margin-bottom:3px; }
  .slot-g-row input{ flex:1; min-width:110px; }
  /* 幅の狭い端末で下書き表がはみ出す場合は横スクロールで逃がす（クリップさせない） */
  .draft-table-wrap{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .draft-table{ min-width:440px; }
  /* マイタイテ：共有メモ入力（タイムテーブルの下）＋字数カウント */
  .mytt-memo{ padding:6px 16px 4px; }
  .mytt-memo-label{ font-size:12.5px; font-weight:700; color:var(--ink); margin-bottom:6px; }
  .mytt-memo-hint{ font-weight:600; font-size:11px; color:var(--sumi); }
  .mytt-memo-input{
    width:100%; box-sizing:border-box; border:1.5px solid var(--line); border-radius:10px;
    padding:9px 11px; font-size:16px; font-family:inherit; resize:vertical; min-height:66px;
    background:#fff; color:var(--ink);
  }
  .mytt-memo-count{ text-align:right; font-size:11px; font-weight:700; color:var(--sumi); margin-top:4px; }
  .mytt-memo-count.over{ color:var(--red); }
  /* マイタイテ：画像で共有ボタン＆プレビューモーダル */
  .mytt-share-bar{ padding:2px 16px 10px; }
  .mytt-share-btn{
    width:100%; padding:11px 14px; border:none; border-radius:12px; cursor:pointer;
    background:var(--red); color:#fff; font-family:'Zen Maru Gothic',sans-serif;
    font-weight:700; font-size:14px; box-shadow:0 3px 0 rgba(0,0,0,.12);
  }
  .mytt-share-btn:active{ transform:translateY(1px); box-shadow:0 2px 0 rgba(0,0,0,.12); }
  .share-backdrop{
    position:fixed; inset:0; z-index:4000; background:rgba(20,22,30,.55);
    display:flex; align-items:flex-end; justify-content:center;
  }
  .share-modal{
    width:100%; max-width:520px; max-height:94vh; overflow-y:auto;
    background:var(--paper); border-radius:20px 20px 0 0; padding:16px 16px 22px;
    box-sizing:border-box;
  }
  @media(min-width:560px){ .share-backdrop{ align-items:center; } .share-modal{ border-radius:20px; } }
  .share-modal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
  .share-modal-title{ font-family:'Zen Maru Gothic',sans-serif; font-weight:700; font-size:16px; color:var(--ink); }
  .share-modal-close{ border:none; background:transparent; font-size:20px; color:var(--sumi); cursor:pointer; line-height:1; }
  .share-preview{ background:var(--paper-2); border-radius:14px; padding:12px; display:flex; justify-content:center; }
  .share-preview img{ max-width:100%; height:auto; border-radius:8px; box-shadow:0 6px 20px rgba(0,0,0,.14); }
  .share-memo-label{ display:block; margin:16px 2px 6px; font-size:12.5px; font-weight:700; color:var(--sumi); }
  .share-memo-input{
    width:100%; box-sizing:border-box; border:1.5px solid var(--line); border-radius:10px;
    padding:10px 12px; font-size:16px; font-family:inherit; resize:vertical; background:#fff; color:var(--ink);
  }
  .share-actions{ display:flex; gap:10px; margin-top:14px; }
  .share-actions .btn{ flex:1; }
  /* ⑦ 列並び替えボタン */
  .stage-move{ display:inline-flex; flex-direction:column; gap:1px; margin-right:2px; }
  .stage-move-btn{
    width:22px; height:16px; line-height:14px; padding:0;
    font-size:9px; border:1px solid var(--line); border-radius:4px;
    background:#fff; color:var(--sumi); cursor:pointer;
  }
  .stage-move-btn:disabled{ opacity:.3; cursor:default; }

  /* ④ 検索結果カード（Material風） */
  .result-card{
    display:flex; align-items:stretch; gap:12px;
    background:#fff; border-radius:12px;
    box-shadow:0 1px 3px rgba(26,33,56,0.12);
    padding:12px 14px; margin:0 16px 10px;
    cursor:pointer; transition:box-shadow .15s ease, transform .05s ease;
    border-left:5px solid var(--ink);
  }
  .result-card:active{ transform:scale(0.995); box-shadow:0 2px 8px rgba(26,33,56,0.18); }
  .result-card.live{ border-left-color:#3A5AAB; }
  .result-card.tokuten{ border-left-color:#2D6A4F; }
  .result-kind{
    flex:0 0 auto; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
    min-width:40px; font-size:20px;
  }
  .result-kind span{
    font-family:'Zen Maru Gothic',sans-serif; font-weight:700; font-size:10px; color:var(--sumi);
  }
  .result-main{ flex:1; min-width:0; }
  .result-name{ font-family:'Zen Maru Gothic',sans-serif; font-weight:900; font-size:15px; }
  .result-meta{ font-size:12px; color:var(--sumi); margin-top:2px; }
  .result-event{ font-size:11px; color:#9a9488; margin-top:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .result-go{ flex:0 0 auto; align-self:center; font-size:22px; color:var(--line); }
  /* タイテ内検索：ポップアップ（グループの該当枠をカード表示） */
  .ttsm-backdrop{
    position:fixed; inset:0; z-index:120; background:rgba(20,24,40,.42);
    display:flex; align-items:center; justify-content:center; padding:20px;
  }
  .ttsm{
    background:#fff; border-radius:16px; width:100%; max-width:440px; max-height:82vh;
    display:flex; flex-direction:column; overflow:hidden; box-shadow:0 12px 40px rgba(20,24,40,.28);
  }
  .ttsm-head{ padding:16px 18px 12px; border-bottom:1px solid var(--line); }
  .ttsm-title{ font-family:'Zen Maru Gothic',sans-serif; font-weight:900; font-size:19px; color:var(--ink); }
  .ttsm-body{ padding:14px 16px 4px; overflow-y:auto; flex:1; -webkit-overflow-scrolling:touch; }
  .ttsm-card{
    display:flex; align-items:center; gap:10px; border-radius:12px;
    padding:12px 14px; margin-bottom:12px; cursor:pointer;
  }
  .ttsm-card-info{ flex:1; min-width:0; }
  .ttsm-card-time{ font-family:'Zen Maru Gothic',sans-serif; font-weight:800; font-size:15px; }
  .ttsm-card-stage{ font-size:13px; margin-top:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .ttsm-mine{
    flex:0 0 auto; white-space:nowrap; background:#fff; color:var(--red);
    border-radius:999px; padding:6px 11px; font-family:'Zen Maru Gothic',sans-serif;
    font-weight:700; font-size:12px; box-shadow:0 1px 3px rgba(0,0,0,.12);
  }
  .ttsm-chev{ flex:0 0 auto; font-size:22px; opacity:.85; }
  .ttsm-foot{ padding:12px 16px 16px; border-top:1px solid var(--line); }
  .ttsm-close{
    width:100%; padding:13px; border:none; border-radius:12px; cursor:pointer;
    font-family:'Zen Maru Gothic',sans-serif; font-weight:700; font-size:15px;
    background:var(--ink); color:#fff;
  }

  /* ④ タイムテーブル遷移後のハイライト（数秒間パルス） */
  .g-block-highlight{ z-index:9 !important; animation:blockPulse .7s ease-in-out 3; }
  @keyframes blockPulse{
    0%,100%{ box-shadow:0 0 0 0 rgba(240,180,41,0); outline:3px solid rgba(240,180,41,0); outline-offset:-3px; }
    50%{ box-shadow:0 0 0 5px rgba(240,180,41,0.55); outline:3px solid var(--gold); outline-offset:-3px; }
  }
  .g-column-body{
    position:relative;
    background:transparent;
  }
  .hour-grid-line{ position:absolute; left:0; right:0; z-index:0; height:0; border-top:1px dashed rgba(74,74,74,.22); pointer-events:none; }
  .g-block{
    box-sizing:border-box;
    position:absolute;
    border-radius:6px;
    padding:var(--tt-pad-y,3px) var(--tt-pad-x,5px);
    overflow:hidden;
    /* パステルの塗りに合わせて文字は濃色。薄い枠線で白背景から分離する。 */
    color:#2B2E38;
    border:1px solid rgba(40,44,60,0.14);
    cursor:pointer;
    /* タップの手応え（押すと少し凹む）※テスト用。不要なら :active ルールごと削除 */
    transition:transform .08s ease, filter .08s ease;
  }
  .g-block:active{ transform:scale(0.94); filter:brightness(0.9); }
  /* マイタイテに追加済みのブロックは赤い外枠で示す（グリッドの塗り色には赤を使わない） */
  .g-block.mine{ outline:3px solid var(--red); outline-offset:-3px; box-shadow:0 0 0 1.5px #fff inset; }
  .g-block-time{
    font-family:'JetBrains Mono', monospace;
    font-size:var(--tt-time-font,8.5px);
    font-weight:700;
    opacity:.9;
    line-height:1.15;
  }
  .g-block-name{
    font-family:'Noto Sans JP', sans-serif;
    font-size:var(--tt-name-font,10.5px);
    font-weight:700;
    line-height:1.2;
    margin-top:1px;
  }

  .g-block-name.small{ font-size:9px; }
  .g-block.short-slot{
    padding:2px 4px;
  }
  .g-block.short-slot .g-block-time{
    font-size:var(--tt-short-time-font,7px);
    line-height:1;
  }
  .g-block.short-slot .g-block-name{
    font-size:var(--tt-short-name-font,8px);
    line-height:1.02;
    margin-top:0;
    letter-spacing:-.02em;
  }
  .g-block.short-slot .g-block-venue{
    font-size:6.5px;
    right:3px;
    bottom:2px;
    padding:0;
    max-width:70%;
  }
  /* マイタイテのブロック右下に出す会場名 */
  .g-block-venue{
    position:absolute;
    right:5px;
    bottom:3px;
    max-width:calc(100% - 10px);
    font-family:'Zen Maru Gothic', sans-serif;
    font-size:8.5px;
    font-weight:700;
    opacity:.92;
    text-align:right;
    line-height:1.1;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    text-shadow:0 1px 2px rgba(0,0,0,0.25);
    pointer-events:none;
  }
