/* 山口だいすけ公式サイト スマホ管理アプリ（クラス名は dsa- で始める） */
:root {
  --dsa-yellow: #eeee22;
  --dsa-yellow-soft: #fbfbc8;
  --dsa-ink: #2f3133;
  --dsa-sub: #6b6f73;
  --dsa-line: #e3e3dc;
  --dsa-bg: #fafaf5;
  --dsa-card: #ffffff;
  --dsa-ok: #1f8a4c;
  --dsa-warn: #c0392b;
  --dsa-radius: 18px;
  --dsa-safe-b: env(safe-area-inset-bottom, 0px);
  --dsa-safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--dsa-bg); color: var(--dsa-ink); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  font-size: 17px; line-height: 1.6;
  padding-top: var(--dsa-safe-t);
  overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; display: block; }

.dsa-wrap { max-width: 720px; margin: 0 auto; padding: 12px 16px calc(120px + var(--dsa-safe-b)); }

/* 上部 */
.dsa-top { display: flex; align-items: center; gap: 8px; min-height: 52px; }
.dsa-top h1 { font-size: 19px; margin: 0; flex: 1; font-weight: 800; letter-spacing: .02em; }
.dsa-top .dsa-brand { display: flex; align-items: center; gap: 8px; }
.dsa-top .dsa-brand i { width: 26px; height: 26px; border-radius: 50%; background: var(--dsa-yellow); box-shadow: inset -3px -3px 0 rgba(0,0,0,.08); flex: none; }
.dsa-iconbtn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; }
.dsa-iconbtn:active { background: var(--dsa-line); }
.dsa-iconbtn svg { width: 24px; height: 24px; }

/* HOME の6ボタン */
.dsa-grid6 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 20px; }
.dsa-big {
  border: 0; border-radius: var(--dsa-radius); background: var(--dsa-card);
  min-height: 112px; padding: 16px 12px; text-align: left;
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  box-shadow: 0 1px 0 var(--dsa-line), 0 2px 10px rgba(0,0,0,.04);
  font-weight: 800; font-size: 18px; text-decoration: none;
}
.dsa-big svg { width: 34px; height: 34px; }
.dsa-big.dsa-primary { background: var(--dsa-yellow); }
.dsa-big:active { transform: scale(.98); }

/* カード・見出し */
.dsa-h2 { font-size: 15px; color: var(--dsa-sub); font-weight: 700; margin: 22px 4px 8px; display: flex; justify-content: space-between; align-items: baseline; }
.dsa-h2 a { font-size: 14px; color: var(--dsa-ink); text-decoration: none; }
.dsa-card { background: var(--dsa-card); border-radius: var(--dsa-radius); padding: 14px 16px; box-shadow: 0 1px 0 var(--dsa-line); }
.dsa-card + .dsa-card { margin-top: 10px; }
.dsa-list { background: var(--dsa-card); border-radius: var(--dsa-radius); box-shadow: 0 1px 0 var(--dsa-line); overflow: hidden; }
.dsa-row { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--dsa-line); text-decoration: none; min-height: 56px; width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; }
.dsa-row:first-child { border-top: 0; }
.dsa-row:active { background: var(--dsa-yellow-soft); }
.dsa-row .dsa-grow { flex: 1; min-width: 0; }
.dsa-row .dsa-t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dsa-meta { font-size: 13px; color: var(--dsa-sub); }
.dsa-thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--dsa-line); flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--dsa-sub); }
.dsa-empty { padding: 18px 16px; color: var(--dsa-sub); text-align: center; }

