/* ============================================
   happi mum - Monitor Test Guide Site
   Warm, friendly design for moms
   ============================================ */

:root {
  --primary: #e8927c;
  --primary-light: #fce4de;
  --primary-dark: #c56b55;
  --accent: #7bc8a4;
  --accent-light: #d4f0e3;
  --warm-yellow: #f5d76e;
  --warm-yellow-light: #fef9e7;
  --soft-blue: #7ec8e3;
  --soft-blue-light: #e1f3fa;
  --soft-purple: #b39ddb;
  --soft-purple-light: #ede7f6;
  --text: #4a3728;
  --text-light: #7a6b60;
  --bg: #fffaf5;
  --bg-card: #ffffff;
  --border: #f0e6dc;
  --shadow: rgba(139, 107, 80, 0.08);
  --sidebar-w: 300px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 15px;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, #fff7f0 0%, #fff 100%);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 100;
  transition: transform .3s ease, width .3s ease;
}

/* Sidebar toggle button (PC) */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  z-index: 110;
  width: 32px; height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px var(--shadow);
  transition: left .3s ease;
}
@media (min-width: 901px) {
  .sidebar-toggle {
    display: flex;
    left: calc(var(--sidebar-w) - 16px);
  }
  body.sidebar-collapsed .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
  }
  body.sidebar-collapsed .main {
    margin-left: 0;
  }
  body.sidebar-collapsed .sidebar-toggle {
    left: 12px;
  }
}
.sidebar-header {
  padding: 24px 20px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--warm-yellow-light) 100%);
}
.sidebar-logo { font-size: 28px; margin-bottom: 4px; }
.sidebar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
}
.sidebar-subtitle {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.nav-section {
  padding: 12px 0 4px;
}
.nav-section-title {
  padding: 0 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.nav-item:hover {
  background: var(--primary-light);
  border-left-color: var(--primary);
}
.nav-item.active {
  background: var(--primary-light);
  border-left-color: var(--primary);
  font-weight: 600;
  color: var(--primary-dark);
}
.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.nav-label { flex: 1; line-height: 1.3; }

/* icon bg colors */
.icon-overview { background: var(--warm-yellow-light); }
.icon-group { background: var(--accent-light); }
.icon-week { background: var(--soft-blue-light); }
.icon-admin { background: var(--soft-purple-light); }
.icon-kpi { background: #fce4ec; }
.icon-system { background: #e8eaf6; }

/* ---- Main Content ---- */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--warm-yellow-light) 50%, var(--accent-light) 100%);
  padding: 60px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: var(--warm-yellow);
  opacity: .12;
  border-radius: 50%;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -30px; left: -30px;
  width: 160px; height: 160px;
  background: var(--primary);
  opacity: .08;
  border-radius: 50%;
}
.hero-emoji { font-size: 56px; margin-bottom: 12px; }
.hero h1 {
  font-size: 32px;
  color: var(--primary-dark);
  margin-bottom: 8px;
  position: relative;
}
.hero p {
  font-size: 16px;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

/* Home banner (announcement) */
.home-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1200px;
  margin: 20px auto -8px;
  padding: 14px 22px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  text-decoration: none;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(197, 107, 85, .22);
  font-weight: 600;
  font-size: 15px;
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease;
  border: 1px solid rgba(255, 255, 255, .25);
}
.home-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(197, 107, 85, .32);
}
.home-banner:active {
  transform: translateY(0);
}
.home-banner-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
}
.home-banner-text {
  flex: 1;
  line-height: 1.5;
}
.home-banner-text strong {
  color: #fff;
  font-weight: 700;
  margin-right: 4px;
}
.home-banner-arrow {
  font-size: 20px;
  flex-shrink: 0;
  opacity: .9;
  transition: transform .2s ease;
}
.home-banner:hover .home-banner-arrow {
  transform: translateX(4px);
  opacity: 1;
}
@media (max-width: 640px) {
  .home-banner {
    margin: 16px 16px -4px;
    padding: 12px 16px;
    font-size: 13.5px;
    gap: 10px;
    border-radius: 10px;
  }
  .home-banner-icon { font-size: 20px; }
  .home-banner-arrow { font-size: 18px; }
}

