/*
 * つづくログ 見た目の方針（2026-11-18 社長了承）
 * 1. 題材は「ラジオ体操の出席カード」と「学校のプリント」。地はわら半紙の色、基本の色はロゴの青を一段濃くした #234c9c（ロゴは #2c5fc4。旧：ブルーブラック #1f3a68）
 *    （2026-11-18 方眼は目が疲れる・白地は X と同じ → わら半紙に変更）
 * 2. 朱色は「ハンコ＝やった印」だけに使う（今日やった！ボタン・済の印・カレンダーのやった日）
 * 3. リンクはボタンに。主＝インクの塗り／その他＝細い枠線／移動＝「→」付きの文字（下線なし）
 *    カードは細い線で囲み、角は柔らかく（2026-11-18 社長）。影は付けない
 * 避けるもの：クリーム地＋明朝体の見出し＋赤茶の差し色、角の丸いカード＋同じ薄い影（AI のありがち）
 */
:root {
  /* ブランドの色（ロゴと同じ。2026-11-18 社長決定） */
  --brand-blue: #2c5fc4;   /* ロゴの「づ」の青 */
  --brand-yellow: #fcae1a; /* ロゴの濁点の黄色（応援） */
  --ink: #234c9c;            /* アプリの中の青：ロゴの青と同じ色味で一段濃く（ロゴの青は広い面積だと明るすぎる。2026-11-18 社長） */
  --ink-dark: #1c3f82;       /* ホバー用にさらに少し濃く */
  --ink-soft: #f1ece0;  /* 最新の投稿の地・ホバー（地のわら半紙に近い、少し沈んだ紙） */
  --line: #ddd5c1;       /* 罫線（紙になじむ色） */
  --warabanshi: #f1ece0;  /* わら半紙（地）：白寄りに（2026-11-18 社長）。少し灰色がかった黄土色 */
  --paper: #faf7f0;       /* カード：地より明るい紙 */
  --paper-light: #fdfcf8; /* 入力欄・スタンプ */
  --text: #20242c;
  --muted: #6e6858;   /* 鉛筆の灰色（紙になじむ暖かい灰） */
  --shu: #c8321f;        /* 朱肉。やった印だけ */
  --amber: #a87b12;
}

* { box-sizing: border-box; }
body {
  margin: 0; color: var(--text);
  font-family: -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  background-color: var(--warabanshi);
}
a { color: var(--ink); text-decoration: none; }
h1 { font-size: 22px; letter-spacing: .02em; margin: 8px 0 12px; }
h2 { font-size: 17px; }
main { max-width: 720px; margin: 0 auto; padding: 16px; }
.hint { color: var(--muted); font-size: 13px; }
b, .num { font-variant-numeric: tabular-nums; }

/* ヘッダー：ノートの表紙の帯 */
header.top { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px;
  background: var(--paper); border-bottom: 2px solid var(--ink); }
.brand { display: flex; align-items: baseline; gap: 10px; }
header .logo { font-weight: 700; font-size: 19px; color: var(--ink); letter-spacing: .06em; }
.tagline { font-size: 12px; color: var(--muted); }
header nav { display: flex; gap: 4px; align-items: center; font-size: 14px; }
header nav .me { margin-right: 6px; color: var(--muted); }
header nav form { display: inline; }

/* ボタン3種 */
.btn, .btn-primary, .btn-ghost, .btn-go, .linkish {
  display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 14px; cursor: pointer;
  border-radius: 6px; padding: 6px 12px; line-height: 1.3; text-decoration: none; }
.btn { border: 1px solid var(--ink); color: var(--ink); background: var(--paper-light); }
.btn:hover { background: var(--ink-soft); }
.btn-primary, input[type=submit].btn-primary { border: 1px solid var(--ink); background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-dark); border-color: var(--ink-dark); }
.btn-ghost, .linkish { border: 1px solid transparent; background: none; color: var(--ink); }
.btn-ghost:hover, .linkish:hover { border-color: var(--line); background: var(--paper-light); }
.btn-go { border: none; background: none; color: var(--ink); padding: 6px 2px; font-weight: 600; }
.btn-go:hover { color: var(--ink-dark); }
.btn-go .arrow { transition: transform .15s; display: inline-block; }
.btn-go:hover .arrow { transform: translateX(3px); }
.btn-block { display: flex; justify-content: center; width: 100%; }

