/* ============================================================
   style_mobile.css — モバイル版 システムCSS
   レイアウト・構造・アニメーション・機能スタイル

   【このファイルについて】
   レイアウト・構造・アニメーションに関わるCSSを記述します。
   デザインの変更（色・フォント・背景・ボーダーなど）は design_mobile.css を編集してください。

   【ファイル構成】
   style_mobile.css  ← このファイル（触らない）
   design_mobile.css ← デザイン変更用（こちらを編集）
============================================================ */


/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  height: 100%;
  overflow: hidden;
}
a {
  text-decoration: none;
}
button {
  cursor: pointer;
}

/* ============================================================
   CSS変数
============================================================ */

/* ============================================================
   LAYOUT
============================================================ */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* ============================================================
   HEADER（固定）
============================================================ */
#header {
  flex-shrink: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 6px 14px 6px 6px;
  gap: 8px;
}
#header-avatar {
  width: 72px;
  height: 72px;
  overflow: hidden;
  flex-shrink: 0;
}
#header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ヘッダー右ブロック：アイコンの右側 */
#header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* 上下に振り分け */
  align-self: stretch;
  padding: 10px 10px 10px 0;
  position: relative;
  z-index: 2;
}

/* タイトルは右上 */
#header-title {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
  text-align: right;
}

/* キャッチコピーは左下 */
#header-tagline {
  font-size: 11px;
  text-align: left;
  align-self: flex-start;
}

/* ============================================================
   RESULT BAR (sticky — スクロールで一番上に固定)
============================================================ */
#result-bar {
  flex-shrink: 0;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 6px;
  position: sticky;
  top: 0;
  z-index: 50;
}

/* ナビアイコン群（左側） */
#bar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* bar-nav内の縦ラインは左右マージンで隙間を制御 */
#bar-nav #bar-nav-sep {
  margin: 0 6px;
}
.bar-nav-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease);
  flex-shrink: 0;
}

/* 区切り線 */
#bar-nav-sep {
  width: 1px;
  height: 20px;
  flex-shrink: 0;
}

/* フィルターチップ */
#filter-chips {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
#filter-chips::-webkit-scrollbar {
  display: none;
}

/* result-bar の選択タグ横スクロール */
#tag-chips-bar {
  display: flex;
  gap: 5px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  align-items: center;
}
#tag-chips-bar::-webkit-scrollbar {
  display: none;
}
.tag-bar-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}
.tag-bar-chip .chip-x {
  font-size: 13px;
  line-height: 1;
  margin-left: 1px;
}
.filter-chip {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}
.filter-chip button {
  display: flex;
  align-items: center;
  padding: 0;
  font-size: 13px;
  line-height: 1;
}
#bar-sort {
  display: none;
}

/* ============================================================
   MAIN SCROLL AREA
============================================================ */
#main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 6px 8px 80px;
}

/* ============================================================
   リンクリスト
============================================================ */
#links-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.link-row {
  padding: 8px 10px;
  display: flex;
  align-items: stretch;
  gap: 10px;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  transition: background var(--ease);
}

/* 左カラム：ファビコン＋クリック数 */
.row-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
}

/* ファビコン：タイトル行＋タグ行の高さを1辺とした正方形 */
.row-thumb {
  width: 42px;
  height: 42px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* クリック数 */
.row-clicks {
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
}

/* 右カラム：タイトル・タグ・メモ */
.row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
}

/* タイトル行 */
.row-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.row-title {
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
}
.row-dead {
  font-size: 10px;
  flex-shrink: 0;
}

/* タグ行：厳選リボンバッジ + タグ */
.row-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow: hidden;
  align-items: center;
}