/* Content area */
.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}

/* ---- Page TOC (sticky left index) ---- */
.page-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 36px;
  align-items: start;
}
.toc {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 16px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.toc::-webkit-scrollbar { width: 4px; }
.toc::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.toc-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 12px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc-item {
  display: block;
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--text-light);
  text-decoration: none;
  border-left: 2px solid transparent;
  line-height: 1.5;
  cursor: pointer;
  transition: all .12s;
  word-break: break-all;
}
.toc-item:hover {
  color: var(--primary-dark);
  background: var(--primary-light);
  border-left-color: var(--primary);
}
.toc-item.active {
  color: var(--primary-dark);
  font-weight: 600;
  border-left-color: var(--primary);
  background: var(--primary-light);
}
.toc-item.toc-h3 {
  padding-left: 24px;
  font-size: 11.5px;
}
.toc-item.toc-h4 {
  padding-left: 36px;
  font-size: 11px;
}

/* No TOC on index page */
.page-body { min-width: 0; }

/* Article typography */
.article h1 {
  font-size: 28px;
  color: var(--primary-dark);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--primary-light);
  display: flex;
  align-items: center;
  gap: 12px;
}
.article h2 {
  font-size: 20px;
  color: var(--text);
  margin: 36px 0 16px;
  padding: 12px 16px;
  background: linear-gradient(90deg, var(--primary-light) 0%, transparent 100%);
  border-left: 4px solid var(--primary);
  border-radius: 0 8px 8px 0;
}
.article h3 {
  font-size: 17px;
  color: var(--primary-dark);
  margin: 28px 0 12px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}
.article h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--text);
}
.article p {
  margin: 12px 0;
  line-height: 1.9;
}
.article strong {
  color: var(--primary-dark);
}
.article hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

/* Tables */
.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
}
.article thead th {
  background: var(--primary);
  color: white;
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
}
.article tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.article tbody tr:nth-child(even) {
  background: #fdf8f4;
}
.article tbody tr:hover {
  background: var(--primary-light);
}

/* Lists */
.article ul, .article ol {
  margin: 12px 0;
  padding-left: 24px;
}
.article li {
  margin: 6px 0;
  line-height: 1.7;
}
.article li::marker {
  color: var(--primary);
}

/* Checkboxes */
.article input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border: 2px solid var(--primary);
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 8px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}
.article input[type="checkbox"]:checked {
  background: var(--primary);
}
.article input[type="checkbox"]:checked::after {
  content: '\2713';
  color: white;
  font-size: 12px;
  position: absolute;
  top: 0; left: 3px;
}

/* Blockquotes */
.article blockquote {
  background: var(--warm-yellow-light);
  border-left: 4px solid var(--warm-yellow);
  padding: 16px 20px;
  margin: 16px 0;
  border-radius: 0 12px 12px 0;
  font-size: 14px;
}
.article blockquote p { margin: 4px 0; }

/* Code blocks */
.article pre {
  background: #2d2419;
  color: #f0e6dc;
  padding: 20px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.6;
}
.article code {
  background: var(--primary-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--primary-dark);
}
.article pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ---- Index Cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 12px var(--shadow);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(139,107,80,.15);
  border-color: var(--primary);
}
.card-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 12px;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.card-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
}

/* Section banners on index */
.section-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  margin: 36px 0 16px;
  background: linear-gradient(90deg, var(--primary-light), transparent);
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
}
.section-banner-icon { font-size: 28px; }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 24px;
}
.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px; height: 48px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  display: none;
  z-index: 200;
  transition: opacity .2s;
}
.back-to-top.show { display: flex; align-items: center; justify-content: center; }

