:root {
  color-scheme: light;
  font-family: "Malgun Gothic", "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  --ink: #241e3e;
  --muted: #635d74;
  --primary: #5c41c4;
  --primary-dark: #4e33b5;
  --border: #e5e0f3;
  --paper: #f7f6ff;
  --white: #fff;
  --radius: 24px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; background: var(--paper); color: var(--ink); font-size: 1rem; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, [tabindex="0"]:focus-visible { outline: 3px solid #6a48e0; outline-offset: 4px; }
h1:focus { outline: none; }
p { margin: 0; }
.icon-library { position: absolute; width: 0; height: 0; }
.icon { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }

.topbar { background: #fff; border-bottom: 1px solid #ebe7f7; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 74px; gap: 12px; }
.brand { display: inline-flex; flex-shrink: 0; gap: 11px; align-items: center; padding: 0; border: 0; background: transparent; font-size: 1.14rem; font-weight: 800; letter-spacing: -.07em; white-space: nowrap; }
.brand-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; color: white; background: #694dd4; }
.brand-period { color: #7552d5; }
.class-status { display: inline-flex; min-width: 0; max-width: 58%; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 999px; border: 1px solid #eae6f5; background: #f7f5fc; color: #595269; font-size: .86rem; font-weight: 700; white-space: nowrap; }
.class-status > span { flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: #9082aa; }

.home { padding-block: 28px 44px; }
.hero { position: relative; min-height: 365px; border-radius: 30px; overflow: hidden; isolation: isolate; background: #5b409a; box-shadow: 0 14px 35px #2d1b5a16; }
.hero-art, .hero::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-art { object-fit: cover; object-position: center 45%; }
.hero::after { content: ""; background: linear-gradient(90deg, #302057 0%, #3e286fef 21%, #5437919c 39%, #6044a716 58%, transparent 68%); pointer-events: none; }
.hero-content { position: relative; z-index: 1; padding: 47px 49px 50px; color: white; }
.subject { display: inline-flex; align-items: center; gap: 9px; font-size: 1rem; font-weight: 700; color: #f0e8ff; letter-spacing: -.035em; }
.subject > span { width: 4px; height: 4px; border-radius: 50%; background: #f9c888; }
.hero h1 { margin: 15px 0 14px; font-size: clamp(3rem, 5.2vw, 4.48rem); line-height: 1.11; font-weight: 900; letter-spacing: -.095em; color: #fff; }
.hero h1 > span { color: #ffca86; margin-left: .035em; }
.hero-copy { font-size: 1.07rem; color: #f6f1ff; font-weight: 600; letter-spacing: -.045em; }

.actions { margin-top: 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.action-card { min-height: 124px; text-align: left; display: flex; position: relative; align-items: center; gap: 15px; padding: 21px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 6px #2e176107; transition: background .15s, border-color .15s, transform .15s; }
.action-card:hover { border-color: #b7a5ee; transform: translateY(-2px); }
.action-card:active { transform: translateY(1px); }
.action-giant { background: #ede7fe; border-color: #cdbdf8; }
.action-icon { width: 52px; height: 52px; flex-shrink: 0; border-radius: 16px; display: grid; place-items: center; color: #5a38be; background: #ddd0fb; }
.action-icon .icon { width: 26px; height: 26px; }
.action-plain .action-icon { color: #176f61; background: #dff5ee; }
.action-saved .action-icon { color: #9c5316; background: #fff0d5; }
.action-text { display: grid; gap: 6px; word-break: keep-all; }
.action-text strong { font-size: clamp(1.05rem, 1.6vw, 1.26rem); font-weight: 800; letter-spacing: -.06em; }
.action-text > span { color: var(--muted); line-height: 1.5; font-size: .86rem; font-weight: 600; letter-spacing: -.045em; }
.count { position: absolute; top: 11px; right: 11px; padding: 3px 7px; border-radius: 20px; color: #783f0d; background: #fff0d5; font-size: .78rem; font-weight: 800; }
.prep-panel { display: flex; align-items: center; gap: 12px; margin-block: 16px 0; padding: 13px 16px; border: 1px solid #e9e3f5; border-radius: 16px; color: #4b4060; background: #f0ebfa; }
.prep-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: #e6def8; color: #6046ae; flex: 0 0 auto; }
.prep-icon .icon { width: 20px; height: 20px; }
.prep-panel strong { font-size: .93rem; font-weight: 800; letter-spacing: -.035em; }
.prep-panel p { font-size: .87rem; line-height: 1.55; color: #61566f; }

.inner-view { padding-block: 24px 45px; }
.back-button { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 11px -6px; min-height: 44px; padding: 5px 9px; color: #584487; background: transparent; border: none; border-radius: 10px; font-size: .95rem; font-weight: 750; }
.back-button:hover { background: #ebe4fc; }
.back-button .icon { width: 18px; height: 18px; }
.inner-view h1 { margin: 0 0 6px; font-size: clamp(1.85rem, 4vw, 2.7rem); line-height: 1.25; font-weight: 850; letter-spacing: -.08em; }
.view-description { font-size: 1rem; line-height: 1.6; color: var(--muted); letter-spacing: -.035em; }
.review-view { width: min(860px, 100%); margin-inline: auto; }
.review-frame { position: relative; width: 100%; margin: 0; border-radius: 24px; overflow: hidden; background: #211a36; }
.review-frame img { display: block; width: 100%; height: auto; max-height: 62dvh; object-fit: contain; }
.camera-gate { position: absolute; inset: 0; display: grid; place-items: center; padding: 15px; background: #251b44d9; color: white; text-align: center; }
.gate-content { display: grid; gap: 9px; justify-items: center; max-width: 440px; }
.gate-content > strong { font-size: clamp(1.14rem, 3vw, 1.62rem); letter-spacing: -.06em; }
.gate-content > p { font-size: .94rem; line-height: 1.45; color: #f1eaff; }
.gate-icon { display: grid; place-items: center; border-radius: 16px; width: 49px; height: 49px; background: #7355c4; }
.gate-actions, .review-actions, .dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 15px; border: 1px solid transparent; border-radius: 13px; font-weight: 800; font-size: .96rem; letter-spacing: -.05em; }
.button .icon { width: 19px; height: 19px; }
.primary { color: white; background: var(--primary); }
.primary:hover:not(:disabled) { background: var(--primary-dark); }
.button:disabled { color: #625c70; background: #ebe7f4; border-color: #e0dbea; }
.secondary { color: #433569; background: #fff; border-color: #e4dcf1; }
.secondary:hover { background: #f1eafb; }
.example-badge { position: absolute; top: 13px; left: 13px; color: #fff; padding: 6px 10px; border-radius: 9px; background: #211a36df; font-size: .84rem; font-weight: 800; }
.storage-message { color: #8b2852; font-size: .93rem; line-height: 1.5; margin-top: 10px; }
.storage-message:empty { display: none; }

.saved-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-top: 20px; }
.empty-state { grid-column: 1 / -1; min-height: 205px; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 25px; text-align: center; border: 1px solid var(--border); border-radius: 22px; background: #fff; }
.empty-state .action-icon { margin-bottom: 3px; color: #7454c2; background: #ede6fd; }
.empty-state strong { font-size: 1.16rem; }
.empty-state p { color: var(--muted); }
.saved-card { display: grid; gap: 8px; padding: 9px; border: 1px solid var(--border); border-radius: 17px; text-align: left; background: #fff; }
.saved-card:hover { border-color: #b7a5ee; }
.saved-card img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; background: #e8dff5; }
.saved-card span { color: var(--muted); font-size: .87rem; padding: 0 3px 3px; }
.review-frame { margin-top: 13px; }
.send-note { margin-top: 11px; color: var(--muted); font-size: .95rem; text-align: center; }
.review-actions { margin-top: 12px; }
.delete-button { color: #882b43; }
.confirm-dialog { width: min(390px, calc(100vw - 28px)); padding: 25px; color: var(--ink); border: 1px solid var(--border); border-radius: 21px; box-shadow: 0 20px 80px #16102551; }
.confirm-dialog::backdrop { background: #2317398a; }
.confirm-dialog h2 { margin: 0 0 8px; }
.confirm-dialog p { color: var(--muted); line-height: 1.5; }
.dialog-actions { justify-content: end; margin-top: 18px; }
.danger { color: white; background: #a22a49; }

@media (max-width: 860px) {
  .shell { width: calc(100% - 40px); }
  .action-card { padding: 15px; gap: 10px; min-height: 110px; }
  .action-icon { width: 45px; height: 45px; border-radius: 14px; }
  .action-icon .icon { width: 23px; height: 23px; }
  .hero-content { padding: 41px 34px; }
  .hero { min-height: 330px; }
}

@media (max-width: 620px) {
  .shell { width: calc(100% - 28px); }
  .topbar-inner { min-height: 61px; }
  .brand { font-size: 1.02rem; gap: 7px; }
  .brand-icon { width: 33px; height: 33px; border-radius: 10px; }
  .brand-icon .icon { width: 21px; height: 21px; }
  .class-status { padding: 6px 8px; font-size: .77rem; gap: 5px; }
  .class-status > span { width: 6px; height: 6px; }
  .home { padding-top: 14px; }
  .hero { min-height: 304px; border-radius: 22px; }
  .hero-content { padding: 26px 20px; }
  .hero h1 { font-size: clamp(2.55rem, 9.5vw, 3.5rem); margin: 12px 0; }
  .hero-art { object-position: 58% center; }
  .hero::after { background: linear-gradient(90deg, #35245be8 0%, #44296faa 42%, #55398c24 75%, transparent 100%); }
  .subject { font-size: .9rem; }
  .hero-copy { max-width: 18ch; font-size: .93rem; line-height: 1.5; word-break: keep-all; }
  .actions { grid-template-columns: 1fr; gap: 9px; margin-top: 13px; }
  .action-card { min-height: 76px; border-radius: 17px; padding: 12px 13px; }
  .action-text { gap: 2px; }
  .action-text strong { font-size: 1.09rem; }
  .prep-panel { margin-top: 11px; padding: 10px 11px; }
  .saved-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .inner-view { padding-top: 13px; }
  .review-frame { border-radius: 17px; }
  .review-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-actions .primary { grid-column: 1 / -1; }
  .gate-content { gap: 6px; }
  .gate-icon { width: 37px; height: 37px; border-radius: 11px; }
  .gate-icon .icon { width: 21px; height: 21px; }
  .gate-content > p { font-size: .87rem; }
  .gate-actions { margin-top: 2px; }
  .gate-actions .button { padding-inline: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}

.prep-storage { margin-top: 2px; font-size: .8rem; color: #61566f; }
.prep-storage:empty { display: none; }
.credits-link { display: block; margin: 12px auto 0; min-height: 44px; padding: 0 16px; background: none; border: 0; color: #61566f; font: inherit; font-size: .9rem; text-decoration: underline; cursor: pointer; }
.credits-list { max-width: 640px; margin: 14px 0 0; padding-left: 1.1em; line-height: 1.7; }
.credits-list li { margin-bottom: 10px; }

.class-status.on { background: #e5f6ea; border-color: #a9dcb7; color: #1d5b34; }
.class-status.on > span { background: #2f9e57; }
.class-status b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.send-all { display: flex; justify-content: center; margin: 12px 0 0; }
.send-all[hidden] { display: none; }
.name-input { box-sizing: border-box; width: 100%; min-height: 52px; margin: 10px 0 4px; padding: 0 14px; border: 2px solid #cfc6e6; border-radius: 14px; font: inherit; font-size: 1.1rem; }
