/* ===================================================
   BOKUDO — Sub-page Specific Styles
   =================================================== */

/* ---- Nav active ---- */
.nav-active { color: var(--gold) !important; font-weight: 700 !important; }

/* ---- Lang Toggle ---- */
.lang-toggle {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px; padding: 6px 14px; cursor: pointer;
  font-size: .75rem; font-family: var(--font-sans);
  transition: var(--ease);
}
.lang-toggle:hover { border-color: var(--gold); }
.lang-ja, .lang-zh { color: rgba(255,255,255,.5); transition: var(--ease); }
.lang-ja.active, .lang-zh.active { color: var(--gold); font-weight: 700; }
.lang-divider { color: rgba(255,255,255,.2); font-size: .65rem; }

/* ===================================================
   SEARCH PAGE
   =================================================== */
.search-section { padding: 48px 0 80px; }

.search-bar-wrap {
  background: var(--white); border: 1.5px solid var(--border-2);
  border-radius: 16px; padding: 28px; margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}
.search-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper); border: 1.5px solid var(--border-2);
  border-radius: 10px; padding: 10px 16px; margin-bottom: 18px;
  transition: var(--ease);
}
.search-bar:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.search-icon { font-size: 1rem; opacity: .5; }
.search-bar input {
  flex: 1; border: none; background: none; font-size: 1rem;
  font-family: var(--font-sans); color: var(--ink); outline: none;
}
.search-clear {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: .85rem; padding: 2px 6px;
  transition: var(--ease); border-radius: 4px;
}
.search-clear:hover { background: var(--paper-2); color: var(--ink); }

.search-filters {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
}
.filter-group {
  display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 120px;
}
.filter-group label { font-size: .75rem; font-weight: 600; color: var(--muted); letter-spacing: .5px; }
.filter-group select {
  padding: 9px 12px; border: 1.5px solid var(--border-2);
  border-radius: 8px; font-size: .85rem; font-family: var(--font-sans);
  background: var(--white); color: var(--ink); cursor: pointer; outline: none;
  transition: var(--ease);
}
.filter-group select:focus { border-color: var(--gold); }
.search-submit { white-space: nowrap; height: 40px; padding: 0 24px; }

.results-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.results-count { font-size: .875rem; color: var(--muted); }
.view-toggle { display: flex; gap: 4px; }
.view-btn {
  width: 34px; height: 34px; border-radius: 6px;
  background: var(--white); border: 1.5px solid var(--border-2);
  cursor: pointer; font-size: 1rem; transition: var(--ease);
}
.view-btn.active { background: var(--gold); border-color: var(--gold); }

.load-more-wrap { text-align: center; margin-top: 48px; }

/* Work Card (shared) */
.work-card { cursor: pointer; }
.work-thumb { position: relative; }
.work-free-badge, .work-paid-badge {
  position: absolute; top: 8px; right: 8px;
  font-size: .65rem; font-weight: 700; padding: 3px 10px;
  border-radius: 10px; z-index: 1;
}
.work-free-badge { background: rgba(40,180,100,.9); color: white; }
.work-paid-badge { background: rgba(155,35,53,.9); color: white; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.7); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: var(--ease);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--white); border-radius: 20px;
  width: 90%; max-width: 700px; max-height: 88vh;
  overflow-y: auto; position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px); transition: var(--ease);
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-box--gallery { max-width: 860px; }
.modal-box--booking { max-width: 560px; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--paper); border: none; cursor: pointer;
  font-size: .9rem; z-index: 1; transition: var(--ease);
}
.modal-close:hover { background: var(--paper-2); }