/* Mobile hamburger */
.hamburger {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  width: 44px; height: 44px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 22px;
  cursor: pointer;
  z-index: 150;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  align-items: center;
  justify-content: center;
}
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 90;
}

/* ---- Illustrations (CSS-based) ---- */
.illust-house {
  width: 80px; height: 80px;
  position: relative;
  margin: 0 auto 16px;
}
.illust-house::before {
  content: '';
  position: absolute;
  bottom: 0; left: 10px;
  width: 60px; height: 45px;
  background: var(--warm-yellow-light);
  border: 3px solid var(--warm-yellow);
  border-radius: 4px;
}
.illust-house::after {
  content: '';
  position: absolute;
  top: 5px; left: 0;
  width: 0; height: 0;
  border-left: 40px solid transparent;
  border-right: 40px solid transparent;
  border-bottom: 30px solid var(--primary);
}

/* Progress bar */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin: 8px 0 24px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  transition: width .5s ease;
}

/* ---- Week status badges (sidebar) ---- */
.nav-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}
.nav-badge-closed {
  background: #e0e0e0;
  color: #757575;
}
.nav-badge-current {
  background: var(--primary);
  color: white;
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}
.nav-badge-mygroup {
  background: #e8f5e9;
  color: #2e7d32;
}
.nav-item-mygroup {
  background: #e8f5e9 !important;
  border-left: 3px solid #4caf50 !important;
  font-weight: 600;
}
.nav-item-closed {
  opacity: .55;
}
.nav-item-current {
  background: var(--warm-yellow-light) !important;
  border-left-color: var(--warm-yellow) !important;
  font-weight: 600;
}
.nav-badge-prep {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
}
.nav-item-prep {
  opacity: .65;
}

/* ---- Prep (準備中) placeholder ---- */
.prep-card {
  text-align: center;
  padding: 56px 24px;
  background: linear-gradient(135deg, #fff8f0 0%, #fff3e0 100%);
  border: 2px dashed #ffb74d;
  border-radius: 20px;
  margin: 24px 0;
}
.prep-emoji {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 16px;
}
.prep-title {
  font-size: 22px;
  color: #e65100;
  margin: 0 0 12px;
}
.prep-text {
  font-size: 15px;
  color: #8d6e63;
  line-height: 1.9;
  margin: 0;
}

/* ---- Card status (index) ---- */
.card-closed {
  opacity: .5;
  filter: grayscale(40%);
}
.card-closed:hover { opacity: .75; }
.card-current {
  border: 2px solid var(--primary) !important;
  box-shadow: 0 4px 20px rgba(232,146,124,.25) !important;
}
.card-badge {
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
}
.card-badge-closed {
  background: #e0e0e0;
  color: #757575;
}
.card-badge-current {
  background: var(--primary);
  color: white;
}

/* ---- Current week banner (index top) ---- */
.current-week-banner {
  background: linear-gradient(135deg, var(--warm-yellow-light) 0%, var(--primary-light) 100%);
  border: 2px solid var(--primary);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 28px;
}
.current-week-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  padding: 8px;
  border-radius: 12px;
  transition: background .15s;
}
.current-week-link:hover {
  background: rgba(255,255,255,.5);
}

/* ---- Page status banner (detail) ---- */
.page-status-banner {
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}
.page-status-closed {
  background: #f5f5f5;
  color: #757575;
  border: 1px solid #e0e0e0;
}
.page-status-current {
  background: linear-gradient(90deg, var(--warm-yellow-light), var(--primary-light));
  color: var(--primary-dark);
  border: 1px solid var(--primary);
}

