/* つぶやきメーカー ツール画面
   コンセプト：「原稿用紙と赤鉛筆」— 紙 #FBFAF6／罫 #E7E2D6／墨 #23201B／補助墨 #6E675C／校正の赤 #D43A2A／安全の緑 #4C7A5B
   赤は身バレチェック（校正）まわりと安心度だけに使う。 */
:root {
  --paper: #FBFAF6;
  --rule: #E7E2D6;
  --ink: #23201B;
  --ink-sub: #6E675C;
  --red: #D43A2A;
  --green: #4C7A5B;
  --sheet: #FFFFFF;
  --tint: #F3F0E7;
  --line-soft: #C9C2B2;
  --font-head: "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Yu Mincho", "YuMincho", serif;
  --font-body: -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0;}
body { font-family: var(--font-body); background: var(--paper); color: var(--ink); line-height: 1.7;}
a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
header { background: var(--paper); border-bottom: 1px solid var(--rule); padding: 30px 20px 24px; text-align: center;}
header h1 { font-family: var(--font-head); font-size: 27px; font-weight: 700; letter-spacing: .06em;}
header p { font-size: 13px; color: var(--ink-sub); margin-top: 6px;}
.badge { display: inline-block; background: var(--sheet); border: 1px solid var(--line-soft); border-radius: 3px; padding: 2px 12px; font-size: 11px; color: var(--ink-sub); margin-top: 12px;}
main { max-width: 720px; margin: 0 auto; padding: 18px 14px 60px;}
.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: 3px; padding: 22px 20px; margin-bottom: 18px; box-shadow: 3px 3px 0 #EFEAE0;}
.card h2 { font-family: var(--font-head); font-size: 19px; letter-spacing: .03em; padding-bottom: 8px; border-bottom: 1px solid var(--rule); margin-bottom: 12px;}
.card p.sub, p.sub { font-size: 12.5px; color: var(--ink-sub); margin-bottom: 14px;}
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 5px;}
input[type=text], select, textarea { width: 100%; border: 1px solid #D8D2C2; border-radius: 3px; padding: 10px 12px; font-size: 15px; font-family: inherit; background: var(--sheet); color: var(--ink);}
input[type=text]:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; }
textarea { min-height: 92px; resize: vertical; line-height: 28px; background-image: repeating-linear-gradient(var(--sheet), var(--sheet) 27px, var(--rule) 28px);}
.row { display: flex; gap: 10px;}
.row > div { flex: 1;}
button.main-btn { width: 100%; margin-top: 18px; background: var(--ink); color: var(--paper); border: none; border-radius: 3px; padding: 14px; font-size: 16px; font-weight: 700; cursor: pointer;}
button.main-btn:hover { background: #3A362E;}
button.main-btn:disabled { background: #D8D2C2; color: #7A7462; cursor: not-allowed;}
.free-note { text-align: center; font-size: 12.5px; color: var(--ink-sub); margin-top: 10px;}
.sample-btn { background: var(--sheet); color: var(--ink); border: 1px solid var(--line-soft); border-radius: 3px; padding: 5px 14px; font-size: 12.5px; cursor: pointer; margin-top: 8px;}
.result-box { border: 1px solid var(--rule); border-radius: 3px; padding: 14px 16px; margin-top: 12px; background: var(--sheet); box-shadow: 2px 2px 0 #EFEAE0;}
.result-box h3 { font-size: 12.5px; font-weight: 700; color: var(--ink-sub); margin-bottom: 6px;}
.result-box .title { font-family: var(--font-head); font-weight: 700; font-size: 16px; margin-bottom: 4px;}
.result-box p { font-size: 14.5px; white-space: pre-wrap; word-break: break-word;}
.copy-btn { margin-top: 10px; background: var(--sheet); border: 1px solid var(--ink); color: var(--ink); border-radius: 3px; padding: 6px 16px; font-size: 13px; font-weight: 600; cursor: pointer;}
.char-count { font-size: 12px; color: var(--ink-sub); text-align: right; margin-top: 4px;}
.paywall { display: none; text-align: center; padding: 18px 10px; border-top: 1px solid var(--rule); margin-top: 18px;}
.paywall button { margin-top: 12px; background: var(--ink); color: var(--paper); border: none; border-radius: 3px; padding: 12px 26px; font-size: 15px; font-weight: 700; cursor: pointer;}
.reset-link { display: inline-block; margin-top: 14px; font-size: 12px; color: var(--ink-sub); text-decoration: underline; cursor: pointer; background: none; border: none;}
/* 身バレチェック：赤鉛筆で校正する見た目。チェック済みは赤い✓印と淡い赤の地 */
.check-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 30px 10px 12px; border: 1px solid var(--rule); border-radius: 3px; margin-top: 8px; cursor: pointer; font-size: 14px; background: var(--sheet); position: relative;}
.check-item input { margin-top: 4px; transform: scale(1.25); accent-color: var(--red);}
.check-item small { display: block; color: var(--ink-sub); font-size: 12px;}
.check-item:has(input:checked) { border-color: rgba(212,58,42,.55); background: #FDF6F3;}
.check-item:has(input:checked)::after { content: "✓"; position: absolute; top: 8px; right: 12px; color: var(--red); font-weight: 700; font-size: 16px;}
.score-wrap { margin-top: 16px;}
.score-bar { height: 12px; background: #EFEAE0; border-radius: 999px; overflow: hidden;}
.score-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #D43A2A, #D9A441, #4C7A5B); background-size: 720px 100%; transition: width .4s;}
.score-text { font-size: 14px; font-weight: 700; margin-top: 8px; text-align: center;}
.file-note { font-size: 12.5px; color: var(--ink-sub); margin-top: 8px;}
#previewImg { max-width: 100%; border: 1px solid var(--rule); border-radius: 3px; margin-top: 12px; display: none;}
#downloadClean { display: none; margin-top: 12px; background: var(--green); color: #fff; text-align: center; text-decoration: none; border-radius: 3px; padding: 12px; font-weight: 700; font-size: 15px;}
.check-photo-empty { border: 1.5px dashed var(--line-soft); border-radius: 3px; padding: 14px; margin-top: 12px; font-size: 13px; color: var(--ink-sub); background: var(--tint); text-align: center;}
.check-photo-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px;}
.check-photo-bar span { font-size: 13px; font-weight: 700; color: var(--ink);}
#checkPhotoSticky { position: sticky; top: 8px; z-index: 5; background: var(--sheet); padding: 6px 0 2px;}
#checkPhotoImg { width: 100%; max-height: 46vh; object-fit: contain; border-radius: 3px; background: var(--tint); cursor: zoom-in; display: block;}
/* 身バレチェック：横向き／幅広画面では写真とリストを2カラムにし、各ペインを独立スクロールさせる */
@media (orientation: landscape) and (min-width: 480px) {
  .check-split { display: flex; gap: 14px; align-items: flex-start;}
  .check-pane-photo { flex: 1 1 50%; min-width: 0; max-height: calc(100vh - 36px); max-height: calc(100dvh - 36px); overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right: 2px;}
  .check-pane-list { flex: 1 1 50%; min-width: 0; max-height: calc(100vh - 36px); max-height: calc(100dvh - 36px); overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right: 2px;}
  .check-pane-list .check-item:first-child { margin-top: 0;}
  .check-pane-photo #checkPhotoSticky { position: static;}
  .check-pane-photo #checkPhotoImg { max-height: none;}
}
#previewImg { cursor: zoom-in;}
.zoom-modal { position: fixed; inset: 0; background: rgba(35,32,27,.94); z-index: 100; display: flex; flex-direction: column;}
.zoom-modal.hidden { display: none;}
.zoom-scroll { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 12px;}
.zoom-scroll img { max-width: 100%; max-height: calc(100vh - 130px); border-radius: 3px; cursor: zoom-in;}
.zoom-scroll img.zoomed { max-width: none; max-height: none; cursor: zoom-out;}
.zoom-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px;}
.zoom-bar p { color: var(--rule); font-size: 12.5px;}
#zoomClose { background: var(--paper); border: none; border-radius: 3px; padding: 8px 18px; font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; flex-shrink: 0;}
footer { text-align: center; font-size: 11.5px; color: #A39C8B; padding: 0 20px 30px;}
footer nav { margin-bottom: 10px;}
footer nav a { margin: 0 8px; font-size: 12.5px; color: var(--ink-sub);}
nav.site-nav { background: var(--sheet); border-bottom: 1px solid var(--rule);}
nav.site-nav ul { max-width: 720px; margin: 0 auto; padding: 0 14px; list-style: none; display: flex; gap: 4px; flex-wrap: wrap;}
nav.site-nav a { display: block; padding: 10px 12px; font-size: 13.5px; font-weight: 600; color: var(--ink-sub); text-decoration: none;}
nav.site-nav a:hover { background: var(--tint);}
nav.site-nav a.current { color: var(--ink); box-shadow: inset 0 -3px 0 var(--ink);}
.save-btn { margin-top: 10px; margin-left: 8px; background: var(--sheet); border: 1px solid var(--ink); color: var(--ink); border-radius: 3px; padding: 6px 16px; font-size: 13px; font-weight: 600; cursor: pointer;}
.style-box { border: 1px solid var(--rule); border-radius: 3px; padding: 12px 14px; margin-top: 12px; background: #F7F4EC; font-size: 13.5px;}
.draft-item { border: 1px solid var(--rule); border-radius: 3px; padding: 10px 12px; margin-top: 8px; background: var(--sheet);}
.draft-head { font-size: 13px; font-weight: 600;}
.draft-btns { margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap;}
.mini-btn { background: var(--sheet); border: 1px solid var(--ink); color: var(--ink); border-radius: 3px; padding: 4px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer;}
.hidden { display: none;}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
