/* マイページ — 温かみのあるダッシュボード */
html.gantomo-mypage {
  --bg: #fffaf5;
  --ink: #4a3f35;
  --ink-muted: #6b5f54;
  --accent: #e8882e;
  --accent-soft: #ffe8d6;
  --line: rgba(74, 63, 53, 0.1);
  --max: 72rem;
}

html.gantomo-mypage body {
  margin: 0;
  font-family: "Noto Sans JP", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

html.gantomo-mypage a {
  color: inherit;
}

html.gantomo-mypage .site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 245, 0.95);
  backdrop-filter: blur(12px);
}

html.gantomo-mypage .site-header .gantomo-crossnav {
  border-bottom: 1px solid var(--line);
}

html.gantomo-mypage .header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

html.gantomo-mypage .logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
}

html.gantomo-mypage .logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent) 0%, #6a9f82 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(74, 124, 98, 0.15);
}

html.gantomo-mypage .logo-mark svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html.gantomo-mypage .logo-text {
  font-family: "Noto Serif JP", serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

html.gantomo-mypage .nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

html.gantomo-mypage .nav a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

html.gantomo-mypage .nav a:hover {
  color: var(--ink);
  background: var(--accent-soft);
}

.gantomo-home {
  margin: 0 auto;
  padding: 0 0 3.5rem;
}

/* 未ログイン時のマイページ案内 */
html.gantomo-mypage-guest .gantomo-nav-member {
  display: none !important;
}

html.gantomo-mypage-guest #gantomo-home {
  display: none !important;
}

html:not(.gantomo-mypage-guest) #mypage-gate {
  display: none !important;
}

#mypage-gate[hidden],
#gantomo-home[hidden] {
  display: none !important;
}

.mypage-gate {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--g-site-header-height, 67px) - var(--g-crossnav-height, 56px));
  padding: 2rem 1.25rem 3rem;
  box-sizing: border-box;
}

.mypage-gate-card {
  width: min(100%, 36rem);
  padding: 2rem 1.75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(26, 24, 22, 0.07);
  text-align: center;
}

.mypage-gate-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.mypage-gate-card h1 {
  margin: 0 0 1rem;
  font-family: "Noto Serif JP", serif;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 700;
  color: var(--ink);
}

.mypage-gate-lead {
  margin: 0 0 1.5rem;
  color: var(--ink-muted);
  line-height: 1.85;
  text-align: left;
}

.mypage-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.mypage-gate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 10rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.mypage-gate-btn--primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

.mypage-gate-btn--primary:hover {
  background: #3d6a53;
  border-color: #3d6a53;
}

.mypage-gate-btn--secondary {
  background: #fff;
  color: var(--accent);
  border: 1px solid rgba(74, 124, 98, 0.35);
}

.mypage-gate-btn--secondary:hover {
  background: var(--accent-soft);
}

.mypage-gate-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.mypage-gate-note a {
  color: var(--accent);
}

/* ボタン（index.html から分離。マイページ専用） */
html.gantomo-mypage .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.9rem 1.65rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  border: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.3;
}

html.gantomo-mypage .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(26, 24, 22, 0.07);
}

