/* =====================================================
   bonus/boki3 — PocketPortal 購入者特典
   BK3StudySite のデザイントークンを継承
   ===================================================== */
:root {
  --primary:       #b45309;
  --primary-dark:  #92400e;
  --primary-light: #fef3c7;
  --primary-mid:   #d97706;
  --accent:        #4f46e5;
  --accent-light:  #e0e7ff;
  --success:       #059669;
  --success-light: #d1fae5;
  --danger:        #dc2626;
  --danger-light:  #fee2e2;
  --bg:            #fffbeb;
  --card:          #ffffff;
  --border:        #e2e8f0;
  --text:          #1e293b;
  --text-muted:    #64748b;
  --text-light:    #94a3b8;
  --radius:        14px;
  --radius-sm:     10px;
  --radius-xs:     6px;
  --shadow:        0 2px 12px rgba(180,83,9,.08);
  --shadow-md:     0 4px 20px rgba(180,83,9,.13);
  --safe-bottom:   env(safe-area-inset-bottom, 0px);
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN',
               'Hiragino Sans', Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* === TOP NAV === */
.top-nav {
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-nav-inner {
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-nav-logo {
  font-weight: 900;
  font-size: .95rem;
  color: var(--primary-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
}
.top-nav-back {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  background: var(--card);
  transition: all .15s;
  display: flex;
  align-items: center;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
}
.top-nav-back:active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

/* === HERO === */
.bonus-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #c05621 50%, var(--primary-mid) 100%);
  color: #fff;
  padding: 32px 20px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.bonus-hero::before {
  content: attr(data-emoji);
  position: absolute;
  right: -10px;
  bottom: -20px;
  font-size: 120px;
  opacity: .07;
  pointer-events: none;
}
.bonus-hero h1 { font-size: 1.5rem; font-weight: 900; margin-bottom: 6px; letter-spacing: -.02em; }
.bonus-hero p  { font-size: .88rem; opacity: .88; line-height: 1.6; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 800;
  padding: 3px 12px;
  margin-bottom: 12px;
  letter-spacing: .05em;
}

/* === MAIN LAYOUT === */
.bonus-main {
  max-width: 780px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* === SECTION LABEL === */
.section-label {
  font-size: .78rem;
  font-weight: 900;
  color: var(--text-muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 8px 0 10px;
  border-bottom: 2px solid var(--primary-light);
  margin-bottom: 14px;
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label:first-child { margin-top: 0; }

/* === TOOL CARD GRID === */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media(min-width: 520px) { .tool-grid { grid-template-columns: 1fr 1fr; } }

.tool-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  border: 1.5px solid var(--border);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow);
  transition: all .18s;
  -webkit-tap-highlight-color: transparent;
}
.tool-card:hover, .tool-card:focus { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.tool-card:active { transform: translateY(0); }
.tool-icon  { font-size: 1.8rem; }
.tool-title { font-size: 1rem; font-weight: 900; color: var(--primary-dark); }
.tool-desc  { font-size: .82rem; color: var(--text-muted); line-height: 1.6; flex: 1; }
.tool-arrow { font-size: .8rem; font-weight: 700; color: var(--primary); align-self: flex-end; }

/* === NOTE CARD (購入者限定表示) === */
.note-card {
  background: #fef9f0;
  border: 1.5px solid #fcd34d;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: .84rem;
  color: #78350f;
  line-height: 1.7;
  margin-bottom: 20px;
}
.note-card strong { color: #b45309; }

/* === CONTENT CARD === */
.content-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.content-card h2 {
  font-size: 1rem;
  font-weight: 900;
  color: var(--primary-dark);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.content-card h3 { font-size: .9rem; font-weight: 800; color: var(--text); margin: 12px 0 6px; }
.content-card p  { font-size: .88rem; color: var(--text); line-height: 1.8; margin-bottom: 8px; }
.content-card p:last-child { margin-bottom: 0; }
.content-card ul, .content-card ol { padding-left: 1.3em; font-size: .88rem; }
.content-card li { margin-bottom: 6px; line-height: 1.7; }
.content-card strong { color: var(--primary-dark); }

/* === STEP LIST (おすすめ学習順など) === */
.steps-list { display: flex; flex-direction: column; gap: 10px; }
.step-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: #fff;
  font-weight: 900;
  font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-content { flex: 1; }
.step-title { font-size: .92rem; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.step-desc  { font-size: .8rem; color: var(--text-muted); line-height: 1.6; }

/* === BUTTONS === */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 22px;
  font-size: .92rem; font-weight: 800;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  min-height: 48px;
  width: 100%;
  box-shadow: 0 3px 10px rgba(180,83,9,.3);
}
.btn-primary:active { transform: scale(.98); opacity: .9; }
.btn-primary:disabled { opacity: .5; cursor: default; transform: none; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--card);
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  font-size: .88rem; font-weight: 800;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  min-height: 44px;
  width: 100%;
}
.btn-secondary:active { background: var(--primary-light); }

.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row .btn-primary, .btn-row .btn-secondary { width: auto; flex: 1; }

/* === CALLOUT === */
.callout {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: .88rem; line-height: 1.7;
}
.callout-icon { font-size: 1.2rem; flex-shrink: 0; }
.callout-body strong { display: block; font-weight: 800; margin-bottom: 3px; font-size: .9rem; }
.callout-body p { margin: 0; }
.callout-warn { background: var(--danger-light); border-left: 4px solid var(--danger); }
.callout-tip  { background: var(--accent-light); border-left: 4px solid var(--accent); }
.callout-exam { background: #fff7ed; border-left: 4px solid var(--primary); }
.callout-ok   { background: var(--success-light); border-left: 4px solid var(--success); }

/* === DATA TABLE === */
.data-table {
  width: 100%; border-collapse: collapse;
  font-size: .84rem; margin-top: 8px;
  overflow-x: auto; display: block;
}
.data-table th {
  background: var(--primary-light);
  padding: 9px 10px;
  font-weight: 800; color: var(--primary-dark);
  border: 1px solid #fcd34d;
  text-align: center; white-space: nowrap;
}
.data-table td {
  padding: 9px 10px;
  border: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:nth-child(even) td { background: #f8fafc; }
.debit-col  { color: #1d4ed8; font-weight: 800; }
.credit-col { color: #dc2626; font-weight: 800; }

/* === SCORE BAR === */
.score-bar {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
}
.score-item { text-align: center; }
.score-num { font-size: 1.6rem; font-weight: 900; color: var(--primary-dark); display: block; line-height: 1.2; }
.score-lbl { font-size: .7rem; color: var(--text-muted); font-weight: 700; }

/* === JOURNAL TRAINING === */
.q-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--primary);
}
.q-num {
  font-size: .72rem; font-weight: 800; color: var(--text-muted);
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px;
}
.q-text {
  font-size: .95rem; font-weight: 700; color: var(--text);
  line-height: 1.7; margin-bottom: 16px;
  padding: 12px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}
.journal-input-row {
  display: grid;
  grid-template-columns: 1fr 28px 1fr;
  gap: 8px;
  margin-bottom: 12px;
  align-items: end;
}
.journal-input-col { display: flex; flex-direction: column; gap: 6px; }
.journal-input-label { font-size: .72rem; font-weight: 800; }
.debit-label  { color: #1d4ed8; }
.credit-label { color: #dc2626; }
.journal-mid  { display: flex; align-items: center; justify-content: center; padding-bottom: 10px; font-size: 1rem; color: var(--border); }
select.journal-select,
input.journal-amount {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  min-height: 44px;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}
select.journal-select:focus,
input.journal-amount:focus { border-color: var(--primary); }

.q-result {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: .88rem; line-height: 1.7;
  display: none;
}
.q-result.show { display: block; }
.q-result.correct { background: var(--success-light); border: 1.5px solid var(--success); }
.q-result.wrong   { background: var(--danger-light);  border: 1.5px solid var(--danger);  }
.q-result-label   { font-weight: 900; font-size: 1.1rem; margin-bottom: 8px; }
.q-answer { font-size: .85rem; margin: 6px 0; padding: 8px 12px; background: rgba(255,255,255,.6); border-radius: var(--radius-xs); }
.q-exp    { font-size: .82rem; color: #374151; margin-top: 8px; line-height: 1.7; border-top: 1px solid rgba(0,0,0,.08); padding-top: 8px; }

/* === ACCOUNT MAP === */
.search-wrap { margin-bottom: 16px; }
.search-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .92rem; font-family: inherit;
  background: var(--card);
  color: var(--text);
  outline: none;
  min-height: 48px;
  -webkit-appearance: none;
}
.search-input:focus { border-color: var(--primary); }
.search-hint { font-size: .78rem; color: var(--text-muted); margin-top: 6px; }

.account-category { margin-bottom: 16px; }
.cat-header {
  font-size: .88rem; font-weight: 900;
  padding: 8px 14px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: #fff;
}
.cat-asset     { background: #1d4ed8; }
.cat-liability { background: #b91c1c; }
.cat-equity    { background: #047857; }
.cat-revenue   { background: #7c3aed; }
.cat-expense   { background: #b45309; }

.account-list {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 12px;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.account-tag {
  font-size: .82rem; font-weight: 700;
  padding: 5px 12px;
  border-radius: 99px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--text);
  transition: all .15s;
}
.account-tag.hl {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
  transform: scale(1.05);
}
.account-tag.hidden { display: none; }

/* === TIMER === */
.timer-wrap { text-align: center; margin: 20px 0; }
.timer-display {
  font-size: 3.5rem; font-weight: 900;
  color: var(--primary-dark);
  font-feature-settings: 'tnum';
  letter-spacing: -.02em;
  line-height: 1;
}
.timer-display.warn { color: var(--danger); }
.timer-label { font-size: .8rem; color: var(--text-muted); font-weight: 700; margin-top: 6px; }

/* === MINI TEST === */
.test-section-header {
  font-size: .9rem; font-weight: 900;
  color: var(--primary-dark);
  background: var(--primary-light);
  border: 2px solid #fcd34d;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 20px 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.test-q {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  border-left: 3px solid var(--border);
}
.test-q.answered-correct { border-left-color: var(--success); }
.test-q.answered-wrong   { border-left-color: var(--danger); }
.test-q-text {
  font-size: .9rem; font-weight: 700; color: var(--text);
  line-height: 1.7; margin-bottom: 12px;
  padding: 10px; background: #f8fafc;
  border-radius: var(--radius-xs);
}
.test-choices { display: flex; flex-direction: column; gap: 8px; }
.test-choice-btn {
  width: 100%; text-align: left;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .86rem; font-family: inherit;
  background: var(--card);
  color: var(--text);
  transition: all .12s;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.5;
}
.test-choice-btn:active:not(:disabled) { background: var(--primary-light); border-color: var(--primary); }
.test-choice-btn.selected { background: #eff6ff; border-color: #3b82f6; }
.test-choice-btn.correct  { background: var(--success-light); border-color: var(--success); font-weight: 700; }
.test-choice-btn.wrong    { background: var(--danger-light);  border-color: var(--danger);  }
.test-choice-btn:disabled { cursor: default; }
.test-q-exp {
  margin-top: 10px; padding: 10px 12px;
  background: #f8fafc; border-radius: var(--radius-xs);
  font-size: .82rem; color: var(--text-muted); line-height: 1.7;
  display: none;
}
.test-q-exp.show { display: block; }

.result-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md);
  text-align: center;
  border-top: 4px solid var(--primary);
}
.result-card h2 { font-size: 1.3rem; font-weight: 900; color: var(--primary-dark); margin-bottom: 16px; }
.result-scores { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; }
.result-score-item { text-align: center; }
.result-score-num { font-size: 2rem; font-weight: 900; color: var(--primary-dark); display: block; }
.result-score-lbl { font-size: .72rem; color: var(--text-muted); font-weight: 700; }

/* === CHECKLIST (last-week-plan) === */
.progress-mini {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px;
}
.progress-mini-bar-wrap {
  flex: 1; height: 10px; background: #f1f5f9;
  border-radius: 99px; overflow: hidden;
}
.progress-mini-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-mid));
  border-radius: 99px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.progress-mini-label { font-size: .78rem; font-weight: 800; color: var(--primary-dark); white-space: nowrap; }

.day-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--border);
  transition: border-color .2s, background .2s;
}
.day-card.completed { border-left-color: var(--success); background: linear-gradient(to right, var(--success-light), #fff 40%); }

.day-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.day-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary-light); border: 2px solid var(--primary-mid);
  color: var(--primary-dark); font-weight: 900; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.day-card.completed .day-num { background: var(--success); border-color: var(--success); color: #fff; }
.day-titles { flex: 1; }
.day-title    { font-size: .95rem; font-weight: 900; color: var(--text); }
.day-subtitle { font-size: .78rem; color: var(--text-muted); }

.check-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.check-box {
  width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  transition: all .15s;
  background: #fff;
  margin-top: 2px;
}
.check-item.checked .check-box { background: var(--success); border-color: var(--success); color: #fff; }
.check-text { font-size: .88rem; color: var(--text); line-height: 1.6; flex: 1; }
.check-item.checked .check-text { text-decoration: line-through; color: var(--text-muted); }

/* === MISTAKE LIST === */
.mistake-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--primary);
}
.mistake-title {
  font-size: 1rem; font-weight: 900; color: var(--primary-dark);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
  display: flex; align-items: center; gap: 8px;
}
.mistake-row { margin-bottom: 12px; }
.mistake-row:last-child { margin-bottom: 0; }
.mistake-row-label {
  font-size: .72rem; font-weight: 900; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 5px;
}
.mistake-row-body {
  font-size: .88rem; color: var(--text); line-height: 1.7;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
}
.mistake-row.wrong .mistake-row-body  { background: var(--danger-light); }
.mistake-row.right .mistake-row-body  { background: var(--success-light); }
.mistake-row.exam  .mistake-row-body  { background: var(--primary-light); }

/* === FOOTER === */
.site-footer {
  padding: 36px 0 24px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.7);
}
.footer-inner {
  max-width: 780px; margin: 0 auto; padding: 0 16px;
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
  color: var(--text-muted); font-size: .75rem;
}
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-weight: 700; }
.footer-links a:active { color: var(--primary); }

/* === PAGE NAV (prev / next) === */
.page-nav {
  display: flex; justify-content: space-between;
  align-items: stretch; gap: 10px;
  margin-top: 24px;
}
.nav-btn {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  text-decoration: none;
  font-size: .84rem; font-weight: 700;
  transition: all .12s;
  flex: 1; min-height: 48px;
  display: flex; align-items: center;
  -webkit-tap-highlight-color: transparent;
}
.prev-btn { justify-content: flex-start; }
.next-btn { justify-content: flex-end; }
.nav-btn:active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