/* Work Detail Modal Content */
.work-detail { display: grid; grid-template-columns: 1fr 1fr; min-height: 400px; }
.wd-image {
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%);
  border-radius: 20px 0 0 20px;
  display: flex; align-items: center; justify-content: center;
}
.wd-char {
  font-family: var(--font-serif); font-size: 8rem; font-weight: 900;
  color: var(--gold); line-height: 1;
}
.wd-info { padding: 36px 28px; }
.wd-tag {
  display: inline-block; font-size: .72rem; font-weight: 700;
  background: var(--gold-dim); color: var(--gold);
  padding: 4px 12px; border-radius: 12px; margin-bottom: 14px;
}
.wd-title {
  font-family: var(--font-serif); font-size: 1.4rem; font-weight: 900;
  color: var(--ink); margin-bottom: 6px;
}
.wd-master { font-size: .875rem; color: var(--muted); margin-bottom: 20px; }
.wd-meta { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.wd-meta-row { display: flex; gap: 8px; font-size: .82rem; }
.wd-meta-row span:first-child { color: var(--muted); width: 64px; flex-shrink: 0; }
.wd-meta-row span:last-child { color: var(--ink); font-weight: 500; }
.wd-desc { font-size: .82rem; color: var(--muted); line-height: 1.7; margin-bottom: 24px; }
.wd-actions { display: flex; flex-direction: column; gap: 10px; }
.wd-actions .btn-primary, .wd-actions .btn-secondary { width: 100%; }

/* ===================================================
   GENERATOR PAGE
   =================================================== */
.generator-section { padding-bottom: 80px; }
.generator-layout { display: grid; grid-template-columns: 360px 1fr; gap: 48px; align-items: start; }

.gen-controls {
  background: var(--white); border: 1px solid var(--border-2);
  border-radius: 16px; padding: 28px; position: sticky; top: 82px;
}
.gen-control-group { margin-bottom: 24px; }
.gen-control-group:last-child { margin-bottom: 0; }
.gen-control-group > label {
  display: block; font-size: .78rem; font-weight: 700;
  color: var(--muted); letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 10px;
}
.gen-control-group input[type="text"] {
  width: 100%; padding: 14px 16px;
  background: var(--paper); border: 1.5px solid var(--border-2);
  border-radius: 10px; font-size: 1.4rem;
  font-family: var(--font-serif); color: var(--ink); outline: none;
  transition: var(--ease); letter-spacing: 4px;
}
.gen-control-group input[type="text"]:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }

.style-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.style-radio {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border-radius: 8px;
  border: 1.5px solid var(--border-2);
  cursor: pointer; transition: var(--ease);
  background: var(--paper);
}
.style-radio input { display: none; }
.style-radio.active, .style-radio:hover { border-color: var(--gold); background: var(--gold-dim); }
.style-char {
  font-family: var(--font-serif); font-size: 1.6rem; font-weight: 900;
  color: var(--ink); line-height: 1;
}
.style-radio span:last-child { font-size: .7rem; color: var(--muted); }
.style-radio.active .style-char { color: var(--gold); }
.style-radio.active span:last-child { color: var(--gold); font-weight: 700; }

.color-options { display: flex; gap: 8px; }
.color-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid transparent; cursor: pointer; padding: 2px;
  transition: var(--ease); display: flex; align-items: center; justify-content: center;
  background: none;
}
.color-btn span { width: 26px; height: 26px; border-radius: 50%; display: block; }
.color-btn.active, .color-btn:hover { border-color: var(--gold); }

.seal-options { display: flex; gap: 16px; }
.seal-opt { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .875rem; }
.seal-opt input { accent-color: var(--gold); width: 16px; height: 16px; }

.size-options { display: flex; gap: 8px; }
.size-btn {
  flex: 1; padding: 9px 6px; border-radius: 8px;
  background: var(--paper); border: 1.5px solid var(--border-2);
  font-size: .78rem; cursor: pointer; transition: var(--ease); text-align: center;
  font-family: var(--font-sans);
}
.size-btn.active, .size-btn:hover { border-color: var(--gold); background: var(--gold-dim); font-weight: 700; }
.pro-tag {
  background: var(--gold); color: var(--ink);
  font-size: .6rem; font-weight: 700; padding: 1px 5px;
  border-radius: 4px; margin-left: 3px;
}

.gen-license-box { background: var(--paper); border-radius: 10px; padding: 16px; margin-bottom: 20px; }
.license-options { display: flex; gap: 8px; }
.license-card {
  flex: 1; padding: 14px; border-radius: 8px;
  border: 1.5px solid var(--border-2); cursor: pointer; transition: var(--ease);
}
.license-card input { display: none; }
.license-card.active { border-color: var(--gold); background: var(--gold-dim); }
.lc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.lc-header span { font-size: .78rem; font-weight: 700; color: var(--ink); }
.lc-header strong { font-size: .9rem; color: var(--gold); }
.license-card p { font-size: .7rem; color: var(--muted); line-height: 1.5; }
.gen-submit-btn { width: 100%; }

/* ── Gen Preview (Canvas-based) ── */
.gen-preview-area { display: flex; flex-direction: column; gap: 16px; }