html.gantomo-mypage .btn-primary {
  color: #fff;
  background: var(--accent, #4a7c62);
}

html.gantomo-mypage .btn-primary:hover {
  background: #3d6a53;
}

html.gantomo-mypage .btn-secondary {
  color: var(--ink, #1a1816);
  background: #fff;
  border: 1px solid var(--line, rgba(26, 24, 22, 0.08));
}

html.gantomo-mypage .btn-ghost {
  color: var(--ink-muted, #5c5651);
  background: transparent;
}

html.gantomo-mypage .btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
}

html.gantomo-mypage svg {
  max-width: 100%;
  height: auto;
}

/* --- シェル（柔らかい背景） --- */
.home-shell {
  position: relative;
  max-width: var(--max, 72rem);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.home-shell::before {
  content: "";
  position: absolute;
  inset: -2rem 0 auto;
  height: 280px;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(74, 124, 98, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 85% 10%, rgba(184, 149, 106, 0.1) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.home-shell > * {
  position: relative;
  z-index: 1;
}

/* --- ウェルカム帯 --- */
.home-welcome {
  padding: 1.75rem 0 1.5rem;
  margin-bottom: 0.25rem;
}

.home-welcome-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent, #4a7c62);
  margin-bottom: 0.5rem;
}

.home-welcome-title {
  font-family: "Noto Serif JP", serif;
  font-size: clamp(1.5rem, 3.8vw, 2.15rem);
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 0.65rem;
  color: var(--ink, #1a1816);
}

.home-welcome-title span {
  color: var(--accent, #4a7c62);
}

.home-welcome-lead {
  font-size: 0.92rem;
  color: var(--ink-muted, #5c5651);
  line-height: 1.8;
  max-width: 40rem;
  margin: 0 0 1.35rem;
}

.home-quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.home-quick-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink, #1a1816);
  background: #fff;
  border: 1px solid var(--line, rgba(26, 24, 22, 0.1));
  box-shadow: 0 2px 12px rgba(26, 24, 22, 0.04);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.home-quick-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(26, 24, 22, 0.08);
}

.home-quick-link--forum:hover {
  border-color: rgba(74, 124, 98, 0.4);
  color: var(--accent-hover, #3d6a53);
}

.home-quick-link--chat:hover {
  border-color: rgba(122, 111, 150, 0.35);
  color: #5e5478;
}

.home-quick-link--community:hover {
  border-color: rgba(184, 149, 106, 0.4);
  color: #8a6b42;
}

.home-quick-icon {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: center / 14px 14px no-repeat;
}

.home-quick-link--forum .home-quick-icon {
  background-color: var(--accent-soft, #e8f0eb);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a7c62' stroke-width='2'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
}

.home-quick-link--chat .home-quick-icon {
  background-color: #ede8f2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a6f96' stroke-width='2'%3E%3Cpath d='M12 22c5.5 0 10-4 10-9V5l-8 3-2-3-8 3v8c0 5 4.5 9 10 9z'/%3E%3C/svg%3E");
}

.home-quick-link--community .home-quick-icon {
  background-color: var(--warm-soft, #f5ede3);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8956a' stroke-width='2'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M6 21v-1a6 6 0 0 1 12 0v1'/%3E%3C/svg%3E");
}

/* --- ダッシュボードレイアウト --- */
.home-dashboard {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

@media (min-width: 960px) {
  .home-dashboard {
    grid-template-columns: minmax(272px, 300px) 1fr;
    gap: 1.5rem;
  }

  .home-sidebar {
    position: sticky;
    top: calc(var(--g-crossnav-height, 56px) + 4.5rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
}

.home-main {
  display: grid;
  gap: 1.15rem;
  grid-template-columns: 1fr;
  min-width: 0;
}

@media (min-width: 720px) {
  .home-main {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }

  .home-panel--wide {
    grid-column: 1 / -1;
  }
}

/* --- プロフィールカード --- */
.home-profile-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line, rgba(26, 24, 22, 0.08));
  border-radius: var(--radius, 20px);
  box-shadow: 0 4px 24px rgba(26, 24, 22, 0.06);
  overflow: hidden;
}

.home-profile-accent {
  height: 4px;
  background: linear-gradient(90deg, var(--accent, #4a7c62) 0%, #6a9f82 50%, var(--warm, #b8956a) 100%);
}

.home-profile-inner {
  padding: 1.25rem 1.2rem 1.35rem;
}

.home-profile-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.home-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  outline: 2px solid var(--accent-soft, #e8f0eb);
  flex-shrink: 0;
  background: var(--bg-soft, #f3efe8);
  box-shadow: 0 4px 14px rgba(74, 124, 98, 0.12);
}

.home-profile-ident {
  min-width: 0;
}

.home-profile-name {
  font-family: "Noto Serif JP", serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
  word-break: break-word;
}

.home-profile-handle {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-light, #8a837c);
  margin-top: 0.1rem;
}

.home-profile-bio {
  font-size: 0.86rem;
  color: var(--ink-muted, #5c5651);
  line-height: 1.7;
  margin: 0 0 1rem;
}

.home-profile-bio.home-empty {
  font-style: italic;
  color: var(--ink-light, #8a837c);
}

.home-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.home-stat {
  text-align: center;
  padding: 0.55rem 0.35rem;
  border-radius: 10px;
  background: var(--bg, #faf8f5);
  border: 1px solid var(--line, rgba(26, 24, 22, 0.06));
}

.home-stat-value {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent, #4a7c62);
  line-height: 1.2;
}

.home-stat-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-light, #8a837c);
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

.home-stat-note {
  font-size: 0.75rem;
  color: var(--ink-light, #8a837c);
  text-align: center;
  margin: 0 0 1rem;
}

.home-stat-note span {
  font-weight: 700;
  color: var(--warm, #b8956a);
}

.home-profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.home-profile-actions .btn {
  font-size: 0.82rem;
  padding: 0.55rem 0.5rem;
  text-align: center;
  justify-content: center;
}

/* --- 通知パネル（サイドバー） --- */
.home-notify-panel {
  padding: 1rem 1.1rem 1.15rem;
  background: linear-gradient(160deg, #fff 0%, #faf6f0 100%);
  border: 1px solid var(--line, rgba(26, 24, 22, 0.08));
  border-radius: var(--radius-sm, 14px);
  box-shadow: 0 2px 16px rgba(26, 24, 22, 0.04);
}

.home-notify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.home-notify-head .home-panel-heading {
  margin: 0;
}

.home-notify-total {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #c45c4a;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  flex-shrink: 0;
}

.home-notify-total[hidden] {
  display: none;
}

.home-notify-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.home-notify-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line, rgba(26, 24, 22, 0.08));
  font-size: 0.78rem;
  color: var(--ink-muted, #5c5650);
}

.home-notify-chip strong {
  color: var(--ink, #1a1816);
  font-weight: 700;
}

.home-notify-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-notify-list li {
  padding: 0.4rem 0;
  border-top: 1px solid var(--line, rgba(26, 24, 22, 0.06));
}

.home-notify-list li:first-child {
  border-top: none;
  padding-top: 0;
}

.home-notify-list a {
  color: var(--ink, #1a1816);
  text-decoration: none;
  font-size: 0.84rem;
  line-height: 1.5;
}

.home-notify-list a:hover {
  color: var(--accent, #4a7c62);
}

.home-notify-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.home-notify-actions .btn {
  flex: 1 1 auto;
  min-width: 0;
}

/* --- 共通パネル --- */
.home-panel {
  background: #fff;
  border: 1px solid var(--line, rgba(26, 24, 22, 0.08));
  border-radius: var(--radius-sm, 14px);
  padding: 1.15rem 1.2rem 1.2rem;
  box-shadow: 0 2px 16px rgba(26, 24, 22, 0.04);
}

.home-panel--accent {
  background: linear-gradient(135deg, #fff 0%, #f8fbf9 100%);
  border-color: rgba(74, 124, 98, 0.12);
}

.home-panel--soft {
  background: linear-gradient(135deg, #fff 0%, #faf8f5 100%);
}

.home-panel-heading {
  font-family: "Noto Serif JP", serif;
  font-size: 0.98rem;
  font-weight: 600;
  margin: 0 0 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink, #1a1816);
}

.home-panel-icon {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 8px;
  flex-shrink: 0;
  background: center / 14px 14px no-repeat;
}

.home-panel-icon--announce {
  background-color: #e8f4fa;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230088cc' stroke-width='2'%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E");
}

.home-panel-icon--topics {
  background-color: var(--accent-soft, #e8f0eb);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a7c62' stroke-width='2'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
}

.home-panel-icon--follow {
  background-color: var(--warm-soft, #f5ede3);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8956a' stroke-width='2'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
}

.home-panel-icon--members {
  background-color: #ede8f2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a6f96' stroke-width='2'%3E%3Cpath d='M12 2l2.4 7.4H22l-6 4.6 2.3 7L12 16.6 5.7 21l2.3-7-6-4.6h7.6L12 2z'/%3E%3C/svg%3E");
}

.home-panel-icon--community {
  background-color: var(--accent-soft, #e8f0eb);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a7c62' stroke-width='2'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E");
}

.home-panel-icon--notify {
  background-color: #fdeee9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c45c4a' stroke-width='2'%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3C/svg%3E");
}

.home-panel-icon--mine {
  background-color: var(--accent-soft, #e8f0eb);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a7c62' stroke-width='2'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
}

.home-panel-icon--bookmark {
  background-color: #fff4e5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8956a' stroke-width='2'%3E%3Cpath d='M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
}

.home-profile-tip {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: rgba(184, 149, 106, 0.12);
  border: 1px solid rgba(184, 149, 106, 0.25);
  font-size: 0.8rem;
  color: var(--ink-muted, #5c5651);
  line-height: 1.6;
}

.home-profile-tip a {
  color: var(--accent-hover, #3d6a53);
  font-weight: 600;
  text-decoration: none;
}

.home-profile-tip a:hover {
  text-decoration: underline;
}

.home-unread-strip {
  margin-bottom: 1rem;
  scroll-margin-top: 7rem;
}

.home-unread-strip-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  background: linear-gradient(90deg, #fdeee9 0%, #fff8f5 100%);
  border: 1px solid rgba(196, 92, 74, 0.2);
}

.home-unread-strip-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink, #1a1816);
  line-height: 1.5;
}

.home-unread-strip-text strong {
  color: #a84838;
}

.home-unread-strip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

html.gantomo-mypage #home-diary,
html.gantomo-mypage #home-profile,
html.gantomo-mypage #home-notifications,
html.gantomo-mypage #home-my-activity,
html.gantomo-mypage #home-bookmarks,
html.gantomo-mypage #home-topics,
html.gantomo-mypage #home-following,
html.gantomo-mypage #home-communities,
html.gantomo-mypage #home-announcements,
html.gantomo-mypage #home-suggestions {
  scroll-margin-top: 7rem;
}

.home-panel-lead,
.home-follow-lead,
.home-communities-lead {
  font-size: 0.84rem;
  color: var(--ink-muted, #5c5651);
  line-height: 1.7;
  margin: -0.45rem 0 0.85rem;
}

.home-follow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* --- トピックリスト --- */
.home-topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-topic-list li {
  border-top: 1px solid var(--line, rgba(26, 24, 22, 0.06));
  padding: 0.6rem 0;
}

.home-topic-list li:first-child {
  border-top: none;
  padding-top: 0;
}

.home-topic-list a {
  color: var(--ink, #1a1816);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.55;
  display: block;
}

.home-topic-list a:hover {
  color: var(--accent-hover, #3d6a53);
}

.home-topic-meta {
  font-size: 0.75rem;
  color: var(--ink-light, #8a837c);
  margin-top: 0.2rem;
}

.home-more {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent, #4a7c62);
  text-decoration: none;
}

.home-more::after {
  content: "→";
  transition: transform 0.2s;
}

.home-more:hover {
  color: var(--accent-hover, #3d6a53);
}

.home-more:hover::after {
  transform: translateX(3px);
}

/* --- メンバー一覧 --- */
.home-member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}

.home-member-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line, rgba(26, 24, 22, 0.06));
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.home-member-item:hover {
  border-color: rgba(74, 124, 98, 0.2);
  box-shadow: 0 2px 10px rgba(26, 24, 22, 0.04);
}

.home-member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--accent-soft, #e8f0eb);
}

.home-member-info {
  flex: 1 1 auto;
  min-width: 0;
}

.home-member-info a {
  display: block;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--ink, #1a1816);
  text-decoration: none;
}

.home-member-info a:hover {
  color: var(--accent-hover, #3d6a53);
}

.home-member-meta {
  font-size: 0.72rem;
  color: var(--ink-light, #8a837c);
}

.home-member-follow {
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  white-space: nowrap;
}

/* --- コミュニティカード --- */
.home-category-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.home-category-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line, rgba(26, 24, 22, 0.08));
  border-radius: 14px;
  padding: 1rem 1.05rem 0.95rem;
  background: #fff;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  min-height: 100%;
}

.home-category-card:hover {
  border-color: rgba(74, 124, 98, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 24, 22, 0.07);
}

.home-category-icon {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  margin-bottom: 0.6rem;
  background: var(--accent-soft, #e8f0eb) center / 22px 22px no-repeat;
}

.home-category-card--patients .home-category-icon {
  background-color: #e8f0eb;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a7c62' stroke-width='1.7'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M6 21v-1a6 6 0 0 1 12 0v1'/%3E%3C/svg%3E");
}

.home-category-card--families .home-category-icon {
  background-color: #f5ede3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8956a' stroke-width='1.7'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3C/svg%3E");
}

.home-category-card--bereaved .home-category-icon {
  background-color: #ede8f2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a6f96' stroke-width='1.7'%3E%3Cpath d='M12 2l2.4 7.4H22l-6 4.6 2.3 7L12 16.6 5.7 21l2.3-7-6-4.6h7.6L12 2z'/%3E%3C/svg%3E");
}

.home-category-card--news .home-category-icon {
  background-color: #fdeee9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e45735' stroke-width='1.7'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20'/%3E%3C/svg%3E");
}

.home-category-card--general .home-category-icon {
  background-color: #f0efed;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c5651' stroke-width='1.7'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
}

.home-category-card--announcements .home-category-icon {
  background-color: #e8f4fa;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230088cc' stroke-width='1.7'%3E%3Cpath d='M3 11v2a4 4 0 0 0 4 4h1M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}

.home-category-card h3 {
  font-family: "Noto Serif JP", serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--accent, #4a7c62);
}

.home-category-card p {
  font-size: 0.8rem;
  color: var(--ink-muted, #5c5651);
  line-height: 1.6;
  margin-bottom: 0.5rem;
  flex: 1 1 auto;
}

.home-category-meta {
  font-size: 0.72rem;
  color: var(--ink-light, #8a837c);
  margin-bottom: 0.45rem;
}

.home-category-join {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-hover, #3d6a53);
}

.home-loading,
.home-empty {
  font-size: 0.86rem;
  color: var(--ink-muted, #5c5651);
  line-height: 1.65;
}

/* --- ヘッダーナビ（マイページ） --- */
html.gantomo-mypage .nav.gantomo-nav-member {
  display: flex;
}

/* --- モバイル調整 --- */
@media (max-width: 719px) {
  .home-welcome {
    padding-top: 1.25rem;
  }

  .home-quick-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .home-quick-link {
    flex-direction: column;
    padding: 0.65rem 0.4rem;
    text-align: center;
    gap: 0.35rem;
  }

  .home-quick-label {
    font-size: 0.78rem;
  }

  .home-profile-actions {
    grid-template-columns: 1fr;
  }

  .home-member-list {
    grid-template-columns: 1fr;
  }

  .home-unread-strip-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .home-unread-strip-actions .btn {
    width: 100%;
    justify-content: center;
  }

  html.gantomo-mypage .nav.gantomo-nav-member {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
  }

  html.gantomo-mypage .nav.gantomo-nav-member::-webkit-scrollbar {
    display: none;
  }

  html.gantomo-mypage .nav.gantomo-nav-member a {
    flex-shrink: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-quick-link:hover,
  .home-category-card:hover,
  .home-more:hover::after {
    transform: none;
  }
}

/* --- 日記 --- */
.home-panel--diary {
  background: linear-gradient(180deg, #fffaf5 0%, #fff 40%, #faf8f5 100%);
  border-color: rgba(210, 120, 60, 0.15);
}

.home-panel-icon--diary {
  background-color: #ffe8d6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d2783c' stroke-width='2'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/%3E%3C/svg%3E");
}

.diary-header .home-panel-heading {
  color: #8a4a22;
}

.diary-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  background: #fff3e8;
  border-radius: 999px;
  border: 1px solid rgba(210, 120, 60, 0.2);
}

.diary-tab {
  flex: 1 1 0;
  border: none;
  background: transparent;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: #8a6b42;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.diary-tab.is-active {
  background: #fff;
  color: #c45c2a;
  box-shadow: 0 2px 8px rgba(196, 92, 42, 0.15);
}

#home-diary .diary-panel {
  display: none;
}

#home-diary .diary-panel.is-active {
  display: block;
}

.diary-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.diary-card {
  padding: 1rem 1.05rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(26, 24, 22, 0.08);
  box-shadow: 0 2px 12px rgba(26, 24, 22, 0.04);
}

.diary-card--private {
  border-top: 3px solid #8a837c;
}

.diary-card--members {
  border-top: 3px solid #7a6f96;
}

.diary-card--public {
  border-top: 3px solid #d2783c;
}

.diary-card-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.diary-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: hsl(var(--g-h, 24) 45% 52%);
  flex-shrink: 0;
}

.diary-card-ident {
  flex: 1 1 auto;
  min-width: 0;
}

.diary-name {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink, #1a1816);
}

.diary-handle {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-light, #8a837c);
}

.diary-mood {
  font-size: 1.35rem;
  line-height: 1;
}

.diary-vis {
  font-size: 1rem;
  opacity: 0.85;
}

.diary-card-meta {
  font-size: 0.72rem;
  color: var(--ink-light, #8a837c);
  margin-bottom: 0.45rem;
}

.diary-card-title {
  font-family: "Noto Serif JP", serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.45rem;
}

.diary-body {
  font-size: 0.88rem;
  color: var(--ink-muted, #5c5651);
  line-height: 1.8;
  word-break: break-word;
}

.diary-more {
  margin-top: 0.35rem;
  padding: 0;
  border: none;
  background: none;
  color: #c45c2a;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.diary-more:hover {
  text-decoration: underline;
}

.diary-comment-toggle {
  margin-top: 0.65rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(210, 120, 60, 0.25);
  background: #fff8f2;
  color: #8a4a22;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.diary-comment-toggle:hover {
  background: #ffe8d6;
}

.diary-comments {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(26, 24, 22, 0.1);
}

.diary-comment-list {
  list-style: none;
  margin: 0 0 0.55rem;
  padding: 0;
}

.diary-comment {
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(26, 24, 22, 0.06);
}

.diary-comment-author {
  font-weight: 700;
  font-size: 0.8rem;
}

.diary-comment-time {
  font-size: 0.68rem;
  color: var(--ink-light, #8a837c);
}

.diary-comment-body {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--ink-muted, #5c5651);
}

.diary-comment-del {
  margin-left: 0.35rem;
  padding: 0 0.35rem;
  border: none;
  background: none;
  color: #a84838;
  cursor: pointer;
  font-size: 0.9rem;
}

.diary-comment-form {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.diary-comment-form input {
  flex: 1 1 auto;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line, rgba(26, 24, 22, 0.12));
  border-radius: 999px;
  font: inherit;
  font-size: 0.82rem;
}

.diary-comment-empty {
  font-size: 0.82rem;
  color: var(--ink-light, #8a837c);
}

.diary-owner-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.diary-compose {
  padding: 1.1rem 1.15rem;
  border: 1px solid rgba(210, 120, 60, 0.2);
  border-radius: 14px;
  background: #fff;
}

.diary-mood {
  border: none;
  margin: 0 0 0.85rem;
  padding: 0;
}

.diary-mood-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.diary-mood-chip {
  cursor: pointer;
}

.diary-mood-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.diary-mood-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  border: 2px solid transparent;
  background: #fff8f2;
  font-size: 0.85rem;
  transition: border-color 0.2s, background 0.2s;
}

.diary-mood-chip.is-active span,
.diary-mood-chip input:checked + span {
  border-color: #d2783c;
  background: #ffe8d6;
}

.diary-visibility {
  border: none;
  margin: 0 0 0.85rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.diary-vis-chip {
  cursor: pointer;
}

.diary-vis-chip input {
  position: absolute;
  opacity: 0;
}

.diary-vis-chip-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.55rem 0.4rem;
  border-radius: 12px;
  border: 2px solid rgba(26, 24, 22, 0.08);
  background: #faf8f5;
  font-size: 0.72rem;
  color: var(--ink-muted, #5c5651);
  transition: border-color 0.2s, background 0.2s;
}

.diary-vis-chip input:checked + .diary-vis-chip-inner {
  border-color: #d2783c;
  background: #fff3e8;
  color: #8a4a22;
}

.diary-vis-chip-inner strong {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 0.15rem;
  color: inherit;
}

.home-diary-form-grid {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.home-diary-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.home-diary-form-grid .home-diary-field {
  margin-bottom: 0;
}

.home-diary-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted, #5c5651);
}

.home-diary-field input[type="date"],
.home-diary-field input[type="text"],
.home-diary-field textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line, rgba(26, 24, 22, 0.12));
  border-radius: 10px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink, #1a1816);
  background: #fff;
  box-sizing: border-box;
}

.home-diary-field textarea {
  resize: vertical;
  min-height: 8rem;
  line-height: 1.75;
}

.home-diary-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.diary-compose .btn-primary {
  background: linear-gradient(145deg, #d2783c 0%, #c45c2a 100%);
}

.diary-compose .btn-primary:hover {
  background: linear-gradient(145deg, #c46a32 0%, #b04f22 100%);
}

.home-diary-msg {
  margin: 0.65rem 0 0;
  font-size: 0.84rem;
  line-height: 1.6;
}

.home-diary-msg--ok {
  color: var(--accent-hover, #3d6a53);
}

.home-diary-msg--error {
  color: #a84838;
}

@media (max-width: 719px) {
  .home-diary-form-grid {
    grid-template-columns: 1fr;
  }

  .diary-visibility {
    grid-template-columns: 1fr;
  }

  .diary-tabs {
    flex-wrap: wrap;
    border-radius: 14px;
  }
}