.dsa-chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--dsa-line); margin: 2px 4px 0 0; }
.dsa-chip.dsa-main { background: var(--dsa-yellow); }
.dsa-st { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.dsa-st-draft { background: #eee; }
.dsa-st-publish { background: #dff3e6; color: var(--dsa-ok); }
.dsa-st-future { background: #e3ecfb; color: #2457a6; }

/* 状態 */
.dsa-stat { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--dsa-line); font-size: 15px; }
.dsa-stat:first-of-type { border-top: 0; }
.dsa-stat b { font-weight: 700; }
.dsa-ok { color: var(--dsa-ok); font-weight: 800; }
.dsa-ng { color: var(--dsa-warn); font-weight: 800; }

/* ボタン */
.dsa-btn {
  border: 0; border-radius: 999px; min-height: 52px; padding: 0 22px;
  font-weight: 800; background: var(--dsa-card); box-shadow: inset 0 0 0 2px var(--dsa-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.dsa-btn.dsa-y { background: var(--dsa-yellow); box-shadow: none; }
.dsa-btn.dsa-dark { background: var(--dsa-ink); color: #fff; box-shadow: none; }
.dsa-btn.dsa-s { min-height: 40px; padding: 0 14px; font-size: 15px; }
.dsa-btn.dsa-wide { width: 100%; }
.dsa-btn:disabled { opacity: .45; }
.dsa-btn:active { transform: scale(.98); }
.dsa-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dsa-btns > * { flex: 1 1 auto; }

/* 下部の固定バー（親指の届く位置） */
.dsa-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(250,250,245,.96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--dsa-line);
  padding: 10px 16px calc(10px + var(--dsa-safe-b));
}
.dsa-bar .dsa-in { max-width: 720px; margin: 0 auto; display: flex; gap: 8px; }
.dsa-bar .dsa-btn { flex: 1; padding: 0 10px; }

/* 入力 */
.dsa-label { display: block; font-size: 14px; font-weight: 700; color: var(--dsa-sub); margin: 18px 4px 6px; }
.dsa-input, .dsa-textarea {
  width: 100%; border: 2px solid var(--dsa-line); border-radius: 14px; background: #fff;
  padding: 12px 14px; font-size: 17px; outline: none;
}
.dsa-input:focus, .dsa-textarea:focus { border-color: var(--dsa-ink); }
.dsa-title-input { font-size: 20px; font-weight: 800; }
.dsa-textarea { min-height: 120px; resize: none; line-height: 1.7; }
.dsa-hint { font-size: 13px; color: var(--dsa-sub); margin: 6px 4px 0; }

/* カテゴリー */
.dsa-cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.dsa-cat {
  border: 2px solid var(--dsa-line); background: #fff; border-radius: 14px;
  min-height: 48px; padding: 6px 10px; font-weight: 700; font-size: 15px; text-align: left;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.dsa-cat.dsa-on { border-color: var(--dsa-ink); background: var(--dsa-yellow-soft); }
.dsa-cat.dsa-on.dsa-is-main { background: var(--dsa-yellow); }
.dsa-cat em { font-style: normal; font-size: 11px; font-weight: 800; background: var(--dsa-ink); color: #fff; border-radius: 999px; padding: 1px 7px; }

/* 本文ブロック */
.dsa-block { background: #fff; border-radius: 14px; border: 2px solid var(--dsa-line); margin-top: 10px; position: relative; }
.dsa-block .dsa-textarea { border: 0; min-height: 90px; }
.dsa-block img { border-radius: 12px; width: 100%; }
.dsa-block-tools { display: flex; justify-content: flex-end; gap: 2px; padding: 0 4px 4px; }
.dsa-block-tools button { border: 0; background: none; min-width: 40px; height: 36px; border-radius: 10px; font-size: 15px; color: var(--dsa-sub); font-weight: 700; }
.dsa-block-tools button:active { background: var(--dsa-line); }
.dsa-add { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.dsa-add button, .dsa-add label {
  border: 2px dashed #c9c9bd; background: transparent; border-radius: 14px; min-height: 64px;
  font-size: 13px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center;
}
.dsa-add svg { width: 24px; height: 24px; }
.dsa-locked { background: #f1f1ea; border-radius: 14px; padding: 12px 14px; font-size: 14px; color: var(--dsa-sub); }
.dsa-frame { width: 100%; border: 0; border-radius: 14px; background: #fff; height: 60vh; margin-top: 8px; }

/* メディア */
.dsa-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.dsa-tabs::-webkit-scrollbar { display: none; }
.dsa-tab { border: 0; border-radius: 999px; background: var(--dsa-card); box-shadow: inset 0 0 0 2px var(--dsa-line); min-height: 40px; padding: 0 16px; font-weight: 800; white-space: nowrap; font-size: 15px; }
.dsa-tab.dsa-on { background: var(--dsa-ink); color: #fff; box-shadow: none; }
.dsa-mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
@media (min-width: 600px) { .dsa-mgrid { grid-template-columns: repeat(5, 1fr); } }
.dsa-mitem { border: 0; padding: 0; background: var(--dsa-card); border-radius: 12px; overflow: hidden; text-align: left; box-shadow: 0 1px 0 var(--dsa-line); }
.dsa-mitem .dsa-sq { aspect-ratio: 1; width: 100%; object-fit: cover; background: var(--dsa-line); display: grid; place-items: center; font-weight: 900; color: var(--dsa-sub); }
.dsa-mitem .dsa-cap { font-size: 11px; padding: 4px 6px; color: var(--dsa-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsa-src { display: grid; gap: 10px; }
.dsa-src label { cursor: pointer; }
.dsa-src .dsa-big { min-height: 76px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; }
.dsa-hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dsa-pending { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.dsa-pending .dsa-sq { aspect-ratio: 1; border-radius: 10px; object-fit: cover; width: 100%; background: var(--dsa-line); display: grid; place-items: center; font-weight: 900; color: var(--dsa-sub); }
.dsa-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; background: #f4f4ee; border-radius: 10px; padding: 8px 10px; margin-top: 6px; user-select: all; -webkit-user-select: all; }
.dsa-progress { height: 8px; border-radius: 999px; background: var(--dsa-line); overflow: hidden; margin-top: 12px; }
.dsa-progress i { display: block; height: 100%; background: var(--dsa-ink); width: 0; transition: width .2s; }

/* 下から出るシート・プレビュー */
.dsa-sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.dsa-sheet { background: var(--dsa-bg); width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 10px 16px calc(18px + var(--dsa-safe-b)); }
.dsa-sheet .dsa-grab { width: 44px; height: 5px; border-radius: 99px; background: #cfcfc6; margin: 2px auto 10px; }
.dsa-sheet img.dsa-full { border-radius: 14px; width: 100%; max-height: 50vh; object-fit: contain; background: #eee; }

.dsa-preview { position: fixed; inset: 0; z-index: 50; background: #fff; overflow-y: auto; padding-top: var(--dsa-safe-t); }
.dsa-preview-head { position: sticky; top: 0; background: var(--dsa-ink); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; font-size: 14px; font-weight: 700; z-index: 2; }
.dsa-preview-head button { white-space: nowrap; flex: none; background: var(--dsa-yellow); border: 0; border-radius: 999px; min-height: 40px; padding: 0 18px; font-weight: 800; color: var(--dsa-ink); }
.dsa-site-head { background: var(--dsa-yellow); padding: 12px 16px; font-weight: 900; }
.dsa-article { max-width: 760px; margin: 0 auto; padding: 20px 16px 60px; }
.dsa-article h1 { font-size: 24px; line-height: 1.45; margin: 4px 0 8px; }
.dsa-article .dsa-art-body p { margin: 0 0 1.2em; white-space: pre-wrap; }
.dsa-article .dsa-art-body figure { margin: 0 0 1.2em; }
.dsa-article .dsa-art-body img { border-radius: 8px; }
.dsa-og { border: 1px solid var(--dsa-line); border-radius: 14px; overflow: hidden; background: #fff; }
.dsa-og .dsa-og-img { aspect-ratio: 1.91; width: 100%; object-fit: cover; background: var(--dsa-line); display: grid; place-items: center; color: var(--dsa-sub); font-size: 13px; }
.dsa-og .dsa-og-txt { padding: 10px 12px; }
.dsa-og .dsa-og-txt b { display: block; font-size: 15px; line-height: 1.4; }
.dsa-og .dsa-og-txt small { color: var(--dsa-sub); font-size: 12px; word-break: break-all; }

/* 知らせ */
.dsa-toast { position: fixed; left: 50%; bottom: calc(96px + var(--dsa-safe-b)); transform: translateX(-50%); background: var(--dsa-ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 15px; z-index: 60; max-width: 90vw; text-align: center; }
.dsa-error { background: #fdecea; color: var(--dsa-warn); border-radius: 14px; padding: 12px 14px; font-weight: 700; margin: 10px 0; }
.dsa-note { background: var(--dsa-yellow-soft); border-radius: 14px; padding: 12px 14px; font-size: 15px; margin: 10px 0; }

/* ログイン */
.dsa-login { min-height: 90vh; display: flex; flex-direction: column; justify-content: center; max-width: 420px; margin: 0 auto; padding: 24px 16px; }
.dsa-login .dsa-logo { width: 84px; height: 84px; border-radius: 50%; background: var(--dsa-yellow); margin: 0 auto 14px; box-shadow: inset -6px -6px 0 rgba(0,0,0,.08); display: grid; place-items: center; font-weight: 900; font-size: 22px; }
.dsa-login h1 { text-align: center; font-size: 20px; margin: 0 0 18px; }

@media (min-width: 900px) {
  .dsa-wrap { max-width: 860px; }
  .dsa-grid6 { grid-template-columns: repeat(3, 1fr); }
}

/* 普段は閉じておく欄 */
.dsa-more { margin-top: 18px; }
.dsa-more summary { font-size: 14px; font-weight: 700; color: var(--dsa-sub); padding: 10px 4px; cursor: pointer; list-style: none; }
.dsa-more summary::before { content: "＋ "; }
.dsa-more[open] summary::before { content: "－ "; }
.dsa-more summary::-webkit-details-marker { display: none; }
