:root {
  color-scheme: light;
  --ink: #172b2a;
  --muted: #70807e;
  --line: #e5ebe8;
  --paper: #f5f7f4;
  --teal: #157b70;
  --teal-dark: #11675e;
  --mint: #e9f4ef;
  --shadow: 0 12px 36px rgba(30, 64, 57, 0.06);
}

html { background: var(--paper); }
body { background: var(--paper); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(21, 123, 112, 0.2);
  outline-offset: 2px;
}

.brand-lockup { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 800; font-size: 18px; letter-spacing: -0.045em; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: block; flex: 0 0 auto; }
.brand-ai { color: var(--teal); }
.eyebrow { color: #84928d; font-size: 10px; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; vertical-align: 1px; border-radius: 50%; background: #56a98a; box-shadow: 0 0 0 4px #e3f1e8; }

.auth-screen { display: flex; min-height: 100vh; flex-direction: column; background: radial-gradient(ellipse at 17% 0%, #eaf5ef 0, transparent 35%), #f7f8f5; }
.auth-screen.hidden { display: none; }
.auth-header, .auth-footer { display: flex; align-items: center; justify-content: space-between; padding: 24px clamp(20px, 5vw, 72px); }
.auth-header { border-bottom: 1px solid rgba(215, 227, 221, 0.72); }
.auth-switch { color: #77847f; background: none; border: 0; cursor: pointer; font-size: 12px; }
.auth-switch strong { color: var(--teal); }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); align-items: center; gap: clamp(32px, 8vw, 120px); width: min(1080px, calc(100% - 48px)); margin: auto; padding: 64px 0; }
.auth-story { max-width: 560px; }
.auth-story .eyebrow { color: var(--teal); }
.auth-story h1 { margin: 24px 0 18px; color: #203b37; font-size: clamp(38px, 5vw, 62px); font-weight: 700; letter-spacing: -0.07em; line-height: 1.06; }
.auth-story h1 span { color: var(--teal); }
.auth-story > p { max-width: 410px; color: #6d7c77; font-size: 15px; line-height: 1.8; }
.auth-proof { display: flex; align-items: center; gap: 12px; margin-top: 38px; color: #7b8983; font-size: 12px; }
.proof-avatars { display: flex; }
.proof-avatars span { display: grid; width: 30px; height: 30px; place-items: center; margin-left: -5px; border: 2px solid #f7f8f5; border-radius: 50%; background: #dfeee5; color: var(--teal); font-size: 12px; }
.proof-avatars span:first-child { margin-left: 0; }
.proof-avatars span:nth-child(2) { background: #edf0df; }
.proof-avatars span:nth-child(3) { background: #e4ecf3; }
.auth-card { padding: 34px; border: 1px solid #e8eeea; border-radius: 22px; background: rgba(255,255,255,.94); box-shadow: 0 22px 60px rgba(36, 65, 55, .08); }
.auth-card h2 { margin: 10px 0 6px; color: #243b37; font-size: 25px; font-weight: 700; letter-spacing: -.045em; }
.auth-card-copy { margin: 0 0 24px; color: #7a8983; font-size: 12px; line-height: 1.6; }
.auth-fields { display: grid; gap: 9px; }
.auth-fields label { margin-top: 4px; color: #465a54; font-size: 11px; font-weight: 700; }
.auth-fields input, .profile-fields input { width: 100%; min-height: 44px; box-sizing: border-box; padding: 0 13px; border: 1px solid #e1e9e4; border-radius: 10px; background: #fbfcfa; color: var(--ink); font-size: 12px; transition: border-color .18s, box-shadow .18s, background .18s; }
.auth-fields input:focus, .profile-fields input:focus { border-color: #81b9a4; background: white; box-shadow: 0 0 0 3px rgba(21,123,112,.09); }
.auth-fields input::placeholder { color: #a5b0aa; }
.button-primary, .button-secondary { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: 10px; cursor: pointer; font-size: 12px; font-weight: 700; transition: transform .18s, background .18s, box-shadow .18s; }
.button-primary { border: 1px solid var(--teal); background: var(--teal); color: white; box-shadow: 0 5px 12px rgba(21, 123, 112, .13); }
.button-primary:hover { transform: translateY(-1px); background: var(--teal-dark); box-shadow: 0 8px 18px rgba(21, 123, 112, .17); }
.button-primary:disabled { transform: none; cursor: wait; opacity: .72; }
.button-secondary { border: 1px solid var(--line); background: white; color: #47605a; }
.button-secondary:hover { background: #f4f8f5; }
.auth-submit { width: 100%; min-height: 46px; margin-top: 10px; }
.auth-legal { margin: 18px 0 0; color: #99a59e; font-size: 10px; text-align: center; }
.auth-error { margin: 6px 0; padding: 10px 12px; border: 1px solid #f2d4d0; border-radius: 9px; background: #fff6f4; color: #a5473a; font-size: 11px; line-height: 1.5; }
.auth-error.is-success { border-color: #cce4d5; background: #f1faf4; color: #357452; }
.auth-error.hidden { display: none; }
.auth-footer { color: #99a59f; font-size: 10px; }
.auth-footer span:first-child { color: #5c7069; font-weight: 700; }
.profile-email { color: #8a9791; font-size: 11px; }
.profile-email span { color: #526761; }
.profile-avatar-row { display: flex; align-items: center; gap: 14px; margin: 20px 0 16px; }
.profile-avatar { display: grid; width: 52px; height: 52px; flex: 0 0 auto; place-items: center; overflow: hidden; border: 1px solid #d8e9df; border-radius: 50%; background-color: #eff7f1; background-position: center; background-size: cover; color: var(--teal); font-size: 23px; }
.optional-label { margin-left: 4px; color: #9ba8a2; font-size: 10px; font-weight: 500; }

.landing-page { width: 100%; background: #f7f8f5; color: #152321; }
.landing-page[hidden] { display: none; }
.landing-header { display: flex; width: min(1080px, calc(100% - 48px)); height: 76px; align-items: center; justify-content: space-between; margin: 0 auto; border-bottom: 1px solid #e9ede9; }
.landing-header .brand-lockup, .landing-footer .brand-lockup { gap: 8px; font-size: 14px; font-weight: 750; letter-spacing: -.04em; }
.landing-header .brand-mark, .landing-footer .brand-mark { width: 21px; height: 21px; }
.landing-nav { display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); }
.landing-nav a, .landing-login { color: #687571; font-size: 11px; text-decoration: none; transition: color .18s; }
.landing-nav a:hover, .landing-login:hover { color: #157b70; }
.landing-login { padding: 8px 0; border: 0; background: none; color: #116e62; cursor: pointer; font-weight: 700; }
.landing-login span { margin-left: 8px; font-size: 15px; }
.landing-hero { display: grid; width: min(1080px, calc(100% - 48px)); min-height: 610px; grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; margin: 0 auto; padding: 24px 0 48px; }
.landing-copy { max-width: 500px; }
.landing-eyebrow { margin: 0; color: #627773; font-size: 9px; font-weight: 750; letter-spacing: .16em; }
.landing-eyebrow > span { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #e5a179; vertical-align: 1px; }
.landing-copy h1 { margin: 20px 0 20px; color: #14211f; font-size: clamp(58px, 6vw, 84px); font-weight: 500; letter-spacing: -.085em; line-height: .99; }
.landing-copy h1 em, .landing-method-heading h2 em { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; }
.landing-description { max-width: 410px; margin: 0; color: #71807b; font-size: 13px; line-height: 1.9; }
.landing-actions { display: flex; align-items: center; gap: 24px; margin-top: 26px; }
.landing-primary { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 12px; padding: 0 18px; border: 1px solid #167969; border-radius: 28px; background: #167969; box-shadow: 0 8px 18px rgba(22, 121, 105, .15); color: white; cursor: pointer; font-size: 12px; font-weight: 700; transition: transform .18s, background .18s, box-shadow .18s; }
.landing-primary:hover { transform: translateY(-2px); background: #11695c; box-shadow: 0 10px 22px rgba(22, 121, 105, .2); }
.landing-primary span { font-size: 16px; font-weight: 400; }
.landing-secondary { color: #60716b; font-size: 11px; font-weight: 650; text-decoration: none; }
.landing-secondary:hover { color: #167969; }
.landing-note { margin: 48px 0 0; color: #8b9892; font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.landing-note span { margin: 0 8px; color: #a8c4b6; }
.landing-visual { position: relative; display: grid; min-height: 400px; place-items: center; isolation: isolate; overflow: hidden; }
.orbit { position: absolute; z-index: -1; width: 310px; height: 310px; border: 1px solid rgba(105, 171, 142, .2); border-radius: 50%; }
.orbit-one { transform: rotate(-18deg) scaleX(1.2); }
.orbit-two { width: 360px; height: 250px; transform: rotate(34deg); }
.landing-study-card, .landing-card-back { position: absolute; width: 226px; height: 298px; box-sizing: border-box; border-radius: 20px; }
.landing-study-card { z-index: 2; display: flex; flex-direction: column; padding: 27px 24px 21px; transform: translate(-6px, 5px) rotate(-5deg); border: 1px solid #edf0ed; background: #fff; box-shadow: 0 25px 65px rgba(38, 70, 57, .13); }
.study-card-top { display: flex; align-items: center; justify-content: space-between; color: #91a09a; font-size: 9px; letter-spacing: .04em; }
.study-card-top i { width: 7px; height: 7px; border-radius: 50%; background: #e6b356; }
.study-card-label { margin-top: 4px; color: #8a9992; font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.landing-study-card > p { margin: auto 0; color: #162220; font-size: 19px; font-weight: 500; letter-spacing: -.04em; line-height: 1.35; }
.study-card-bottom { display: flex; align-items: flex-end; justify-content: space-between; color: #87958f; font-size: 8px; line-height: 1.6; }
.study-card-bottom span:last-child { color: #d99a44; text-align: right; }
.landing-card-back { z-index: 1; display: flex; flex-direction: column; padding: 30px 24px; transform: translate(48px, 13px) rotate(8deg); background: #d7eee3; color: #437b68; }
.landing-card-back > span { color: #6a9b86; font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.landing-card-back > p { margin: 86px 0 0; font-family: Georgia, 'Times New Roman', serif; font-size: 20px; font-style: italic; line-height: 1.35; }
.landing-float { position: absolute; z-index: 3; display: flex; min-height: 40px; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid #edf0ed; border-radius: 24px; background: rgba(255,255,255,.96); box-shadow: 0 10px 28px rgba(38, 70, 57, .09); color: #788680; font-size: 9px; white-space: nowrap; }
.landing-float > span { color: #e0a957; font-size: 13px; }
.landing-float strong { color: #315c50; }
.landing-generated { top: 74px; right: 4px; }
.landing-streak { bottom: 58px; left: 5px; }
.landing-method { width: min(1080px, calc(100% - 48px)); margin: 0 auto; padding: 80px 0 42px; border-top: 1px solid #e2e9e4; }
.landing-method-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.landing-method-heading h2 { margin: 12px 0 0; color: #182522; font-size: clamp(32px, 4vw, 48px); font-weight: 500; letter-spacing: -.065em; line-height: 1.08; }
.landing-method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 42px; }
.landing-method-grid article { min-height: 152px; padding: 21px; border: 1px solid #e7ece8; border-radius: 15px; background: rgba(255,255,255,.55); scroll-margin-top: 24px; }
.method-number { color: #c58b56; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.landing-method-grid h3 { margin: 22px 0 8px; color: #29413a; font-size: 14px; letter-spacing: -.03em; }
.landing-method-grid p { max-width: 270px; margin: 0; color: #7c8983; font-size: 11px; line-height: 1.75; }
.landing-bottom-cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 34px; padding-top: 24px; border-top: 1px solid #e7ece8; color: #71807a; font-family: Georgia, 'Times New Roman', serif; font-size: 17px; font-style: italic; }
.landing-bottom-cta .landing-primary { font-family: Inter, sans-serif; font-size: 11px; font-style: normal; }
.landing-footer { display: flex; width: min(1080px, calc(100% - 48px)); min-height: 68px; align-items: center; justify-content: space-between; margin: 0 auto; border-top: 1px solid #e7ece8; color: #87948e; font-size: 9px; }
.auth-home-link { padding: 0; border: 0; background: transparent; cursor: pointer; }
.auth-story h1 em { color: #167969; font-family: Georgia, 'Times New Roman', serif; font-weight: 400; }
.auth-proof-line { width: 28px; height: 1px; background: #d4a66c; }
.auth-card { border-radius: 18px; box-shadow: 0 18px 55px rgba(36, 65, 55, .06); }

.explanation-panel { position: fixed; z-index: 75; top: 16px; right: 16px; bottom: 16px; display: flex; width: min(390px, calc(100vw - 32px)); flex-direction: column; overflow: hidden; border: 1px solid #e4ebe6; border-radius: 18px; background: #fbfcfa; box-shadow: 0 18px 60px rgba(25, 49, 40, .18); }
.explanation-panel.hidden { display: none; }
.explanation-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 20px 17px; border-bottom: 1px solid #e8eee9; }
.explanation-header .eyebrow { font-size: 8px; }
.explanation-header h2 { margin: 5px 0 0; color: #263b36; font-size: 17px; font-weight: 700; letter-spacing: -.045em; }
.explanation-close { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border: 1px solid #e8eee9; border-radius: 50%; background: white; color: #6f7d77; cursor: pointer; font-size: 21px; line-height: 1; }
.explanation-context { padding: 15px 20px; border-bottom: 1px solid #e8eee9; background: #f4f8f4; }
.explanation-context span { color: #8a9991; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.explanation-context p { margin: 6px 0 0; color: #435650; font-size: 11px; line-height: 1.6; }
.explanation-thread { display: flex; flex: 1; flex-direction: column; gap: 11px; overflow-y: auto; padding: 17px; }
.explanation-message { max-width: 94%; padding: 12px 13px; border: 1px solid #e5ebe6; border-radius: 13px; background: white; color: #52625b; font-size: 11px; line-height: 1.75; overflow-wrap: anywhere; }
.explanation-message p { margin: 0; white-space: pre-wrap; }
.explanation-message strong { color: #226c5c; font-weight: 750; }
.explanation-user { align-self: flex-end; border-color: #dcebe0; background: #edf5ef; color: #395a4d; }
.explanation-assistant { align-self: flex-start; }
.explanation-loading, .explanation-error { margin: 4px 0; padding: 12px; border-radius: 11px; background: #f0f5f1; color: #60776b; font-size: 11px; line-height: 1.6; }
.explanation-loading::before { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #5c9c7b; content: ""; animation: explanation-pulse 1s ease-in-out infinite alternate; }
.explanation-error { background: #fff5f2; color: #9c5144; }
.explanation-error::before { content: none; }
.explanation-compose { display: flex; gap: 8px; margin: 0 15px; padding: 8px; border: 1px solid #e1e9e3; border-radius: 13px; background: white; }
.explanation-compose input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #31453d; font-size: 11px; }
.explanation-compose input::placeholder { color: #9aa69f; }
.explanation-compose button { display: flex; min-width: 57px; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 9px; background: #167969; color: white; cursor: pointer; font-size: 10px; font-weight: 700; }
.explanation-compose button:disabled, .explanation-compose input:disabled { cursor: wait; opacity: .6; }
.explanation-compose button span { font-size: 14px; }
.explanation-footnote { margin: 10px 19px 14px; color: #98a39c; font-size: 8px; line-height: 1.5; }
.explanation-source { padding: 12px; border: 1px solid #e5ebe6; border-radius: 12px; background: white; }
.explanation-source a { color: #315e50; font-size: 11px; font-weight: 700; text-decoration: none; }
.explanation-source a:hover { text-decoration: underline; }
.explanation-source p { margin: 7px 0 0; color: #78867f; font-size: 10px; line-height: 1.6; }
body.assistant-panel-open #main-app { margin-right: min(390px, 34vw); }
#study-complete.hidden { display: none; }
@keyframes explanation-pulse { to { opacity: .3; transform: scale(.75); } }

#main-app { min-height: 100vh; padding-left: 244px; box-sizing: border-box; background: var(--paper); }
#main-app > aside { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: 244px; min-width: 244px; height: 100vh; min-height: 0; box-sizing: border-box; overflow-y: auto; padding: 24px 16px; border-right: 1px solid #e8eeea; background: #fbfcfa; }
#main-app > aside > div:first-child { gap: 28px; }
#main-app > aside nav { display: grid; gap: 4px; }
#main-app > aside nav button { min-height: 39px; padding: 0 11px; border-radius: 9px; color: #74827c; font-size: 11px; }
#main-app > aside nav button:hover { background: #f0f5f1; color: #315b51; }
.app-nav-button { display: flex; width: 100%; align-items: center; gap: 12px; padding: 10px 11px; border: 0; background: transparent; color: #74827c; cursor: pointer; text-align: left; font-size: 11px; }
.app-nav-button.is-active { background: #eaf4ed; color: #246c5d; font-weight: 700; }
#main-app > aside .border-t { border-color: #e9efeb; }
#main-app > aside .bg-slate-50 { background: #f3f7f3; }
#main-app > aside .border-slate-100 { border-color: #e8efea; }
#main-app > .app-main { flex: 1 1 auto; width: 100%; max-width: 1260px; min-height: 100vh; box-sizing: border-box; margin: 0 auto; padding: 34px clamp(22px, 4vw, 58px) 56px; }
.app-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.app-topbar h1 { margin: 5px 0 0; color: #263b36; font-size: 26px; font-weight: 700; letter-spacing: -.055em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-search { display: flex; min-height: 39px; align-items: center; gap: 10px; padding: 0 10px; border: 1px solid #e5ebe7; border-radius: 9px; background: #fbfcfa; color: #929e98; cursor: pointer; font-size: 10px; }
.topbar-search > span:first-child { font-size: 18px; }
.topbar-search kbd { padding: 3px 5px; border: 1px solid #e7ece9; border-radius: 4px; background: #f4f6f3; color: #7a8982; font-family: inherit; font-size: 9px; }
.topbar-create { min-height: 39px; }
.dashboard-focus { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 25px 28px; border: 1px solid #e2eee6; border-radius: 16px; background: radial-gradient(circle at 94% 10%, rgba(213, 237, 220, .65), transparent 29%), linear-gradient(105deg, #f0f7f1, #f8faf6); }
.dashboard-focus .eyebrow { color: #618578; }
.dashboard-focus h2 { margin-top: 8px; color: #26433c; font-size: 22px; }
.dashboard-focus .button-primary { white-space: nowrap; }
#tab-dashboard .grid > div { border-color: #e8eeea; border-radius: 14px; background: #fff; box-shadow: 0 4px 14px rgba(25, 54, 45, .025); }
#tab-dashboard .grid > div p:last-child { color: #29443d; }
#saved-decks-list > div:not(.text-center) { border-color: #e8eeea; border-radius: 13px; }
#tab-dashboard > div:last-child { border-color: #e8eeea; border-radius: 15px; box-shadow: var(--shadow); }
.page-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.page-intro h2 { margin: 0; color: #263b36; font-size: 22px; font-weight: 700; letter-spacing: -.045em; }
.page-intro p { margin: 6px 0 0; color: #83908a; font-size: 11px; }
.library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.library-search { display: flex; min-height: 42px; width: min(100%, 360px); align-items: center; gap: 9px; padding: 0 12px; border: 1px solid #e4ebe6; border-radius: 10px; background: white; color: #87968f; }
.library-search input { width: 100%; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 11px; }
.library-filters { display: flex; gap: 6px; }
.filter-chip { padding: 8px 11px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #83918a; cursor: pointer; font-size: 10px; }
.filter-chip.is-active { border-color: #dce9df; background: #edf5ef; color: #387363; font-weight: 700; }
.library-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.library-deck { display: flex; min-height: 146px; flex-direction: column; justify-content: space-between; padding: 18px; border: 1px solid #e7eee9; border-radius: 14px; background: white; box-shadow: 0 4px 14px rgba(25,54,45,.025); transition: transform .2s, box-shadow .2s, border-color .2s; }
.library-deck:hover { transform: translateY(-2px); border-color: #cce2d5; box-shadow: var(--shadow); }
.library-deck h3 { margin: 0; overflow-wrap: anywhere; color: #2b413b; font-size: 14px; font-weight: 700; letter-spacing: -.02em; }
.library-deck p { margin: 7px 0 0; color: #89958f; font-size: 10px; }
.deck-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 20px; color: #778780; font-size: 10px; }
.deck-meta strong { color: #39816d; font-size: 10px; }
.deck-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.deck-actions button { min-height: 31px; padding: 0 10px; border: 1px solid #e4ebe6; border-radius: 8px; background: white; color: #65756e; cursor: pointer; font-size: 10px; font-weight: 600; }
.deck-actions button:first-child { border-color: #d9ebe0; background: #eff7f1; color: #337460; }
.empty-state { grid-column: 1 / -1; padding: 40px 20px; border: 1px dashed #dce6df; border-radius: 14px; background: rgba(255,255,255,.55); color: #87948d; text-align: center; font-size: 11px; }
.weakness-summary { display: flex; align-items: center; gap: 20px; padding: 19px 22px; border: 1px solid #e8eee9; border-radius: 14px; background: linear-gradient(115deg, #eef6f0, #fafbf8); }
.weakness-summary > div { display: flex; min-width: 155px; align-items: center; gap: 11px; }
.summary-icon { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 11px; background: #dcefe1; color: #31806d; font-size: 19px; }
.weakness-summary strong, .weakness-summary span:not(.summary-icon) { display: block; }
.weakness-summary strong { color: #2f4d43; font-size: 18px; }
.weakness-summary span:not(.summary-icon) { color: #7f8d85; font-size: 9px; }
.weakness-summary p { max-width: 520px; margin: 0; color: #79877f; font-size: 10px; line-height: 1.6; }
.weak-cards-list { display: grid; gap: 9px; }
.weak-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid #e8eee9; border-radius: 12px; background: white; }
.weak-card h3 { margin: 0; color: #344a43; font-size: 11px; font-weight: 650; }
.weak-card p { margin: 5px 0 0; color: #89958f; font-size: 10px; }
.weak-card button { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #e2ebe5; border-radius: 8px; background: #f5f9f5; color: #397765; cursor: pointer; font-size: 10px; font-weight: 650; }
.profile-panel { max-width: 680px; padding: 24px; border: 1px solid #e7eee9; border-radius: 15px; background: white; box-shadow: var(--shadow); }
.profile-panel-head { display: flex; align-items: center; gap: 13px; padding-bottom: 20px; border-bottom: 1px solid #edf1ed; }
.profile-panel-head h3 { margin: 0; color: #344a43; font-size: 14px; }
.profile-panel-head p { margin: 5px 0 0; color: #8a9790; font-size: 10px; }
.profile-panel-head .button-secondary { margin-left: auto; }
.profile-fields { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 12px; margin: 22px 0; }
.profile-fields label { color: #61726a; font-size: 10px; font-weight: 650; }
.profile-panel > .button-primary { min-width: 130px; }
.weekly-activity-panel { padding: 17px 20px 14px; border: 1px solid #e7eee9; border-radius: 14px; background: white; }
.weekly-activity-head { display: flex; align-items: center; justify-content: space-between; }
.weekly-activity-head h3 { margin: 0; color: #425a51; font-size: 11px; font-weight: 700; }
.weekly-activity-head p { margin: 4px 0 0; color: #9aa59e; font-size: 9px; }
.weekly-activity-head > span { padding: 6px 9px; border-radius: 7px; background: #f0f6f1; color: #427b68; font-size: 9px; font-weight: 700; }
.weekly-activity { display: grid; height: 73px; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 8px; margin-top: 10px; }
.activity-day { display: flex; height: 68px; flex-direction: column; align-items: center; justify-content: end; gap: 5px; }
.activity-day > span { width: min(24px, 70%); min-height: 4px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #80b99a, #c7e4d0); }
.activity-day small { color: #98a49d; font-size: 8px; }
#srs-actions { gap: 8px; }
.srs-btn { display: flex; min-height: 52px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 11px; cursor: pointer; font-size: 11px; font-weight: 700; transition: transform .16s, box-shadow .16s; }
.srs-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(25,54,45,.07); }
.srs-btn small { font-size: 8px; font-weight: 500; opacity: .72; }
.review-again { border: 1px solid #f0dbd7; background: #fff5f2; color: #a74e40; }
.review-hard { border: 1px solid #f0e5d2; background: #fffaf0; color: #947044; }
.review-good { border: 1px solid #e8ebd3; background: #fbfbeF; color: #7d8042; }
.review-easy { border: 1px solid #d8eadc; background: #f0f8f0; color: #3f805c; }
.quiz-option { width: 100%; padding: 13px 14px; border: 1px solid #e5ebe7; border-radius: 10px; background: #fbfcfa; color: #52635b; cursor: pointer; font-size: 11px; text-align: left; transition: border-color .16s, background .16s; }
.quiz-option:hover:not(:disabled) { border-color: #b7d7c2; background: #f0f7f1; }
.quiz-option:disabled { cursor: default; }
.deck-quiz-setup, .deck-quiz-card { padding: clamp(20px, 4vw, 34px); border: 1px solid #e5ece7; border-radius: 18px; background: white; box-shadow: var(--shadow); }
.deck-quiz-setup { max-width: 620px; margin: 24px auto; }
.deck-quiz-mark { display: grid; width: 42px; height: 42px; place-items: center; margin-bottom: 21px; border-radius: 13px; background: #eaf4ed; color: #28755f; font-size: 22px; }
.deck-quiz-setup > .eyebrow { color: #548370; font-size: 8px; }
.deck-quiz-setup h3 { margin: 9px 0; color: #263c35; font-size: 22px; letter-spacing: -.05em; }
.deck-quiz-description { max-width: 490px; margin: 0 0 23px; color: #7b8982; font-size: 11px; line-height: 1.8; }
.deck-quiz-setup label { display: block; margin-bottom: 7px; color: #52645b; font-size: 10px; font-weight: 700; }
.deck-quiz-setup select { width: 100%; min-height: 44px; margin-bottom: 15px; padding: 0 12px; border: 1px solid #e1e9e3; border-radius: 10px; background: #fbfcfa; color: #354a40; font-size: 11px; }
.deck-quiz-setup .button-primary { min-height: 43px; }
.deck-quiz-setup .button-primary:disabled { cursor: not-allowed; }
.deck-quiz-error { margin: 0 0 12px; color: #a34b40; font-size: 11px; }
.deck-quiz-card { max-width: 720px; margin: 8px auto; }
.deck-quiz-progress { display: flex; justify-content: space-between; gap: 15px; color: #7c8b83; font-size: 9px; font-weight: 700; letter-spacing: .06em; }
.deck-quiz-progress span:first-child { color: #47806a; }
.deck-quiz-progress-track { height: 4px; margin: 14px 0 26px; overflow: hidden; border-radius: 5px; background: #edf2ee; }
.deck-quiz-progress-track span { display: block; height: 100%; border-radius: inherit; background: #4b9a7a; transition: width .2s; }
.deck-quiz-card > h3 { margin: 0 0 20px; color: #263b35; font-size: clamp(17px, 3vw, 22px); line-height: 1.45; letter-spacing: -.035em; }
.deck-quiz-options { display: grid; gap: 9px; }
.deck-quiz-option { display: flex; width: 100%; min-height: 50px; align-items: center; gap: 12px; padding: 10px 13px; border: 1px solid #e4ebe6; border-radius: 11px; background: #fcfdfa; color: #53635a; cursor: pointer; font-size: 11px; line-height: 1.5; text-align: left; transition: border-color .15s, background .15s, color .15s; }
.deck-quiz-option:hover:not(:disabled) { border-color: #a7ceba; background: #f4f9f5; }
.deck-quiz-option > span { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border: 1px solid #e4ebe6; border-radius: 8px; background: white; color: #829087; font-size: 9px; font-weight: 800; }
.deck-quiz-option.is-incorrect { border-color: #e7b9af; background: #fff6f3; color: #a65044; }
.deck-quiz-option.is-incorrect > span { border-color: #e7b9af; color: #a65044; }
.deck-quiz-option.is-correct { border-color: #a8d2b5; background: #f0f8f1; color: #34704e; }
.deck-quiz-option.is-correct > span { border-color: #a8d2b5; color: #34704e; }
.deck-quiz-option:disabled { cursor: default; }
.deck-quiz-feedback { display: grid; gap: 7px; margin-top: 15px; padding: 13px 15px; border: 1px solid #e7ebe6; border-radius: 11px; color: #617168; font-size: 11px; line-height: 1.65; }
.deck-quiz-feedback strong { color: #354b40; }
.deck-quiz-feedback.is-incorrect { border-color: #efd3ca; background: #fff8f5; }
.deck-quiz-feedback.is-correct { border-color: #d4e9d7; background: #f5faf4; }
.deck-quiz-feedback.is-revealed { border-color: #e6e3ce; background: #fcfbf3; }
.deck-quiz-hint { color: #5d7768; }
.deck-quiz-reveal { justify-self: start; margin-top: 3px; padding: 0; border: 0; background: transparent; color: #37755f; cursor: pointer; font-size: 10px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.deck-quiz-source { margin-top: 19px; padding: 12px 14px; border-radius: 10px; background: #f5f8f5; }
.deck-quiz-source span { color: #809188; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.deck-quiz-source p { margin: 5px 0 0; color: #78877f; font-size: 9px; line-height: 1.6; overflow-wrap: anywhere; }
.deck-quiz-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; color: #87938c; font-size: 9px; }
.deck-quiz-controls .button-primary { min-height: 38px; font-size: 10px; }
.deck-quiz-results { display: flex; max-width: 520px; flex-direction: column; align-items: center; gap: 13px; margin: 28px auto; padding: 38px 25px; border: 1px solid #e5ece7; border-radius: 17px; background: white; text-align: center; box-shadow: var(--shadow); }
.deck-quiz-results .eyebrow { margin: 5px 0 0; color: #548370; }
.deck-quiz-results h3 { margin: 0; color: #2b4439; font-size: 24px; letter-spacing: -.05em; }
.deck-quiz-results > p:not(.eyebrow) { margin: 0 0 8px; color: #79867f; font-size: 11px; line-height: 1.7; }
.command-option.is-selected { background: #eef6f0; color: #246c5d; }
.session-complete { display: grid; max-width: 520px; justify-items: center; gap: 12px; margin: 30px auto; padding: 38px 25px; border: 1px solid #e2eee6; border-radius: 17px; background: white; text-align: center; box-shadow: var(--shadow); }
.session-complete-mark { display: grid; width: 45px; height: 45px; place-items: center; border-radius: 50%; background: #eaf5ed; color: #3d8c65; font-size: 21px; }
.session-complete h2 { margin: 0; color: #304940; font-size: 22px; letter-spacing: -.04em; }
.session-complete p { max-width: 330px; margin: 0; color: #84918a; font-size: 11px; line-height: 1.7; }
#tab-study .perspective-1000 { min-height: 340px; }
#tab-study #card-inner { height: 340px; }
#tab-study #card-question, #tab-study #card-answer { overflow-wrap: anywhere; }
#tab-study > div:first-child { padding-bottom: 2px; }
#aiModal { z-index: 70; }
#commandPalette { z-index: 80; }
#toast-container { z-index: 90; }
#commandPalette .is-selected { background: #eef6f0; color: #246c5d; }
.auth-header .brand-mark { width: 37px; height: 37px; }

@media (max-width: 800px) {
  body.assistant-panel-open #main-app { margin-right: 0; }
  .explanation-panel { top: auto; right: 10px; bottom: 10px; left: 10px; width: auto; height: min(72vh, 600px); border-radius: 17px; }
  .landing-hero { min-height: 530px; gap: 14px; }
  .landing-copy h1 { font-size: clamp(54px, 8vw, 68px); }
  .landing-visual { transform: scale(.88); }
  .landing-generated { right: -8px; }
  .landing-streak { left: -8px; }
  .landing-method { padding-top: 58px; }
  .auth-layout { grid-template-columns: 1fr; width: min(500px, calc(100% - 36px)); gap: 28px; padding: 38px 0; }
  .auth-story { text-align: center; }
  .auth-story h1 { margin: 16px 0 10px; font-size: clamp(34px, 8vw, 46px); }
  .auth-story > p { margin: 0 auto; font-size: 13px; }
  .auth-proof { justify-content: center; margin-top: 18px; }
  #main-app { flex-direction: column; padding-left: 0; }
  #main-app > aside { position: relative; top: auto; right: auto; bottom: auto; left: auto; width: 100%; min-width: 0; height: auto; min-height: 0; overflow: visible; padding: 12px 16px 10px; border-right: 0; border-bottom: 1px solid #e8eeea; }
  #main-app > aside > div:first-child { gap: 10px; }
  #main-app > aside nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
  #main-app > aside nav::-webkit-scrollbar { display: none; }
  #main-app > aside nav button { width: auto; min-width: max-content; min-height: 36px; padding: 0 10px; }
  #main-app > aside > div:last-child { display: none; }
  #main-app > .app-main { flex: 0 1 auto; width: 100%; max-width: none; min-height: 0; margin: 0; padding: 23px 18px 40px; }
}

@media (max-width: 560px) {
  .landing-header { width: calc(100% - 36px); height: 64px; }
  .landing-header .brand-lockup { font-size: 13px; }
  .landing-nav { gap: 14px; }
  .landing-nav a { display: none; }
  .landing-login { font-size: 10px; }
  .landing-hero { width: calc(100% - 40px); grid-template-columns: 1fr; gap: 0; padding: 50px 0 34px; }
  .landing-copy h1 { margin: 17px 0; font-size: clamp(56px, 14vw, 72px); }
  .landing-description { max-width: 360px; font-size: 12px; }
  .landing-actions { align-items: flex-start; flex-direction: column; gap: 16px; }
  .landing-note { margin-top: 28px; font-size: 7px; }
  .landing-visual { min-height: 340px; margin-top: 6px; transform: scale(.88); }
  .landing-generated { top: 39px; right: 0; }
  .landing-streak { bottom: 34px; left: 0; }
  .landing-method { width: calc(100% - 40px); padding: 48px 0 30px; }
  .landing-method-heading { align-items: flex-start; flex-direction: column; gap: 0; }
  .landing-method-grid { grid-template-columns: 1fr; gap: 10px; margin-top: 24px; }
  .landing-method-grid article { min-height: unset; padding: 17px; }
  .landing-method-grid h3 { margin-top: 13px; }
  .landing-bottom-cta { align-items: flex-start; flex-direction: column; margin-top: 24px; }
  .landing-footer { width: calc(100% - 40px); }
  .auth-header, .auth-footer { padding: 17px 18px; }
  .auth-switch { max-width: 150px; font-size: 10px; text-align: right; }
  .auth-layout { padding: 25px 0; }
  .auth-story h1 { font-size: 36px; }
  .auth-card { padding: 23px; border-radius: 17px; }
  .auth-footer { font-size: 9px; }
  .auth-story h1 { font-size: 43px; }
  .app-topbar { align-items: flex-start; margin-bottom: 20px; }
  .app-topbar h1 { font-size: 22px; }
  .topbar-search { width: 38px; min-width: 38px; justify-content: center; padding: 0; }
  .topbar-search > span:nth-child(2), .topbar-search kbd, .topbar-create { display: none; }
  .topbar-search > span:first-child { font-size: 21px; }
  .dashboard-focus { align-items: flex-start; flex-direction: column; padding: 20px; }
  .dashboard-focus h2 { font-size: 20px; }
  .library-toolbar { align-items: stretch; flex-direction: column; }
  .library-search { width: auto; }
  .library-grid { grid-template-columns: 1fr; }
  .weakness-summary { align-items: flex-start; flex-direction: column; gap: 12px; }
  #srs-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weakness-summary > div { min-width: 0; }
  .profile-panel { padding: 18px; }
  .profile-panel-head { flex-wrap: wrap; }
  .profile-panel-head .button-secondary { margin-left: 0; }
  .profile-fields { grid-template-columns: 1fr; gap: 8px; }
  .profile-fields label:not(:first-child) { margin-top: 7px; }
  .weak-card { align-items: flex-start; flex-direction: column; }
  .weekly-activity-panel { padding: 15px; }
  .weekly-activity { gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
