/* Cafe Bowwow サイト管理 — 装飾は最小限。まずスマホで使えることを優先する。 */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #d8dce3;
  --text: #1d2129;
  --muted: #626b7a;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --danger: #b3261e;
  --ok: #1a7f37;
  --radius: 10px;
  --gap: 16px;
}

* { box-sizing: border-box; }

/* hidden 属性は UA の display:none で効くが、こちらで display を
   指定している要素（flex / grid）には負ける。まとめて優先させる。 */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ---------------------------------------------------------- ヘッダー */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  line-height: 1.2;
}
.brand span {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.account { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.avatar { border-radius: 50%; }
.login-name { color: var(--muted); }
@media (max-width: 480px) { .login-name { display: none; } }

.link-button {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tab {
  padding: 8px 14px;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab.is-active { color: var(--text); font-weight: 700; border-bottom-color: var(--accent); }

.page { max-width: 880px; margin: 0 auto; padding: 16px 16px 120px; }

/* -------------------------------------------------------- 汎用部品 */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: #eef1f5; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.button.primary:hover { background: #1a5fd0; }
.button.publish { border-color: var(--ok); color: var(--ok); font-weight: 700; }
.button.danger { border-color: var(--danger); color: var(--danger); }
.button.small { min-height: 36px; padding: 4px 12px; font-size: 13px; }
.button.large { min-height: 52px; font-size: 17px; padding: 12px 24px; }
.button.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.note, .hint { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); padding: 24px 0; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #eef1f5;
  color: var(--muted);
  white-space: nowrap;
}
.badge.draft { background: #fff4e5; border-color: #f0c98c; color: #8a5300; }
.badge.editing { background: #e8f0fe; border-color: #a9c6f7; color: #14459b; }
.badge.new { background: #e8f6ec; border-color: #a3d5b3; color: var(--ok); }

/* ------------------------------------------------------------ ログイン */

.login { max-width: 420px; margin: 8vh auto; text-align: center; }
.login h1 { font-size: 24px; line-height: 1.4; }
.login .lead { color: var(--muted); margin-bottom: 28px; }
.login .note { margin-top: 24px; }

.login-form { display: grid; gap: 14px; text-align: left; margin-bottom: 8px; }
.login-form .button { margin-top: 4px; }
.login-error {
  padding: 10px 12px;
  margin-bottom: 20px;
  text-align: left;
  color: var(--danger);
  background: #fdecea;
  border: 1px solid #f2b8b5;
  border-radius: var(--radius);
}

/* 「または」を左右の罫線で挟む */
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 14px;
}
.login-divider::before, .login-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

.error-card h1 { font-size: 20px; margin-top: 0; }
.error-message { white-space: pre-wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* -------------------------------------------------------------- 一覧 */

.list-head { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); }
.list-head h1 { font-size: 20px; }

.entry-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.entry a {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
}
.entry a:hover { border-color: var(--accent); }
.entry-title { font-weight: 700; }
.entry-meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.entry-meta code { font-size: 11px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }

/* -------------------------------------------------------------- 編集 */

.edit-head { margin-bottom: 12px; }
.back { text-decoration: none; color: var(--accent); font-size: 14px; }
.pr-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  background: #e8f0fe;
  border: 1px solid #a9c6f7;
  border-radius: var(--radius);
  font-size: 13px;
}

.editor { display: grid; gap: 20px; }
.field { display: grid; gap: 6px; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field label { font-weight: 700; font-size: 14px; }

input[type="text"], input[type="date"], input[type="url"], input[type="password"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px; /* iOS でのズームを防ぐ */
  font-family: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
textarea { resize: vertical; line-height: 1.7; }
#f-body { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.field-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ai-polish input { flex: 1 1 220px; }
.counter { font-size: 12px; color: var(--muted); }
.counter.over { color: var(--danger); font-weight: 700; }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.checkbox input { width: 20px; height: 20px; }
.thumb-row { display: flex; gap: 8px; align-items: center; }

.ai-suggestions { display: grid; gap: 6px; }
.ai-suggestions button { text-align: left; justify-content: flex-start; }


/* AI 出力 */
.ai-output {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-height: 62vh;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(0,0,0,.12);
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-output-head { display: flex; align-items: center; gap: 8px; }
.ai-output pre {
  flex: 1;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: 14px;
  background: #f2f4f7;
  border-radius: 8px;
  padding: 10px;
  min-height: 60px;
}

.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ボタンの中で回すとき。背景がボタンごとに違うので、文字色に合わせる */
.button .spinner {
  flex: 0 0 auto;
  border-color: currentColor;
  border-top-color: transparent;
}
/* 処理中のボタンは、押せないが薄くはしない（押した手応えを消さないため） */
.button.is-working:disabled { opacity: 1; }

/* 操作バー */
.sticky-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 30;
  overflow-x: auto;
}
.sticky-bar .button { flex: 1 1 auto; white-space: nowrap; }

/* 保存したがまだ公開していない、をボタンのすぐ上で知らせる（営業日） */
.sticky-bar.has-status { flex-wrap: wrap; }
.bar-status {
  flex: 0 0 100%;
  margin: 0;
  color: #9a5b00;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.sticky-bar.is-pending .button.publish { background: var(--ok); color: #fff; }

/* 画面の移動中に上端で伸びる線（押した手応え） */
.nav-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  opacity: 0;
  z-index: 100;
  transition: width .2s ease-out, opacity .2s ease;
  pointer-events: none;
}
.nav-progress.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .nav-progress { transition: none; }
}

/* ------------------------------------------------------ 公開した変更 */

.history-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
}
.history-item:hover { background: #eef1f5; }
.history-item__date {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.history-item__title { flex: 1; min-width: 12em; font-weight: 700; overflow-wrap: anywhere; }
.history-item__marks { display: flex; gap: 6px; flex-wrap: wrap; }

.history-section { margin-top: 28px; }
.history-section h2 { font-size: 16px; margin-bottom: 12px; }
/* 履歴のやり取りは読むだけ。入力欄が無いぶん詰めて出す */
.chat--past { gap: 8px; }

.commit-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.commit-list li {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.commit-list__date { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.commit-list__message { flex: 1; min-width: 12em; overflow-wrap: anywhere; }
.commit-list__author { color: var(--muted); }

/* ---------------------------------------------------------- プレビュー */

.preview-head { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); margin-bottom: 12px; }
.width-switch { display: flex; gap: 4px; }

/* いま何を見ているのか（どの変更か・公開済みか）を上に出す */
.preview-pr {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.preview-pr__main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  min-width: 0;
}
.preview-pr__main strong { font-size: 15px; }
.preview-pr__main a { font-size: 13px; color: var(--muted); }
.preview-pr .button { margin-left: auto; }
.preview-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.preview-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.preview-countdown {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.preview-bar .button { margin-left: auto; }
/* プレビューは中身が主役なので、親の最大幅を無視して画面いっぱいに使う */
.preview-page {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding-inline: 16px;
}
.preview-stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.preview-stage[data-width="sp"] { max-width: 390px; margin: 0 auto; }
.preview-stage iframe {
  display: block;
  width: 100%;
  height: calc(100vh - 260px);
  min-height: 420px;
  border: 0;
  background: #fff;
}

/* -------------------------------------------------------------- トースト */

.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  max-width: min(92vw, 560px);
  padding: 12px 16px;
  border-radius: var(--radius);
  background: #22262c;
  color: #fff;
  font-size: 14px;
  z-index: 60;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* --------------------------------------------------- デザイン編集 */

.group-title { font-size: 15px; margin: 24px 0 8px; color: var(--muted); }
.file-title { font-size: 18px; margin: 8px 0 2px; overflow-wrap: anywhere; }
textarea.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
  tab-size: 2;
}

/* ------------------------------------------------ AI アシスタント */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.assistant-head { margin-bottom: 16px; }
.assistant-head h1 { font-size: 20px; margin-bottom: 4px; }

.chat { display: grid; gap: 12px; padding-bottom: 8px; }
.chat__msg {
  max-width: min(100%, 46rem);
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.chat__msg p { margin: 0 0 8px; }
.chat__msg p:last-child { margin-bottom: 0; }
.chat__msg--user {
  margin-left: auto;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.chat__msg--status { color: var(--muted); }
.chat__msg--error { border-color: var(--danger); color: var(--danger); }

.chat__examples { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.chip {
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: 1px dashed var(--border);
  border-radius: 999px;
  background: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
}
.chip:hover { background: #eef1f5; }

.chat-form {
  position: sticky;
  bottom: 76px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 0;
  background: var(--bg);
}
.chat-form textarea { flex: 1; resize: vertical; }

/* 変更案と差分 */
.proposal { margin-top: 12px; display: grid; gap: 8px; }
.proposal__item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfd;
}
.proposal__item summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
}
.proposal__item code { font-size: 12px; overflow-wrap: anywhere; }
.proposal__note { color: var(--muted); }

.diff {
  margin: 0;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
}
.diff__line { padding: 0 12px; white-space: pre; }
.diff__line--add { background: #e6ffec; color: #04620f; }
.diff__line--del { background: #ffebe9; color: #82071e; }
.diff__line--hunk { color: var(--muted); background: #f2f4f7; }

/* 添付ファイル */

.chat-form { flex-direction: column; align-items: stretch; }
.chat-form__row { display: flex; gap: 8px; align-items: flex-end; }
.chat-form__row textarea { flex: 1; }
.chat-form.is-dragover {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius);
}

.attach-button {
  min-width: 44px;
  padding: 0 12px;
  font-size: 20px;
  line-height: 1;
}

.attachments {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0;
}
.attachment {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
}
.attachment img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 50%;
}
.attachment .doc-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef1f5;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}
.attachment button {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
}
.attachment button:hover { color: var(--danger); }

.chat__msg .attachments { margin-top: 8px; margin-bottom: 0; }

/* 前回までのやり取り（復元したもの）は少し控えめに */
.chat__msg--past { opacity: .72; }
.chat__msg--user.chat__msg--past { opacity: .85; }

/* 作業（会話）の切り替え */

.workspaces {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.workspaces__label { font-size: 12px; color: var(--muted); }
.workspaces__list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}
.workspace {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 22rem;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.workspace:hover { border-color: var(--accent); }
.workspace.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.workspace__pr { color: var(--muted); font-size: 11px; }
.workspaces__list li { display: flex; align-items: center; gap: 2px; }
.workspace__remove {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  font-size: 14px; line-height: 1; padding: 4px 6px;
}
.workspace__remove:hover { color: var(--danger, #b3261e); }

/* 操作バーに「どの作業か」を出す */

.action-bar {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.action-bar__context {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  min-width: 0;
}
.action-bar__label {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff4e5;
  border: 1px solid #f0c98c;
  color: #8a5300;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.action-bar__context strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.action-bar__context a { flex: none; font-size: 12px; }
.action-bar__buttons { display: flex; gap: 8px; overflow-x: auto; }
.action-bar__buttons .button { flex: 1 1 auto; white-space: nowrap; }

/* 変更内容（PR の差分） */

.changes-dialog {
  width: min(100vw - 2rem, 60rem);
  max-height: 84vh;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}
.changes-dialog::backdrop { background: rgba(0, 0, 0, .4); }
.changes-dialog__head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
#changes-body { padding: 12px 16px 20px; overflow-y: auto; max-height: calc(84vh - 60px); }
.change-file { margin-bottom: 12px; border: 1px solid var(--border); border-radius: 8px; }
.change-file summary {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
}
.change-file code { font-size: 12px; overflow-wrap: anywhere; }
.change-stat { color: var(--muted); font-size: 12px; }
.change-stat .add { color: var(--ok); }
.change-stat .del { color: var(--danger); }

/* 営業日カレンダー */
.cal-palette { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-brush { gap: 6px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-head strong { font-size: 17px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-weekday, .cal-cell {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.cal-weekday { min-height: 36px; font-size: 13px; font-weight: 700; }
.cal-cell { display: grid; justify-items: center; align-content: start; gap: 0; min-height: 76px; padding: 4px 2px; }
.cal-weekday.w-0, .cal-cell.w-0 { background: #fbe9ee; }
.cal-weekday.w-6, .cal-cell.w-6 { background: #e6f1fb; }
.cal-weekday:hover, .cal-cell:hover { border-color: var(--accent); }
.cal-grid.is-painting .cal-cell, .cal-grid.is-painting .cal-weekday { cursor: crosshair; }
.cal-grid:not(.is-painting) .cal-weekday { cursor: default; }
.cal-detail { display: grid; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius); }
.cal-image { display: grid; gap: 8px; }
.cal-image img { display: block; width: min(100%, 360px); height: auto; border: 1px solid var(--border); }
.cal-cell.is-today .cal-day { font-weight: 700; text-decoration: underline; }
.cal-cell.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.cal-day { font-size: 13px; color: var(--muted); }
.cal-mark { font-size: 22px; line-height: 1.3; min-height: 1.3em; color: #d1242f; }
.cal-mark.k-closed { color: #57606a; }
.cal-mark.k-temporary { color: #fff; background: #d1242f; border-radius: 4px; padding: 0 4px; font-size: 15px; font-weight: 700; line-height: 1.6; }
.cal-brush .cal-mark { font-size: 16px; min-height: 0; }
.cal-brush.is-active .cal-mark { color: inherit; }
.cal-note { font-size: 10px; line-height: 1.2; overflow-wrap: anywhere; }
.cal-kinds { display: grid; gap: 6px; }
.cal-kind { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 8px; }
.cal-kind .cal-mark { text-align: center; font-size: 18px; min-height: 0; }

/* サイト公開（GitHub Actions）の進み具合。どの画面でもタブの下に出す */
.deploy-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: #eef4ff;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.deploy-status[hidden] { display: none; }
.deploy-status .spinner { flex: 0 0 auto; }
.deploy-text { flex: 1 1 auto; min-width: 0; }
.deploy-text small { margin-left: 8px; color: var(--muted); }
.deploy-mark {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.deploy-status.is-done { background: #eaf6ee; }
.deploy-status.is-done .deploy-mark { background: var(--ok); }
.deploy-status.is-failed { background: #fdecea; color: var(--danger); }
.deploy-status.is-failed .deploy-mark { background: var(--danger); }
.deploy-steps {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.deploy-steps li + li::before { content: "›"; margin-right: 6px; }
.deploy-steps .is-done { color: var(--ok); }
.deploy-steps .is-current { color: var(--text); font-weight: 700; }
@media (max-width: 560px) {
  .deploy-steps { display: none; }
}

/* サイトの設定（見るだけ） */

.settings-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.settings-list dt { color: var(--muted); font-size: 13px; }
.settings-list dd { margin: 0; overflow-wrap: anywhere; }
.settings-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.settings-detail { padding: 12px; }
@media (max-width: 480px) { .settings-list { grid-template-columns: 1fr; gap: 2px 0; } .settings-list dd { margin-bottom: 8px; } }

/* 上部のサイト切り替え */

.brand-area { display: flex; align-items: center; gap: 12px; min-width: 0; }
.site-switch { position: relative; }
.site-switch summary { list-style: none; display: inline-flex; align-items: center; }
.site-switch summary::-webkit-details-marker { display: none; }
.site-switch summary::after { content: "▾"; margin-left: 4px; font-size: 11px; }
.site-switch__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  max-width: min(320px, 80vw);
  max-height: 60vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  padding: 6px;
  display: grid;
}
.site-switch__menu a {
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.site-switch__menu a:hover { background: #eef1f5; }
.site-switch__all { color: var(--accent) !important; }
.site-switch__menu a + .site-switch__all { border-top: 1px solid var(--border); border-radius: 0 0 6px 6px; margin-top: 4px; }
