:root {
  color-scheme: light;
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif;
  background: #f4f7fb;
  color: #14233a;
  --navy: #102744;
  --blue: #2368d8;
  --blue-soft: #eaf2ff;
  --border: #d9e2ef;
  --muted: #62738a;
  --card: #fff;
  --danger: #a92d3d;
}
* { box-sizing: border-box; }
body { margin: 0; background: #f4f7fb; }
main { min-height: 100vh; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
.topbar { min-height: 4.5rem; padding: .85rem clamp(1rem, 4vw, 3rem); display: flex; align-items: center; gap: 1.4rem; color: #fff; background: var(--navy); }
.topbar a { color: #dbe8f8; text-decoration: none; }
.topbar a.current { color: #fff; font-weight: 750; }
.topbar .brand { margin-right: auto; color: #fff; font-size: 1.08rem; font-weight: 800; letter-spacing: .01em; }
.topbar nav { display: flex; align-items: center; gap: 1rem; }
.topbar form { margin: 0; }
.logout { width: auto; padding: .58rem .85rem; border: 1px solid #7690b0; border-radius: .55rem; color: #fff; background: transparent; }
.page-heading { width: min(76rem, calc(100% - 2rem)); margin: 0 auto; padding: 3.2rem 0 1.6rem; }
.page-heading h1 { margin: .25rem 0 .65rem; color: var(--navy); font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.08; }
.page-heading p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--blue) !important; font-size: .75rem; font-weight: 850; letter-spacing: .14em; }
.launcher-grid { width: min(76rem, calc(100% - 2rem)); margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
.launcher-card { min-height: 11rem; max-width: 24.5rem; padding: 1.5rem; display: flex; flex-direction: column; justify-content: flex-end; gap: .45rem; border: 1px solid var(--border); border-radius: 1rem; color: var(--navy); background: var(--card); box-shadow: 0 8px 24px rgba(16,39,68,.06); text-decoration: none; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.launcher-card:hover, .launcher-card:focus-visible { transform: translateY(-2px); border-color: #79a9ee; box-shadow: 0 12px 30px rgba(35,104,216,.12); outline: none; }
.launcher-card strong { font-size: 1.45rem; }
.launcher-card > span:last-child { color: var(--muted); }
.card-kicker { margin-bottom: auto; color: var(--blue); font-size: .72rem; font-weight: 850; letter-spacing: .12em; }
.kanban-state { width: min(62rem, calc(100% - 2rem)); margin: 0 auto 4rem; padding: 1.5rem; display: grid; grid-template-columns: minmax(9rem, auto) 1fr; gap: .75rem 1.5rem; border: 1px solid var(--border); border-radius: 1rem; background: #fff; }
.kanban-state dt { font-weight: 800; }
.kanban-state dd { margin: 0; overflow-wrap: anywhere; }
.prompt-standalone-header { width: min(76rem, calc(100% - 2rem)); margin: 0 auto; padding: 1.5rem 0 1rem; display: flex; align-items: end; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border); }
.prompt-standalone-header p { margin: 0 0 .15rem; color: var(--muted); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.prompt-standalone-header h1 { margin: 0; color: var(--navy); font-size: 1.35rem; font-weight: 650; letter-spacing: -.01em; }
.prompt-standalone-header form { margin: 0; }
.prompt-logout { width: auto; padding: .42rem .65rem; border: 1px solid var(--border); border-radius: .35rem; color: var(--muted); background: #fff; font-size: .75rem; }
.prompt-nav { position: sticky; top: 0; z-index: 10; width: min(76rem, calc(100% - 2rem)); margin: 0 auto 1.2rem; padding: .35rem 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem; border-bottom: 1px solid var(--border); background: rgba(244,247,251,.96); backdrop-filter: blur(8px); }
.prompt-nav a { min-height: 2.4rem; padding: .55rem .4rem; display: grid; place-items: center; border-radius: .35rem; color: #5d6e83; font-size: .82rem; font-weight: 550; text-align: center; text-decoration: none; }
.prompt-nav a.active { color: #174f9d; background: #eaf2ff; font-weight: 700; }
.fixture-banner { width: min(76rem, calc(100% - 2rem)); margin: 0 auto 1.2rem; padding: .9rem 1rem; border: 1px solid #e7b752; border-radius: .75rem; color: #6c4800; background: #fff7df; font-size: .78rem; font-weight: 600; text-align: center; }
.source-selector { width: min(76rem, calc(100% - 2rem)); margin: 0 auto 1rem; display: flex; gap: .55rem; flex-wrap: wrap; }
.source-selector a { padding: .65rem 1rem; border: 1px solid var(--border); border-radius: 999px; background: #fff; text-decoration: none; }
.source-selector a.active { border-color: var(--blue); color: var(--blue); }
.batch-grid { width: min(76rem, calc(100% - 2rem)); margin: 0 auto 4rem; display: grid; grid-template-columns: repeat(4, minmax(0, 18.25rem)); justify-content: center; gap: 1rem; }
.batch-card { width: 100%; max-width: 18.25rem; overflow: hidden; display: block; border: 1px solid var(--border); border-radius: .9rem; background: #fff; box-shadow: 0 6px 18px rgba(16,39,68,.05); text-decoration: none; color: inherit; }
.batch-card img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; background: #eef3f8; }
.batch-card-body { padding: 1rem; display: grid; gap: .3rem; }
.batch-card-body span { color: var(--muted); }
.prompt-cards { width: min(102rem, calc(100% - 2rem)); margin: 0 auto 4rem; display: grid; grid-template-columns: repeat(4, minmax(0, 24.5rem)); justify-content: center; gap: 1rem; align-items: start; }
.prompt-card { width: 100%; max-width: 24.5rem; padding: .85rem; display: flex; flex-direction: column; gap: .8rem; border: 1px solid var(--border); border-radius: .65rem; background: #fff; box-shadow: 0 3px 12px rgba(16,39,68,.035); }
.thumbnail-wrap { width: 100%; max-width: 300px; align-self: center; overflow: hidden; border-radius: .45rem; background: #eef3f8; }
.thumbnail-wrap img { width: 100%; height: auto; max-height: 360px; display: block; object-fit: contain; }
.prompt-content { min-width: 0; }
.badges, .status-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.classification, .source-meta, .status-row span { color: #64758b; font-size: .72rem; font-weight: 500; }
.classification { color: #174f9d; font-weight: 700; }
.source-meta { margin-left: auto; text-align: right; }
.badge { padding: .22rem .45rem; border: 1px solid var(--border); border-radius: 999px; color: #4a5e79; background: #f8fafc; font-size: .68rem; }
.badge.fixture-badge { border-color: #e7b752; color: #6c4800; background: #fff7df; font-size: .64rem; font-weight: 600; }
.prompt-content h2 { margin: .75rem 0 .35rem; color: var(--navy); font-size: .82rem; font-weight: 650; }
.summary-ko { margin: 0 0 .75rem; color: #26384f; font-size: .9rem; line-height: 1.62; white-space: pre-wrap; }
.src-anchor { font-weight: 800; }
.src-anchor.genital-term { font-weight: 800; background: #ffe3e3; color: #7a1f1f; padding: 0 .12em; border-radius: .2em; }
.status-row { margin-bottom: .7rem; gap: .3rem .65rem; }
.status-row b { font-weight: 600; }
details { margin-top: .5rem; border-top: 1px solid var(--border); background: #fff; }
summary { padding: .65rem .1rem; color: #334a67; font-size: .78rem; font-weight: 600; cursor: pointer; }
.detail-toolbar { padding: 0 0 .5rem; display: flex; justify-content: flex-end; }
.detail-toolbar button, .review-actions button { width: auto; min-height: 2.65rem; padding: .62rem .9rem; border: 1px solid #9db9e3; border-radius: .6rem; color: #174f9d; background: #fff; font-size: .78rem; font-weight: 600; }
.detail-toolbar button.success { border-color: #4d9a72; color: #236a49; }
.canonical-text { max-width: 100%; margin: 0; padding: 0 0 .75rem; overflow: visible; color: #33445b; background: transparent; font: 400 .78rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.source-text { color: #3b4c63; }
.krea-sections { display: grid; gap: .65rem; padding-bottom: .75rem; }
.krea-section { padding: .65rem .7rem; border-left: 2px solid #b8c9dd; background: #f8fafc; }
.krea-section h3 { margin: 0 0 .3rem; color: #284660; font-size: .68rem; font-weight: 750; letter-spacing: .035em; }
.krea-section p { margin: 0; color: #384b63; font-size: .78rem; line-height: 1.55; white-space: pre-wrap; }
.internal-details dl { padding: 0 1rem 1rem; display: grid; grid-template-columns: minmax(7rem, auto) 1fr; gap: .45rem .8rem; }
.internal-details dt { font-weight: 750; }
.internal-details dd { margin: 0; overflow-wrap: anywhere; }
.review-actions { margin: .75rem 0; display: flex; gap: .45rem; flex-wrap: wrap; }
.review-actions button { color: #fff; background: var(--blue); }
.review-actions button.secondary { color: #425675; background: #fff; }
.review-actions button.danger { color: #fff; background: #b42318; border-color: #8f1d14; }
.review-actions button.danger:hover { background: #912018; }
.review-actions button:disabled { cursor: wait; opacity: .65; }
.empty-state { width: min(76rem, calc(100% - 2rem)); margin: 2rem auto 4rem; padding: 3rem 1rem; border: 1px dashed #b9c7d8; border-radius: 1rem; color: var(--muted); background: #fff; text-align: center; }
.empty-state.error { color: var(--danger); }
.toast { position: fixed; right: 1.25rem; top: 5.5rem; z-index: 30; padding: .85rem 1rem; border-radius: .7rem; color: #fff; background: var(--navy); box-shadow: 0 10px 30px rgba(0,0,0,.2); opacity: 0; transform: translateY(-.5rem); pointer-events: none; transition: .18s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
label { display: grid; gap: .4rem; margin: 1rem 0; }
input { width: 100%; padding: .8rem; border: 1px solid var(--border); border-radius: .55rem; }
body > main > h1, body > main > p, body > main > form { width: min(28rem, calc(100% - 2rem)); margin-right: auto; margin-left: auto; }
body > main > h1 { margin-top: 3rem; }
body > main > form { padding: 1.4rem; border: 1px solid var(--border); border-radius: 1rem; background: #fff; }
body > main > form button { width: 100%; padding: .75rem; border: 0; border-radius: .55rem; color: #fff; background: var(--blue); font-weight: 750; }

@media (max-width: 900px) {
  .launcher-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batch-grid { grid-template-columns: repeat(2, minmax(0, 18.25rem)); }
  .prompt-cards { grid-template-columns: repeat(2, minmax(0, 24.5rem)); }
}
@media (max-width: 640px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; gap: .75rem; }
  .topbar .brand { width: 100%; }
  .topbar nav { flex: 1; }
  .logout { min-height: 2.75rem; }
  .page-heading { padding-top: 2rem; }
  .launcher-grid, .batch-grid, .prompt-cards { grid-template-columns: 1fr; }
  .launcher-card, .batch-card { width: 100%; max-width: 24.5rem; }
  .prompt-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prompt-card { max-width: 24.5rem; padding: .8rem; }
  .thumbnail-wrap { width: min(300px, 100%); margin: 0 auto; }
  .review-actions button { flex: 1 1 8rem; min-height: 3rem; }
  .internal-details dl { grid-template-columns: 1fr; }
  .toast { right: 1rem; left: 1rem; top: auto; bottom: 1rem; text-align: center; }
  .prompt-standalone-header { align-items: center; }
}

.source-cards { width: min(76rem, calc(100% - 2rem)); margin: 0 auto 4rem; display: grid; grid-template-columns: repeat(4, minmax(0, 18.25rem)); justify-content: center; gap: 1rem; }
.source-card { width: 100%; max-width: 18.25rem; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: .9rem; background: #fff; box-shadow: 0 6px 18px rgba(16,39,68,.05); text-decoration: none; color: inherit; }
.source-card img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; background: #eef3f8; }
.source-card-body { padding: 1rem; display: grid; gap: .3rem; }
.source-card-body span { color: var(--muted); }
@media (max-width: 900px) { .source-cards { grid-template-columns: repeat(2, minmax(0, 18.25rem)); } }
@media (max-width: 640px) { .source-cards { grid-template-columns: minmax(0, 24.5rem); } .source-card { max-width: 24.5rem; } }

.rules-panel { width: min(62rem, calc(100% - 2rem)); margin: 0 auto 1.5rem; padding: 1.5rem 1.5rem 1.5rem 1.2rem; border: 1px solid var(--border); border-radius: 1rem; background: #fff; }
.rules-list { margin: 0; padding-left: 1.25rem; display: grid; gap: .85rem; }
.rules-list li { color: #24364f; line-height: 1.6; }
.usage-block { width: min(62rem, calc(100% - 2rem)); margin: 0 auto 4rem; padding: 1.5rem; border: 1px solid var(--border); border-radius: 1rem; background: #fff; }
.usage-block h2 { margin: 0 0 .75rem; color: var(--navy); font-size: 1.05rem; }
.usage-block p { margin: .35rem 0; }
.usage-block .muted { color: var(--muted); font-size: .85rem; }

.review-all-note{margin:12px auto 8px;color:#334155;font-size:14px;text-align:center;width:min(102rem, calc(100% - 2rem))}
.review-all-note b{color:#0f172a}
.empty-state{text-align:center;width:min(102rem, calc(100% - 2rem));margin:2rem auto}
.prompt-view-adult,.prompt-view-review{text-align:center}
.prompt-view-adult .prompt-cards,.prompt-view-adult .prompt-card,
.prompt-view-adult .prompt-content,.prompt-view-adult .summary-block,
.prompt-view-adult .badges,.prompt-view-adult .status-row{text-align:left}
.decade-chips,.range-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:.4rem;width:min(102rem, calc(100% - 2rem));margin:0 auto 1rem}
.fixture-banner,.projection-error-banner{text-align:center}

/* Adult / compare — TOP LEVEL (must NOT be inside a phone media query) */
.prompt-view-adult .prompt-cards {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem;
  width: min(102rem, calc(100% - 2rem));
  margin: 0 auto 4rem;
  grid-template-columns: none !important;
}
.prompt-view-adult .prompt-card {
  flex: 0 0 24.5rem;
  width: 24.5rem;
  max-width: 24.5rem;
  box-sizing: border-box;
}
.prompt-view-adult .prompt-card.compare-card,
.prompt-card.compare-card {
  flex: 0 0 42rem;
  width: 42rem;
  max-width: 42rem; /* hard width so 300+300 fits; do not use min(...,100%) under grid */
  box-sizing: border-box;
  grid-column: auto;
}
.thumbnail-compare {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: .55rem;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  margin: 0 auto;
  overflow-x: visible;
}
.thumbnail-compare .compare-cell,
.thumbnail-compare .thumbnail-wrap.compare-cell {
  margin: 0 !important;
  width: 300px !important;
  min-width: 300px !important;
  max-width: 300px !important;
  flex: 0 0 300px !important;
  align-self: flex-start !important;
  box-sizing: border-box;
}

@media (max-width: 720px) {
  .prompt-view-adult .prompt-card,
  .prompt-view-adult .prompt-card.compare-card,
  .prompt-card.compare-card {
    flex: 1 1 100%;
    width: 100%;
    max-width: min(42rem, 100%);
  }
  .thumbnail-compare {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Master-only card key on 판대기/성인 */
.item-key-chip {
  display: inline-flex;
  align-items: center;
  padding: .15rem .45rem;
  border-radius: .35rem;
  background: #0f172a;
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  user-select: all;
}

/* Date chips: collapsed by default */
.decade-chip-fold {
  width: min(102rem, calc(100% - 2rem));
  margin: 0 auto 1rem;
  border: 1px solid var(--border);
  border-radius: .65rem;
  background: #fff;
  padding: .35rem .7rem .55rem;
}
.decade-chip-fold > summary {
  cursor: pointer;
  list-style: none;
  padding: .35rem 0;
  color: #334155;
  font-size: .9rem;
  font-weight: 600;
}
.decade-chip-fold > summary::-webkit-details-marker { display: none; }
.decade-chip-fold > summary::before {
  content: "▸ ";
  color: #64748b;
}
.decade-chip-fold[open] > summary::before { content: "▾ "; }
.decade-chip-fold .source-selector {
  width: 100%;
  margin: .35rem 0 0;
}

/* Bottom 10-day range pager: ← | current | → */
.decade-bottom-pager {
  position: sticky;
  bottom: 0;
  z-index: 8;
  width: min(40rem, calc(100% - 1.5rem));
  margin: 1.2rem auto 1.5rem;
  padding: .55rem .75rem;
  display: grid;
  grid-template-columns: 2.6rem 1fr 2.6rem;
  align-items: center;
  gap: .5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 8px 24px rgba(16,39,68,.12);
  backdrop-filter: blur(8px);
}
.decade-pager-btn {
  display: grid;
  place-items: center;
  min-height: 2.4rem;
  border-radius: 999px;
  text-decoration: none;
  color: #0f172a;
  font-size: 1.15rem;
  font-weight: 700;
  background: #eef3f8;
}
.decade-pager-btn:hover { background: #dbe7f3; }
.decade-pager-btn.disabled {
  opacity: .35;
  pointer-events: none;
}
.decade-pager-current {
  text-align: center;
  font-size: .9rem;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 일반/출처: 성인·판대기만 남아 thumb 없을 때 회색 이미지 자리 자체를 만들지 않음 */
.source-card.no-thumb img,
.batch-card.no-thumb img { display: none; }
.source-card.no-thumb,
.batch-card.no-thumb { background: #fff; }

/* loa-gw-speed (2026-10-16): 판대기/준성인/성인 render 150+ cards on one page — let the browser skip
   layout/paint for off-screen cards (no visual change; cards render as they scroll into view). */
.prompt-cards > .prompt-card { content-visibility: auto; contain-intrinsic-size: auto 760px; }
.prompt-cards > .prompt-card.compare-card { contain-intrinsic-size: auto 900px; }

/* loa-gw-paginate (2026-10-16): 판대기·준성인·성인 50장씩 페이지 */
.page-pager { width: min(102rem, calc(100% - 2rem)); margin: .4rem auto 1rem; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .35rem; text-align: center; }
.page-pager-bottom { margin: 0 auto 3rem; }
.page-pager-btn, .page-pager-num { min-width: 2.3rem; min-height: 2.3rem; padding: .4rem .7rem; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: .5rem; background: #fff; color: #174f9d; font-size: .85rem; font-weight: 600; text-decoration: none; }
.page-pager-num.current { color: #fff; background: var(--blue); border-color: var(--blue); }
.page-pager-btn.disabled { opacity: .4; pointer-events: none; }
.page-pager-gap { color: var(--muted); padding: 0 .2rem; }
.page-pager-info { width: 100%; color: var(--muted); font-size: .8rem; }
