/* SALON BLOG STUDIO — オフホワイト・チャコール・グレージュの落ち着いた画面 */
:root {
  --bg: #F7F5F2;
  --surface: #FFFFFF;
  --ink: #2B2A28;
  --ink-2: #5F5B55;
  --ink-3: #8E8880;
  --line: #E4DED6;
  --greige: #A39E93;
  --greige-soft: #EDE8E1;
  --accent: #2B2A28;
  --warn: #9A4B2F;
  --radius: 10px;
  --sans: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --serif: 'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* サイドバー */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 200px; z-index: 30;
  background: #EFEBE5; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 28px 14px 20px;
}
.sidebar .brand { font-family: var(--serif); letter-spacing: .2em; font-size: 14px; line-height: 1.7; color: var(--ink); text-decoration: none; padding: 0 10px 26px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; font-size: 14px;
}
.side-nav a:hover { background: rgba(0,0,0,.04); }
.side-nav a.active { background: var(--ink); color: #fff; }
.side-nav svg, .menu-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side-note { margin-top: auto; padding: 0 10px; font-family: var(--serif); font-size: 10px; letter-spacing: .2em; color: var(--ink-3); }
.content { margin-left: 200px; min-height: 100vh; }
.side-update { margin: 18px 10px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2); font-size: 13px; cursor: pointer; text-align: left; }
.update-bar {
  position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px; border-radius: 12px;
  background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.18); max-width: calc(100% - 32px);
}
.update-bar .btn { color: var(--ink); }
.mobilebar { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 25; }