.gen-canvas-wrap {
  position: relative;
  border-radius: 16px; overflow: hidden;
  background: #0e0e14;
  box-shadow: 0 8px 40px rgba(0,0,0,.35);
  line-height: 0; /* remove gap below canvas */
}

#genMainCanvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  transition: opacity .3s ease;
}

.gcl-style-tag {
  position: absolute; bottom: 14px; right: 16px;
  font-size: .68rem; color: rgba(255,255,255,.3);
  letter-spacing: 3px; text-transform: uppercase;
  pointer-events: none;
}

/* Loading overlay */
.gen-loading {
  position: absolute; inset: 0;
  background: rgba(14,14,20,.85);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  border-radius: 16px;
  transition: opacity .3s ease;
  z-index: 5;
}
.gen-loading.hidden { opacity: 0; pointer-events: none; }

.gen-loading-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid rgba(201,168,76,.2);
  border-top-color: var(--gold);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.gen-loading span {
  font-size: .8rem; color: rgba(255,255,255,.55); letter-spacing: 1px;
}

/* Watermark notice */
.watermark-notice {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: rgba(201,168,76,.08);
  border: 1px solid rgba(201,168,76,.2);
  border-radius: 8px;
  font-size: .78rem; color: var(--muted);
}
.watermark-notice.hidden { display: none; }

/* Download bar */
.gen-download-bar { display: flex; gap: 10px; }
.dl-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 14px 8px; background: var(--white); border: 1.5px solid var(--border-2);
  border-radius: 10px; cursor: pointer; transition: var(--ease); font-family: var(--font-sans);
}
.dl-btn:hover { border-color: var(--gold); box-shadow: 0 4px 16px rgba(201,168,76,.15); }
.dl-btn span { font-size: .9rem; font-weight: 700; color: var(--ink); }
.dl-btn small { font-size: .68rem; color: var(--muted); margin-top: 3px; }
.dl-btn--gold { background: var(--gold-dim); border-color: var(--gold); }
.dl-btn--gold span { color: var(--gold); }
.dl-btn--gold:hover { background: var(--gold); }
.dl-btn--gold:hover span, .dl-btn--gold:hover small { color: var(--ink); }
.dl-btn:disabled { opacity: .45; cursor: not-allowed; }

/* History */
.gen-history-label { font-size: .78rem; font-weight: 700; color: var(--muted); letter-spacing: 1px; margin-bottom: 10px; }
.gen-history-list { display: flex; gap: 8px; flex-wrap: wrap; }
.hist-item {
  width: 58px; height: 58px; border-radius: 8px;
  background: var(--ink); border: 1.5px solid var(--border-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--ease); overflow: hidden; position: relative;
}
.hist-item canvas {
  width: 58px !important; height: 58px !important;
  border-radius: 6px;
}
.hist-item:hover { border-color: var(--gold); transform: scale(1.08); box-shadow: 0 4px 16px rgba(201,168,76,.3); }

/* ===================================================
   GALLERY PAGE
   =================================================== */
.gallery-main { padding-bottom: 0; }
.gallery-tab-bar {
  display: flex; gap: 6px; flex-wrap: wrap;
  justify-content: center; margin-bottom: 32px;
}
.gtab {
  padding: 9px 20px; border-radius: 24px;
  background: var(--white); border: 1.5px solid var(--border-2);
  font-size: .82rem; cursor: pointer; transition: var(--ease);
  font-family: var(--font-sans); color: var(--ink);
}
.gtab.active, .gtab:hover { background: var(--gold); border-color: var(--gold); font-weight: 700; }

.ranking-banner {
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%);
  border: 1px solid var(--gold); border-radius: 12px;
  padding: 16px 24px; margin-bottom: 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.ranking-title { font-family: var(--font-serif); font-size: 1rem; font-weight: 700; color: var(--gold); }
.ranking-period { font-size: .8rem; color: rgba(255,255,255,.5); }

