/* ===== CCN ENGLISH Library mockups — shared utilities ===== */
/* All 8 styles import brand.css then override per their visual identity */

* { box-sizing: border-box; margin: 0; padding: 0; }
body { -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* Style banner (top label across all 8 mockups) */
.style-banner { background: var(--ink); color: var(--paper); padding: 6px 20px; font-size: 11px; letter-spacing: 0.15em; text-align: center; font-family: -apple-system, "Hiragino Kaku Gothic ProN", sans-serif; }
.style-banner em { font-style: normal; color: var(--turquoise); }

/* Bottom switcher common to all 8 styles */
.style-switch { padding: 18px 20px; background: var(--cream); border-top: 1px solid var(--line); font-family: -apple-system, sans-serif; }
.style-switch-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.style-switch-label { font-size: 11px; color: var(--ink-soft); letter-spacing: 0.05em; margin-right: 4px; }
.style-switch a { display: inline-flex; align-items: center; gap: 6px; background: var(--paper); border: 1px solid var(--line); padding: 6px 11px; border-radius: 14px; font-size: 11px; font-weight: 700; transition: all 0.15s; text-decoration: none; color: var(--ink); }
.style-switch a:hover { border-color: var(--ink); }
.style-switch a.current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.style-switch a .num { font-family: "Iowan Old Style", "Charter", serif; font-style: italic; font-size: 10px; color: var(--turquoise-deep); margin-right: 2px; font-weight: 700; }
.style-switch a.current .num { color: var(--turquoise); }
.style-switch a.settings { background: var(--cream); border-style: dashed; }

/* Global nav (top-right floating) — appears on every page */
.lib-globalnav {
  position: fixed; top: 12px; right: 12px;
  z-index: 1000;
  display: flex; gap: 6px; align-items: center;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 100px;
  padding: 6px 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", sans-serif;
}
.lib-globalnav a {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
  padding: 5px 10px; border-radius: 100px;
  transition: all 0.15s;
  white-space: nowrap;
}
.lib-globalnav a:hover { background: var(--ink); color: var(--paper); }
.lib-globalnav a.search { background: var(--cream); border: 1px solid var(--line); }
.lib-globalnav a.scheduler { background: var(--turquoise-pale); color: var(--ink); }
.lib-globalnav a.scheduler:hover { background: var(--turquoise-deep); color: var(--paper); }
.lib-globalnav .sep { width: 1px; height: 14px; background: var(--line); }
@media (max-width: 720px) {
  .lib-globalnav { top: auto; right: 12px; bottom: 12px; padding: 4px 6px; }
  .lib-globalnav a { font-size: 10px; padding: 4px 8px; }
  .lib-globalnav a span.label { display: none; }
}

/* Common footer */
.lib-foot { padding: 24px 20px; text-align: center; font-family: -apple-system, sans-serif; font-size: 11px; color: var(--ink-soft); letter-spacing: 0.05em; background: var(--paper); border-top: 1px solid var(--line); }

/* ============================================================
   ACCOUNT FAB (round avatar) + DRAWER (right slide-in)
   Inspired by Genny Settings layout
   ============================================================ */

/* Hide the old floating pill nav and per-page user widget — replaced by .account-fab */
.lib-globalnav { display: none !important; }
.appbar .me { display: none !important; }

/* Reserve clearance on the right of EVERY top header so the floating
   .account-fab (top:16px right:16px, 42px wide) never sits over header
   content. 76px = FAB(42) + margin(16+18). Covers all known header
   classes used across the 8 home styles + scheduler + onboarding. */
.appbar,
.hd,
.top-bar,
.masthead-inner,
.topbar { padding-right: 76px !important; }
@media (max-width: 720px) {
  .appbar,
  .hd,
  .top-bar,
  .masthead-inner,
  .topbar { padding-right: 64px !important; }
}

/* Round avatar floating button at top-right */
.account-fab {
  position: fixed;
  top: 16px; right: 16px;
  z-index: 1000;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: linear-gradient(135deg, var(--turquoise) 0%, var(--pink) 100%);
  box-shadow: 0 4px 18px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.06);
  cursor: pointer;
  display: grid; place-items: center;
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", sans-serif;
  color: #fff;
  padding: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}
.account-fab:hover { transform: scale(1.06); box-shadow: 0 6px 24px rgba(0,0,0,0.28); }
.account-fab .initial {
  font-size: 16px; font-weight: 900;
  text-shadow: 0 1px 2px rgba(0,0,0,0.18);
  line-height: 1;
}

/* Drawer backdrop */
.account-drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.42);
  z-index: 1099;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.account-drawer-backdrop.open { opacity: 1; pointer-events: auto; }