/* 厳選バッジ（リボン型：左フラット・右がV字切り欠き） */
.row-gensen-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 10px 1px 7px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  /* 左フラット・右中央がへこんだリボン形状 */
  clip-path: polygon(0% 0%, 100% 0%, calc(100% - 8px) 50%, 100% 100%, 0% 100%);
}
.row-tag {
  font-size: 11px;
  padding: 1px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* メモ：2行固定 */
.row-desc {
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  min-height: calc(13px * 1.5 * 2);
}

/* ============================================================
   詳細ポップアップ（上から降りてくる）
============================================================ */
#detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  transition: opacity 0.5s ease;
}
#detail-overlay.visible {
  display: block;
}
#detail-panel {
  position: fixed;
  /* result-bar(44px)の下から始まり、search-tab(57px)の上まで */
  top: calc(var(--header-h) + var(--bar-h));
  left: 2.5%;
  right: 2.5%;
  width: 95%;
  height: calc(100dvh - var(--header-h) - var(--bar-h) - 57px);
  /* 四隅角丸 */
  z-index: 201;
  transform: translateY(calc(-100% - var(--header-h) - var(--bar-h)));
  /* 画面上に隠す */
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#detail-panel.show {
  transform: translateY(0);
}
#detail-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
}

/* リンクアイコン（右上） */
#detail-link-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
}

/* OGP左上エリア：共有アイコン＋更新日 横並び */
#detail-thumb-top-left {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  z-index: 1;
}
#detail-share-thumb {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
#detail-updated-at {
  font-size: 10px;
  white-space: nowrap;
}

/* ファビコン左カラム：ファビコン＋クリック数 */
#detail-header-favicon-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
#detail-clicks {
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
}
#detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#detail-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: absolute;
  top: 0;
  left: 0;
}
#detail-thumb-favicon {
  width: 100px;
  height: 100px;
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}
#detail-thumb-domain {
  font-size: 11px;
}
#detail-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  /* flexスクロールに必要 */
  overflow: hidden;
}

/* ファビコン＋タイトル＋URLの横並びブロック */
#detail-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  flex-shrink: 0;
}
#detail-header-favicon {
  width: 47px;
  height: 47px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#detail-header-favicon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#detail-header-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#detail-title {
  font-size: 23px;
  font-weight: 700;
  line-height: 1.4;
  /* 折り返しあり */;
}

/* URLはOGP画像エリア右下に移動（CSS）*/
#detail-url {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
  text-align: right;
  z-index: 2;
  pointer-events: none;
}
#detail-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  flex-shrink: 0;
}
.detail-tag {
  font-size: 11px;
  padding: 2px 7px;
}
#detail-desc {
  font-size: 16px;
  font-style: italic;
  line-height: 1.55;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  word-break: break-word;
  white-space: pre-wrap;
  scrollbar-width: thin;
}
#detail-desc::-webkit-scrollbar {
  width: 4px;
}
#detail-desc a {
  text-decoration: underline;
}
#detail-footer {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
#detail-open-btn {
  flex: 1;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.detail-icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ============================================================
   検索バー（下から引き上げ式）
============================================================ */
#search-handle {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  /* 初期状態：パネルをバー分だけ見せてパネルは隠す */
  transform: translateY(var(--panel-h, 100%));
  will-change: transform;
}
#search-tab {
  height: 68px;
  /* インジケーター分少し高く */
  display: flex;
  flex-direction: column;
  /* インジケーターを上、コンテンツを下 */
  align-items: stretch;
  padding: 6px 12px 10px;
  gap: 6px;
  font-size: 20px;
  font-weight: 700;
  user-select: none;
  flex-shrink: 0;
}

/* 引き上げインジケーター（ピル型バー） */
#search-drag-indicator {
  width: 40px;
  height: 4px;
  margin: 0 auto;
  flex-shrink: 0;
}

/* コンテンツ行（search-tab-left + tab-sort）横並び */
#search-tab-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
#search-tab-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
#search-tab-count {
  /* 親(#search-tab)のfont-sizeを継承 */
  font-weight: 700;
  white-space: nowrap;
}
#tab-sort {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.tab-sort-btn {
  padding: 4px 10px;
  font-size: 17px;
  /* 検索バーの20pxより少し小さく */
  font-weight: 600;
  white-space: nowrap;
}
#search-panel {
  overflow: hidden;
  height: calc(100dvh - var(--header-h) - var(--bar-h) - 57px);
  display: block;
  /* 常時表示、translateYで隠す */;
}
#search-panel-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* 検索入力 */
#search-input-wrap {
  padding: 10px 12px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* すべて・リロードボタン */