/* Masonry Gallery */
.gallery-item-m { position: relative; }
.gallery-item-m .gallery-rank {
  position: absolute; top: 8px; left: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold); color: var(--ink);
  font-size: .8rem; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.gallery-thumb-m {
  display: flex; align-items: center; justify-content: center;
}
.gallery-meta-m { padding: 12px 14px; }
.gallery-meta-actions {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-2);
}
.gallery-action-btn {
  background: none; border: none; cursor: pointer;
  font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 4px;
  transition: var(--ease); padding: 3px 6px; border-radius: 4px;
}
.gallery-action-btn:hover { color: var(--gold); background: var(--gold-dim); }
.gallery-action-btn.liked { color: var(--red); }
.gallery-style-tag {
  font-size: .68rem; background: var(--gold-dim); color: var(--gold);
  padding: 2px 8px; border-radius: 10px;
}
.market-price {
  font-size: .82rem; font-weight: 700; color: var(--red);
}

/* Frame Tool */
.frame-tool-section { background: var(--paper-2); padding-top: 80px; }
.frame-tool-layout { display: grid; grid-template-columns: 360px 1fr; gap: 48px; align-items: start; }
.frame-tool-left {
  background: var(--white); border: 1px solid var(--border-2);
  border-radius: 16px; padding: 28px; position: sticky; top: 82px;
}
.upload-zone {
  border: 2px dashed var(--border-2); border-radius: 12px;
  padding: 32px; text-align: center; margin-bottom: 20px;
  transition: var(--ease); cursor: pointer;
}
.upload-zone:hover { border-color: var(--gold); background: var(--gold-dim); }
.upload-icon { font-size: 2rem; margin-bottom: 10px; }
.upload-text { font-size: .82rem; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.upload-btn { font-size: .82rem !important; padding: 8px 20px !important; }
.frame-type-select { margin-bottom: 20px; }
.frame-type-select label { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); letter-spacing: 1px; margin-bottom: 10px; }
.frame-types { display: flex; gap: 6px; flex-wrap: wrap; }
.ftype-btn {
  padding: 8px 16px; border-radius: 20px;
  background: var(--paper); border: 1.5px solid var(--border-2);
  font-size: .8rem; cursor: pointer; transition: var(--ease); font-family: var(--font-sans);
}
.ftype-btn.active, .ftype-btn:hover { background: var(--gold); border-color: var(--gold); font-weight: 700; }
.frame-adjustments { margin-bottom: 20px; }
.adj-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  font-size: .82rem;
}
.adj-row label { width: 60px; flex-shrink: 0; color: var(--muted); font-size: .78rem; }
.adj-row input[type="range"] { flex: 1; accent-color: var(--gold); }
.adj-row select {
  flex: 1; padding: 6px 10px; border: 1.5px solid var(--border-2);
  border-radius: 6px; font-size: .82rem; font-family: var(--font-sans); outline: none;
  background: var(--white);
}
.adj-row input[type="checkbox"] { accent-color: var(--gold); width: 16px; height: 16px; }
.frame-dl-btn { width: 100%; }

.frame-tool-right {}
.frame-preview-box {
  aspect-ratio: 3/4; background: var(--paper);
  border: 1px solid var(--border-2); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; overflow: hidden;
  box-shadow: var(--shadow-md);
}
/* Preview mocks */
.frame-preview-mock { display: flex; align-items: center; justify-content: center; }
.frame-kakejiku-mock {
  width: 200px; height: 340px;
  background: linear-gradient(180deg, #2c1b0a 0%, #1a1000 100%);
  border: 6px solid #8b6914;
  box-shadow: inset 0 0 30px rgba(0,0,0,.4);
  position: relative;
}
.frame-kakejiku-mock::before, .frame-kakejiku-mock::after {
  content: ''; position: absolute; left: -10px; right: -10px; height: 18px;
  background: #5c3d0a; border-radius: 2px;
}
.frame-kakejiku-mock::before { top: -16px; }
.frame-kakejiku-mock::after { bottom: -16px; }
.fp-inner { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; }
.fp-char {
  font-family: var(--font-serif); font-size: 5rem; font-weight: 900;
  color: var(--gold); line-height: 1;
}
.fp-seal {
  position: absolute; bottom: 12px; right: 12px;
  width: 36px; height: 36px; border-radius: 3px;
  background: var(--red); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: .9rem; color: white; font-weight: 900;
}

.frame-share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn {
  flex: 1; padding: 10px; border-radius: 8px;
  background: var(--white); border: 1.5px solid var(--border-2);
  font-size: .8rem; cursor: pointer; transition: var(--ease); font-family: var(--font-sans);
  white-space: nowrap;
}
.share-btn:hover { border-color: var(--gold); color: var(--gold); }
.share-btn--gold { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); font-weight: 700; }
.share-btn--gold:hover { background: var(--gold); color: var(--ink); }

