@import url("/web-theme.css");
@import url("/course-package-preview.css");

:root { font: 15px var(--web-font); color: var(--ink); background: var(--canvas); font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; }
button, a, summary, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { max-width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; color: var(--ink); background: #fff; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 600; line-height: 1.4; border-radius: 999px; cursor: pointer; transition: background .15s, border-color .15s; }
button:hover { background: var(--primary-light); border-color: var(--primary-soft); }
button:disabled { opacity: .45; cursor: not-allowed; }
input, textarea { width: 100%; min-width: 0; }
textarea { resize: vertical; line-height: 1.8; }
input::placeholder, textarea::placeholder { color: var(--subtle); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 18px; margin: 0 8px 0 0; padding: 0; accent-color: var(--primary); vertical-align: middle; }
label { display: grid; gap: 8px; margin: 18px 0; font-size: 13px; font-weight: 600; }
label:has(input[type=checkbox]), label:has(input[type=radio]) { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; line-height: 1.7; }
label input[type=checkbox], label input[type=radio] { flex-shrink: 0; margin-top: 3px; }
:where(button, a, summary, input, select, textarea):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.primary:hover { background: var(--night); border-color: var(--night); }
.sun-button { background: var(--sun); color: #13231c; border-color: var(--sun); font-weight: 700; }
.sun-button:hover { background: #f5b82e; border-color: #f5b82e; }
.icon { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.8; vertical-align: middle; }
h1, h2, h3, h4, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: 28px; font-weight: 800; line-height: 1.3; }
h2 { margin: 0 0 12px; font-size: 18px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 700; }
p { line-height: 1.8; }
.muted { color: var(--muted); font-size: 13px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand strong { font-size: 17px; font-weight: 800; }
.brand small { display: block; color: var(--subtle); font-size: 10px; letter-spacing: .18em; margin-top: 2px; font-weight: 600; }
.brand-mark { display: block; width: 36px; height: 36px; border-radius: 28%; object-fit: contain; }
.topbar { min-height: 72px; padding: 12px max(24px, calc((100vw - 1120px) / 2)); display: flex; align-items: center; gap: 20px; position: sticky; top: 0; z-index: 30; background: #f6f4eeed; backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.workspace-label { font-size: 13px; font-weight: 600; color: var(--muted); border-left: 1px solid var(--line); padding-left: 20px; text-decoration: none; }
.button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 18px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; }
.button-link:hover { background: var(--night); }
.topbar-links { display: flex; gap: 20px; align-items: center; margin-left: auto; }
.topbar-links a { font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.topbar-links a:hover { color: var(--primary); }
.account-menu { position: relative; }
.account-menu > summary { display: flex; align-items: center; gap: 4px; list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; background: #fff; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); }
.account-menu > summary > .icon { width: 14px; color: var(--subtle); }
.account-dropdown { position: absolute; top: calc(100% + 10px); right: 0; width: 248px; max-width: calc(100vw - 32px); padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 12px 32px #1e26551a; }
.account-dropdown > p { margin: 0; padding: 12px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.account-dropdown a, .account-dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; font-size: 13px; text-decoration: none; border: 0; border-radius: 12px; justify-content: flex-start; }
.account-dropdown a:hover { background: var(--primary-light); }
#logout { color: var(--coral); }
body > main { max-width: 1120px; margin: 0 auto; padding: 24px 24px 64px; }
.workspace-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.workspace-tools button { background: transparent; border: 0; color: var(--muted); padding-inline: 0; min-height: 32px; }
#refresh { margin-left: auto; }
.workspace-tools button:hover { color: var(--primary); }
.opening { display: grid; justify-items: center; gap: 16px; padding: 96px 0; color: var(--muted); font-size: 14px; text-align: center; }
.opening .icon { width: 28px; height: 28px; color: var(--primary); }
.opening p { margin: 0; }
.family-upload section, .family-upload > details { margin: 20px 0; padding: 24px; border: 1px solid var(--line); border-radius: var(--card-radius); background: #fff; }
.family-upload section > p { font-size: 13px; color: var(--muted); }
.family-upload section > h2 + p { margin-top: 0; }
.make-head, .draft-head { margin: 8px 0 24px; }
.make-head p, .draft-head > p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.draft-head > .muted { font-size: 13px; }
.state-pill { display: inline-block; margin: 0 0 12px !important; padding: 4px 12px; border-radius: 999px; background: var(--sun-light); color: var(--sun-ink) !important; font-size: 12px !important; font-weight: 700; }
.state-pill.is-applied { background: var(--mint); color: var(--forest) !important; }
.state-pill.is-discarded { background: var(--canvas); color: var(--muted) !important; }
.make-steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 20px 0 0; padding: 0; }
.make-steps > li { counter-increment: step; display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 18px; background: var(--canvas); }
.make-steps > li::before { content: counter(step); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; }
.make-steps > li:first-child { background: var(--sun-light); }
.make-steps > li:first-child::before { background: var(--sun); color: var(--deep); }
.make-steps h3 { margin: 0 0 6px; }
.make-steps p { margin: 0 0 12px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.manual-copy { margin-top: 12px; }
.token-box { margin-top: 20px; padding: 14px 0 0 !important; border-top: 1px solid var(--line); }
.token-box pre { padding: 12px 16px; border-radius: 12px; background: var(--canvas); font: 12px/1.8 ui-monospace, monospace; }
.token-box p { font-size: 13px; color: var(--muted); }
.course-list .empty { margin: 0; padding: 20px; border: 1px dashed var(--line); border-radius: 16px; text-align: center; }
.course-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 0; border-bottom: 1px solid var(--line); }
.course-card:last-child { border-bottom: 0; padding-bottom: 0; }
.course-card > div { flex: 1; min-width: 200px; }
.course-card h3 { margin: 0 0 4px; }
.course-card p { margin: 0; font-size: 12px; color: var(--muted); }
.family-upload > details > summary { font-size: 14px; }
.family-upload > details[open] > summary { margin-bottom: 8px; }
.draft-flow { list-style: none; counter-reset: flow; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 20px; padding: 0; }
.draft-flow li { counter-increment: flow; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.draft-flow li::before { content: counter(flow); grid-row: span 2; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 13px; font-weight: 800; }
.draft-flow strong { font-size: 14px; }
.draft-flow span { font-size: 12px; color: var(--muted); line-height: 1.6; }
.revise-box { display: grid; gap: 12px; justify-items: start; margin: 20px 0; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 20px; }
.revise-box h2, .revise-box p { margin: 0; }
.revise-box > p { color: var(--muted); line-height: 1.7; }
.revise-box > textarea, .revise-box .manual-copy, .revise-box .manual-upload { justify-self: stretch; }
.revise-box .manual-upload { margin: 4px 0 0; }
.revise-box textarea, .manual-copy textarea { padding: 14px 16px; border-radius: 16px; background: var(--canvas); font: inherit; font-size: 14px; }
.publish-box select { max-width: 320px; }
.share-box { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.share-box pre { padding: 12px 16px; border-radius: 12px; background: var(--canvas); font: 12px/1.8 ui-monospace, monospace; }
.quiet-danger { background: transparent; border-color: transparent; color: var(--coral); }
.quiet-danger:hover { background: var(--coral-light); border-color: var(--coral-light); }
.family-upload textarea { width: 100%; }
.family-upload input[type=file] { padding: 20px; border: 2px dashed var(--line); border-radius: 16px; background: #f6f4ee80; min-height: 88px; }
input[type=file]::file-selector-button { font: inherit; color: var(--primary); background: var(--primary-light); border: 0; border-radius: 999px; padding: 8px 12px; margin-right: 8px; cursor: pointer; }
.family-upload img, .family-upload video { max-width: 100%; max-height: 480px; object-fit: contain; }
.family-upload audio { max-width: 100%; }
.family-upload button { margin: 6px 8px 6px 0; }
.family-upload details { padding: 12px 0; }
.family-upload > details { padding: 16px 24px; }
.family-upload summary { cursor: pointer; font-size: 13px; font-weight: 600; line-height: 1.7; overflow-wrap: anywhere; }
.upload-prose { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-block: 20px; }
.actions button { margin: 0; }
#notice { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 50; max-width: min(560px, calc(100% - 32px)); padding: 12px 20px; border-radius: 20px; background: var(--night); color: #fff; box-shadow: 0 8px 24px #1e265526; font-size: 13px; line-height: 1.7; margin: 0; }
#notice:empty { display: none; }
dialog { max-width: 480px; width: calc(100% - 32px); max-height: calc(100dvh - 40px); overflow-y: auto; border: 1px solid var(--line); border-radius: 24px; padding: 24px; color: var(--ink); box-shadow: 0 20px 60px #1e26552e; }
dialog::backdrop { background: #1e265580; backdrop-filter: blur(2px); }
dialog p { font-size: 13px; }
dialog .actions { justify-content: flex-end; margin-bottom: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.login-view > .topbar { display: none; }
.login-view > main { max-width: none; padding: 0; }
#login-page { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.login-brand-panel { position: relative; display: flex; flex-direction: column; padding: 40px 48px 56px; background: var(--deep); color: #fff; overflow: hidden; }
.login-brand-panel::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 94% 5%, #ffffff0f 0 180px, transparent 181px), radial-gradient(circle at 82% 78%, #ffc83de6 0 72px, transparent 73px); pointer-events: none; }
.login-brand-panel > * { position: relative; }
.login-brand-panel .brand { align-self: flex-start; }
.login-introduction { margin-block: auto; padding-block: 64px; }
.login-brand-caption { color: #ffffff80; font-size: 13px; margin: 0; }
.login-introduction h2 { max-width: 520px; margin: 0; font-size: 44px; line-height: 1.15; font-weight: 800; }
.login-introduction h2 span { color: var(--sun); }
.login-introduction > p { max-width: 480px; margin: 20px 0 0; color: #ffffffbf; font-size: 17px; line-height: 1.7; }
.login-main { background: var(--paper); display: flex; flex-direction: column; min-width: 0; padding: 40px; }
.login-mobile-brand { display: none; }
#login { width: 100%; max-width: 448px; margin: auto; padding-block: 40px; animation: fade-up .24s ease-out; }
#login h1 { font-size: 30px; font-weight: 800; color: #13231c; }
.login-subtitle { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.login-fields { display: grid; gap: 20px; margin-top: 36px; }
#login label { display: block; margin: 0 0 6px; font-size: 13px; line-height: 20px; }
.login-input { display: flex; align-items: center; min-width: 0; height: 56px; border: 1px solid var(--line); border-radius: var(--card-radius); background: #fff; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.login-input:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px #1b1c201a; }
.login-input:has([aria-invalid=true]) { border-color: #dc2626; box-shadow: 0 0 0 3px #dc26260d; }
.login-input > .icon { margin-left: 14px; color: var(--subtle); }
.login-input input { flex: 1; width: 0; height: 100%; min-height: 0; border: 0; border-radius: var(--card-radius); padding: 0 12px; font-size: 15px; background: transparent; outline: none; }
.phone-prefix { display: flex; align-items: center; gap: 6px; height: 100%; padding: 0 12px 0 14px; border-right: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.phone-prefix .icon { color: var(--subtle); }
#send-login { flex-shrink: 0; min-height: 32px; margin-right: 6px; padding: 4px 10px; border: 0; border-radius: 6px; box-shadow: none; background: transparent; color: var(--primary); font-size: 13px; white-space: nowrap; }
#send-login:hover:enabled { background: var(--green-light); }
#send-login:disabled { opacity: 1; color: var(--subtle); }
.login-error { margin: 6px 0 0; color: #b42318; font-size: 12px; line-height: 1.7; }
.login-error:empty { display: none; }
.login-delivery { margin: 8px 0 0; font-size: 12px; color: var(--primary); }
#login-notice:not(:empty) { margin-top: 16px; }
#login .primary { width: 100%; min-height: 56px; gap: 10px; margin-top: 28px; border-radius: 999px; font-size: 16px; background: var(--ink); border-color: var(--ink); box-shadow: 0 1px 2px #1018141a; }
.login-security { display: flex; align-items: flex-start; gap: 8px; margin: 20px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.login-security .icon { margin-top: 2px; color: var(--subtle); }
.login-footer { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 12px; }
.login-footer button { min-height: 32px; padding: 4px; color: inherit; font-size: inherit; background: transparent; border: 0; box-shadow: none; }
.login-footer button:hover { color: var(--primary); }
.is-spinning { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1023px) {
  #login-page { grid-template-columns: minmax(0, 1fr); }
  .login-brand-panel { display: none; }
  .login-main { padding: 32px 24px 24px; }
  .login-mobile-brand { display: inline-flex; align-self: flex-start; }
}
@media (max-width: 480px) {
  #login .login-input input { font-size: 16px; padding-inline: 10px; }
  #login .primary, .login-input { min-height: 48px; }
  #login .login-input input { height: 46px; }
  .login-main .brand strong { display: inline; }
  #send-login { padding-inline: 8px; font-size: 12px; }
  .phone-prefix { padding-inline: 12px; }
}
.login-view > main { margin: 0; }
#login .primary:hover { background: #000; border-color: #000; }
#send-login { background: var(--sun-light); color: var(--ink); border-radius: 12px; min-height: 40px; }
.login-input { border-radius: 16px; border-color: #e6e2d7; }
.login-workflow { list-style: none; padding: 0; margin: 40px 0 0; display: grid; gap: 20px; }
.login-workflow li { display: flex; gap: 16px; align-items: flex-start; }
.login-workflow li > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--sun); color: var(--deep); font-weight: 800; flex-shrink: 0; }
.login-workflow strong { font-size: 16px; }
.login-workflow p { font-size: 13px; color: #ffffff99; margin: 4px 0 0; }
@media (max-width: 767px) {
  .workspace-label { display: none; }
  .topbar { gap: 12px; padding-inline: 16px; }
  .topbar-links { gap: 12px; }
  .topbar-links a { font-size: 12px; }
  body > main { padding: 20px 16px 48px; }
  .workspace-tools { margin-bottom: 4px; }
  .workspace-tools button { min-height: 44px; }
  .make-head, .draft-head { margin-block: 0 16px; }
  .family-upload section, .family-upload > details { padding: 20px; }
  .family-upload > section, .family-upload > details { padding: 16px; }
  .family-upload > .make-guide { margin-block: 16px; }
  .make-steps, .draft-flow { grid-template-columns: minmax(0, 1fr); }
  .make-steps { gap: 8px; margin-top: 12px; }
  .make-steps > li { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: 10px; padding: 14px; border-radius: 14px; }
  .make-steps > li::before { width: 28px; height: 28px; font-size: 13px; }
  .make-steps h3 { margin: 2px 0 4px; }
  .make-steps p { margin: 0; }
  .make-steps > li > div > button { margin: 8px 0 0; }
  .draft-flow li { grid-template-columns: 26px minmax(0, 1fr); padding: 10px 12px; }
  .family-upload .course-card > div { min-width: min(200px, 100%); }
  h1 { font-size: 24px; }
}
@media (max-width: 480px) {
  .family-upload .course-list .course-card { flex-direction: column; align-items: stretch; gap: 8px; }
  .family-upload .course-list .course-card > div { flex: none; min-width: 0; }
  .family-upload .course-list .course-card > button { align-self: flex-start; margin: 0; }
}
@media (max-width: 390px) { .brand small { display: none; } .topbar-links { gap: 8px; } .brand { gap: 8px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.next-step em { padding: 3px 10px; border-radius: 999px; background: var(--canvas); color: var(--muted); font-size: 12px; font-style: normal; font-weight: 600; }
.next-step h3 { font-size: 15px; }
.picked-files { display: grid; gap: 6px; margin: 8px 0; }
.picked-files > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 14px; border-radius: 12px; background: var(--canvas); font-size: 13px; }
.picked-files button { margin: 0; min-height: 28px; padding: 2px 10px; font-size: 12px; }
.picked-status { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.picked-status[data-state=ready] { color: var(--forest); font-weight: 600; }
.usage-line { margin: 12px 0 0 !important; font-size: 13px !important; color: var(--subtle) !important; }
.usage-line[data-full=true] { color: var(--coral) !important; font-weight: 600; }
/* Common questions, shared by the public pages and the workspace (course-making content in web-session.js). */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; cursor: pointer; font-size: 16px; font-weight: 700; list-style: none; }
.faq summary::after { content: "+"; color: var(--subtle); font-size: 22px; font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 0 0 20px; color: var(--muted); font-size: 15px; }
.faq a { font-weight: 700; }
.workspace-faq .faq details { padding: 0; }
.workspace-faq .faq details:last-child { border-bottom: 0; }
.workspace-faq .faq summary { font-size: 15px; }
.workspace-faq .faq p { font-size: 14px; }

.login-legal { margin: 16px 0; font-size: 13px; line-height: 1.7; }
#login .login-legal label { display: inline; margin: 0 8px 0 0; line-height: inherit; white-space: nowrap; }
.login-legal input[type="checkbox"] { margin: 0 8px 0 0; }
.login-legal p { display: inline; margin: 0; line-height: inherit; }
.login-legal a { white-space: nowrap; }

.course-support { margin-top: 24px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface, #fff); }
.course-support p { margin: 8px 0 12px; color: var(--muted); font-size: 14px; }
.course-support-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; overflow-wrap: anywhere; }
.course-support-contact[hidden] { display: none; }
.course-support-contact button { min-height: 44px; }
.course-support-contact [role="status"] { font-size: 13px; color: var(--muted); }