#search-login-btn, #search-reload-btn, #search-share-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--ease);
}

/* 新規登録ボタン：縦ラインの右にスペースなしでうっすら赤 */
#btn-new {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--ease);
}

/* タグエリアとの区切り縦ライン */
#bar-chips-sep {
  width: 1px;
  height: 20px;
  flex-shrink: 0;
}

/* 虫眼鏡アイコン付き検索ボックスのラッパー */
#search-input-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
#search-input-icon {
  position: absolute;
  left: 10px;
  pointer-events: none;
  display: flex;
  align-items: center;
}
#search-input {
  flex: 1;
  padding: 8px 12px 8px 34px;
  /* 左に虫眼鏡分の余白 */
  border: 1px solid var(--c-border2);
  font-size: 14px;
  outline: none;
  width: 100%;
}
#search-clear-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* フィルターモード */

/* すべて・厳選 横並び固定エリア */
#search-top-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 8px 12px;
  flex-shrink: 0;
}
#search-top-tags .search-tag-item {
  flex: 1 1 auto;
}
#search-filter-row {
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
#search-filter-label {
  font-size: 15px;
  margin-right: 6px;
}
.filter-mode-btns {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

/* 右寄せ */
.filter-mode-btn {
  padding: 4px 12px;
  font-size: 15px;
}
.filter-mode-btn.active {
  font-weight: 700;
}

/* タグ一覧：横並びフロー */
#search-tag-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-content: flex-start;
}
.search-tag-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  font-size: 19px;
  line-height: 1.2;
  transition: all var(--ease);
  cursor: pointer;
}
.search-tag-item.active {
  font-weight: 700;
}
.search-tag-divider {
  width: 100%;
  flex-basis: 100%;
  /* flex-wrap内で必ず改行して横幅いっぱいに */
  height: 1px;
  margin: 2px 0;
}
.search-tag-count {
  font-size: 13px;
  padding: 1px 6px;
}

/* ============================================================
   共有モーダル（QRコード）
============================================================ */
#share-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  visibility: hidden;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
#share-modal.show {
  visibility: visible;
}

/* 消えるとき: オーバーレイをフェードアウトしながらボックスを上へ */
#share-modal.hide {
  visibility: hidden;
}
#share-modal-box {
  width: 100%;
  max-width: 320px;
  overflow: hidden;
  transform: translateY(100vh);
  /* 初期位置: 画面下 */
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
#share-modal.show #share-modal-box {
  transform: translateY(0);
  /* 下から中央へ */;
}
#share-modal.hide #share-modal-box {
  transform: translateY(-100vh);
  /* 上へ消える */;
}
#share-modal-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#share-modal-title {
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
#share-modal-close {
  font-size: 18px;
  margin-left: 8px;
  flex-shrink: 0;
}
#share-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
#qr-canvas {
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#qr-canvas svg, #qr-canvas canvas, #qr-canvas img {
  width: 200px !important;
  height: 200px !important;
}
#share-url-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
#share-url-input {
  flex: 1;
  padding: 7px 10px;
  font-size: 11px;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#btn-copy-url {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--ease);
}

/* QR保存ボタン: アイコンボタン（URLテキストボックス左） */
#btn-qr-dl {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--ease);
}

/* 閉じるボタン（幅いっぱい） */
#share-modal-footer {
  padding: 0 16px 16px;
}
#btn-share-close {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--ease);
}

