/* Approved Writing Lab visual system. Presentation only; existing role and
   feature-flag visibility, form controls and business logic remain unchanged. */
:root {
  --bg:#f8f2e8; --paper:#fffdf9; --ink:#191714; --muted:#746c62;
  --lilac:#dfc2e1; --lilac2:#f1e5f2; --brown:#7a4726;
  --softline:#dfd2c3; --green:#dcff70; --red:#a12d2d;
  --wl-radius:20px; --wl-shadow:6px 7px 0 var(--brown);
}
body { background:var(--bg); font-family:Arial,Helvetica,sans-serif; }
main { max-width:1440px; margin:0 auto; }
main > section { scroll-margin-top:100px; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,
textarea:focus-visible,summary:focus-visible { outline:3px solid #9271a4; outline-offset:4px; }
button:disabled { cursor:not-allowed; }
::selection { background:var(--lilac); color:var(--ink); }
.topbar { max-width:1440px; min-height:76px; height:auto; margin:0 auto;
  padding:16px 32px; gap:22px; background:var(--paper); border-bottom:1px solid #e9e0d5; }
.brand { gap:10px; flex-shrink:0; }
.brand-mark { width:34px; height:34px; font-size:18px; }
.brand b { font-size:16px; letter-spacing:-.04em; }
.brand small { font-size:9px; }
.main-nav { gap:3px; justify-content:center; flex-wrap:wrap; }
.main-nav a { padding:9px 11px; border-radius:24px; font-size:12px;
  font-weight:650; text-transform:none; letter-spacing:0; white-space:nowrap; }
.main-nav a:hover { color:var(--ink); background:#f2ece3; }
.main-nav a[aria-current="page"],.main-nav a.active { background:var(--ink); color:var(--paper); }
.account-actions { gap:7px; flex-shrink:0; }
.user-chip { border-radius:24px; border-color:var(--softline); padding:4px 12px 4px 4px; }
.user-chip b { font-size:11px; }
.user-chip-copy small { font-size:8px; }
.link-button { font-size:11px; padding:9px; }
.dark-button,.outline-button { border-radius:11px; min-height:42px; padding:12px 19px;
  font-size:12px; line-height:1.3; text-align:center; }
.dark-button { color:var(--paper); }
.dark-button:hover:not(:disabled) { background:#34302b; border-color:#34302b; }
.outline-button { background:transparent; color:var(--ink); }
.outline-button:hover:not(:disabled) { background:#eee5d8; }
.dark-button.compact { border-radius:22px; min-height:36px; padding:10px 16px; }
.text-link { font-weight:650; font-size:12px; text-underline-offset:4px; }
.checker-section,.history-section,.teacher-section,.faq,.formats,.pricing-section { padding:64px clamp(22px,5vw,74px); }
.section-title { margin-bottom:28px; }
.section-title > p { font-size:10px; letter-spacing:.08em; }
.section-title h2 { font-size:clamp(30px,3.6vw,46px); line-height:1.12; letter-spacing:-.045em; margin:11px 0 15px; }
.section-title > span { font-size:14px; line-height:1.6; }

/* The existing live check form, including file uploads, is kept intact. */
.exam-tabs { border:0; gap:10px; grid-template-columns:repeat(4,minmax(0,1fr)); }
.exam-tabs button,.exam-tabs button:last-child,.exam-tabs button:nth-child(n) { border:1px solid var(--softline);
  border-radius:14px; min-height:76px; padding:17px 20px; }
.exam-tabs button.active { border-color:var(--ink); box-shadow:3px 4px 0 var(--brown); }
.exam-tabs b { font-size:16px; }
.exam-tabs small { font-size:11px; line-height:1.4; }
.checker-form { border:1px solid var(--softline); border-radius:22px; overflow:hidden; }
.mode-row { grid-template-columns:100px minmax(200px,1fr) auto; min-height:80px;
  padding:18px 24px; border-color:var(--softline); }
.mode-row > label { font-size:10px; }
.mode-row select,.teacher-student-picker select { border-color:var(--softline); border-radius:9px; font-size:13px; }
.mode-meta { flex-wrap:wrap; justify-content:flex-end; gap:10px; }
.mode-meta b { border-radius:20px; padding:7px 11px; }
.mode-meta span,.reset-check { font-size:11px; }
.input-card { min-width:0; padding:26px; border-color:var(--softline); }
.input-card header { margin-bottom:24px; }
.input-card header h3 { font-size:20px; letter-spacing:-.025em; }
.input-card header p { font-size:12px; line-height:1.5; }
.input-card header i { border-radius:10px; background:var(--lilac2); font-style:normal; }
.field-label { font-size:11px; }
.input-card textarea { border:1px solid var(--softline); border-radius:10px; background:var(--bg);
  font:14px/1.7 Arial,Helvetica,sans-serif; min-height:320px; padding:18px; }
.file-box { border-color:#c7b29f; border-radius:12px; padding:17px; }
.file-box b { font-size:12px; }
.file-box small { font-size:11px; }
.file-box > span { width:42px; height:42px; font-size:23px; }
.check-action { padding:25px; border-color:var(--softline); grid-template-columns:minmax(0,1fr) auto minmax(0,.7fr); gap:25px; }
.check-action > div b { font-size:13px; }
.check-action > div span,.check-action > p { font-size:12px; line-height:1.6; }
.round-submit { width:auto; height:auto; min-height:54px; min-width:185px; border-radius:13px;
  display:inline-flex; align-items:center; justify-content:center; gap:22px; padding:17px 24px; font-size:17px; }
.round-submit span { font-size:23px; margin:0; }
.status,.error { border-radius:14px; padding:22px; }
.status b { font-size:16px; }
.status p { font-size:13px; line-height:1.6; }
.result { border-radius:20px; border-color:var(--softline); padding:30px; background:var(--paper); }
.result-head h2 { font-size:34px; line-height:1.15; }
.result-summary,.expert-consensus { border-radius:12px; }
.criteria { gap:12px; }
.criterion { border:1px solid var(--softline); border-radius:14px; padding:22px; }
.criterion p,.mistake p { font-size:12px; line-height:1.6; }
.mistake { border-color:var(--softline); }
.mistake b { font-size:14px; }
.strengths span { border-radius:9px; font-size:12px; line-height:1.5; }
.ai-k1-scheme,.requirement-map { border-color:var(--softline); border-radius:14px; overflow:hidden; }
.ai-k1-scheme > div { border-color:var(--softline); }
.teacher-student-picker { border-color:var(--softline); border-radius:16px; padding:20px; }

/* Real history and teacher tools retain every original control and record. */
.history-board,.empty-account { background:var(--paper); border:1px solid var(--softline); border-radius:20px; overflow:hidden; }
.history-board > header { border-color:var(--softline); padding:24px; }
.history-board > header h3 { font-size:22px; margin:7px 0 0; }
.history-list article { padding:22px 24px; border-color:var(--softline); gap:18px; }
.history-list article b { font-size:14px; line-height:1.4; }
.history-list p,.history-criteria { font-size:11px; line-height:1.6; }
.history-score { font-size:27px; }
.history-id { color:var(--muted); font-size:11px; }
.history-empty { padding:20px; font-size:13px; line-height:1.6; }
.student-assignments { border-color:var(--softline); }
.student-assignments article { padding:18px 0; }
.student-assignments article small,.student-assignments article span { font-size:11px; }
.teacher-section { background:var(--bg); }
.teacher-toolbar { border:1px solid var(--softline); border-radius:18px; overflow:hidden; }
.teacher-toolbar form { border-color:var(--softline); }
.teacher-toolbar form > div { gap:8px; }
.teacher-toolbar input { border:1px solid var(--softline); border-radius:9px; font-size:13px; }
.teacher-toolbar form > label { font-size:10px; }
.teacher-summary span { font-size:10px; }
.teacher-layout { border:1px solid var(--softline); border-radius:20px; overflow:hidden; }
.teacher-students { border-color:var(--softline); }
.teacher-student-card { padding:20px; }
.teacher-student-card b { font-size:13px; }
.teacher-student-card small { font-size:11px; line-height:1.5; }
.teacher-student-card.active { background:var(--lilac2); box-shadow:inset 3px 0 0 var(--brown); }
.student-progress { padding:26px; }
.progress-head { border-color:var(--softline); }
.progress-head h3 { font-size:29px; }
.delete-student { border-radius:8px; font-size:10px; }
.progress-format-picker button { border-color:var(--softline); border-radius:9px; }
.progress-format-picker button b { font-size:11px; }
.progress-format-picker button small { font-size:10px; }
.progress-metrics,.teacher-bank-metrics { border:1px solid var(--softline); border-radius:12px; overflow:hidden; }
.progress-metrics div,.teacher-bank-metrics div { border-color:var(--softline); }
.progress-metrics span,.teacher-bank-metrics span { font-size:10px; }
.student-work { border-color:var(--softline); }
.student-work b { font-size:13px; }
.student-work p { font-size:11px; }
.review-work-button,.student-message-button,.student-work-actions button { border-radius:8px; font-size:11px; padding:10px 12px; }
.teacher-review-panel,.teacher-message-panel { border:1px solid var(--softline); border-radius:16px; padding:24px; }
.teacher-message-panel textarea,.teacher-review-panel textarea { border-color:var(--softline); border-radius:9px; font:13px/1.65 Arial,Helvetica,sans-serif; }
.review-choice { border-radius:8px; overflow:hidden; }
.teacher-v2 { border:1px solid var(--softline); border-radius:20px; overflow:hidden; }
.teacher-v2-head,.teacher-v2-grid,.teacher-v2-card,.teacher-v2-columns > section:first-child,
.teacher-v2-progress,.teacher-v2-legacy-note { border-color:var(--softline); }
.teacher-v2-head h3 { font-size:29px; }
.teacher-v2-head p,.teacher-v2-card p { font-size:12px; }
.teacher-v2-metrics { border-color:var(--softline); border-radius:12px; overflow:hidden; }
.teacher-v2-metrics div { border-color:var(--softline); }
.teacher-v2-metrics span { font-size:10px; }
#teacher-assignment-form > input,#teacher-assignment-form > select,.teacher-v2-card > input,
.teacher-linked-student input,.teacher-mock-builder select { border-radius:8px; font-size:12px; }
.teacher-mock-builder { border-radius:12px; }
.teacher-mock-builder label,.teacher-targets label,.teacher-linked-student small,
.teacher-linked-student label,.teacher-assignment-row small,.teacher-attempt-row small,
.teacher-bank-attempt summary small,.teacher-v2-legacy-note { font-size:11px; line-height:1.5; }
.teacher-assignment-row > span { font-size:11px; }
.teacher-bank-detail pre { border-radius:12px; font-size:13px; }
.teacher-bank-detail ul { font-size:12px; }
.teacher-bank-criteria span,.teacher-grade-grid label { border-radius:9px; }

/* Price amounts, buttons and development gates are untouched. */
.pricing-switch { border-radius:12px; overflow:hidden; }
.pricing-note { border-radius:12px; padding:18px 20px; font-size:12px; }
.price-grid,.billing-plan-grid { border:0; gap:12px; }
.price-card,.price-card:last-child,.price-card:nth-child(n),.billing-plan-card,.billing-plan-card:last-child { border:1px solid #655a52; border-radius:17px; padding:24px 20px; }
.price-card.featured,.billing-plan-card.featured { border-color:var(--lilac); }
.price-card > div strong { font-size:56px; }
.price-card button,.billing-plan-card button { border-radius:9px; padding:13px; font-size:12px; }
.price-card p,.billing-plan-card p { font-size:12px; line-height:1.6; }
.price-card > div small,.billing-plan-card > span,.billing-v2-heading > p { font-size:11px; }
.billing-plan-card h4 { font-size:21px; }
.billing-plan-card > strong { font-size:34px; }
.price-badge,.development-notice { border-radius:20px; font-size:9px; }
.pricing-contact { border-radius:16px; padding:24px; }
.pricing-contact small,.pricing-contact span { font-size:11px; line-height:1.6; }
.pricing-available-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin:32px 0 20px; scroll-margin-top:100px; }
.pricing-available-heading h3 { margin:14px 0 8px; font-size:clamp(24px,2.5vw,34px); line-height:1.2; }
.pricing-available-heading p { margin:0; max-width:660px; color:#d5c9bf; font-size:14px; line-height:1.6; }
.pricing-available-badge { display:inline-block; padding:7px 12px; border-radius:20px; background:var(--green); color:var(--ink); font-size:11px; font-weight:800; }
.pricing-available-heading .pricing-account { flex-shrink:0; font-size:12px; }
.pricing-upcoming { margin:48px 0 0; padding-top:32px; border-top:1px solid #655a52; }
.pricing-upcoming .billing-v2-heading small { color:var(--lilac); }
.pricing-upcoming .billing-launch-note { max-width:780px; margin:12px 0 0; color:#d5c9bf; font-size:14px; line-height:1.6; }
.billing-launch-note a { color:var(--bg); text-decoration:underline; text-underline-offset:3px; }
.pricing-upcoming .billing-plan-card.development-card { opacity:1; }
.pricing-upcoming .billing-plan-card.development-card .price-badge { background:#e1c5e2; color:var(--ink); }
@media(max-width:700px) { .pricing-available-heading { align-items:flex-start; flex-direction:column; gap:12px; } .pricing-upcoming { margin-top:36px; padding-top:24px; } }
.promo-entry input { border-radius:8px; }
.promo-entry > label,.promo-entry > small { font-size:11px; }
.format-grid { gap:12px; }
.format-grid article { border:1px solid #655a52; border-radius:18px; min-height:240px; padding:26px; }
.format-grid article h3 { font-size:28px; }
.format-grid article p { font-size:13px; line-height:1.6; }
.format-links a { font-size:11px; }
.faq-list details { border-color:var(--softline); }
.faq-list summary { font-size:16px; padding:20px 0; }
.faq-list p { font-size:13px; line-height:1.7; }
body > footer { max-width:1440px; margin:0 auto; padding:38px clamp(22px,5vw,74px);
  border-top:1px solid var(--softline); background:var(--paper); color:var(--ink); gap:28px; }
body > footer a,body > footer span { font-size:11px; line-height:1.6; }
body > footer a { color:var(--muted); }
.footer-independence { color:var(--muted); line-height:1.6; }
#auth-dialog,#invite-dialog { border:1px solid var(--ink); border-radius:20px; padding:28px;
  background:var(--paper); max-height:88vh; overflow:auto; }
.auth-brand > div b { font-size:20px; line-height:1.3; }
.auth-brand small { font-size:11px; line-height:1.4; }
.role-picker button { border-color:var(--softline); border-radius:13px; }
.role-picker button.active { border-color:var(--ink); }
.role-picker button > small,.auth-providers small,.auth-consent { font-size:11px; line-height:1.55; }
.telegram-button,.vk-button,.auth-status { border-radius:10px; }

/* Read-only dashboard derived from the signed-in account. */
.wl-dashboard { margin:0 0 30px; }
.wl-dashboard[hidden] { display:none!important; }
.wl-dash-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:24px; }
.wl-dash-heading h3 { font-size:36px; line-height:1.1; letter-spacing:-.04em; margin:0 0 10px; }
.wl-dash-heading h3 em { font-family:Georgia,'Times New Roman',serif; font-weight:400; }
.wl-dash-heading p { font-size:13px; line-height:1.6; color:var(--muted); margin:0; }
.wl-dash-top { display:grid; grid-template-columns:1fr 1fr 1fr; gap:18px; margin-bottom:22px; }
.wl-dash-card { min-width:0; border:1px solid var(--softline); border-radius:20px; padding:24px; background:var(--paper); }
.wl-dash-card h4 { margin:0 0 14px; font-size:15px; line-height:1.4; letter-spacing:-.02em; }
.wl-dash-card p { font-size:12px; line-height:1.6; color:var(--muted); }
.wl-dash-latest { background:var(--lilac); border-color:var(--ink); box-shadow:var(--wl-shadow); margin:0 6px 7px 0; }
.wl-dash-number { font-size:48px; line-height:1; letter-spacing:-.05em; font-weight:750; margin:17px 0 12px; }
.wl-dash-number small { font-size:17px; color:#61564d; margin-left:7px; letter-spacing:-.02em; }
.wl-dash-latest p { color:#564953; }
.wl-dash-links { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.wl-dash-links a { border:1px solid var(--softline); border-radius:9px; font-size:11px; padding:9px 11px; text-decoration:none; color:var(--ink); }
.wl-dash-links a:hover { background:var(--lilac2); }
.wl-dash-balance { background:var(--ink); color:var(--paper); border-color:var(--ink); display:flex; flex-direction:column; }
.wl-dash-balance p,.wl-dash-balance small { color:#d1c6b8; }
.wl-dash-balance > a { margin-top:auto; background:var(--green); color:var(--ink); border:1px solid var(--green); }
.wl-dash-analysis { display:grid; grid-template-columns:1.8fr 1fr; gap:18px; }
.wl-dash-chart-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; }
.wl-dash-chart-head h4 { margin:0; }
.wl-dash-chart-head select { max-width:100%; border:1px solid var(--softline); border-radius:9px; padding:9px 10px; background:var(--bg); font-size:11px; }
.wl-dash-chart { display:block; width:100%; height:220px; margin:30px 0 10px; overflow:visible; }
.wl-dash-baseline { stroke:#a89a8a; stroke-width:1; }
.wl-dash-bar { fill:var(--lilac); }
.wl-dash-bar.is-latest { fill:var(--ink); }
.wl-dash-bar-value { font:700 14px Arial,Helvetica,sans-serif; fill:var(--ink); }
.wl-dash-bar-date { font:12px Arial,Helvetica,sans-serif; fill:var(--muted); }
.wl-dash-caption { font-size:11px!important; margin:10px 0 0; }
.wl-dash-criteria { display:grid; gap:18px; margin-top:24px; }
.wl-dash-criterion > div:first-child { display:flex; justify-content:space-between; gap:10px; margin-bottom:8px; font-size:12px; line-height:1.4; }
.wl-dash-track { display:block; width:100%; border:0; border-radius:8px; height:7px; background:#eee5d9; color:var(--brown); overflow:hidden; appearance:none; -webkit-appearance:none; }
.wl-dash-track::-webkit-progress-bar { background:#eee5d9; border-radius:8px; }
.wl-dash-track::-webkit-progress-value { background:var(--brown); border-radius:8px; }
.wl-dash-track::-moz-progress-bar { background:var(--brown); border-radius:8px; }
.wl-dash-criterion.is-lowest .wl-dash-track { color:var(--red); }
.wl-dash-criterion.is-lowest .wl-dash-track::-webkit-progress-value { background:var(--red); }
.wl-dash-criterion.is-lowest .wl-dash-track::-moz-progress-bar { background:var(--red); }
.wl-dash-empty { min-height:180px; display:flex; flex-direction:column; justify-content:center; align-items:flex-start; }
.wl-dash-empty strong { font-size:20px; line-height:1.4; }
.wl-dash-empty p { max-width:420px; }

@media(min-width:1280px) {
  .price-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
}
@media(max-width:1160px) {
  .topbar { gap:12px; padding:14px 24px; flex-wrap:wrap; }
  .main-nav { order:3; flex-basis:100%; justify-content:flex-start; gap:3px; }
  .account-actions { margin-left:auto; }
  .main-nav a { font-size:11px; padding:7px 10px; }
  main > section { scroll-margin-top:125px; }
  .mode-row { grid-template-columns:85px minmax(0,1fr); }
  .mode-meta { grid-column:2; justify-self:start; justify-content:flex-start; }
  .billing-plan-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .price-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(max-width:900px) {
  .topbar,main,body > footer { margin-left:0; margin-right:0; }
  .main-nav { display:flex; }
  .checker-section,.history-section,.teacher-section,.formats,.pricing-section,.faq { padding:48px 24px; }
  .teacher-layout { grid-template-columns:280px minmax(0,1fr); }
  .input-grid { grid-template-columns:1fr; }
  .input-card { border-right:0; border-bottom:1px solid var(--softline); }
  .check-action { grid-template-columns:1fr auto; }
  .check-action > p { grid-column:1/-1; text-align:left; margin:0; }
  .wl-dash-top { grid-template-columns:1fr 1fr; }
  .wl-dash-balance { grid-column:1/-1; display:grid; grid-template-columns:1fr auto; align-items:center; column-gap:20px; }
  .wl-dash-balance h4,.wl-dash-balance p { grid-column:1; }
  .wl-dash-balance .wl-dash-number { grid-column:2; grid-row:1/3; margin:0; }
  .wl-dash-balance > a { grid-column:2; grid-row:3; }
  .wl-dash-analysis { grid-template-columns:1fr; }
  .wl-dash-criteria { grid-template-columns:1fr 1fr; }
}
@media(max-width:620px) {
  .topbar { position:relative; padding:13px 16px; gap:12px; }
  .brand b { font-size:15px; }
  .brand small { display:none; }
  .account-actions .link-button { display:inline-flex; font-size:10px; padding:7px; }
  .user-chip { padding-right:5px; }
  .user-chip-copy { display:none!important; }
  .main-nav { flex-wrap:nowrap; overflow-x:auto; width:100%; padding-bottom:2px; }
  .main-nav a { flex-shrink:0; font-size:11px; }
  main > section { scroll-margin-top:20px; }
  .checker-section,.history-section,.teacher-section,.formats,.pricing-section,.faq { padding:42px 18px; }
  .section-title h2 { font-size:32px; }
  .exam-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .exam-tabs button:nth-child(n) { min-height:70px; padding:15px; }
  .mode-row { grid-template-columns:1fr; padding:20px; }
  .mode-meta { grid-column:1; }
  .input-card { padding:20px; }
  .input-card header { margin-bottom:18px; }
  .input-card textarea { min-height:250px; padding:14px; }
  .file-box { padding:14px; }
  .file-box.selected { padding-right:14px; padding-bottom:38px; }
  .file-remove { top:auto; bottom:12px; transform:none; }
  .check-action { display:flex; flex-direction:column; align-items:stretch; text-align:left; padding:20px; gap:18px; }
  .round-submit { width:100%; }
  .result { padding:20px; }
  .result-head h2 { font-size:27px; }
  .criteria { grid-template-columns:1fr; }
  .teacher-layout,.teacher-toolbar { grid-template-columns:1fr; }
  .teacher-students { border-right:0; border-bottom:1px solid var(--softline); }
  .teacher-toolbar input { border:1px solid var(--softline); }
  .teacher-toolbar form > div { gap:9px; }
  .history-list article { grid-template-columns:1fr auto; padding:20px; gap:10px; }
  .history-id { grid-column:1/-1; }
  .history-criteria { display:block; grid-column:1/-1; order:4; }
  .history-list article > strong { grid-column:2; grid-row:2; }
  .price-grid,.billing-plan-grid,.format-grid { grid-template-columns:1fr; }
  .price-card:nth-child(n),.billing-plan-card { min-height:265px; }
  .billing-v2-heading { align-items:flex-start; flex-direction:column; gap:10px; }
  .billing-v2-heading > p { text-align:left; }
  .promo-entry > div { flex-direction:column; }
  body > footer { grid-template-columns:1fr 1fr; padding:30px 18px; gap:24px 18px; }
  #auth-dialog,#invite-dialog { padding:22px; }
  .wl-dash-heading { flex-direction:column; align-items:flex-start; }
  .wl-dash-heading h3 { font-size:30px; }
  .wl-dash-top { grid-template-columns:1fr; gap:16px; }
  .wl-dash-card { padding:21px; }
  .wl-dash-balance { display:flex; align-items:stretch; gap:0; }
  .wl-dash-balance .wl-dash-number { margin:14px 0; }
  .wl-dash-number { font-size:44px; }
  .wl-dash-chart { height:auto; min-height:170px; }
  .wl-dash-criteria { grid-template-columns:1fr; }
}
@media(prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  .price-card { transition:none; }
}