/* ---- Checklist Memos ---- */
.chk-memo-btn {
  background: #fff7f0;
  border: 1px solid #f0d9c2;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  margin-left: 6px;
  border-radius: 6px;
  opacity: .85;
  transition: opacity .15s, background .15s, border-color .15s;
  vertical-align: middle;
}
.chk-memo-btn:hover { opacity: 1; background: #ffe9d3; border-color: #e8b88f; }
.chk-memo-btn.has-memo { opacity: 1; background: #fff3e0; border-color: #ffb74d; }
.chk-memo-wrap {
  margin: 6px 0 8px 26px;
}
.chk-memo-input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #fdfaf7;
  min-height: 48px;
  resize: vertical;
  line-height: 1.5;
}
.chk-memo-input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}
/* Page-wide comment box (2026-04-24, thread-1714) */
.page-comment-box {
  margin: 20px 0 12px;
  padding: 14px 16px;
  background: #fffaf3;
  border: 1.5px dashed #f4c89a;
  border-radius: 10px;
}
.page-comment-label {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 8px;
  font-size: 14px;
}
.page-comment-hint {
  font-size: 11px;
  color: var(--text-light);
  font-weight: normal;
}
.page-comment-input {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
  background: #fff;
  resize: vertical;
  box-sizing: border-box;
}
.page-comment-input:focus {
  outline: none;
  border-color: var(--primary);
}
.page-comment-status {
  margin-top: 6px;
  min-height: 14px;
  font-size: 11px;
  color: var(--text-light);
}
/* Page comment on report cards */
.report-page-comment {
  margin: 10px 0 6px;
  padding: 10px 12px;
  background: #fffaf3;
  border-left: 3px solid #f4c89a;
  border-radius: 0 8px 8px 0;
}
.report-page-comment-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.report-page-comment-body {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
/* Report card memos */
.report-memos {
  margin-top: 8px;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}
.report-memos summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-dark);
  cursor: pointer;
  padding: 4px 0;
}
.report-memos-list {
  margin-top: 6px;
}
.report-memo-item {
  font-size: 12px;
  padding: 4px 8px;
  margin: 3px 0;
  background: var(--warm-yellow-light);
  border-radius: 6px;
  line-height: 1.5;
}
.report-memo-id {
  display: inline-block;
  background: var(--border);
  color: var(--text-light);
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10px;
  margin-right: 6px;
  font-family: monospace;
}

/* ---- Login Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(74,55,40,.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: white;
  border-radius: 20px;
  padding: 36px 32px;
  width: 380px;
  max-width: 92vw;
  box-shadow: 0 12px 48px rgba(0,0,0,.2);
}

/* ---- Forms ---- */
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fdfaf7;
  transition: border-color .15s;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}
.form-group textarea {
  min-height: 80px;
  resize: vertical;
}
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}
.btn-secondary {
  background: var(--accent-light);
  color: var(--text);
}
.btn-secondary:hover { background: var(--accent); color: white; }
.btn-warning {
  background: var(--warm-yellow);
  color: var(--text);
}
.btn-warning:hover { background: #e6c85e; }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ---- Sidebar User ---- */
.sidebar-user {
  padding: 12px 20px;
  background: var(--accent-light);
  border-bottom: 1px solid var(--border);
}
.sidebar-actions {
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-action-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--primary-dark);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background .15s;
}
.sidebar-action-link:hover {
  background: var(--primary-light);
}

/* ---- Report Form ---- */
.report-form {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 2px 12px var(--shadow);
  border: 1px solid var(--border);
  margin: 20px 0;
}
.report-form h2 {
  margin: 0 0 20px;
  background: none;
  padding: 0;
  border: none;
}
.report-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ---- Checklist Progress ---- */
.check-progress {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 20px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  bottom: 16px;
  z-index: 50;
  box-shadow: 0 -2px 12px var(--shadow);
}
.check-progress-bar {
  flex: 1;
  min-width: 120px;
}
.check-progress-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

/* ---- Admin Tabs ---- */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.admin-tab {
  padding: 12px 24px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-tab:hover {
  color: var(--primary-dark);
  background: var(--primary-light);
}
.admin-tab.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
}
.tab-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}
.admin-tab.active .tab-badge {
  background: var(--primary);
  color: white;
}
.admin-tab-content {
  min-height: 200px;
}