/* ============================================================
   ログインモーダル
============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show {
  display: flex;
}
.modal-box {
  width: 100%;
  max-width: 320px;
  overflow: hidden;
}
.modal-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
}
.modal-close {
  font-size: 18px;
  line-height: 1;
}
.modal-body {
  padding: 16px;
}
.form-label {
  font-size: 11px;
  margin-bottom: 4px;
  display: block;
}
.form-input {
  width: 100%;
  padding: 9px 10px;
  font-size: 14px;
  outline: none;
  margin-bottom: 10px;
}
.btn-primary {
  width: 100%;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
}

/* ============================================================
   編集パネル（下からスライドアップ）
============================================================ */
#edit-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 90dvh;
  /* 全高さ固定でスクロール可能に */
  background: var(--c-surface);
  z-index: 400;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#edit-panel.show {
  transform: translateY(0);
}
#edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 399;
  display: none;
}
#edit-overlay.show {
  display: block;
}
#edit-panel-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  flex-shrink: 0;
}
#edit-panel-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
#edit-panel-close {
  font-size: 20px;
  line-height: 1;
}
#edit-panel-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 14px;
}

/* Wiki記法入力補助ボタン */
.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}
.form-label-row .form-label {
  margin-bottom: 0;
}
.btn-wiki-insert {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.form-group {
  margin-bottom: 8px;
}
.form-label {
  font-size: 13px;
  margin-bottom: 3px;
  display: block;
}
.form-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 16px;
  outline: none;
}
.form-textarea {
  width: 100%;
  padding: 8px 10px;
  font-size: 16px;
  outline: none;
  resize: vertical;
  min-height: 112px;
  /* 約4行分 */;
}

/* URL行: テキストボックス + 取得ボタン */
.edit-url-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.edit-url-row .form-input {
  flex: 1;
}
#btn-edit-fetch {
  padding: 0 12px;
  height: 42px;
  /* form-inputと同じ高さ */
  background: var(--c-crimson);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  white-space: nowrap;
  box-sizing: border-box;
}
#btn-edit-fetch .spinner {
  width: 12px;
  height: 12px;
  animation: spin 0.7s linear infinite;
}

/* サイト名行: ファビコン + テキストボックス */
.edit-title-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.edit-title-row .form-input {
  flex: 1;
}
#edit-favicon-wrap {
  width: 42px;
  height: 42px;
  /* form-inputと同じ高さ */
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
#edit-favicon-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}
#edit-favicon-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* タグ入力 */
#edit-tag-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 16px;
  outline: none;
}
#edit-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  min-height: 0;
}
.edit-tag-chip {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 9px;
  font-size: 13px;
}
.edit-tag-chip button {
  font-size: 14px;
  line-height: 1;
}
#edit-tag-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.palette-chip {
  padding: 4px 9px;
  font-size: 13px;
}

/* OGP画像プレビュー */
#edit-thumb-area {
  width: 100%;
  overflow: hidden;
}
#edit-thumb-preview {
  width: 100%;
  display: block;
  object-fit: cover;
  max-height: 140px;
}

/* gensen チェック */
#edit-gensen-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
}
#edit-gensen-wrap input[type="checkbox"] {
  width: 20px;
  height: 20px;
}
#edit-gensen-label {
  font-size: 16px;
}
#edit-panel-footer {
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
#edit-save-btn {
  flex: 1;
  padding: 11px;
  font-size: 16px;
  font-weight: 700;
}
#edit-delete-btn {
  padding: 11px 16px;
  font-size: 16px;
}

/* ============================================================
   トースト
============================================================ */
#toast-container {
  position: fixed;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.toast {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  animation: toastIn 0.2s ease, toastOut 0.3s ease 2s forwards;
}
@keyframes toastIn  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* ============================================================
   スピナー / 空表示
============================================================ */
.spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  font-size: 13px;
  gap: 10px;
}
.spinner {
  width: 20px;
  height: 20px;
  border-top-color: var(--c-crimson);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state {
  text-align: center;
  padding: 40px 20px;
  font-size: 13px;
}
/* ============================================================
   PCバナー（PC・タブレットでモバイル版を開いた時の誘導）
============================================================ */
#pc-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  flex-shrink: 0;
}
#pc-banner.visible { display: flex; }
.pc-banner-text { flex: 1; }
.pc-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-banner-yes, .btn-banner-no {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