/* Gallery Item Detail Modal */
.gallery-detail { padding: 32px; }
.gd-image {
  width: 100%; aspect-ratio: 1;
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%);
  border-radius: 12px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: center;
}
.gd-char { font-family: var(--font-serif); font-size: 10rem; font-weight: 900; color: var(--gold); line-height: 1; }
.gd-meta { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.gd-author strong { display: block; font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.gd-author span { font-size: .8rem; color: var(--muted); }
.gd-stats { display: flex; gap: 12px; }
.gd-stat { display: flex; align-items: center; gap: 4px; font-size: .82rem; color: var(--muted); }
.gd-desc { font-size: .875rem; color: var(--muted); line-height: 1.7; margin-bottom: 20px; }
.gd-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.gd-tag { font-size: .72rem; background: var(--gold-dim); color: var(--gold); padding: 3px 10px; border-radius: 10px; }
.gd-actions { display: flex; gap: 8px; }
.gd-actions button { flex: 1; }

/* Comments */
.comment-section { padding: 0 32px 32px; border-top: 1px solid var(--border-2); }
.comment-title { font-size: .875rem; font-weight: 700; color: var(--ink); margin: 20px 0 14px; }
.comment-input-row { display: flex; gap: 10px; margin-bottom: 16px; }
.comment-input {
  flex: 1; padding: 10px 14px; border: 1.5px solid var(--border-2);
  border-radius: 8px; font-size: .875rem; font-family: var(--font-sans); outline: none;
}
.comment-input:focus { border-color: var(--gold); }
.comment-submit { padding: 10px 18px; background: var(--gold); border: none; border-radius: 8px; cursor: pointer; font-weight: 700; }
.comment-list { display: flex; flex-direction: column; gap: 12px; }
.comment-item { display: flex; gap: 10px; }
.comment-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--ink-2); display: flex; align-items: center; justify-content: center;
  font-size: .8rem; color: var(--gold); font-weight: 700; flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-author { font-size: .78rem; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.comment-text { font-size: .82rem; color: var(--muted); line-height: 1.5; }

/* ===================================================
   LESSON PAGE
   =================================================== */
.lesson-main { padding-bottom: 80px; }
.lesson-type-tabs {
  display: flex; gap: 0; border: 1.5px solid var(--border-2);
  border-radius: 10px; overflow: hidden; width: fit-content; margin-bottom: 36px;
}
.ltype-btn {
  padding: 12px 28px; background: none; border: none; cursor: pointer;
  font-size: .875rem; font-family: var(--font-sans); color: var(--muted);
  transition: var(--ease);
}
.ltype-btn.active { background: var(--gold); color: var(--ink); font-weight: 700; }
.ltype-content {}
.teacher-filters {
  display: flex; gap: 12px; align-items: flex-end;
  flex-wrap: wrap; margin-bottom: 28px;
  background: var(--white); border: 1px solid var(--border-2);
  border-radius: 12px; padding: 20px;
}
.teacher-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.teacher-card-full {
  background: var(--white); border: 1px solid var(--border-2);
  border-radius: 14px; overflow: hidden; transition: var(--ease);
}
.teacher-card-full:hover { border-color: var(--gold); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.tcf-header {
  padding: 24px; display: flex; gap: 16px; align-items: flex-start;
  border-bottom: 1px solid var(--border-2);
}
.tcf-avatar {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 1.6rem; color: var(--gold); font-weight: 900;
}
.tcf-avatar--2 { background: linear-gradient(135deg, #1a0a2e 0%, #3d1f5c 100%); }
.tcf-avatar--3 { background: linear-gradient(135deg, #0a1f2e 0%, #1f3d5c 100%); }
.tcf-avatar--4 { background: linear-gradient(135deg, #0a2e1a 0%, #1f5c3d 100%); }
.tcf-avatar--5 { background: linear-gradient(135deg, #2e1a0a 0%, #5c3d1f 100%); }
.tcf-avatar--6 { background: linear-gradient(135deg, #1a0a2e 0%, #5c1f3d 100%); }
.tcf-info { flex: 1; }
.tcf-name { font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.tcf-style-badge {
  display: inline-block; background: var(--gold-dim); color: var(--gold);
  font-size: .7rem; padding: 2px 10px; border-radius: 10px; margin-bottom: 6px;
}
.tcf-rating { font-size: .78rem; color: var(--gold); }
.tcf-rating span { color: var(--muted); }
.tcf-certified {
  display: inline-block; background: var(--gold); color: var(--ink);
  font-size: .65rem; font-weight: 700; padding: 2px 8px; border-radius: 8px; margin-left: 6px;
}
.tcf-body { padding: 16px 24px; }
.tcf-desc { font-size: .82rem; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.tcf-styles { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tcf-style-tag { font-size: .7rem; background: var(--paper); border: 1px solid var(--border-2); padding: 3px 10px; border-radius: 10px; color: var(--ink); }
.tcf-price-row { display: flex; justify-content: space-between; align-items: center; }
.tcf-price { font-size: 1rem; font-weight: 700; color: var(--ink); }
.tcf-price span { font-size: .75rem; color: var(--muted); font-weight: 400; }
.tcf-slots { font-size: .78rem; color: var(--muted); }
.tcf-footer { padding: 16px 24px; background: var(--paper); }
.tcf-book-btn { width: 100%; }

/* Workshops */
.workshop-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.ws-filter-btn {
  padding: 8px 20px; border-radius: 24px;
  background: var(--white); border: 1.5px solid var(--border-2);
  font-size: .82rem; cursor: pointer; transition: var(--ease); font-family: var(--font-sans);
}
.ws-filter-btn.active, .ws-filter-btn:hover { background: var(--gold); border-color: var(--gold); font-weight: 700; }
.workshop-grid { display: flex; flex-direction: column; gap: 20px; }
.ws-card-full {
  background: var(--white); border: 1px solid var(--border-2);
  border-radius: 14px; overflow: hidden; transition: var(--ease);
}
.ws-card-full:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); }
.wsc-layout { display: grid; grid-template-columns: 280px 1fr auto; gap: 0; }
.wsc-side {
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px;
}
.wsc-char { font-family: var(--font-serif); font-size: 4rem; font-weight: 900; color: var(--gold); margin-bottom: 8px; line-height: 1; }
.wsc-style-tag {
  font-size: .72rem; background: rgba(201,168,76,.2); color: var(--gold);
  padding: 4px 12px; border-radius: 12px;
}
.wsc-body { padding: 24px 28px; }
.wsc-status { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.wsc-badge-open { background: rgba(40,180,100,.1); color: #228b22; }
.wsc-badge-waitlist { background: rgba(255,140,0,.1); color: #d68000; }
.wsc-badge-upcoming { background: var(--gold-dim); color: var(--gold); }
.wsc-badge-open, .wsc-badge-waitlist, .wsc-badge-upcoming {
  font-size: .7rem; font-weight: 700; padding: 3px 12px; border-radius: 12px;
}
.wsc-title { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.wsc-teacher { font-size: .8rem; color: var(--muted); margin-bottom: 12px; }
.wsc-meta-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; }
.wsc-meta-item { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.wsc-slot-wrap { display: flex; align-items: center; gap: 10px; }
.wsc-slot-bar { flex: 1; height: 5px; background: var(--border-2); border-radius: 3px; overflow: hidden; }
.wsc-slot-fill { height: 100%; background: var(--gold); border-radius: 3px; }
.wsc-slot-txt { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.wsc-pricing-col {
  padding: 24px; display: flex; flex-direction: column;
  justify-content: center; gap: 8px; min-width: 180px;
  border-left: 1px solid var(--border-2);
}
.wsc-tier-row { text-align: center; }
.wsc-tier-label { font-size: .72rem; color: var(--muted); display: block; margin-bottom: 2px; }
.wsc-tier-price { font-size: .95rem; font-weight: 700; color: var(--ink); }
.wsc-tier-row.featured-tier .wsc-tier-price { color: var(--gold); }
.wsc-enroll-btn { margin-top: 8px; width: 100%; }

/* Replay */
.replay-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.replay-card {
  background: var(--white); border: 1px solid var(--border-2);
  border-radius: 12px; overflow: hidden; transition: var(--ease);
}
.replay-card:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); transform: translateY(-3px); }
.replay-thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.replay-char { font-family: var(--font-serif); font-size: 4rem; font-weight: 900; color: var(--gold); opacity: .6; }
.replay-play {
  position: absolute; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(201,168,76,.9); display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--ink);
}
.replay-price-badge {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,.7); color: var(--white);
  font-size: .75rem; font-weight: 700; padding: 4px 12px; border-radius: 12px;
}
.replay-meta { padding: 14px 16px; }
.replay-title { font-size: .875rem; font-weight: 700; color: var(--ink); margin-bottom: 4px; line-height: 1.4; }
.replay-teacher { font-size: .78rem; color: var(--muted); margin-bottom: 8px; }
.replay-stats { display: flex; gap: 12px; font-size: .75rem; color: var(--muted); margin-bottom: 12px; }
.replay-buy-btn { width: 100%; }

/* Booking Modal */
.booking-content { padding: 36px; }
.booking-content h3 {
  font-family: var(--font-serif); font-size: 1.3rem; font-weight: 900;
  color: var(--ink); margin-bottom: 20px;
}
.booking-teacher-info {
  display: flex; gap: 12px; align-items: center;
  background: var(--paper); border-radius: 10px; padding: 16px;
  margin-bottom: 24px;
}
.bti-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 1.3rem; color: var(--gold); font-weight: 900;
}
.bti-name { font-weight: 700; color: var(--ink); font-size: .9rem; }
.bti-style { font-size: .78rem; color: var(--muted); }
.bti-price { font-size: .9rem; font-weight: 700; color: var(--gold); margin-left: auto; }

/* Calendar */
.booking-calendar { margin-bottom: 20px; }
.cal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.cal-month { font-weight: 700; font-size: .9rem; color: var(--ink); }
.cal-nav {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--border-2);
  cursor: pointer; font-size: .9rem; transition: var(--ease);
}
.cal-nav:hover { background: var(--gold); border-color: var(--gold); }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.cal-day-label {
  text-align: center; font-size: .7rem; color: var(--muted);
  font-weight: 700; padding: 4px 0;
}
.cal-day {
  aspect-ratio: 1; border-radius: 6px; display: flex; align-items: center;
  justify-content: center; font-size: .82rem; cursor: pointer; transition: var(--ease);
}
.cal-day:hover:not(.cal-day--empty):not(.cal-day--past) { background: var(--gold-dim); }
.cal-day.selected { background: var(--gold); color: var(--ink); font-weight: 700; }
.cal-day--empty { pointer-events: none; }
.cal-day--past { color: var(--border-2); pointer-events: none; }
.cal-day--available { background: rgba(40,180,100,.08); }

/* Time Slots */
.time-slots { margin-bottom: 20px; }
.time-slots-label { font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 10px; letter-spacing: 1px; }
.time-slots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.time-slot {
  padding: 10px; border-radius: 8px; border: 1.5px solid var(--border-2);
  text-align: center; font-size: .82rem; cursor: pointer; transition: var(--ease);
  background: var(--white);
}
.time-slot:hover { border-color: var(--gold); }
.time-slot.selected { background: var(--gold); border-color: var(--gold); font-weight: 700; }
.time-slot--busy { background: var(--paper-2); color: var(--muted); pointer-events: none; text-decoration: line-through; }

.booking-features {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 20px;
}
.bf-item { display: flex; gap: 8px; align-items: center; font-size: .78rem; color: var(--muted); }
.booking-confirm-btn { width: 100%; }
.booking-confirm-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===================================================
   Responsive sub-pages
   =================================================== */
@media (max-width: 900px) {
  .generator-layout { grid-template-columns: 1fr; }
  .gen-controls { position: static; }
  .frame-tool-layout { grid-template-columns: 1fr; }
  .frame-tool-left { position: static; }
  .teacher-grid { grid-template-columns: 1fr 1fr; }
  .wsc-layout { grid-template-columns: 1fr; }
  .wsc-side { padding: 20px; flex-direction: row; gap: 12px; }
  .wsc-pricing-col { border-left: none; border-top: 1px solid var(--border-2); flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; }
  .replay-grid { grid-template-columns: 1fr 1fr; }
  .work-detail { grid-template-columns: 1fr; }
  .wd-image { border-radius: 20px 20px 0 0; aspect-ratio: 16/9; }
}
@media (max-width: 600px) {
  .search-filters { flex-direction: column; }
  .teacher-grid { grid-template-columns: 1fr; }
  .replay-grid { grid-template-columns: 1fr; }
  .booking-features { grid-template-columns: 1fr; }
  .time-slots-grid { grid-template-columns: repeat(4, 1fr); }
}
