:root {
  color-scheme: light;
  --primary: #008069;
  --primary-dark: #006c59;
  --primary-soft: #e7f5ef;
  --bg: #f0f2f5;
  --surface: #fff;
  --text: #182b28;
  --muted: #74817e;
  --border: #dfe3e5;
  --chat-bg: #efeae2;
  --success: #25d366;
  --shadow: 0 12px 34px rgba(27, 55, 48, .07);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font-family: Inter, Arial, sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.app-shell { width: min(1120px, 100%); min-height: 100vh; margin: auto; padding: 0 30px; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid rgba(31, 65, 56, .09); }
.brand { display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
.brand img { display: block; width: 174px; height: auto; object-fit: contain; }
.account-bar { display: flex; align-items: center; gap: 13px; }
.account-name { font-size: 12px; font-weight: 700; }
.language-control select { min-height: 36px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); padding: 0 9px; font-size: 12px; }
.auth-layout { min-height: calc(100vh - 132px); display: grid; grid-template-columns: 1.1fr minmax(330px, .75fr); align-items: center; gap: 80px; padding: 54px 7%; }
.welcome-copy { max-width: 470px; }
.eyebrow { margin: 0; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: 1.25px; }
.eyebrow-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--success); }
.welcome-copy h1, .hero-copy h1 { margin: 20px 0 15px; font-size: clamp(38px, 5vw, 58px); line-height: 1.08; letter-spacing: -2.6px; }
.welcome-copy h1 span { color: var(--primary); }
.welcome-copy > p { max-width: 415px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.welcome-points { display: grid; gap: 13px; margin-top: 30px; font-size: 12px; font-weight: 600; }
.check-mark { display: inline-grid; place-items: center; width: 21px; height: 21px; margin-right: 8px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.panel { background: var(--surface); border: 1px solid rgba(37, 69, 61, .06); border-radius: 18px; box-shadow: var(--shadow); }
.auth-panel { padding: 29px; }
.panel-heading h2 { margin: 10px 0 5px; font-size: 23px; letter-spacing: -.5px; }
.panel-heading > p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 24px 0 20px; border-radius: 10px; background: #f5f7f6; }
.auth-tab { padding: 9px 5px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 700; }
.auth-tab.active { color: var(--primary); background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.field { display: grid; gap: 7px; margin: 0 0 15px; color: #344641; font-size: 11px; font-weight: 700; }
.field input { width: 100%; height: 43px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; outline: 0; color: var(--text); background: #fff; font-size: 12px; font-weight: 500; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .chat-compose input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,128,105,.1); }
.field input::placeholder { color: #a4afac; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 0 15px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-weight: 750; transition: background .15s, transform .15s, border-color .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--primary); color: white; }
.button-primary:hover { background: var(--primary-dark); }
.button-wide { width: 100%; min-height: 45px; }
.button-quiet { background: transparent; border-color: var(--border); color: var(--text); }
.button-quiet:hover { border-color: var(--primary); color: var(--primary); }
.button-small { min-height: 35px; padding: 0 11px; font-size: 11px; }
.privacy-note { margin: 16px 0 0; color: #96a19e; text-align: center; font-size: 10px; }
.form-message { min-height: 18px; margin: 9px 0 0; color: #b6473c; font-size: 11px; line-height: 1.5; }
.form-message.success-message { color: var(--primary); }

.dashboard { padding-bottom: 35px; }
.hero-card { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 275px; margin: 28px 0 38px; padding: 34px 46px; overflow: hidden; border-radius: 20px; background: linear-gradient(115deg, #006b58 0%, #008069 57%, #14947a 100%); color: #fff; box-shadow: 0 16px 36px rgba(0, 100, 79, .2); }
.hero-copy { position: relative; z-index: 1; max-width: 530px; }
.light-eyebrow { color: rgba(255,255,255,.72); }
.hero-copy h1 { margin: 13px 0 9px; font-size: 39px; letter-spacing: -1.5px; }
.hero-copy h1 span { color: #b6f0d7; }
.hero-copy > p { max-width: 420px; margin: 0; color: rgba(255,255,255,.79); font-size: 12px; line-height: 1.8; }
.hero-art { position: absolute; right: 4%; top: 0; width: 260px; height: 100%; opacity: .8; }
.art-orbit { position: absolute; width: 220px; height: 220px; right: 4px; top: 25px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; transform: rotate(-20deg) scaleY(.65); }
.orbit-two { width: 175px; height: 175px; right: 28px; top: 47px; transform: rotate(38deg) scaleY(.7); }
.art-book { position: absolute; display: grid; place-items: center; right: 77px; top: 79px; width: 75px; height: 75px; border: 1px solid rgba(255,255,255,.45); border-radius: 19px; background: rgba(255,255,255,.13); box-shadow: 0 14px 30px rgba(0,0,0,.08); font-size: 32px; transform: rotate(-10deg); }
.art-star { position: absolute; color: #c1f2dd; font-size: 23px; }
.star-one { right: 30px; top: 53px; }.star-two { right: 202px; top: 176px; }
.content-section { margin: 0 0 38px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.section-heading h2 { margin: 5px 0 0; font-size: 20px; letter-spacing: -.45px; }
.section-number { color: #b6c1bd; font-size: 13px; font-weight: 800; }
.exam-form { padding: 18px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.exam-name-field { margin-bottom: 12px; }
.exam-name-field input { height: 44px; }
.form-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.language-note { margin: 0; color: var(--muted); font-size: 11px; }
.language-note strong { color: var(--text); }
.confirmation-card { display: flex; align-items: center; gap: 15px; padding: 17px; margin-top: 13px; border: 1px solid #cfe9dc; border-radius: 13px; background: #f4fbf7; }
.confirmation-icon { display: grid; flex: 0 0 36px; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.confirmation-copy { flex: 1; min-width: 0; }
.confirmation-copy h3 { margin: 5px 0 4px; overflow-wrap: anywhere; font-size: 14px; }
.confirmation-copy p { margin: 0; color: var(--muted); font-size: 11px; }
.confirmation-actions { display: flex; gap: 8px; }
.exam-grid, .study-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.exam-card, .study-card { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); box-shadow: 0 3px 12px rgba(30,60,50,.025); }
.exam-card { cursor: pointer; transition: border-color .15s, transform .15s; }
.exam-card:hover, .study-card:hover { border-color: rgba(0,128,105,.45); transform: translateY(-1px); }
.card-kicker { color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.exam-card h3, .study-card h3 { margin: 8px 0 6px; font-size: 14px; line-height: 1.5; }
.exam-card p, .study-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.card-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 11px; border-top: 1px solid #edf0ef; color: var(--muted); font-size: 10px; }
.empty-state { padding: 25px 15px; border: 1px dashed #cbd6d1; border-radius: 13px; text-align: center; }
.empty-icon { color: var(--primary); font-size: 22px; }
.empty-state h3 { margin: 8px 0 5px; font-size: 13px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 11px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 17px; color: var(--muted); font-size: 11px; }
.breadcrumbs button { padding: 0; border: 0; background: transparent; color: var(--primary); font: inherit; font-weight: 700; }
.study-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.study-heading h2 { margin: 5px 0 0; font-size: 20px; }
.study-card { cursor: pointer; }
.study-card > span { display: inline-block; margin-top: 12px; color: var(--primary); font-size: 10px; font-weight: 750; }

.tutor { overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.tutor-head { display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 11px 15px; border-bottom: 1px solid var(--border); }
.tutor-avatar { display: grid; flex: 0 0 35px; place-items: center; width: 35px; height: 35px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.tutor-head strong, .tutor-head span { display: block; }
.tutor-head strong { font-size: 12px; }
.tutor-head div:nth-child(2) span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.online-indicator { margin-left: auto; color: var(--primary); font-size: 10px; font-weight: 700; }
.tutor-layout { display: grid; grid-template-columns: 205px minmax(0,1fr); min-height: 540px; }
.point-list { padding: 15px 10px; border-right: 1px solid var(--border); background: #fbfcfb; }
.point-list h3 { display: flex; align-items: center; justify-content: space-between; margin: 0 5px 12px; font-size: 11px; }
.point-list h3 span { color: var(--muted); font-size: 10px; }
.point-list button { display: flex; width: 100%; gap: 9px; align-items: center; padding: 9px 8px; border: 0; border-radius: 8px; background: transparent; color: #56635f; text-align: left; font-size: 10px; line-height: 1.4; }
.point-list button:hover, .point-list button.active { background: var(--primary-soft); color: var(--primary-dark); }
.point-list button span:first-child { flex: 0 0 20px; color: var(--primary); font-weight: 800; }
.chat-column { display: flex; min-width: 0; min-height: 0; flex-direction: column; background: var(--chat-bg); }
.chat-messages { display: flex; flex: 1; flex-direction: column; gap: 12px; min-height: 460px; max-height: 620px; overflow: auto; padding: 17px; }
.chat-intro { max-width: 480px; align-self: center; padding: 8px 13px; border-radius: 10px; background: rgba(255,255,255,.7); color: #62706b; text-align: center; font-size: 10px; line-height: 1.6; }
.message { width: min(94%, 500px); padding: 12px 13px; border: 1px solid rgba(0,0,0,.035); border-radius: 4px 12px 12px 12px; background: #fff; box-shadow: 0 2px 5px rgba(40,50,45,.035); }
.message.student-message { align-self: flex-end; border-radius: 12px 4px 12px 12px; background: #d9fdd3; }
.message-label { display: block; margin-bottom: 6px; color: var(--primary); font-size: 10px; font-weight: 800; }
.message h3 { margin: 0 0 7px; font-size: 13px; line-height: 1.5; }
.message p { margin: 0; color: #45534e; font-size: 11px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; padding-top: 8px; border-top: 1px solid #eef0ef; }
.message-actions button { min-height: 27px; padding: 0 9px; border: 1px solid #dfe6e2; border-radius: 7px; background: #fff; color: #52635c; font-size: 9px; font-weight: 700; }
.message-actions button:hover { border-color: var(--primary); color: var(--primary); }
.chat-compose { display: flex; gap: 8px; align-items: center; padding: 11px; background: #f8faf8; }
.chat-compose input { flex: 1; min-width: 0; height: 39px; padding: 0 12px; border: 1px solid var(--border); border-radius: 20px; outline: 0; background: #fff; font-size: 11px; }
.send-button { display: grid; flex: 0 0 36px; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--primary); color: #fff; font-size: 19px; }
.toast { position: fixed; z-index: 5; left: 50%; bottom: 24px; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 9px; background: #173c34; color: white; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s, transform .2s; font-size: 12px; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
footer { display: flex; justify-content: space-between; gap: 12px; padding: 17px 0 22px; border-top: 1px solid rgba(31,65,56,.09); color: #91a09a; font-size: 10px; }
footer span:first-child { color: var(--primary); font-weight: 800; letter-spacing: .5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.busy { opacity: .65; pointer-events: none; }

@media (max-width: 740px) {
  .app-shell { padding: 0 17px; }
  .topbar { height: 68px; }
  .brand img { width: 150px; }
  .account-bar { gap: 7px; }
  .account-name { display: none; }
  .auth-layout { min-height: auto; grid-template-columns: 1fr; gap: 23px; padding: 37px 0 30px; }
  .welcome-copy h1 { margin-top: 12px; font-size: 40px; }
  .welcome-copy > p { font-size: 12px; }
  .welcome-points { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 19px; font-size: 10px; }
  .auth-panel { padding: 23px 19px; }
  .hero-card { min-height: 245px; margin: 20px 0 30px; padding: 26px 23px; }
  .hero-copy h1 { font-size: 34px; }
  .hero-art { right: -85px; opacity: .42; }
  .exam-grid, .study-grid { grid-template-columns: 1fr; }
  .confirmation-card { align-items: flex-start; flex-wrap: wrap; }
  .confirmation-copy { min-width: calc(100% - 60px); }
  .confirmation-actions { width: 100%; justify-content: flex-end; }
  .tutor-layout { grid-template-columns: 1fr; }
  .point-list { border-right: 0; border-bottom: 1px solid var(--border); }
  .point-list > div { display: flex; gap: 6px; overflow: auto; padding-bottom: 4px; }
  .point-list button { flex: 0 0 150px; }
  .chat-messages { min-height: 380px; max-height: 58vh; padding: 12px; }
  .message { width: 96%; }
  .study-heading { align-items: flex-start; flex-direction: column; }
  .study-heading .button { min-height: 35px; }
}

@media (max-width: 430px) {
  .app-shell { padding: 0 13px; }
  .brand img { width: 132px; }
  .language-control select { max-width: 91px; }
  .button-small { padding: 0 8px; }
  .hero-copy h1 { font-size: 30px; }
  .form-inline { align-items: flex-start; flex-direction: column; }
  .form-inline .button { width: 100%; }
  footer { font-size: 9px; }
}

body.signed-in { overflow: hidden; }
body.signed-in .app-shell { display: flex; width: min(1120px, 100%); height: 100dvh; min-height: 0; flex-direction: column; }
body.signed-in main { display: flex; flex: 1; min-height: 0; }
body.signed-in .topbar { flex: 0 0 64px; height: 64px; }
body.signed-in footer { display: none; }
.wa-workspace { display: flex; flex: 1; min-height: 0; padding: 10px 0 14px; }
.wa-window { display: flex; width: min(850px, 100%); height: 100%; min-height: 0; flex-direction: column; overflow: hidden; margin: auto; border: 1px solid #d6dfdb; border-radius: 12px; background: #efeae2; box-shadow: 0 5px 24px rgba(34, 55, 47, .08); }
.wa-conversation-head { display: flex; flex: 0 0 62px; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid #e6e9e7; background: #f7f9f8; }
.wa-conversation-head strong, .wa-conversation-head span, .tutor-heading strong, .tutor-heading span { display: block; }
.wa-conversation-head strong, .tutor-heading strong { font-size: 12px; }
.wa-conversation-head span, .tutor-heading span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.wa-conversation { display: flex; flex: 1; min-height: 0; flex-direction: column; overflow: auto; padding: 18px; background-color: var(--chat-bg); background-image: radial-gradient(rgba(67, 93, 79, .07) .7px, transparent .7px); background-size: 17px 17px; }
.wa-feed { display: flex; flex-direction: column; gap: 10px; }
.wa-bubble { width: fit-content; max-width: min(88%, 580px); padding: 10px 12px; border: 1px solid rgba(0,0,0,.035); border-radius: 4px 11px 11px 11px; background: #fff; box-shadow: 0 1px 2px rgba(20,40,30,.08); }
.wa-bubble p { margin: 0; color: #34423d; font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.wa-bubble .message-label { margin-bottom: 4px; font-size: 9px; }
.wa-student { align-self: flex-end; border-radius: 11px 4px 11px 11px; background: #d9fdd3; }
.wa-options { width: fit-content; max-width: min(88%, 580px); }
.wa-option-list { overflow: hidden; border: 1px solid #e0e6e2; border-radius: 5px 11px 11px 11px; background: #fff; box-shadow: 0 1px 2px rgba(20,40,30,.08); }
.wa-option { display: flex; width: 100%; min-height: 47px; align-items: center; justify-content: space-between; gap: 20px; padding: 9px 13px; border: 0; border-bottom: 1px solid #edf0ee; background: #fff; color: var(--text); text-align: left; font-size: 11px; font-weight: 650; }
.wa-option:last-child { border-bottom: 0; }
.wa-option:hover, .wa-option:focus-visible { background: #f0f8f4; color: var(--primary-dark); outline: 0; }
.wa-option span { flex: 0 0 auto; color: var(--muted); font-size: 9px; font-weight: 500; }
.wa-compose { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; padding: 10px 13px; border-top: 1px solid #e1e7e3; background: #f7f9f8; }
.wa-compose input { flex: 1; min-width: 0; height: 42px; padding: 0 16px; border: 1px solid #dce3df; border-radius: 23px; outline: 0; background: #fff; color: var(--text); font-size: 12px; }
.wa-compose input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,128,105,.09); }
.wa-compose .send-button { flex-basis: 39px; width: 39px; height: 39px; }
.wa-status { flex: 0 0 auto; margin: 0; padding: 0 14px 5px; background: #f7f9f8; color: #b6473c; font-size: 10px; }
.study-section { display: flex; flex: 1; min-height: 0; flex-direction: column; overflow: hidden; padding-bottom: 4px; }
.study-heading { flex: 0 0 auto; margin: 0 auto 10px; width: min(850px, 100%); }
.tutor-heading { display: flex; align-items: center; gap: 10px; }
.study-section .tutor { display: flex; flex: 1; width: min(850px, 100%); min-height: 0; flex-direction: column; margin: 0 auto; }
.study-section .tutor-layout { flex: 1; min-height: 0; }
.study-section .chat-messages { min-height: 0; max-height: none; }
.study-section .chat-column { min-height: 0; }
.study-section .point-list { overflow: auto; }
.breadcrumbs { flex: 0 0 auto; margin: 0 0 9px; }

@media (max-width: 740px) {
  body.signed-in .app-shell { padding: 0 10px; }
  body.signed-in .topbar { flex-basis: 58px; height: 58px; }
  body.signed-in .brand img { width: 132px; }
  .wa-workspace { padding: 7px 0 9px; }
  .wa-window { border-radius: 10px; }
  .wa-conversation { padding: 13px 10px; }
  .wa-bubble, .wa-options { max-width: 94%; }
  .wa-option { min-height: 44px; }
  .study-heading { flex-direction: row; align-items: center; }
  .study-section .tutor-layout { grid-template-columns: 1fr; }
  .study-section .point-list { flex: 0 0 auto; max-height: 125px; border-right: 0; border-bottom: 1px solid var(--border); }
  .study-section .point-list > div { display: flex; gap: 6px; overflow-x: auto; }
  .study-section .point-list button { flex: 0 0 150px; }
  .study-section .chat-messages { max-height: none; }
}

@media (max-width: 430px) {
  body.signed-in .app-shell { padding: 0 6px; }
  body.signed-in .topbar { padding: 0 5px; }
  body.signed-in .brand img { width: 118px; }
  body.signed-in .language-control select { max-width: 84px; }
  body.signed-in .button-small { padding: 0 7px; }
  .wa-conversation-head { flex-basis: 56px; padding: 8px 11px; }
  .wa-compose { padding: 8px; }
  .study-heading .button { min-height: 33px; padding: 0 9px; font-size: 10px; }
}