/* ---- Admin Dashboard ---- */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  background: var(--primary);
  color: white;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  position: sticky;
  top: 0;
}
.admin-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.admin-table tr:hover td { background: var(--primary-light); }
.matrix-table th, .matrix-table td { padding: 6px 8px; }
.matrix-table tr:hover td { background: inherit; }
.matrix-table tr:hover td:first-child { background: var(--primary-light); }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
}
.badge-admin { background: var(--primary-light); color: var(--primary-dark); }
.badge-leader { background: #e3f2fd; color: #1565c0; }
.badge-tester { background: var(--accent-light); color: #2e7d32; }

/* ---- Admin-only sections hidden in tester view ---- */
.admin-memo { display: none; }
body.role-admin .admin-memo {
  display: block;
  background: #ede7f6;
  border: 1px dashed var(--soft-purple);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 0;
}
body.role-admin .admin-memo::before {
  content: '👑 管理者メモ';
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--soft-purple);
  margin-bottom: 8px;
}

/* Report history cards */
.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.report-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.report-card-title { font-weight: 600; font-size: 15px; }
.report-card-date { font-size: 12px; color: var(--text-light); }
.report-card-body { font-size: 13px; color: var(--text-light); }
.report-card .badge-giveup { background: var(--warm-yellow-light); color: #e65100; }

/* Print */
@media print {
  .sidebar, .hamburger, .back-to-top, .overlay { display: none !important; }
  .main { margin-left: 0 !important; }
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .page-layout {
    grid-template-columns: 180px 1fr;
    gap: 24px;
  }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: flex; }
  .overlay.show { display: block; }
  .main { margin-left: 0; }
  .hero { padding: 40px 20px; }
  .hero h1 { font-size: 24px; }
  .content { padding: 24px 16px 60px; }
  .card-grid { grid-template-columns: 1fr; }
  .article h1 { font-size: 22px; }
  .article table { font-size: 12px; }
  .article thead th, .article tbody td { padding: 8px 10px; }
  .page-layout {
    grid-template-columns: 1fr;
  }
  .toc {
    position: relative;
    top: 0;
    max-height: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 0;
    margin-bottom: 8px;
  }
}

.nav-item-bug {
  margin: 8px 12px;
  background: #fff5f5 !important;
  border: 1px dashed #ef9a9a;
  border-radius: 10px !important;
  border-left: 1px dashed #ef9a9a !important;
}
.nav-item-bug:hover {
  background: #fce4ec !important;
  border-color: #c62828;
}

/* ==== Guide Sections (TOP page) ==== */
.guide-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px var(--shadow);
}
.guide-section-bug {
  border-color: #ef9a9a;
  background: #fff8f8;
}
.guide-heading {
  font-size: 22px;
  color: var(--primary-dark);
  margin: 0 0 8px 0;
}
.guide-intro {
  font-size: 14px;
  color: var(--text-light);
  margin: 0;
  line-height: 1.7;
}
.guide-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.guide-step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.guide-step-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0;
}
.guide-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
  margin: 0 0 16px 0;
}
.guide-img-wrap {
  text-align: center;
}
.guide-img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.guide-img-caption {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 8px;
}
.guide-img-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
/* OS Toggle */
.os-toggle {
  background: #e3f2fd;
  border: 2px solid #1976d2;
  border-radius: 12px;
  padding: 12px 16px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.os-toggle label {
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Callout boxes */
.guide-callout {
  padding: 16px 20px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 16px;
}
.guide-callout-info {
  background: #e3f2fd;
  border-left: 4px solid #1976d2;
  color: #0d47a1;
}
.guide-callout-warm {
  background: #fff3e0;
  border-left: 4px solid #e65100;
  color: #bf360c;
}
.guide-section-giveup {
  border-color: #ffab40;
  background: #fffaf0;
}
@media (max-width: 640px) {
  .guide-img-2col { grid-template-columns: 1fr; }
  .guide-section { padding: 20px 16px; }
  .ga-label { font-size: 10px; padding: 3px 6px; }
  .ga-arrow { font-size: 20px; }
}

/* ==== Document Links ==== */
.doc-links-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.doc-link-card {
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all .2s;
  box-shadow: 0 1px 4px var(--shadow);
}
.doc-link-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

/* ==== Bug Report Styles ==== */
.bug-quick-action {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: linear-gradient(135deg, #fff5f5 0%, #fce4ec 100%);
  border: 2px dashed #ef9a9a;
  border-radius: 16px;
  text-decoration: none;
  transition: all .2s;
}
.bug-quick-action:hover {
  border-color: #c62828;
  background: linear-gradient(135deg, #fce4ec 0%, #ffcdd2 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(198,40,40,.15);
}

.bug-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  transition: box-shadow .2s;
}
.bug-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.bug-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}
.bug-ticket-id {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  background: #263238;
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
}
.bug-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}
.bug-card-desc {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.bug-meta {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bug-images {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.bug-image-thumb {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.bug-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bug-admin-note {
  background: #fffde7;
  border: 1px solid #fff9c4;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 8px;
  line-height: 1.5;
}

/* Bug Report Form - Image Upload */
.bug-image-upload {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 16px;
  background: #fafafa;
}
.bug-image-dropzone {
  text-align: center;
  padding: 24px 16px;
  cursor: pointer;
  border-radius: 8px;
  transition: all .2s;
  font-size: 14px;
  color: var(--text-light);
}
.bug-image-dropzone:hover,
.bug-image-dropzone.dragover {
  background: #e3f2fd;
  color: var(--primary-dark);
}
.bug-image-previews {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.bug-preview-item {
  position: relative;
  width: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.bug-preview-item img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
}
.bug-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bug-preview-name {
  font-size: 10px;
  padding: 4px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  color: var(--text-light);
}
.bug-admin-actions {
  margin-top: -12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 12px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ============================================
   2026-04-28 Week3 改修: お詫びノート / 比較ワーク / 保留チェック項目
   ============================================ */

/* Android 配布遅延のお詫びノート */
.apology-note {
  background: #fff3e0;
  border-left: 4px solid #e65100;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 12px 0 14px;
  color: #5d4037;
  font-size: 14px;
  line-height: 1.8;
}
.apology-note strong { color: #bf360c; font-weight: 700; }
.apology-note .apology-note-sub {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  color: #6d4c41;
}

/* iOS 比較ワーク導入ノート */
.compare-note {
  background: #e1f3fa;
  border-left: 4px solid #1976d2;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 12px 0 14px;
  color: #0d3555;
  font-size: 14px;
  line-height: 1.8;
}
.compare-note strong { color: #0d47a1; font-weight: 700; }

/* 保留中のチェック項目（- [-] 構文） */
.check-item.check-held {
  position: relative;
  background: rgba(120,120,120,0.06);
  border-radius: 8px;
  padding: 6px 10px 6px 8px;
  margin: 4px 0;
  color: var(--text-light);
}
.check-item.check-held input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.check-item.check-held::after {
  content: "保留中";
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #bf360c;
  background: #fff3e0;
  border: 1px solid #ffb74d;
  border-radius: 999px;
  vertical-align: 1px;
}

/* === グループ別チェックリスト統合 (2026-04-29, thread-2025) === */
/* Weekページに自分のグループ専用チェックリストを埋め込む。既存の全体チェックとは独立カウント。 */
.group-checklist-box {
  margin: 28px 0 16px;
  padding: 18px 22px 14px;
  background: linear-gradient(180deg, #fff5e8 0%, #fef3df 100%);
  border: 1px dashed #f4a261;
  border-radius: 14px;
}
.group-checklist-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.group-checklist-title {
  font-weight: 700;
  font-size: 15px;
  color: #c8581b;
}
.group-checklist-hint {
  font-size: 12px;
  font-weight: 400;
  color: #8b6f4e;
  line-height: 1.5;
}
.group-checklist-hint a {
  color: #c8581b;
  text-decoration: underline;
  margin-left: 4px;
}
.group-checklist-items {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.group-check-item {
  padding: 6px 0;
  border-top: 1px solid rgba(244, 162, 97, 0.18);
}
.group-check-item:first-child {
  border-top: none;
}
.group-check-item label {
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: #4a3520;
}
.group-check-item input[type="checkbox"] {
  margin-top: 4px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: #f4a261;
}
.group-check-item input[type="checkbox"]:checked + span {
  color: #8b6f4e;
  text-decoration: line-through;
  text-decoration-color: rgba(139, 111, 78, 0.5);
}
.group-checklist-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #c8581b;
  margin-top: 8px;
}
.group-checklist-count {
  font-weight: 700;
  min-width: 56px;
  text-align: right;
  flex-shrink: 0;
}
.group-checklist-progress .progress-bar {
  flex: 1;
  height: 6px;
  background: #f5e0d4;
}
.group-progress-fill {
  background: linear-gradient(90deg, #f4a261 0%, #e76f51 100%);
}
@media (max-width: 600px) {
  .group-checklist-box {
    padding: 14px 16px 12px;
    margin: 22px 0 12px;
  }
  .group-checklist-title { font-size: 14px; }
  .group-check-item label { font-size: 13px; }
}

/* === Week 5/6 実戦フェーズ用 装飾 (2026-05-12 追加) === */
.practice-note {
  background: #e8f5e9;
  color: #1b5e20;
  border-left: 4px solid #43a047;
  padding: 14px 16px;
  margin: 12px 0;
  border-radius: 8px;
  line-height: 1.7;
  font-size: 14px;
}
.practice-note strong { color: #1b5e20; font-weight: 700; }
.practice-note .practice-note-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #2e7d32;
}

.bouncing-note {
  background: #f3e5f5;
  color: #4a148c;
  border-left: 4px solid #8e24aa;
  padding: 14px 16px;
  margin: 12px 0;
  border-radius: 8px;
  line-height: 1.7;
  font-size: 14px;
}
.bouncing-note strong { color: #4a148c; font-weight: 700; }
.bouncing-note .bouncing-note-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #6a1b9a;
}

/* 役割別動き方ボックス (Week 5/6) */
.role-guide {
  background: #fff8e1;
  border: 1px solid #ffd54f;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
}
.role-guide h4 {
  margin: 0 0 8px 0;
  color: #ef6c00;
  font-size: 15px;
  font-weight: 700;
}
.role-guide ul { margin: 0; padding-left: 20px; }
.role-guide li { margin: 4px 0; line-height: 1.6; font-size: 14px; }
.role-guide li strong { color: #5d4037; font-weight: 700; }

/* テーマ変更告知 (Week 7/8 で使う) */
.schedule-shift-note {
  background: #fffde7;
  color: #6d4c41;
  border-left: 4px solid #fbc02d;
  padding: 14px 16px;
  margin: 12px 0;
  border-radius: 8px;
  line-height: 1.7;
  font-size: 14px;
}
.schedule-shift-note strong { color: #f57f17; font-weight: 700; }

/* ---- 2026-05-18: コメント入力中、下部進捗バー(.check-progress)が入力文字に被るのを防ぐ ---- */
/* yuhki 報告: 「あとこれだけ」進捗バーが textarea の入力文字に被さって見えない問題 */
.check-progress {
  transition: transform .25s ease, opacity .25s ease;
}
.check-progress.is-hidden-by-focus {
  transform: translateY(150%);
  opacity: 0;
  pointer-events: none;
}

/* === Password show/hide toggle (added 2026-05-27) === */
.password-wrap {
  position: relative;
}
.password-wrap input {
  padding-right: 44px !important;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 8px;
  color: var(--text-light);
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.password-toggle:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.05);
}
.password-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.password-toggle .eye-on  { display: none; }
.password-toggle .eye-off { display: block; }
.password-toggle.is-showing .eye-on  { display: block; }
.password-toggle.is-showing .eye-off { display: none; }
