/* Approved Homepage palette. Scoped to Translation and Due Review only. */
html:root body.dg-product-ui.dg-ui42:is([data-dg-page="translate"],[data-dg-page="due-review"]){--learn-bg:#FFFCF5;--learn-surface:#FFFFFF;--learn-soft:#E0F2D8;--learn-text:#182A22;--learn-muted:#52635A;--learn-line:#7C8C80;--learn-line-soft:#D6E1D4;--learn-accent:#0D754D;--learn-on-accent:#FFFFFF;--td-header:#EFF6EB;--td-sidebar:#F2F7E9;--td-hero:#EFF8DA;--td-warm:#FFB02E;--td-warm-opacity:29%;--td-amber-bg:#FCF0DF;--td-amber:#8A511B;--td-output:#F3F8ED;--td-red:#D71928;--td-red-bg:#FFF3F3;--td-hard:#785000;--td-hard-bg:#FFF4D6;--td-blue:#225D9C;--td-blue-bg:#EFF5FF;--td-easy:#0D754D;--td-easy-bg:#E5F6EB;background:var(--learn-bg)!important;color:var(--learn-text)!important}
html:root[data-dg-mode="dark"] body.dg-product-ui.dg-ui42:is([data-dg-page="translate"],[data-dg-page="due-review"]){--learn-bg:#171D16;--learn-surface:#18241F;--learn-soft:#28452B;--learn-text:#E8F1EB;--learn-muted:#B3C3B8;--learn-line:#718979;--learn-line-soft:#344A3A;--learn-accent:#74E2AD;--learn-on-accent:#10251B;--td-header:#20352B;--td-sidebar:#1B281B;--td-hero:#263E26;--td-warm:#FFC76B;--td-warm-opacity:8%;--td-amber-bg:#3D3020;--td-amber:#E8BA80;--td-output:#20362B;--td-red:#FF4D5A;--td-red-bg:#35191D;--td-hard:#FFDA83;--td-hard-bg:#453719;--td-blue:#9BCCFF;--td-blue-bg:#203B51;--td-easy:#74E2AD;--td-easy-bg:#193C2D}
html:root body.dg-ui42:is([data-dg-page="translate"],[data-dg-page="due-review"]) .header-main{background:var(--td-header)!important;border-color:var(--learn-line-soft)!important}
html:root body.dg-ui42:is([data-dg-page="translate"],[data-dg-page="due-review"]) #sidebar{background:var(--td-sidebar)!important}
html:root body.dg-ui42 :is(#dg-translation,#study48-app.due-review) .td-banner{display:flex;align-items:center;gap:15px;padding:20px 23px;margin:0 0 20px;border:1px solid var(--learn-line-soft);border-radius:20px;background:radial-gradient(ellipse at top right,color-mix(in srgb,var(--td-warm) var(--td-warm-opacity),transparent),transparent 65%),linear-gradient(115deg,var(--td-hero),var(--learn-soft));color:var(--learn-text)}
.td-banner-icon{display:grid;place-items:center;flex-shrink:0;width:48px;height:48px;border-radius:13px;background:var(--td-amber-bg);color:var(--td-amber);font-size:25px;font-weight:700}
html:root body.dg-ui42 :is(#dg-translation,#study48-app) .td-eyebrow{color:var(--learn-accent)!important;font-size:11px;font-weight:700;letter-spacing:.06em;margin:0 0 5px}
html:root body.dg-ui42 :is(#dg-translation,#study48-app) .td-banner h1{font-size:clamp(23px,3vw,29px)!important;line-height:1.25;margin:0 0 6px;color:var(--learn-text)!important}
html:root body.dg-ui42 :is(#dg-translation,#study48-app) .td-banner h1 span{color:var(--learn-accent)!important}
html:root body.dg-ui42 :is(#dg-translation,#study48-app) .td-banner p:not(.td-eyebrow){color:var(--learn-muted)!important;font-size:13px;margin:0}
html:root body.dg-ui42 #dg-translation{color:var(--learn-text)}
html:root body.dg-ui42 #dg-translation :is(.tab-btn,.dg-language-selector,.td-editor,.camera-panel,.camera-card,.grammar-card){background:var(--learn-surface)!important;color:var(--learn-text)!important;border-color:var(--learn-line-soft)!important}
html:root body.dg-ui42 #dg-translation .tab-btn{border:1px solid var(--learn-line-soft)!important}
html:root body.dg-ui42 #dg-translation .tab-btn[class*="tab-active"]{background:var(--learn-accent)!important;color:var(--learn-on-accent)!important;border-color:var(--learn-accent)!important;box-shadow:0 3px 0 #FF6B00!important}
html:root body.dg-ui42 #dg-translation .td-editor{border-radius:18px!important;border-top:3px solid var(--td-warm)!important}
html:root body.dg-ui42 #dg-translation .td-editor-output{background:var(--td-output)!important;border-top-color:var(--learn-accent)!important}
html:root body.dg-ui42 #dg-translation :is(#input-text,#output-text,#doc-translated-text,#camera-source,#camera-result,#grammar-content){background:var(--learn-surface)!important;color:var(--learn-text)!important;-webkit-text-fill-color:var(--learn-text)!important}
html:root body.dg-ui42 #dg-translation #output-text{background:transparent!important}
html:root body.dg-ui42 #dg-translation :is(select,.camera-settings label,.camera-note,.translation-provider,[class*="text-gray-"],[class*="text-brand-textDim"]){color:var(--learn-muted)!important;-webkit-text-fill-color:var(--learn-muted)!important}
html:root body.dg-ui42 #dg-translation :is(button:not(.tab-btn),.camera-button){background:var(--learn-soft)!important;color:var(--learn-accent)!important;-webkit-text-fill-color:var(--learn-accent)!important;border-color:var(--learn-line-soft)!important}
html:root body.dg-ui42 #dg-translation .translation-about{background:var(--learn-soft)!important;color:var(--learn-text)!important;border-color:var(--learn-line-soft)!important}
html:root body.dg-ui42 #dg-translation .translation-about summary{background:transparent!important;color:var(--learn-text)!important}
html:root body.dg-ui42 #dg-translation .translation-suggestions button{background:var(--td-amber-bg)!important;color:var(--td-amber)!important;-webkit-text-fill-color:var(--td-amber)!important;border-color:var(--learn-line-soft)!important}
html:root body.dg-ui42 #dg-translation :is(.camera-primary,label[for="doc-upload"]){background:#FF6B00!important;color:#231F1A!important;-webkit-text-fill-color:#231F1A!important;border-color:#C65000!important}
html:root body.dg-ui42 #dg-translation :is(#doc-result,.camera-result,.camera-source){background:var(--td-output)!important;color:var(--learn-text)!important;border-color:var(--learn-line-soft)!important}
html:root body.dg-ui42[data-dg-page="translate"] #history-drawer{background:var(--learn-surface)!important;color:var(--learn-text)!important;border-color:var(--learn-line-soft)!important}
html:root body.dg-ui42[data-dg-page="translate"] #history-drawer :is(p,span,button,[class*="text-gray-"],[class*="text-brand-"]){color:var(--learn-text)!important;-webkit-text-fill-color:var(--learn-text)!important}
html:root body.dg-ui42 #dg-translation .td-ai-discovery{display:flex;align-items:center;gap:13px;padding:12px;margin:15px 0 6px;border-radius:12px;background:var(--td-amber-bg);border:1px solid var(--td-warm)}
html:root body.dg-ui42 #dg-translation #btn-grammar{width:auto!important;height:auto!important;min-height:44px!important;flex-shrink:0;background:#FF6B00!important;color:#231F1A!important;-webkit-text-fill-color:#231F1A!important;border:1px solid #BD4F00!important;border-radius:10px!important;padding:10px 14px!important;box-shadow:0 2px 0 #C65000!important;font-size:14px!important;font-weight:750!important;gap:8px;white-space:nowrap}
html:root body.dg-ui42 #dg-translation #btn-grammar:disabled{opacity:.75!important;cursor:wait;background:#FF6B00!important}
html:root body.dg-ui42 #dg-translation #btn-grammar:after{display:none!important}
html:root body.dg-ui42 #dg-translation .td-ai-description{font-size:12px;color:var(--td-amber)!important;line-height:1.6}.td-ai-description strong{display:block}
html:root body.dg-ui42 #dg-translation .grammar-card{border:1px solid var(--learn-line-soft)!important;border-left:4px solid var(--learn-accent)!important}
html:root body.dg-ui42 #dg-translation .grammar-card :is(h3,[class*="text-purple-"]){color:var(--learn-accent)!important;-webkit-text-fill-color:var(--learn-accent)!important}
/* Due card geometry and data are still rendered by DGFlashcardView. */
html:root body.dg-ui42 #study48-app.due-review{color:var(--learn-text)!important}
html:root body.dg-ui42 #study48-app :is(.due-toolbar,.due-empty,#due-writing){background:var(--learn-surface)!important;color:var(--learn-text)!important;border:1px solid var(--learn-line-soft);border-radius:14px;padding:14px}
html:root body.dg-ui42 #study48-app :is(.due-toolbar label,.due-progress-row,.due-hint,.due-card-meta .badge,.muted,#s48-status){color:var(--learn-muted)!important;-webkit-text-fill-color:var(--learn-muted)!important}
html:root body.dg-ui42 #study48-app :is(.due-toolbar select,#due-answer,#due-plural){background:var(--td-output)!important;color:var(--learn-text)!important;border-color:var(--learn-line-soft)!important}
html:root body.dg-ui42 #study48-app progress{accent-color:#2ECC71;background:var(--learn-line-soft);border-radius:99px}
html:root body.dg-ui42 #study48-app progress::-webkit-progress-bar{background:var(--learn-line-soft);border-radius:99px}html:root body.dg-ui42 #study48-app progress::-webkit-progress-value{background:#2ECC71;border-radius:99px}html:root body.dg-ui42 #study48-app progress::-moz-progress-bar{background:#2ECC71;border-radius:99px}
html:root body.dg-ui42 #study48-app .due-card-stage,html:root body.dg-ui42 #study48-app .due-card-meta{max-width:420px}
html:root body.dg-ui42 #study48-app .due-card-stage{position:relative}
html:root body.dg-ui42 #study48-app .due-card-face{border-color:var(--learn-accent)!important;background:var(--learn-surface);color:var(--learn-text)}
html:root body.dg-ui42 #study48-app #due-flip{position:absolute!important;bottom:14px;left:50%;transform:translateX(-50%);display:inline-flex!important;align-items:center;justify-content:center;width:max-content!important;max-width:calc(100% - 24px);min-width:0!important;min-height:30px!important;margin:0!important;padding:5px 12px!important;font-size:11px!important;line-height:1.4;white-space:nowrap;border-radius:99px!important;background:var(--learn-soft)!important;color:var(--learn-accent)!important;border:1px solid var(--learn-line-soft)!important;box-shadow:none!important;z-index:5}
html:root body.dg-ui42 #study48-app #due-flip:before{content:'';position:absolute;inset:-5px}
html:root body.dg-ui42 #study48-app #due-flip[hidden]{display:none!important}
html:root body.dg-ui42 #study48-app #due-flip-help{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
html:root body.dg-ui42 #study48-app #due-ratings{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;max-width:720px;margin:16px auto}
html:root body.dg-ui42 #study48-app #due-ratings[hidden]{display:none!important}
html:root body.dg-ui42 #study48-app #due-ratings button{display:block!important;text-align:left;min-width:0;min-height:72px;gap:0;padding:13px 15px!important;border:1px solid var(--rate-ink)!important;border-radius:14px!important;background:var(--rate-bg)!important;color:var(--rate-ink)!important;-webkit-text-fill-color:var(--rate-ink)!important;box-shadow:0 1px 0 color-mix(in srgb,var(--rate-ink) 25%,transparent)!important;opacity:1!important}
html:root body.dg-ui42 #study48-app #due-ratings button :is(b,small){display:block;color:var(--rate-ink)!important;-webkit-text-fill-color:var(--rate-ink)!important;line-height:1.5;white-space:normal}
html:root body.dg-ui42 #study48-app #due-ratings b{font-size:15px;font-weight:750}html:root body.dg-ui42 #study48-app #due-ratings small{font-size:12px;font-weight:400;margin-top:5px}
html:root body.dg-ui42 #study48-app #due-ratings [data-rating="1"]{--rate-bg:var(--td-red-bg);--rate-ink:var(--td-red)}html:root body.dg-ui42 #study48-app #due-ratings [data-rating="2"]{--rate-bg:var(--td-hard-bg);--rate-ink:var(--td-hard)}html:root body.dg-ui42 #study48-app #due-ratings [data-rating="3"]{--rate-bg:var(--td-blue-bg);--rate-ink:var(--td-blue)}html:root body.dg-ui42 #study48-app #due-ratings [data-rating="4"]{--rate-bg:var(--td-easy-bg);--rate-ink:var(--td-easy)}
html:root body.dg-ui42 #study48-app #due-ratings button:disabled{cursor:wait;filter:saturate(.6)}
@media(max-width:1023px){html:root body.dg-ui42[data-dg-page="due-review"] .dg-quick-dock{display:none!important}html:root body.dg-ui42[data-dg-page="due-review"]{--dg-dock-height:0px!important;padding-bottom:calc(12px + env(safe-area-inset-bottom))!important}}
@media(max-width:700px){html:root body.dg-ui42 :is(#dg-translation,#study48-app) .td-banner{padding:16px 14px;gap:10px;border-radius:17px}.td-banner-icon{width:38px;height:38px;font-size:22px}html:root body.dg-ui42 #dg-translation .td-ai-discovery{display:block;padding:11px}html:root body.dg-ui42 #dg-translation #btn-grammar{width:100%!important}html:root body.dg-ui42 #dg-translation .td-ai-description{text-align:center;margin-top:8px;font-size:11px}html:root body.dg-ui42 #study48-app #due-ratings{grid-template-columns:repeat(2,minmax(0,1fr))}html:root body.dg-ui42 #study48-app #due-ratings button{padding:11px 12px!important}html:root body.dg-ui42 #study48-app #due-flip{font-size:10px!important;bottom:13px}}

/* Pair the older translation component tokens with the approved palette as well. */
html:root body.dg-ui42[data-dg-page="translate"]{--tr-bg:var(--learn-surface);--tr-soft:var(--learn-soft);--tr-ink:var(--learn-text);--tr-muted:var(--learn-muted);--tr-border:var(--learn-line-soft);--tr-action:var(--learn-accent);--tr-action-ink:var(--learn-on-accent)}
html:root body.dg-ui42 #dg-translation #panel-doc>div{background:var(--learn-surface)!important;color:var(--learn-text)!important;border-color:var(--learn-line-soft)!important}
html:root body.dg-ui42 #dg-translation #panel-text button:not(#btn-grammar){background:var(--learn-soft)!important;color:var(--learn-accent)!important;-webkit-text-fill-color:var(--learn-accent)!important}
html:root body.dg-ui42 #dg-translation #loading-spinner{background:var(--learn-surface)!important;color:var(--learn-muted)!important}
html:root body.dg-ui42 #dg-translation #panel-image :is(select,textarea){color-scheme:light dark}
html:root body.dg-ui42:is([data-dg-page="translate"],[data-dg-page="due-review"]) :is(#mobile-drawer,.dg-side-brand){background:var(--td-sidebar)!important}
html:root body.dg-ui42 :is(#dg-translation,#study48-app) .td-banner h1{font-weight:750!important}
html:root body.dg-ui42 #dg-translation #btn-grammar{display:inline-flex!important;align-items:center!important;justify-content:center!important;}

/* Final approved refinement: retain Homepage cream/orange outside the due card. */
html:root body.dg-product-ui.dg-ui42[data-dg-page="due-review"]{--td-card-face:#F7FBF2;--td-card-ink:#0D754D;--td-footer:#E9F3EC}
html:root[data-dg-mode="dark"] body.dg-product-ui.dg-ui42[data-dg-page="due-review"]{--td-card-face:#20382B;--td-card-ink:#74E2AD;--td-footer:#22362B}
html:root body.dg-product-ui.dg-ui42 #study48-app a[href*="study-reminders"]{background:var(--learn-soft)!important;color:var(--learn-accent)!important;-webkit-text-fill-color:var(--learn-accent)!important;border:1px solid var(--learn-line-soft)!important}
html:root body.dg-product-ui.dg-ui42 #study48-app .due-toolbar label{color:var(--learn-text)!important;-webkit-text-fill-color:var(--learn-text)!important}
html:root body.dg-product-ui.dg-ui42 #study48-app #due-flip{left:50%!important;right:auto!important;transform:translateX(-50%)!important;margin:0!important;justify-content:center!important;white-space:nowrap!important}
html:root body.dg-product-ui.dg-ui42[data-dg-page="due-review"] .footer-main{background:var(--td-footer)!important;color:var(--learn-text)!important;border-color:var(--learn-line-soft)!important}
html:root body.dg-product-ui.dg-ui42[data-dg-page="due-review"] .footer-main :is(p,a,span,h3,h4){color:var(--learn-muted)!important;-webkit-text-fill-color:var(--learn-muted)!important}