/* Drawer (slide from right) */
.account-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 400px; max-width: 100vw;
  height: 100vh;
  background: #FFFFFF;
  z-index: 1100;
  box-shadow: -8px 0 36px rgba(0,0,0,0.18);
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 13px;
  color: var(--ink);
  letter-spacing: 0;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}
.account-drawer.open { transform: translateX(0); }

.acc-drawer-head {
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.acc-drawer-head h2 {
  font-size: 17px; font-weight: 800; letter-spacing: -0.01em;
  margin: 0;
}
.acc-drawer-close {
  background: transparent; border: 0;
  width: 34px; height: 34px; border-radius: 8px;
  font-size: 22px; cursor: pointer;
  color: var(--ink-soft);
  font-family: -apple-system, sans-serif;
  display: grid; place-items: center;
  line-height: 1;
}
.acc-drawer-close:hover { background: var(--cream); color: var(--ink); }

.acc-drawer-body {
  flex: 1; overflow-y: auto;
  padding: 0;
}

/* User card */
.acc-user-card {
  padding: 26px 20px 22px;
  background: linear-gradient(180deg, #FAF8F2 0%, #FFFFFF 100%);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.acc-avatar-wrap {
  position: relative;
  display: inline-block;
  margin: 0 auto 14px;
}
.acc-avatar {
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(135deg, var(--turquoise) 0%, var(--pink) 100%);
  display: flex; align-items: center; justify-content: center;
  border: 3px solid #fff;
  box-shadow: 0 6px 20px rgba(232,155,217,0.30);
  overflow: hidden;
}
.acc-avatar.lg .lg-initial {
  font-size: 32px; font-weight: 900; color: #fff;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
img.acc-avatar.lg.has-img { object-fit: cover; }
.acc-avatar-edit {
  position: absolute;
  bottom: 4px; right: -8px;
  background: var(--ink); color: #fff;
  border: 2px solid #fff;
  border-radius: 99px;
  font-size: 10px; font-weight: 800;
  padding: 4px 10px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  letter-spacing: 0.05em;
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", sans-serif;
}
.acc-avatar-edit:hover { background: var(--turquoise-deep); }
img.fab-img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block;
}
.acc-name {
  font-size: 17px; font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.acc-email {
  font-size: 12px; color: var(--ink-soft);
  margin-top: 4px; word-break: break-all;
}
.acc-tier-badge {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 12px;
  padding: 5px 12px; border-radius: 99px;
  font-size: 10px; font-weight: 900; letter-spacing: 0.14em;
  color: #fff;
}
.acc-tier-badge.tier-line_free { background: #06C755; }
.acc-tier-badge.tier-trial     { background: var(--pink-deep); }
.acc-tier-badge.tier-salon     { background: var(--turquoise-deep); }
.acc-tier-badge.tier-core      { background: var(--ink); }
.acc-tier-badge.tier-student   { background: #C9A93A; color: #2A1810; }

/* Section block */
.acc-section-block {
  padding: 22px 20px 20px;
  border-bottom: 1px solid var(--line);
}
.acc-section-block h3 {
  font-size: 11px; letter-spacing: 0.18em; font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin: 0 0 14px 0;
}

.acc-info-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.acc-info-row {
  display: grid; grid-template-columns: 110px 1fr;
  gap: 12px; align-items: baseline;
  font-size: 13px;
}
.acc-info-row .lbl {
  color: var(--ink-soft); font-size: 11px;
  letter-spacing: 0.05em; font-weight: 700;
}
.acc-info-row .val { font-weight: 700; color: var(--ink); }
.acc-info-row .val em { color: var(--ink-soft); font-style: normal; font-weight: 500; }
.acc-info-row .val a { color: var(--turquoise-deep); font-weight: 700; }

.acc-cta-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ink); color: var(--paper);
  padding: 9px 18px;
  border-radius: 7px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.04em;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  margin-top: 14px;
  transition: opacity 0.15s, transform 0.1s;
  font-family: inherit;
}
.acc-cta-btn:hover { opacity: 0.86; }
.acc-cta-btn:active { transform: translateY(1px); }
.acc-cta-btn.secondary {
  background: var(--cream); color: var(--ink);
  border: 1px solid var(--line);
}
.acc-cta-btn.secondary:hover { background: #fff; border-color: var(--ink); opacity: 1; }

/* Billing history table */
.acc-bill-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.acc-bill-table th, .acc-bill-table td {
  padding: 9px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}
.acc-bill-table th {
  font-size: 10px; letter-spacing: 0.1em; font-weight: 800;
  color: var(--ink-soft);
  background: var(--cream);
  text-transform: uppercase;
}
.acc-bill-table td.amount { font-weight: 800; }
.acc-bill-table .status {
  display: inline-block;
  background: #E8F5E9; color: #2E7D32;
  padding: 2px 8px; border-radius: 99px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.05em;
}

/* Quick links list */
.acc-link-list {
  display: flex; flex-direction: column;
  gap: 0;
}
.acc-link {
  display: grid;
  grid-template-columns: 24px 1fr 14px;
  align-items: center; gap: 12px;
  padding: 12px 0;
  font-size: 13px; font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}
.acc-link:last-child { border-bottom: 0; }
.acc-link:hover { color: var(--turquoise-deep); }
.acc-link .icn { font-size: 16px; text-align: center; }
.acc-link .chev { font-size: 18px; color: var(--ink-soft); line-height: 1; }
.acc-link.logout { color: #C72020; }
.acc-link.logout:hover { color: #8B0000; }

/* Mobile */
@media (max-width: 540px) {
  .account-drawer { width: 100vw; }
  .acc-info-row { grid-template-columns: 100px 1fr; }
  .account-fab { top: 12px; right: 12px; width: 38px; height: 38px; }
}

/* Brand link cursor */
.appbar .brand[role="link"] { cursor: pointer; }
.appbar .brand[role="link"]:hover { opacity: 0.78; }

/* ============================================================
   CCN-108: 初回学習計画モーダル (First Plan Wizard)
   ============================================================ */
.fpw-backdrop {
  position: fixed; inset: 0;
  background: rgba(20,20,20,0.55);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 100000;
}
.fpw-backdrop.open { opacity: 1; pointer-events: auto; }

.fpw {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 100001;
  pointer-events: none;
}
.fpw-card {
  background: var(--paper); color: var(--ink);
  width: 100%; max-width: 760px;
  max-height: 90vh;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.35);
  overflow: hidden;
  display: flex; flex-direction: column;
  transform: translateY(20px) scale(0.97); opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: auto;
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", sans-serif;
}
.fpw.open .fpw-card { transform: translateY(0) scale(1); opacity: 1; }

.fpw-head {
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--cream);
}
.fpw-head .step {
  font-family: "Iowan Old Style", "Charter", serif;
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}
.fpw-head .step em { color: var(--turquoise-deep); font-weight: 800; font-style: italic; }
.fpw-close {
  background: transparent; border: 0;
  font-size: 22px; line-height: 1;
  color: var(--ink-soft); cursor: pointer;
  padding: 4px 8px;
}
.fpw-close:hover { color: var(--ink); }

.fpw-body {
  padding: 32px 36px 24px;
  overflow-y: auto;
}
.fpw-body h2 {
  font-family: "Iowan Old Style", "Charter", serif;
  font-size: 26px; font-weight: 900; letter-spacing: -0.02em;
  line-height: 1.4;
  margin-bottom: 12px;
}
.fpw-body h2 em {
  color: var(--turquoise-deep); font-style: italic;
}
.fpw-body .lead {
  font-size: 14px; color: var(--ink-soft);
  line-height: 1.85;
  margin-bottom: 22px;
}

.fpw-foot {
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; background: var(--cream);
  position: relative;
}
.fpw-back {
  background: transparent; border: 0;
  font-size: 13px; font-weight: 800; color: var(--ink-soft);
  padding: 8px 4px; cursor: pointer;
  letter-spacing: 0.05em;
}
.fpw-back:hover { color: var(--ink); }

.fpw-next {
  position: relative;
  background: var(--ink); color: var(--paper);
  border: 0; padding: 13px 28px;
  font-size: 13px; font-weight: 800; letter-spacing: 0.08em;
  cursor: pointer;
}
.fpw-next:hover { background: var(--turquoise-deep); }
.fpw-next:disabled {
  background: var(--line); color: var(--muted); cursor: not-allowed;
}
.fpw-next.fpw-cta-go {
  background: var(--turquoise-deep);
  color: var(--paper);
  padding: 14px 30px; font-size: 14px;
  box-shadow: 0 6px 18px rgba(79,200,192,0.32);
}
.fpw-next.fpw-cta-go:hover { background: var(--ink); }

/* 点滅指マーク（ボタンを上から下へ指す） */
.fpw-next.pulse::before {
  content: "👇";
  position: absolute;
  top: -34px; left: 50%;
  transform: translateX(-50%);
  font-size: 26px;
  animation: fpw-pulse 1.1s ease-in-out infinite;
  pointer-events: none;
}
@keyframes fpw-pulse {
  0%, 100% { transform: translateX(-50%) translateY(0);    opacity: 0.85; }
  50%      { transform: translateX(-50%) translateY(6px);  opacity: 1; }
}

/* Mode 選択（自動・手動・あとで） */
.fpw-mode-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 8px;
}
.fpw-mode {
  background: var(--paper); border: 1px solid var(--line);
  padding: 24px 20px;
  cursor: pointer; transition: all 0.18s;
  text-align: left;
  font-family: inherit;
  border-radius: 4px;
}
.fpw-mode:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.fpw-mode.primary { border-top: 3px solid var(--turquoise-deep); }
.fpw-mode .ico { font-size: 30px; margin-bottom: 10px; display: block; }
.fpw-mode h3 {
  font-family: "Iowan Old Style", serif;
  font-size: 17px; font-weight: 900;
  margin-bottom: 6px;
}
.fpw-mode p {
  font-size: 12px; color: var(--ink-soft); line-height: 1.7;
}

/* レベル選択 6 カード */
.fpw-level-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.fpw-level {
  background: var(--paper); border: 1px solid var(--line);
  border-top: 3px solid var(--turquoise);
  padding: 20px 18px;
  cursor: pointer; transition: all 0.18s;
  text-align: left;
  font-family: inherit;
  position: relative;
}
.fpw-level:hover { border-color: var(--ink); transform: translateY(-2px); }
.fpw-level.selected {
  background: var(--ink); color: var(--paper);
  border-color: var(--ink); border-top-color: var(--turquoise);
}
.fpw-level .num-it {
  font-family: "Iowan Old Style", "Charter", serif;
  font-style: italic;
  font-size: 12px; font-weight: 800;
  color: var(--turquoise-deep);
  letter-spacing: 0.05em;
}
.fpw-level.selected .num-it { color: var(--turquoise); }
.fpw-level h4 {
  font-family: "Iowan Old Style", serif;
  font-size: 18px; font-weight: 900;
  margin: 8px 0 4px;
}
.fpw-level .age {
  font-size: 11px; color: var(--ink-soft);
  margin-bottom: 8px;
}
.fpw-level.selected .age { color: rgba(255,255,255,0.7); }
.fpw-level .desc {
  font-size: 11px; line-height: 1.7;
  color: var(--ink);
}
.fpw-level.selected .desc { color: rgba(255,255,255,0.85); }
.fpw-level .check {
  position: absolute; top: 10px; right: 10px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: none;
  align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
}
.fpw-level.selected .check {
  display: flex; background: var(--turquoise);
  border-color: var(--turquoise);
}

/* "迷っている方への目安" */
.fpw-hints {
  margin-top: 22px;
  padding: 18px 22px;
  background: var(--cream);
  border-left: 3px solid var(--ink);
  font-size: 12px; line-height: 1.95;
}
.fpw-hints h4 {
  font-size: 11px; letter-spacing: 0.18em;
  font-weight: 800; color: var(--ink-soft);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.fpw-hints ul { list-style: none; padding: 0; margin: 0; }
.fpw-hints li { padding: 3px 0; color: var(--ink); }
.fpw-hints li b { color: var(--turquoise-deep); font-weight: 800; }

.fpw-note {
  margin-top: 14px;
  padding: 10px 14px;
  font-size: 11px; color: var(--muted);
  border-top: 1px dashed var(--line);
  line-height: 1.7;
}

/* 開始日 / ペース */
.fpw-options {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.fpw-opt {
  background: var(--paper); border: 1px solid var(--line);
  padding: 18px 12px;
  text-align: center;
  cursor: pointer; transition: all 0.18s;
  font-family: inherit;
}
.fpw-opt:hover { border-color: var(--ink); transform: translateY(-1px); }
.fpw-opt.selected {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.fpw-opt .ttl {
  font-family: "Iowan Old Style", serif;
  font-size: 15px; font-weight: 900;
}
.fpw-opt .desc {
  font-size: 10px; color: var(--ink-soft);
  margin-top: 4px;
}
.fpw-opt.selected .desc { color: rgba(255,255,255,0.7); }

.fpw-date-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--ink);
  font-size: 14px;
  font-family: inherit;
  margin-top: 8px;
}

/* 完了画面 */
.fpw-done {
  text-align: center;
  padding: 28px 12px;
}
.fpw-done .icn {
  font-size: 60px; margin-bottom: 14px;
  display: block;
}
.fpw-done h2 { margin-bottom: 14px; }
.fpw-done .summary {
  background: var(--cream);
  padding: 18px 22px;
  text-align: left;
  border-left: 3px solid var(--turquoise-deep);
  margin: 18px auto;
  max-width: 480px;
  font-size: 13px;
  line-height: 1.85;
}
.fpw-done .summary b { color: var(--turquoise-deep); }

@media (max-width: 720px) {
  .fpw-body { padding: 22px 20px 18px; }
  .fpw-mode-grid, .fpw-level-grid { grid-template-columns: 1fr; }
  .fpw-options { grid-template-columns: 1fr 1fr; }
  .fpw-body h2 { font-size: 20px; }
}