/* 今日やった！＝ハンコを押すボタン（朱はここと「済」の印だけ） */
.btn-done { border: 2px solid var(--shu); color: var(--shu); background: var(--paper-light); border-radius: 6px;
  padding: 7px 16px; font-weight: 700; font-size: 15px; letter-spacing: .08em; cursor: pointer; }
.btn-done:hover { background: var(--shu); color: #fff; }
.done { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.hanko { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border: 2px solid var(--shu); border-radius: 50%; color: var(--shu); font-weight: 700; font-size: 15px;
  transform: rotate(-8deg); background: var(--paper-light); }

.notice, .alert { padding: 8px 12px; border-left: 3px solid var(--ink); background: var(--paper-light); font-size: 14px; }
.alert { border-left-color: var(--shu); }
.reminder { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--paper-light); border: 1px solid var(--line); border-left: 3px solid var(--ink); padding: 8px 12px; font-size: 14px; border-radius: 10px; }

/* タブ：ノートのインデックス */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--ink); margin-bottom: 14px; }
.tab { padding: 8px 16px; color: var(--muted); border: 1px solid transparent; border-bottom: none; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.active { border-radius: 8px 8px 0 0; color: var(--ink); font-weight: 700; background: var(--paper); border-color: var(--ink); border-bottom: 1px solid var(--paper); }
.tab-count { font-size: 12px; color: var(--muted); margin-left: 2px; }

/* カード：罫線で区切った1枚の記録紙 */
.cards { display: grid; gap: 14px; }
.card, .mine { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }  /* 角は柔らかく。影は付けない */
/* 一覧のカードは状態で線を変えない（状態は右上のバッジで分かる。2026-11-18 社長）。マイページの「まだ」だけ青い線 */
.mine.todo { border-left: 3px solid var(--ink); }
.card-head, .mine-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-head .card-total { font-size: 13px; color: var(--muted); margin-left: 6px; }
.card-title { font-size: 17px; margin: 6px 0 2px; font-weight: 600; }
.card-title a, .mine-head a, .name-link { color: var(--text); }
.card-title a:hover, .mine-head a:hover, .name-link:hover { color: var(--ink); }
.badge { font-size: 12px; padding: 1px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); white-space: nowrap; }
.badge-slipping { border-color: var(--amber); color: var(--amber); }
.badge-welcome_back { border-color: var(--ink); color: var(--ink); }

/* スタンプ */
.stamp-counts { margin: 8px 0; display: flex; gap: 8px; flex-wrap: wrap; min-height: 4px; }
.stamp-tile { position: relative; display: inline-flex; width: 54px; height: 54px; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--paper-light); border-radius: 10px; }
.stamp-tile .count { position: absolute; right: -6px; bottom: -6px; background: var(--ink); color: #fff; font-size: 11px;
  min-width: 18px; text-align: center; padding: 0 4px; border-radius: 9px; }
.stamp-emoji { font-size: 32px; line-height: 1; }
.stamp-img { width: 100%; height: 100%; object-fit: contain; }
.buttons { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.buttons form { display: inline; }
.buttons form.post-form { display: flex; }
.stamp-group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; width: 100%; }
.group-label { font-size: 11px; color: var(--muted); width: 56px; }
.stamp-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 74px; height: 74px;
  border: 1px solid var(--line); background: var(--paper-light); border-radius: 10px; cursor: pointer; padding: 4px; font: inherit; }
.stamp-btn .stamp-emoji { font-size: 30px; }
.stamp-btn .stamp-img { width: 44px; height: 44px; }
.stamp-btn small { font-size: 10px; color: var(--muted); margin-top: 3px; text-align: center; line-height: 1.2; }
.stamp-btn:hover { border-color: var(--ink); }
.stamp-btn.pressed { opacity: .4; cursor: default; }
.stamp-btn.pressed:hover { border-color: var(--line); }
.stamp-btn.scold { border-style: dashed; }