/* 2列のレイアウト（スマホは縦に並ぶ） */
.layout {
  display: grid; grid-template-columns: minmax(340px, 420px) 1fr; gap: 24px;
  max-width: 1280px; margin: 0 auto; padding: 24px;
}
.panel { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.step h2 { margin: 0 0 12px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.step-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.step-head h2 { margin: 0; }
.num { font-family: var(--serif); font-weight: 400; color: var(--greige); font-size: 13px; letter-spacing: .08em; }
.note { color: var(--ink-3); font-size: 12.5px; margin: 10px 0 0; }

/* タブ（ボタンの並び） */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--greige-soft); padding: 4px; border-radius: 8px; }
.seg-wrap { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); }
.seg button {
  border: 0; background: transparent; padding: 8px 6px; border-radius: 6px; cursor: pointer;
  color: var(--ink-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg button:disabled { opacity: .45; cursor: default; }
.subseg { margin-top: 10px; }
.subseg .seg button { white-space: normal; line-height: 1.35; }
.subseg .label, .field label, .crop label { font-size: 12.5px; color: var(--ink-3); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 13.5px; color: var(--ink-2);
}
.chip.on { border-color: var(--ink); color: var(--ink); font-weight: 700; }
.chip .sw { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); }

.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
textarea.input { min-height: 120px; resize: vertical; line-height: 1.6; }
.input:focus, .btn:focus-visible, .seg button:focus-visible, .chip:focus-visible { outline: 2px solid var(--greige); outline-offset: 1px; }

/* 写真を選ぶ */
.drop {
  display: block; margin-top: 10px; border: 1.5px dashed var(--greige); border-radius: 8px; padding: 18px; text-align: center;
  color: var(--ink-2); font-size: 13.5px; cursor: pointer; background: #FBFAF8;
}
.drop.over { background: var(--greige-soft); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin-top: 12px; }
.thumb { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.thumb.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--greige-soft); }
.thumb .meta { padding: 6px 8px; font-size: 11px; color: var(--ink-3); line-height: 1.45; }
.thumb .meta b { display: block; color: var(--ink-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb button { margin: 0 8px 8px; }
.thumb .link.del { color: var(--warn); font-size: 12px; margin: -2px 8px 10px; text-align: center; }
.img-error { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; font-size: 11px; color: var(--ink-3); background: var(--greige-soft); }
.empty { color: var(--ink-3); font-size: 13px; padding: 10px 0 0; }

/* 共有フォルダ */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.crumbs .sep { color: var(--ink-3); }
.link { border: 0; background: none; padding: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font-size: 13px; }
.folders { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.folders svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.upload-box { margin-top: 14px; padding: 12px; border: 1px dashed var(--greige); border-radius: 8px; background: #FBFAF8; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.upload-box .consent { border-radius: 8px; align-items: flex-start; line-height: 1.5; text-align: left; }
.upload-box .consent input { margin-top: 3px; }
.btn.disabled { opacity: .5; pointer-events: none; }
.btn.disabled-look { opacity: .55; }

.ftree { display: grid; gap: 8px; margin-top: 10px; }
.fgroup { border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--surface); }
.fgroup > .chip { font-weight: 700; color: var(--ink); }
.fchildren { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0 14px; }
.chip .cnt { margin-left: 4px; font-size: 11px; color: var(--ink-3); font-weight: 400; }
.chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; flex: none; }
.posts tr.grp td { font-weight: 700; background: #FBFAF8; }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); text-decoration: none; cursor: pointer; font-size: 14px; white-space: nowrap;
}
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 700; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--warn); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* 文章の候補 */
.cands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cand { text-align: left; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #FBFAF8; cursor: pointer; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.cand.on { border-color: var(--ink); background: var(--surface); }
.cand .t { font-family: var(--serif); font-size: 15px; color: var(--ink); font-weight: 600; display: block; margin: 2px 0; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field .count { font-size: 11.5px; color: var(--ink-3); text-align: right; }
.field .count.over { color: var(--warn); font-weight: 700; }

/* 完成イメージ（4:3）：写真は画面全体につながり、右側だけかすませて文字を置く */
.pv {
  container-type: inline-size; position: relative; aspect-ratio: 4 / 3; width: 100%;
  border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.pv-photo { position: absolute; inset: 0 38% 0 0; overflow: hidden; background: rgba(0,0,0,.06); }
.pv-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pv-photo .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(0,0,0,.35); font-size: 3cqw; text-align: center; padding: 0 4cqw; }
.pv-haze { position: absolute; inset: 0 0 0 46%; pointer-events: none; }
.pv-text {
  position: absolute; top: 0; bottom: 0; right: 3.5cqw; width: 42%;
  display: flex; flex-direction: column; justify-content: center; align-items: stretch; text-align: center;
}
.pv-dline { height: 3px; border-top: 1px solid var(--accent); border-bottom: 1px solid var(--accent); margin-bottom: 2.4cqw; opacity: .8; }
.pv-cat { display: flex; justify-content: center; margin-bottom: 2.6cqw; font-family: var(--serif); font-weight: 700; font-size: 2.6cqw; letter-spacing: .08em; }
.pv-cat span { padding: .7cqw 2cqw; border: 1px solid var(--band); line-height: 1.3; }
.pv-cat .a { letter-spacing: .25em; }
.pv-cat .b { background: rgba(255,255,255,.85); flex: 1; }
.pv-catch { white-space: nowrap; font-family: var(--serif); font-weight: 600; font-style: italic; font-size: 3.3cqw; margin: 0 0 1.2cqw; letter-spacing: .04em; }
.pv-catch .big { font-size: 1.35em; }
.pv-title {
  font-family: var(--serif); font-weight: 800; margin: 0; line-height: 1.12; letter-spacing: .02em;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 .3cqw .4cqw rgba(0,0,0,.12)); word-break: keep-all; overflow-wrap: anywhere;
}
.pv-line { height: 1px; background: var(--accent); opacity: .7; margin: 1.8cqw 0; }
.pv-sub { white-space: nowrap; font-family: var(--serif); font-weight: 700; font-size: 3.2cqw; margin: 0; letter-spacing: .06em; }
.pv-sub span { font-weight: 800; }

.crop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.crop div { display: flex; flex-direction: column; gap: 2px; }
.crop input[type=range] { width: 100%; accent-color: var(--ink); }

/* 注意・使い方 */
.warn { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 4px; }
.warn li { font-size: 13px; color: var(--warn); background: #FBF1EC; border-radius: 6px; padding: 6px 10px; }
.warn li::before { content: '! '; font-weight: 700; }
.warn li.ok { color: #3F6B4A; background: #EEF5EF; }
.warn li.ok::before { content: ''; }
.howto { margin: 14px 0 0; padding-left: 1.3em; color: var(--ink-2); font-size: 13.5px; }
.howto li { margin: 2px 0; }
.prompt-box { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.prompt-box summary { cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.prompt-box pre { white-space: pre-wrap; word-break: break-word; font-family: var(--sans); font-size: 12.5px; background: #FBFAF8; border: 1px solid var(--line); border-radius: 8px; padding: 12px; max-height: 420px; overflow: auto; }

/* 履歴・管理 */
.narrow { max-width: 820px; margin: 0 auto; padding: 24px; }
.page-title { font-family: var(--serif); font-size: 22px; font-weight: 600; margin: 4px 0 4px; letter-spacing: .06em; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 14px; }
.card h3 { margin: 0 0 10px; font-size: 15px; }
.hist { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; }
.hist .t { font-family: var(--serif); font-size: 16px; font-weight: 600; }
.hist .m { font-size: 12.5px; color: var(--ink-3); }
.hist .actions { justify-content: flex-end; }
.row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: center; margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 通知 */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 14px;
  transition: .25s; pointer-events: none; z-index: 50; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* スマホ */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
  .content { margin-left: 0; }
  .mobilebar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; background: rgba(247, 245, 242, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  }
  .mobilebar .brand { font-family: var(--serif); font-size: 12px; letter-spacing: .14em; color: var(--ink); text-decoration: none; }
  .menu-btn { border: 0; background: transparent; padding: 8px; border-radius: 8px; cursor: pointer; display: flex; }
  .sidebar { transform: translateX(-100%); transition: transform .22s; box-shadow: 0 0 24px rgba(0,0,0,.12); }
  .sidebar.open { transform: none; }
  .narrow { padding: 16px; }
  .cands { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .seg-wrap { grid-template-columns: repeat(3, 1fr); }
  .seg button { font-size: 13px; padding: 8px 4px; }
  .actions .btn { flex: 1 1 100%; }
  .row { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
}

/* 投稿数 */
.posts { width: 100%; border-collapse: collapse; font-size: 14px; }
.posts th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12.5px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.posts td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.posts td.n { text-align: right; font-variant-numeric: tabular-nums; width: 64px; }
.posts .bar { height: 6px; border-radius: 3px; background: var(--ink); min-width: 2px; }
.posts .barcell { width: 38%; }
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.stat { flex: 1 1 140px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { font-size: 12.5px; color: var(--ink-3); }
.stat .v { font-family: var(--serif); font-size: 26px; font-weight: 600; }
@media (max-width: 860px) { .posts .barcell { display: none; } }