/* 投稿とスレッド */
.post-form { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; align-items: center; }
.post-form input[type=text], .post-form select, input[type=text] { padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 14px; background: var(--paper-light); }
.post-form input[type=text] { flex: 1; min-width: 180px; }
.form-note { width: 100%; }
.post { border-top: 1px solid var(--line); padding: 10px 0; }
.post-head { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.chip { font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 0 8px; border-radius: 10px; }
.post-note { margin: 4px 0; }
.latest { margin: 8px 0; padding: 2px 12px; background: var(--ink-soft); border-radius: 8px; }
.latest .post { border-top: none; }
.thread-title { display: flex; justify-content: space-between; align-items: baseline; margin-top: 24px;
  border-bottom: 1px solid var(--ink); padding-bottom: 6px; }
.seg { display: inline-flex; border: 1px solid var(--ink); font-size: 13px; font-weight: normal; border-radius: 6px; overflow: hidden; }
.seg a, .seg span { padding: 4px 10px; }
.seg span { background: var(--ink); color: #fff; }
.back { margin: 0 0 4px; }
.big { font-size: 20px; }

/* カレンダー：出席カード。やった日にハンコ */
.cal { border-collapse: collapse; margin: 8px 0; background: var(--paper-light); }
.cal td, .cal th { width: 38px; height: 34px; text-align: center; font-size: 13px; border: 1px solid var(--line); }
.cal th { color: var(--muted); font-weight: normal; font-size: 12px; }
.cal td.on { color: var(--shu); font-weight: 700; background:
  radial-gradient(circle, transparent 11px, var(--shu) 12px, var(--shu) 13.5px, transparent 14.5px); }
.cal td.future { color: #bdb59f; }

/* フォーム・その他 */
.choice { display: block; margin: 6px 0; }
fieldset { border: 1px solid var(--line); background: var(--paper-light); margin-bottom: 12px; }
.graduated li { color: var(--muted); font-size: 14px; }
.user-picks { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.user-picks form { display: inline; }
.new-user { display: flex; gap: 6px; margin-top: 12px; }

/* 画面全体を3分割（2026-11-18 社長）：左＝ロゴとメニュー／真ん中＝各ページ／右＝自分のこと。左右はどのページでも同じ */
.app { display: grid; grid-template-columns: 230px minmax(0, 640px) 290px; grid-template-areas: "left feed right";
  justify-content: center; gap: 28px; padding: 0 16px; align-items: start; }
.side-left { grid-area: left; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 0 24px;
  display: flex; flex-direction: column; gap: 14px; }
main.feed { grid-area: feed; max-width: none; margin: 0; padding: 22px 0 40px; min-width: 0; }
main.solo { max-width: 560px; }
.side-right { grid-area: right; position: sticky; top: 18px; display: grid; gap: 14px; margin-top: 22px; }
.sp-top, .bottom-nav { display: none; }
.sp-top.always { display: flex; }

/* 左：ロゴ */
.brand-block { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px 6px; }
.brand-block .logo { font-weight: 700; font-size: 22px; color: var(--ink); letter-spacing: .06em; }
.brand-block .tagline { font-size: 11px; color: var(--muted); }
/* 左：メニュー */
.icon { flex: none; }
.main-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: var(--text); font-size: 15px; border: 1px solid transparent; }
.nav-item:hover { background: var(--paper); }
.nav-item.active { background: var(--paper); color: var(--ink); font-weight: 700; border-color: var(--line); }
.unread-badge { margin-left: auto; background: var(--ink); color: #fff; font-size: 11px; border-radius: 9px; padding: 0 7px; min-width: 18px; text-align: center; }
.side-new { padding: 10px; font-size: 15px; border-radius: 10px; }
.side-title { font-size: 12px; color: var(--muted); margin: 4px 10px 6px; letter-spacing: .1em; }
.cat-nav { display: flex; flex-direction: column; gap: 1px; }
.cat { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-radius: 8px; color: var(--text); font-size: 14px; }
.cat:hover { background: var(--paper); }
.cat.active { background: var(--paper); color: var(--ink); font-weight: 700; }
.cat-count { font-size: 12px; color: var(--muted); font-weight: normal; }
.side-me { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding: 10px; border-top: 1px solid var(--line); font-size: 14px; }
.side-me form { display: inline; }

/* 右：パネル */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.panel-title { font-size: 15px; margin: 0 0 10px; display: flex; justify-content: space-between; align-items: baseline; }
.today-list, .total-list { list-style: none; margin: 0 0 8px; padding: 0; }
.today-list li, .total-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.total-list li { justify-content: space-between; align-items: baseline; }
.today-list li:last-child, .total-list li:last-child { border-bottom: none; }
.today-name { flex: 1; }
.hanko.small { width: 24px; height: 24px; font-size: 11px; border-width: 1.5px; flex: none; }
.hanko.empty { border: 1.5px dashed var(--line); transform: none; }
.btn-mini { font-size: 12px; padding: 2px 10px; border: 1px solid var(--ink); border-radius: 6px; color: var(--ink); }
.btn-mini:hover { background: var(--ink); color: #fff; }
.total-num b { font-size: 22px; color: var(--ink); }
.hitokoto p { margin: 0; line-height: 1.7; }

/* ユーザーページ・お知らせ */
.user-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.user-head form { display: inline; }
.fav.on { background: var(--ink); color: #fff; }
.notice-list { list-style: none; padding: 0; margin: 0; }
.notice-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 8px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; line-height: 1.6; }
.notice-item.unread { border-left: 3px solid var(--ink); }
.notice-date { white-space: nowrap; }
.notice-stamps { display: flex; gap: 6px; margin-top: 4px; }
.mini-stamp { display: inline-flex; align-items: center; gap: 2px; }
.mini-stamp .stamp-emoji { font-size: 20px; }
.mini-stamp .stamp-img { width: 22px; height: 22px; }

/* 少し狭い画面：右の3つを、真ん中の上に横並びで */
@media (max-width: 1180px) {
  .app { grid-template-columns: 220px minmax(0, 680px); grid-template-areas: "left right" "left feed"; row-gap: 0; }
  .side-left { grid-row: 1 / span 2; }
  .side-right { position: static; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .side-right { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-right .panel { padding: 10px 12px; }
  main.feed { padding-top: 14px; }
}

/* スマホ：上にロゴ、下にメニュー。ホームだけ「今日の記録」とカテゴリを一覧の上に */
@media (max-width: 760px) {
  .app { display: block; padding: 0 12px 84px; }
  .side-left { position: static; height: auto; padding: 0; display: block; }
  .side-left .brand-block, .side-left .main-nav, .side-left .side-new, .side-left .side-me, .side-left .side-title { display: none; }
  .side-left .side-cats { display: none; }
  .is-home .side-left .side-cats { display: block; margin: 8px 0 0; }
  .cat-nav { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .cat { white-space: nowrap; border: 1px solid var(--line); background: var(--paper-light); gap: 6px; }
  .side-right { display: none; position: static; margin-top: 10px; }
  .is-home .side-right { display: grid; grid-template-columns: minmax(0, 1fr); }
  .is-home .side-right .totals, .is-home .side-right .hitokoto { display: none; }
  .is-home { display: flex; flex-direction: column; align-items: stretch; }
  .is-home .side-right { order: 1; } .is-home .side-left { order: 2; } .is-home main.feed { order: 3; }
  main.feed { padding-top: 12px; }
  .sp-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px;
    background: var(--paper); border-bottom: 2px solid var(--ink); position: sticky; top: 0; z-index: 10; }
  .sp-top .logo { font-weight: 700; font-size: 18px; color: var(--ink); letter-spacing: .06em; }
  .sp-settings { color: var(--ink); display: inline-flex; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; justify-content: space-around;
    background: var(--paper); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); min-width: 56px; }
  .bn small { font-size: 10px; }
  .bn.active { color: var(--ink); font-weight: 700; }
  .unread-dot { position: absolute; top: -4px; right: 10px; background: var(--ink); color: #fff; font-size: 10px; border-radius: 8px; padding: 0 5px; }
  .stamp-btn { width: 66px; height: 66px; }
  .group-label { width: 100%; }
  .tab { padding: 8px 10px; font-size: 14px; white-space: nowrap; }
  .card, .mine, .panel { padding: 12px; }
}

/* 宣言のひとこと */
.decl-memo { margin: 2px 0 6px; color: var(--text); font-size: 14px; }
.decl-memo::before { content: "— "; color: var(--muted); }
.big-memo { font-size: 16px; margin: -4px 0 10px; }
.memo-input { width: 100%; }

/* カードの左右をならす（2026-11-18 社長：情報が左に偏っている） */
.card-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 6px 0 4px; }
.card-main .card-title { margin: 0; flex: 1; min-width: 0; }
.card-main .stamp-counts { margin: 0; justify-content: flex-end; flex: none; max-width: 50%; }
.decl-memo.inline { margin-left: 10px; font-size: 14px; font-weight: normal; color: var(--muted); }
.decl-memo.inline::before { content: none; }
.card-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.card-foot-buttons { flex: 1; min-width: 0; }
.card-thread { flex: none; white-space: nowrap; }
@media (max-width: 760px) {
  .card-main { flex-direction: column; }
  .card-main .stamp-counts { justify-content: flex-start; max-width: none; }
  .card-foot { flex-direction: column; align-items: stretch; }
  .card-thread { align-self: flex-end; }
}

/* 宣言する：「何を」を3つずつ横に並べる */
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice-grid .choice { white-space: nowrap; font-size: 14px; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-light); cursor: pointer; }
.choice-grid .choice:has(input:checked) { border-color: var(--ink); color: var(--ink); font-weight: 700; }

/* カテゴリのまとまり（運動／学び／生活習慣） */
.choice-group { margin: 10px 0 6px; font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.choice-group:first-of-type { margin-top: 2px; }
.cat-group { display: block; margin: 8px 10px 2px; font-size: 11px; color: var(--muted); letter-spacing: .1em; }
@media (max-width: 760px) { .cat-group { display: none; } .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 週に何回：押して選ぶ札（2026-11-18 社長：プルダウンが単調） */
.freq { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.freq-item { position: relative; cursor: pointer; }
.freq-item input { position: absolute; opacity: 0; pointer-events: none; }
.freq-item span { display: flex; align-items: baseline; justify-content: center; gap: 1px; padding: 10px 0; min-height: 52px; align-content: center; flex-wrap: wrap; font-size: 13px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper-light); color: var(--muted); white-space: nowrap; }
.freq-item span b { font-size: 20px; color: var(--text); margin: 0 1px; }
.freq-item:hover span { border-color: var(--ink); }
.freq-item input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.freq-item input:checked + span b { color: #fff; }
.freq-item input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.freq-quit { display: none; }
form:has(input[value="no_smoking"]:checked, input[value="no_drinking"]:checked) .freq-quit { display: block; }
/* やめる習慣を選んだら：「毎日」を選んだ見た目にして、ほかの札は押せない見た目に（実際の回数はサーバーで毎日にする） */
form:has(input[value="no_smoking"]:checked, input[value="no_drinking"]:checked) .freq-item { pointer-events: none; }
form:has(input[value="no_smoking"]:checked, input[value="no_drinking"]:checked) .freq-item span,
form:has(input[value="no_smoking"]:checked, input[value="no_drinking"]:checked) .freq-item input:checked + span {
  background: var(--paper-light); border-color: var(--line); color: var(--muted); opacity: .45; }
form:has(input[value="no_smoking"]:checked, input[value="no_drinking"]:checked) .freq-item input:checked + span b { color: var(--text); }
form:has(input[value="no_smoking"]:checked, input[value="no_drinking"]:checked) .freq-item:last-child span {
  background: var(--ink); border-color: var(--ink); color: #fff; opacity: 1; }
form:has(input[value="no_smoking"]:checked, input[value="no_drinking"]:checked) .freq-item:last-child span b { color: #fff; }
@media (max-width: 760px) { .freq { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.freq-item span b.daily { font-size: 16px; line-height: 30px; }

/* 左のカテゴリ：まとまりごとに開け閉め（2026-11-18 社長：カテゴリが増えた） */
.cat-chips { display: none !important; }
.cat-fold { margin: 0; }
.cat-summary { list-style: none; cursor: pointer; font-weight: 600; }
.cat-summary::-webkit-details-marker { display: none; }
.cat-summary::before { content: "›"; display: inline-block; width: 14px; color: var(--muted); transition: transform .15s; }
.cat-fold[open] > .cat-summary::before { transform: rotate(90deg); }
.cat-summary { justify-content: flex-start; gap: 2px; }
.cat-summary .cat-count { margin-left: auto; }
.cat-child { padding-left: 26px; }
@media (max-width: 760px) {
  .cat-tree { display: none !important; }
  .cat-chips { display: flex !important; }
}

/* カレンダー（月・年）。やった日は朱のハンコ */
.calendar { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cal-nav { display: flex; align-items: center; gap: 10px; }
.cal-label { font-weight: 700; font-size: 16px; min-width: 7.5em; text-align: center; }
.cal-arrow { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 50%; font-size: 18px; color: var(--ink); background: var(--paper-light); }
.cal-arrow:hover { border-color: var(--ink); }
.cal-arrow.off { color: var(--line); }
.cal-view a, .cal-view span { min-width: 2.4em; text-align: center; }
.cal-month { width: 100%; table-layout: fixed; margin: 0; }
.cal-month td, .cal-month th { height: 40px; width: auto; }
.cal-month td.out { background: transparent; border-color: transparent; }
.cal-month td.today { outline: 2px solid var(--ink); outline-offset: -3px; }
.cal-sum { margin: 8px 0 0; text-align: right; }
.cal-sum b { font-size: 18px; color: var(--ink); }
.cal-year { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; }
.mini { display: flex; flex-direction: column; gap: 3px; }
.mini.dim { opacity: .35; }
.mini-title { font-size: 12px; font-weight: 700; color: var(--ink); }
.mini-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.mini-grid i { aspect-ratio: 1 / 1; border-radius: 50%; background: var(--paper-light); border: 1px solid var(--line); }
.mini-grid i.x { background: transparent; border-color: transparent; }
.mini-grid i.on { background: var(--shu); border-color: var(--shu); }
.mini-grid i.future { background: transparent; border-color: transparent; }
.mini-sum { font-size: 11px; color: var(--muted); text-align: right; }
@media (max-width: 760px) { .cal-year { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cal-month td, .cal-month th { height: 36px; } }

/* カレンダーをひとまわり小さく（2026-11-18 社長） */
.calendar { max-width: 460px; padding: 10px 12px; }
.cal-label { font-size: 15px; min-width: 7em; }
.cal-arrow { width: 26px; height: 26px; font-size: 16px; }
.cal-month td, .cal-month th { height: 32px; font-size: 12px; }
.cal-month th { font-size: 11px; }
.cal td.on { background: radial-gradient(circle, transparent 9px, var(--shu) 10px, var(--shu) 11.5px, transparent 12.5px); }
.cal-year { gap: 8px 10px; }
.mini-grid { gap: 2px; }
.mini-title { font-size: 11px; }
.mini-sum { font-size: 10px; }
.cal-sum b { font-size: 16px; }
@media (max-width: 760px) { .calendar { max-width: none; } }

/* ロゴ画像（2026-11-18 社長が作成） */
.logo-img { display: block; width: 190px; height: auto; }
.sp-top .logo-img { width: 120px; }

/* マイページ：宣言どうしの間をあける（2026-11-18 社長：くっついて見える） */
.mine { margin-bottom: 16px; }

/* 使いやすさの改善（2026-11-18） */
/* かけた時間：押して選ぶ札 */
.min-chips { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.min-chip { position: relative; cursor: pointer; }
.min-chip input { position: absolute; opacity: 0; pointer-events: none; }
.min-chip span { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-light); font-size: 13px; color: var(--muted); }
.min-chip:hover span { border-color: var(--ink); }
.min-chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.min-chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
/* 達成したあと：直す・取り消す */
.done-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; }
.done-actions { display: inline-flex; gap: 2px; }
.done-actions form { display: inline; }
.done-actions .btn-ghost { font-size: 13px; padding: 4px 8px; color: var(--muted); }
/* ハンコがポンと押される */
@keyframes hanko-pop {
  0% { transform: scale(1.9) rotate(-24deg); opacity: 0; }
  55% { transform: scale(.88) rotate(-6deg); opacity: 1; }
  100% { transform: scale(1) rotate(-8deg); opacity: 1; }
}
.hanko.pop { animation: hanko-pop 2.2s cubic-bezier(.2, .9, .3, 1.2) both; }  /* 2026-11-18 社長：もっとゆっくり（0.5秒→1.1秒→2.2秒） */
@media (prefers-reduced-motion: reduce) { .hanko.pop { animation: none; } }
/* 一覧のスタンプはたたんでおく */
.stamp-fold { width: 100%; }
.stamp-summary { list-style: none; cursor: pointer; font-size: 13px; padding: 5px 12px; }
.stamp-summary::-webkit-details-marker { display: none; }
.stamp-summary::after { content: " ▾"; font-size: 11px; }
.stamp-fold[open] > .stamp-summary { margin-bottom: 8px; }
.stamp-fold[open] > .stamp-summary::after { content: " ▴"; }
/* 右の今日の記録から投稿 */
.today-list li { display: block; }
.today-row { display: flex; align-items: center; gap: 8px; cursor: default; }
.quick > summary { list-style: none; cursor: pointer; }
.quick > summary::-webkit-details-marker { display: none; }
.quick[open] > summary .btn-mini { background: var(--ink); color: #fff; }
.post-form.compact { margin-top: 8px; gap: 6px; }
.post-form.compact .min-chip span { padding: 4px 8px; font-size: 12px; }
.post-form.compact input[type=text] { min-width: 0; width: 100%; flex: none; font-size: 13px; }
.post-form.compact .btn-done { width: 100%; padding: 6px; font-size: 14px; }
/* マイページの下の段 */
.mine-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.mine-foot .btn-ghost { font-size: 13px; color: var(--muted); padding: 4px 6px; }
.edit-activity { margin: 4px 0; font-weight: 700; }

/* 右の通算日数：押すとその宣言のスレッドへ */
.total-list li { display: block; }
.total-link { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; color: var(--text); border-radius: 8px; margin: 0 -6px; padding: 2px 6px; }
.total-link:hover { background: var(--paper-light); color: var(--ink); }

/* ハンコの文字を「済」→「達成」に（2026-11-18 社長）。2文字を縦に並べる */
.hanko { flex-direction: column; width: 40px; height: 40px; font-size: 12px; line-height: 1.05; letter-spacing: 0; }
.hanko .hk { display: block; }
.hanko.small { width: 30px; height: 30px; font-size: 10px; line-height: 1; }

/* お気に入りの☆（宣言に対して） */
.head-right { display: inline-flex; align-items: center; gap: 6px; }
.star-frame { display: inline-flex; }
.star-frame form { display: inline; }
.star { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: none; background: none; color: var(--muted); cursor: pointer; border-radius: 50%; padding: 0; }
.star:hover { background: var(--paper-light); color: var(--brand-yellow); }
.star.on { color: var(--brand-yellow); }
.detail-star { float: right; margin-top: 30px; }

/* マイページ（プロフィール）2026-11-18 */
.profile { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 0 8px; }
.profile-main { display: flex; align-items: center; gap: 14px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--ink); color: var(--ink); font-size: 22px; font-weight: 700; flex: none; }
.profile-name { margin: 0; font-size: 22px; }
.profile-stats { margin: 4px 0 0; }
.profile-stats b { color: var(--ink); font-size: 15px; }
.profile form { display: inline; }
.profile-settings { margin: 0 0 16px; }
.profile-settings > summary { list-style: none; cursor: pointer; display: inline-flex; gap: 6px; color: var(--muted); font-size: 14px; }
.profile-settings > summary::-webkit-details-marker { display: none; }
.profile-settings[open] > summary { color: var(--ink); }
.profile-settings .settings-form { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-top: 6px; display: block; }
/* スマホの上：帯にせず、ページの一部としてロゴを置く（2026-11-18 社長：ヘッダーが独立して見える） */
@media (max-width: 760px) {
  .sp-top { position: static; background: transparent; border-bottom: none; padding: 14px 14px 0; }
}

/* 設定ボタンは名前の右。押すと右下に開く（2026-11-18 社長） */
.profile-settings { position: relative; margin: 0; }
.profile-settings > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 14px; }
.profile-settings > summary::-webkit-details-marker { display: none; }
.profile-settings[open] > summary { background: var(--ink); color: #fff; }
.settings-panel { position: absolute; right: 0; top: calc(100% + 6px); width: min(420px, 86vw); z-index: 20;
  background: var(--paper); border: 1px solid var(--ink); border-radius: 12px; padding: 12px 16px; }  /* 上に重なるので枠をインク色にして区切る */
.settings-panel .settings-form { background: none; border: none; padding: 0; margin: 0; }
.settings-panel .hint:last-child { margin-bottom: 0; }

/* 通算日数の節目（10日で太く、50日から小さなメダル） */
.total-n { font-weight: 700; }
.total-n.thin { font-weight: 400; }
.medal { display: inline-flex; vertical-align: -2px; margin-left: 3px; }
/* 通算の数字とメダルを大きく（2026-11-18 社長） */
.card-total .total-n, .mine-head .total-n { font-size: 18px; color: var(--ink); }
.card-total, .mine-head .hint { white-space: nowrap; }
.big .total-n { font-size: 28px; color: var(--ink); }
.medal { vertical-align: -4px; margin-left: 4px; }

/* 週の回数：1か月以内に変えたときは押せない見た目 */
.freq-locked .freq-item { pointer-events: none; }
.freq-locked .freq-item span { opacity: .45; }
.freq-locked .freq-item input:checked + span { opacity: 1; }

/* 2026-11-18 社長：ロゴの下の一言はロゴの下の中央に／記録の詳細ページのカレンダーは中央に */
.brand-block { align-items: center; text-align: center; width: fit-content; }
.brand-block .tagline { margin-top: 2px; }
.calendar { margin-left: auto; margin-right: auto; }

/* ログイン・新規登録（2026-11-18） */
.auth { max-width: 420px; margin: 24px auto; }
.auth-form { display: grid; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.auth-form label, .account-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.auth-form input[type=email], .auth-form input[type=password], .auth-form input[type=text],
.account-form input[type=email], .account-form input[type=password], .account-form input[type=text] {
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 15px; background: var(--paper-light); color: var(--text); }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.demo { margin-top: 28px; border-top: 1px dashed var(--line); padding-top: 14px; }
.account-form { display: grid; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.form-title { margin: 0; font-weight: 700; font-size: 14px; color: var(--text); }
.form-h2 { font-size: 15px; margin: 22px 0 8px; }
.logout { margin-top: 10px; color: var(--muted); font-size: 13px; }
.settings-panel { max-height: 75vh; overflow-y: auto; }
.auth-form input, .account-form input[type=email], .account-form input[type=password], .account-form input[type=text] { width: 100%; min-width: 0; }
.auth-form label, .account-form label { min-width: 0; }
/* ログイン前のページ：ロゴを中央に大きく */
.sp-top.always { justify-content: center; padding: 36px 0 0; background: transparent; border: none; }
.sp-top.always .logo-img { width: 200px; }

/* 設定ページ（2026-11-18）：スタンプの設定／アカウント／ログアウト */
.settings-section { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.settings-h2 { font-size: 16px; margin: 0 0 12px; }
.settings-section .settings-form, .settings-section .account-form { background: none; border: none; padding: 0; margin: 0; }
.settings-section .account-form + .account-form { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.settings-section .account-form:first-child { border-top: none; padding-top: 0; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.toggle-text { display: grid; gap: 2px; }
.toggle-text small { color: var(--muted); font-size: 12px; line-height: 1.5; }
/* スイッチの見た目（中身はチェックボックス） */
.toggle { appearance: none; -webkit-appearance: none; flex: none; width: 44px; height: 26px; border-radius: 13px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle:checked { background: var(--ink); }
.toggle:checked::after { left: 21px; }
.toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.settings-form .btn-primary { margin-top: 12px; }
.account-form .btn-primary { justify-self: start; }
.account-form .hint { margin: -4px 0 0; }

/* スタンプの画像（2026-11-18 社長作）。画像の中に言葉があるので、ボタンの下の文字は出さずに画像を大きく */
.stamp-btn:has(.stamp-img) { width: 88px; height: 88px; padding: 4px; }
.stamp-btn:has(.stamp-img) small { display: none; }
.stamp-btn .stamp-img { width: 78px; height: 78px; }
.stamp-tile:has(.stamp-img) { width: 64px; height: 64px; padding: 3px; }
.mini-stamp .stamp-img { width: 28px; height: 28px; }
@media (max-width: 760px) { .stamp-btn:has(.stamp-img) { width: 76px; height: 76px; } .stamp-btn .stamp-img { width: 68px; height: 68px; } }

/* ふりかえり（前の自分の投稿）。目立たせすぎない */
.look-back { margin: 8px 0 6px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 10px; }
.look-back-head { margin: 0 0 2px; font-size: 12px; color: var(--muted); }
.look-back-body { margin: 0; font-size: 14px; color: var(--text); }

/* ふりかえりの窓 */
.modal { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); padding: 22px 24px 18px; width: min(440px, calc(100vw - 32px)); color: var(--text); }
.modal::backdrop { background: rgba(32, 36, 44, 0.45); }
.modal-kicker { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.modal-title { margin: 0 0 14px; font-size: 18px; color: var(--ink); line-height: 1.5; }
.modal-post { background: var(--paper-light); border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.modal-body { margin: 0; font-size: 16px; }
.modal-post .hint { margin: 4px 0 0; }
.modal .btn { display: block; margin: 0 auto; }
.modal-text { margin: 0 0 16px; font-size: 14px; color: var(--muted); }
