/* Shared production design system. No appearance switch or parallel legacy theme. */
:root {
  --ui-font: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --reading-font: Georgia, "Iowan Old Style", "Songti SC", serif;
  --kai: var(--ui-font);
  --ink-color: #1c1a17;
  --line-color: #e3ded4;
  --accent-color: #d9570f;
}
body { font-family: var(--ui-font); }
.exploration-card { margin:16px 0; padding:18px; border:2px solid var(--ink-color); border-radius:16px; box-shadow:3px 3px var(--ink-color); background:var(--paper-bright); max-width:560px; }
.exploration-card h3 { margin:6px 0 12px; font-size:18px; }
.exploration-card p { margin:10px 0; line-height:1.65; }
.exploration-card small,.exploration-card details,.exploration-memory { color:var(--muted-color); font-size:12px; }
.exploration-actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin:16px 0; }
.exploration-actions :is(a,button) { padding:8px 12px; border:1.5px solid var(--ink-color); border-radius:10px; background:var(--paper-bright); color:var(--ink-color); text-decoration:none; cursor:pointer; font:inherit; }
.exploration-memory { margin-top:12px; }
.exploration-memory button { margin:6px 8px 6px 0; background:none; border:0; text-decoration:underline; color:inherit; cursor:pointer; }
.exploration-notes { white-space:pre-wrap; line-height:1.7; }
.resource-entry { display:none; margin-left:auto; font:inherit; font-size:12px; padding:7px 11px; border:2px solid var(--ink-color); border-radius:10px; background:var(--paper-bright,#fffdf7); cursor:pointer; }
body[data-workspace-mode="tutor"] .resource-entry { display:inline-flex; }
#libraryResourcesOpen { margin-top:14px; font-size:14px; border:2px solid var(--ink-color); border-radius:12px; box-shadow:3px 3px var(--ink-color); padding:9px 16px; background:var(--paper-bright,#fffdf7); cursor:pointer; }
#libraryResourcesOpen:active { transform:translate(2px,2px); box-shadow:1px 1px var(--ink-color); }
.resource-dialog { width:min(640px,calc(100vw / 1.25 - 32px)); max-height:calc(100dvh / 1.25 - 40px); padding:22px; box-sizing:border-box; border:2px solid var(--ink-color); border-radius:20px; box-shadow:4px 5px var(--ink-color); color:var(--ink-color); background:var(--paper-bright,#fffdf7); overflow:auto; overscroll-behavior:contain; font-family:var(--ui-font); }
.resource-dialog::backdrop { background:#24201a55; }
.resource-dialog header { display:flex; align-items:center; justify-content:space-between; gap:16px; position:sticky; top:-22px; z-index:1; padding:8px 0; background:var(--paper-bright,#fffdf7); }
.resource-dialog h2 { font-size:22px; margin:0; }
.resource-dialog #resourceSearchClose { border:0; background:transparent; box-shadow:none; font-size:26px; width:36px; height:36px; padding:0; cursor:pointer; }
.resource-dialog nav { display:flex; gap:8px; margin:18px 0; }
.resource-dialog :is(button,input),.resource-actions :is(a,button) { font:inherit; font-size:13px; border:2px solid var(--ink-color); border-radius:10px; padding:8px 12px; background:var(--paper-bright,#fffdf7); color:inherit; }
.resource-dialog button,.resource-actions button { cursor:pointer; }
.resource-dialog button[aria-pressed="true"],.resource-actions button[aria-pressed="true"] { background:#f4e4c8; }
.resource-dialog form { display:flex; gap:8px; }
.resource-dialog form[hidden] { display:none; }
.resource-dialog input { min-width:0; flex:1; }
.resource-dialog :focus-visible,.learning-resource :focus-visible { outline:2px solid var(--accent-color); outline-offset:3px; }
.resource-dialog button:disabled,.learning-resource button:disabled { opacity:.6; cursor:wait; }
.resource-notice,.resource-evidence,.learning-resource small,.learning-resource details { font-size:12px; color:var(--muted-color,#736a5e); line-height:1.6; }
.learning-resource { margin:14px 0; padding:16px; border:2px solid var(--ink-color); border-radius:15px; box-shadow:3px 3px var(--ink-color); background:var(--paper-bright,#fffdf7); text-align:left; overflow-wrap:anywhere; }
.learning-resource h3 { font-size:17px; line-height:1.4; margin:8px 0; }
.learning-resource p { font-size:13px; line-height:1.65; margin:8px 0; }
.resource-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:12px 0; }
.resource-actions a { text-decoration:none; }
.resource-candidates > summary { cursor:pointer; padding:10px 0; font-size:13px; }
.resource-feedback:empty { display:none; }
.resource-feedback { font-size:12px; }
@media(max-width:600px) { .resource-dialog { padding:14px; } .resource-dialog h2 { font-size:19px; } .resource-actions { gap:8px; } }
#googooVoiceSelect { display:none; }
.voice-language { margin:12px 0; }
.voice-choices { display:flex; gap:10px; overflow-x:auto; padding:8px 3px; }
.voice-choices button { flex:0 0 108px; display:grid; justify-items:center; gap:8px; border:1.5px solid var(--ink-color); border-radius:12px; padding:10px; background:var(--paper-bright); font-size:11px; cursor:pointer; }
.voice-choices button[aria-pressed="true"] { box-shadow:2px 3px var(--ink-color); background:#f6e4c9; }
.voice-avatar { display:grid; place-items:center; width:48px; height:48px; border:1px solid var(--ink-color); border-radius:50%; }
.voice-avatar img { width:30px; height:30px; }
html #englishSurfaceChips .surface-chip { width:72px; min-height:28px; height:28px; font-size:12px; text-align:center; }
html #listeningCardBtn { width:32px; min-width:32px; height:32px; }
html body:is([data-workspace-mode="read"],[data-workspace-mode="input"]) .reading-panel > .titlebar > .panel-actions:first-child {
  position:fixed; top:16px; left:max(24px,calc((100vw - 1480px)/2 + 24px)); z-index:35;
}
html body:is([data-workspace-mode="read"],[data-workspace-mode="input"]) :is(#englishSurfaceChips,#workspaceHomeBtn,#listeningCardBtn) {
  position:static; inset:auto;
}
@media (max-width:760px) {
  html body:is([data-workspace-mode="read"],[data-workspace-mode="input"]) .reading-panel > .titlebar > .panel-actions:first-child { top:62px; left:12px; }
  html body:is([data-workspace-mode="read"],[data-workspace-mode="input"]) .workspace-layout { padding-top:112px; }
  html #englishSurfaceChips .surface-chip { width:76px; }
}
body[data-workspace-mode="input"] #listeningCardBtn,body[data-workspace-mode="input"] #readingPageControls { display:none!important; }
body[data-workspace-mode="input"] :is(.reading-panel,.chat-panel)::after { display:none; }
body[data-workspace-mode="input"] .chat-panel { border:0; border-left:1px solid var(--line-color); border-radius:0; box-shadow:none; }
body[data-workspace-mode="input"] .reading-panel { border:0; border-radius:0; box-shadow:none; }
body:not([data-workspace-mode="home"]) .auth-dock { top:12px; right:18px; }
body:not([data-workspace-mode="home"]) .workspace-layout { padding-top:58px; }
html .reading-explain-card { position:fixed; transform:none; width:420px; height:340px; max-height:calc(100dvh / 1.25 - 32px); display:flex; flex-direction:column; overflow:hidden; z-index:80; padding:14px 16px; font-family:var(--reading-font); font-size:15px; line-height:1.6; }
html .reading-explain-card[hidden] { display:none; }
html .reading-explain-card [hidden] { display:none !important; }
/* HP3: wrap at word boundaries, never manufacture line-end hyphens. */
html .reading-content.hp3-publication,
html .reading-content.hp3-publication :is(p,li,blockquote,.saved-word-highlight,.saved-passage-highlight) {
  word-break:normal;
  overflow-wrap:normal;
  hyphens:none;
  -webkit-hyphens:none;
  text-transform:none;
}
html .reading-explain-head { flex:0 0 auto; max-height:125px; overflow-y:auto; scrollbar-width:thin; }
html .reading-explain-word { font-family:var(--reading-font); font-size:21px; font-weight:700; line-height:1.35; overflow-wrap:anywhere; }
html .reading-explain-body { flex:1 1 auto; min-height:0; max-height:none; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; padding:0 8px 18px 0; }
html .reading-explain-head { align-items:center; }
html .trusted-dictionary-expansion>summary { display:inline-flex; padding:4px 9px; font:14px/1.5 var(--reading-font); border:1.5px solid var(--ink-color); border-radius:8px; box-shadow:1px 2px var(--ink-color); cursor:pointer; margin:10px 0; }
html .reading-explain-body :is(p,li,.trusted-dictionary-definition,.trusted-dictionary-meaning) { font-family:var(--reading-font); font-size:15px; line-height:1.65; letter-spacing:0; }
html .reading-explain-body p { margin:8px 0; }
html .reading-explain-title-row { flex-wrap:wrap; gap:5px 8px; }
html #saveSelectionBtn { display:none!important; }
html .reading-content :is(h1,h2,h3,h4,h5,h6) { font-family:var(--reading-font); font-size:1.08em; line-height:1.45; margin:1.3em 0 .7em; text-align:center; }
html .reading-content strong { color:inherit; }
html .reading-content p { line-height:1.8; margin:.65em 0; }
html .lookup-accents { display:inline-flex; gap:6px; margin:0; }
html .lookup-accents[hidden] { display:none; }
html .lookup-accents button { border:0; outline:0; box-shadow:none; padding:4px; background:none; color:var(--muted-color); font-size:11px; cursor:pointer; }
html .lookup-accents button.is-playing { background:var(--accent-soft); color:var(--accent-color); }
html #readingExplainSaveBtn { border:0; outline:0; box-shadow:none; padding:0; background:none; font-size:26px; width:36px; height:36px; }
body[data-workspace-mode="input"] .chat-log { font-size:15px; }
body[data-workspace-mode="input"] .chat-log .bubble { font-size:inherit; line-height:1.65; }
html .composer { padding:8px 12px; }
html .composer-input-row { align-items:center; min-height:36px; }
html .composer-input-row #chatInput { min-height:32px; padding:4px 8px; max-height:112px; }
html .composer :is(.composer-mic-btn,.composer-primary-btn) { align-self:center; width:36px; height:36px; min-height:36px; }
body[data-workspace-mode="input"] #statusBox { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
/* One compact pager centered on the prose column, excluding the Notes rail. */
html body[data-workspace-mode="read"] .reading-page-controls {
  top:auto; right:auto; left:calc((100% - var(--notes-rail-width,0px)) / 2); bottom:12px;
  width:auto; height:auto; transform:translateX(-50%); padding:3px 5px; z-index:7;
  border-radius:12px; background:var(--paper-bright,#fffaf2); pointer-events:auto;
}
body[data-workspace-mode="read"] .reading-page-controls .reading-page-btn {
  position:static; transform:none; width:28px; height:28px; border:0; outline:0; box-shadow:none; background:transparent;
}
body[data-workspace-mode="read"] .reading-page-jump { position:static; transform:none; }
body[data-workspace-mode="read"] .reading-pane { padding-bottom:52px; }
html .voice-more-panel { position:absolute; right:0; bottom:calc(100% + 8px); z-index:60; width:180px; min-width:0; padding:5px; gap:0; border:1px solid var(--ink-color); outline:0; box-shadow:2px 3px var(--ink-color); border-radius:9px; }
html .voice-more-panel :is(button,a) { display:block; width:100%; padding:8px 10px; margin:0; border:0; outline:0; box-shadow:none; background:none; text-align:left; text-decoration:none; font:12px var(--ui-font); }
html .voice-more > summary { border:0; outline:0; box-shadow:none; background:none; padding:0; width:28px; height:28px; line-height:28px; }
html .voice-evidence-item { display:inline-flex; align-items:center; gap:6px; }
html .voice-draft-segment { justify-content:flex-end; padding:5px 12px; }
html .voice-draft-meta { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
html .voice-draft-actions { flex-wrap:nowrap; }
.home-googoo-chat { display:grid; place-items:center; width:96px; height:96px; margin:20px auto 24px; padding:16px; border:2px solid var(--ink-color); border-radius:50%; background:var(--paper-bright); box-shadow:3px 4px var(--ink-color); cursor:pointer; }
.home-googoo-chat img { width:60px; height:60px; }
html .reading-explain-head :is(#readingExplainSaveBtn,#readingExplainCloseBtn) { display:grid; place-items:center; flex:0 0 36px; width:36px; height:36px; min-height:36px; padding:0; margin:0; border:0; outline:0; box-shadow:none; background:none; font:400 26px/1 var(--ui-font); align-self:center; }
html .composer .composer-input-row { align-items:center; }
html .composer .composer-input-row :is(.composer-mic-btn,.composer-primary-btn) { align-self:center; margin-block:0; }
html .composer-input-row :is(.composer-mic-btn,.composer-primary-btn) { position:static; transform:none; inset:auto; flex-shrink:0; }
html .voice-message-evidence .voice-play-button { width:24px; height:24px; min-height:24px; padding:0; font-size:13px; border:0; box-shadow:none; }
html .voice-message-evidence .voice-more>summary { width:24px; height:24px; min-height:24px; font-size:16px; line-height:24px; }
html .voice-recording-track { width:76px; height:14px; accent-color:var(--accent-color); cursor:pointer; }
.home-dashboard-placeholder { display:none; }
.home-dashboard-loading #homeMineView { position:relative; }
.home-dashboard-loading :is(#dailyLearningHistory,#hpJourney) { visibility:hidden; }
.home-dashboard-loading .home-dashboard-placeholder { display:grid; place-items:center; position:absolute; top:90px; left:0; right:0; height:260px; border:2px solid var(--ink-color); border-radius:20px; color:var(--muted-color); background:var(--paper-bright); }
.today-reading-reload { padding:48px 12px; text-align:center; }
.today-reading-reload button { padding:10px 16px; border:1.5px solid var(--ink-color); border-radius:10px; background:var(--paper-bright); font:14px var(--ui-font); cursor:pointer; }
html .ink-form { width:100%; max-width:360px; margin-inline:auto; }
html .cover-phone-form { gap:8px; }
html .cover-phone-form label { margin-top:0; font:600 13px var(--ui-font); color:var(--ink-70); }
html .cover-phone-form label:not(:first-child) { margin-top:16px; }
html .cover-phone-form input { height:48px; min-height:48px; padding:10px 14px; font:16px var(--ui-font); border:2px solid var(--ink-color); border-radius:10px; outline:none; box-shadow:none; }
html .cover-phone-form input:focus-visible { outline:2px solid var(--accent-color); outline-offset:3px; }
html .cover-phone-form .ink-btn { width:100%; min-height:48px; margin-top:20px; justify-content:center; }
html #coverGoogleBtn { margin-top:18px; margin-left:auto; min-height:34px; padding:6px 10px; font-size:12px; }
html .ink-status { min-height:20px; margin:12px 0 0; font-size:12px; }
#homeFamilyView { min-width:0; }
#homeFamilyView .buddy-head { display:none; }
.wall-frame { position:relative; }
.wall-zoom { position:absolute; right:24px; top:16px; z-index:20; display:flex; background:var(--paper-bright); border:2px solid var(--ink-color); border-radius:24px; box-shadow:2px 3px var(--ink-color); overflow:hidden; }
.wall-zoom button { border:0; background:transparent; color:var(--ink-color); padding:9px 12px; font:inherit; font-weight:600; cursor:pointer; }
.wall-zoom button:disabled { opacity:.35; cursor:default; }
.wall-canvas { scrollbar-width:thin; scrollbar-color:#8b7d65 #efe5d3; scrollbar-gutter:stable; }
.wall-canvas::-webkit-scrollbar { width:12px; height:12px; }
.wall-canvas::-webkit-scrollbar-track,.wall-canvas::-webkit-scrollbar-corner { background:#efe5d3; }
.wall-canvas::-webkit-scrollbar-thumb { background:#8b7d65; border:3px solid #efe5d3; border-radius:10px; }
.wall-own-note { cursor:grab; touch-action:none; }
.wall-own-note .wall-note,.wall-own-note .wall-reply { cursor:text; touch-action:auto; }
.wall-colors { display:flex; gap:10px; margin-top:12px; }
.wall-colors[hidden] { display:none; }
.wall-colors button { width:26px; height:26px; border:1.5px solid var(--ink-color); border-radius:50%; cursor:pointer; }
.wall-colors button[aria-pressed="true"] { outline:2px solid var(--ink-color); outline-offset:3px; }
.shared-wall { margin:24px 0 40px; min-width:0; }
.wall-heading { display:flex; justify-content:space-between; align-items:center; gap:24px; margin-bottom:22px; }
.wall-heading h2 { margin:0; font-size:26px; }
.wall-heading p,.wall-editor small { color:var(--muted-color); font-size:13px; margin:8px 0; }
.wall-tools,.wall-editor-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.wall-canvas { height:72vh; min-height:540px; overflow:auto; border:2px solid var(--ink-color); border-radius:20px; box-shadow:4px 5px 0 var(--ink-color); background-color:#faf4e8; background-image:radial-gradient(#cfc3ae 1px,transparent 1px); background-size:24px 24px; overscroll-behavior:contain; }
.wall-cards { position:relative; width:1500px; min-height:950px; }
.wall-card { position:absolute; width:290px; box-sizing:border-box; padding:22px; border:2px solid var(--ink-color); border-radius:7px 7px 20px 7px; box-shadow:3px 4px 0 var(--ink-color); background:#f7e6a7; overflow-wrap:anywhere; }
.wall-card [data-wall-drag] { cursor:grab; touch-action:none; user-select:none; padding-bottom:12px; }
.wall-card.is-dragging { z-index:10; box-shadow:7px 9px 0 #302a2433; }
.wall-card.is-dragging [data-wall-drag] { cursor:grabbing; }
.wall-card > time { font-size:11px; }
.wall-card footer { flex-wrap:wrap; border-top:1px dashed #84776555; padding-top:8px; }
.wall-card footer button[aria-pressed] { border:1.5px solid var(--ink-color); border-radius:20px; padding:5px 10px; background:var(--paper-bright); }
.wall-card footer button[aria-pressed="true"] { background:#edb68d; color:#302a24; }
.wall-scope { position:relative; }
#wallScopeMenu { position:absolute; right:0; top:calc(100% + 10px); min-width:220px; padding:6px; z-index:30; background:var(--paper-bright); border:2px solid var(--ink-color); border-radius:14px; box-shadow:3px 4px var(--ink-color); }
#wallScopeMenu[hidden] { display:none; }
#wallScopeMenu button { display:block; width:100%; text-align:left; padding:12px 14px; background:transparent; border:0; border-radius:8px; color:var(--ink-color); cursor:pointer; font:inherit; }
#wallScopeMenu button:hover,#wallScopeMenu button:focus-visible { background:#f1e3ce; }
#wallScopeMenu button[aria-selected="true"] { background:#f4d8b9; font-weight:700; }
.wall-card:nth-child(3n+2) { background:#f0f3e9; }
.wall-card:nth-child(3n) { background:#f9efe7; }
.wall-card header { display:flex; justify-content:space-between; gap:12px; font-size:13px; }
.wall-card time { color:var(--muted-color); }
.wall-note { white-space:pre-wrap; line-height:1.8; font-size:17px; margin:22px 0; }
.wall-card footer { display:flex; gap:14px; }
.wall-card footer button { border:0; background:transparent; padding:8px 0; font-size:12px; color:var(--ink-70); cursor:pointer; }
.wall-reply { border-top:1px solid var(--line-color); margin-top:12px; padding-top:12px; font-size:13px; }
.wall-reply p { white-space:pre-wrap; line-height:1.7; margin:6px 0; }
.wall-editor { width:min(100%,380px); box-sizing:border-box; padding:16px; margin:0 0 18px auto; background:var(--paper-bright); border:2px solid var(--ink-color); border-radius:16px; box-shadow:3px 4px var(--ink-color); }
.wall-editor.wall-inline-editor { width:100%; margin:12px 0; padding:10px; border-radius:10px; box-shadow:none; }
.wall-inline-editor #wallPublishAudience,.wall-inline-editor > label { display:none; }
.wall-inline-editor textarea { min-height:70px; font-size:14px; }
.wall-inline-editor .wall-editor-actions { gap:8px; }
.wall-inline-editor .wall-editor-actions button { padding:6px 8px; font-size:12px; }
.wall-editor[hidden] { display:none; }
.wall-editor label[hidden],.wall-editor small[hidden] { display:none; }
.wall-editor label { display:block; font-weight:600; margin-bottom:12px; }
.wall-editor textarea { box-sizing:border-box; width:100%; border:1px solid var(--line-color); padding:14px; border-radius:8px; resize:vertical; font-size:16px; line-height:1.7; background:transparent; }
.wall-editor-actions { margin-top:14px; justify-content:flex-end; }
.wall-editor-actions small { margin-right:auto; }
.wall-empty { padding:100px 32px; max-width:650px; color:var(--muted-color); font-size:18px; }
.wall-people { margin-top:40px; }.wall-people > h3 { color:var(--ink-70); padding:12px 0; font-size:18px; }
.wall-share-selection { position:fixed; bottom:26px; left:50%; transform:translateX(-50%); z-index:1500; background:var(--paper-bright); }
@media(max-width:760px){.wall-heading{align-items:flex-start;flex-direction:column;gap:12px}.wall-card{padding:18px}}
@media(max-width:760px){#homeFamilyView { padding-top:34px; }}
.wall-editor .gg-voice-btn { width:40px; height:40px; border:1px solid var(--ink-color); border-radius:50%; background:var(--paper-color); margin-top:10px; cursor:pointer; }
.social-recommendations { display:flex; flex-wrap:wrap; gap:16px; margin:20px 0 28px; }
.social-recommendations[hidden] { display:none; }
.social-companion-card { display:flex; align-items:center; justify-content:space-between; gap:24px; padding:18px 20px; background:var(--paper-bright); border:2px solid var(--ink-color); border-radius:14px; box-shadow:3px 3px 0 var(--ink-color); }
.social-companion-card p { margin:4px 0 0; font-size:.85rem; color:var(--muted-color); }
/* Match the preferred 125% desktop view without changing browser preferences. */
@media (min-width: 1024px) {
  html { zoom: 1.25; }
  body { min-height: 80vh; }
}
html .account-language-control {
  position: static; display: flex; width: 100%; box-sizing: border-box;
  padding: 8px 10px; gap: 10px; border-radius: 8px; background: transparent;
  font: inherit; color: inherit;
}
html .account-language-control select { flex: 1; min-width: 0; font: inherit; }
html .standalone-page .ui-language-control { left: auto; right: 18px; top: 18px; bottom: auto; }
button, input, select, textarea { font-family: var(--ui-font); }
button { font-weight: 600; touch-action: manipulation; }
html :is(.study-kicker, .panel-meta, .discussion-heading, .today-vocabulary-rail h3,
  .auth-menu, .googoo-settings-panel, .vocabulary-panel-head, .home-view-tab,
  .study-section-head, .content-library-meta, .buddy-name) { font-family: var(--ui-font); }
html :is(.study-home h2, .masthead h1, .station h2) {
  font-family: var(--ui-font); font-weight: 650; letter-spacing: -.025em; line-height: 1.3;
}
html :is(.reading-content, .content-library-title, .passage .p-body) { font-family: var(--reading-font); }

/* Insets draw the larger panels without resizing/reflowing the reading text. */
html :is(.reading-panel, .chat-panel) {
  position: relative;
  border-radius: 20px;
}
html :is(.reading-panel, .chat-panel)::after {
  content: "";
  position: absolute;
  inset: 2px 5px 5px 2px;
  z-index: 8;
  border: 2px solid var(--ink-color);
  border-radius: 18px;
  box-shadow: 3px 3px 0 var(--ink-color);
  pointer-events: none;
}

html :is(
  .surface-chips, .reading-page-controls,
  .home-view-toggle, .composer, .reading-explain-card,
  .googoo-settings-panel, .auth-menu, .vocabulary-panel,
  .study-heatmap-section, .hp-map-scroll, .hp-node-detail,
  .idea-popover, .auth-card, .admin-card, .organize-card,
  .zh-notepad, .writing-pieces-menu,
  .buddy-detail, .buddy-invite-pop
) {
  outline: 2px solid var(--ink-color);
  outline-offset: -2px;
  box-shadow: 3px 3px 0 var(--ink-color);
  border-radius: 16px;
}
html :is(.surface-chips, .home-view-toggle, .reading-page-controls) {
  border-radius: 12px;
  box-shadow: 2px 2px 0 var(--ink-color);
}
html :is(.surface-chip, .home-view-tab) { border-radius: 9px; }
html #readingExplainCard {
  border-color: transparent;
  border-radius: 18px;
  box-shadow: 4px 4px 0 var(--ink-color);
}
html .composer:focus-within {
  outline-color: var(--accent-color);
  box-shadow: 3px 3px 0 var(--ink-color);
}
html .upload-dropzone { border: 2px dashed var(--ink-70); border-radius: 16px; }
html .upload-dropzone:is(:hover, .is-dragover, .is-working) { border-color: var(--accent-color); }
html .auth-avatar-btn { outline: 2px solid var(--ink-color); outline-offset: -2px; box-shadow: 2px 2px 0 var(--ink-color); }
html .buddy-row { outline: 1px solid var(--ink-color); outline-offset: -1px; border-radius: 12px; box-shadow: 2px 2px 0 var(--ink-color); }
html .buddy-row.active { outline: 2px solid var(--accent-color); }
html .buddy-row:hover { box-shadow: 2px 3px 0 var(--ink-color); }
html .ui-language-control select { outline: none; border: 0; border-radius: 6px; font-family: var(--ui-font); }
html .ui-language-control select:focus-visible { outline: 2px solid var(--accent-color); }

/* Deliberately target actions, never every button (word marks and close X stay light). */
html :is(
  .workspace-home-btn, .listening-icon-btn, .composer-mic-btn, .composer-primary-btn,
  .googoo-settings-preview, .ink-btn, .course-open-btn, .reading-chip,
  .voice-circle
) {
  outline: 2px solid var(--ink-color);
  outline-offset: -2px;
  border-radius: 11px;
  box-shadow: 2px 3px 0 var(--ink-color);
  transition: box-shadow 80ms ease, transform 80ms ease;
}
html :is(.workspace-home-btn, .listening-icon-btn, .voice-circle) { border-radius: 50%; }
html :is(
  .workspace-home-btn, .listening-icon-btn, .composer-mic-btn, .composer-primary-btn,
  .googoo-settings-preview, .ink-btn, .course-open-btn, .reading-chip, .voice-circle
):enabled:active {
  transform: translate(1px, 2px);
  box-shadow: 1px 1px 0 var(--ink-color);
}
html :is(
  .composer-mic-btn, .composer-primary-btn, .googoo-settings-preview, .ink-btn,
  .course-open-btn, .reading-chip, .voice-circle
):disabled {
  outline-color: var(--line-color);
  box-shadow: none;
  transform: none;
}
html :is(
  .workspace-home-btn, .listening-icon-btn, .composer-mic-btn, .composer-primary-btn,
  .googoo-settings-preview, .ink-btn, .course-open-btn, .reading-chip, .voice-circle
):focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
}

/* Secondary surfaces share the same stroke, not another layer of card chrome. */
html .study-heatmap-section { padding: 16px; }
/* A shared first-row footprint keeps tabs visually anchored. */
html #dailyLearningHistory,html #uploadDropZone { box-sizing:border-box; min-height:0; margin-top:36px; width:100%; }
html #dailyLearningHistory { padding-bottom:10px; }
html #homeLibraryView .content-library-section { margin-top:0; padding:0; }
html #uploadDropZone { margin-bottom:36px; height:var(--daily-panel-height,260px); }
.library-shelf-frame { margin-top:32px; padding:24px; border:2px solid var(--ink-color); border-radius:18px; box-shadow:3px 4px 0 var(--ink-color); background:var(--paper-bright); }
.library-shelf-frame .library-divider-head { border:0; margin:0 0 24px; padding:0; }
.library-shelf-frame .content-library-head { display:none; }
html .library-shelf-frame .content-library-card { padding:10px; border:2px solid var(--ink-color); border-radius:13px; box-shadow:3px 4px var(--ink-color); background:var(--paper-color); }
html .library-shelf-frame .content-library-cover { aspect-ratio:2 / 3; border-radius:7px; box-shadow:none; }
html .library-shelf-frame .content-library-cover img { object-fit:contain; object-position:center; }
html .library-shelf-frame .content-library-cover::after { display:none; }
html .library-shelf-frame .content-library-card-body { padding:16px 4px 6px; }
html .content-library-cover.plan-cover { width:64px; height:90px; flex-shrink:0; }
html .content-library-cover.plan-cover img { object-fit:contain; }
#wallStatus { min-height:20px; margin:6px 0 12px; font-size:13px; }
@media(max-width:640px){.library-shelf-frame{padding:14px}.library-shelf-frame .content-library-grid{gap:18px}html #uploadDropZone{height:auto;min-height:200px}}
html .content-library-cover.has-image {
  outline: 2px solid var(--ink-color);
  outline-offset: -2px;
  box-shadow: 3px 4px 0 var(--ink-color);
}
html :is(.auth-menu, .googoo-settings-panel, .idea-popover) {
  max-width: calc(100vw - 32px);
  max-height: min(720px, 80dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
html :is(
  .auth-fields input, .cover-phone-form input, .googoo-settings-panel select,
  .profile-preview-row input, #vocabularySearch, .idea-compose-card textarea
) {
  outline: 1.5px solid var(--ink-70);
  outline-offset: -1.5px;
  border-radius: 10px;
  box-shadow: none;
}
html :is(
  .auth-fields input, .cover-phone-form input, .googoo-settings-panel select,
  .profile-preview-row input, #vocabularySearch, .idea-compose-card textarea
):focus {
  outline: 2px solid var(--accent-color);
  outline-offset: -2px;
  box-shadow: 2px 2px 0 var(--ink-color);
}
html :is(
  .auth-primary-btn, .auth-secondary-btn, .auth-google-btn, .profile-save-btn,
  .admin-secondary-btn, .idea-submit-btn, .study-ghost-btn, .content-upload-btn,
  .zh-notepad-btn, .writing-pieces-btn
) {
  outline: 2px solid var(--ink-color);
  outline-offset: -2px;
  border-radius: 11px;
  box-shadow: 2px 3px 0 var(--ink-color);
  touch-action: manipulation;
  transition: box-shadow 80ms ease, transform 80ms ease;
}
html :is(
  .auth-primary-btn, .auth-secondary-btn, .auth-google-btn, .profile-save-btn,
  .admin-secondary-btn, .idea-submit-btn, .study-ghost-btn, .content-upload-btn,
  .zh-notepad-btn, .writing-pieces-btn
):not(:disabled):active {
  transform: translate(1px, 2px);
  box-shadow: 1px 1px 0 var(--ink-color);
}
html :is(button, input, select, textarea):disabled {
  cursor: default;
  box-shadow: none;
  outline-color: var(--line-color);
  transform: none;
  transition: none;
}
html button[aria-busy="true"] { cursor: progress; }
html :is(
  .auth-menu button, .reading-page-btn, .notebook-tab, .today-word summary,
  .voice-more > summary, .voice-play-button
) { border-radius: 8px; }
html :is(button, a, summary, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}
html :is(.auth-close, .admin-close, .vocabulary-close, .googoo-settings-head > button) {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  box-shadow: none;
  background: transparent;
}
@media (hover: hover) {
  html :is(.reading-page-btn, .voice-play-button, .auth-menu button):not(:disabled):hover {
    outline: 1px solid var(--ink-70);
    outline-offset: -1px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html button { transition: none; }
}
/* No floating language footer: return the space to the mobile composer. */
@media (max-width: 760px) {
  body:not(.auth-gate-active) .shell {
    bottom: max(6px, env(safe-area-inset-bottom, 0px));
  }
  html #listeningCardBtn { position: relative; right: auto; }
}

/* Independent entry, family, competency and coach pages use the same controls. */
html .standalone-page :is(.gate, .card, .passage, .core-ring, .peak, .worksheet, .saved-card, .knapsack, .composer) {
  outline: 2px solid var(--ink-color); outline-offset: -2px;
  border-radius: 16px; box-shadow: 3px 3px 0 var(--ink-color);
}
html .standalone-page :is(.go, .ghost, .primary, .knap-go, .print-btn, .ws-tier) {
  font-family: var(--ui-font); font-weight: 600; min-height: 42px;
  outline: 2px solid var(--ink-color); outline-offset: -2px;
  border-radius: 11px; box-shadow: 2px 3px 0 var(--ink-color);
  transition: box-shadow 80ms ease, transform 80ms ease;
}
html .standalone-page :is(.go, .ghost, .primary, .knap-go, .print-btn, .ws-tier):not(:disabled):active {
  transform: translate(1px,2px); box-shadow: 1px 1px 0 var(--ink-color);
}
html .standalone-page :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
  font-family: var(--ui-font); min-width: 0; max-width: 100%;
  outline: 1px solid var(--ink-70); outline-offset: -1px; border-radius: 10px;
}
html .standalone-page :is(input, textarea, select):focus-visible {
  outline: 2px solid var(--accent-color); outline-offset: 2px;
}
html .standalone-page :is(button, input, textarea, select):disabled {
  box-shadow: none; outline-color: var(--line-color); cursor: default; transform: none; transition: none;
}
html .standalone-page :is(.try-row, .bind-row) { flex-wrap: wrap; }
html .standalone-page :is(.try-row, .bind-row) > :is(textarea, select) { flex: 1 1 180px; }
html .standalone-page .masthead h1 { font-size: clamp(24px, 3vw, 32px); }
html .standalone-page .peak-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
html .standalone-page .ui-language-control select { outline: none; }
html .standalone-page .ui-language-control select:focus-visible { outline: 2px solid var(--accent-color); }
html .standalone-page .gg-voice-btn {
  width: 42px; height: 42px; padding: 0; margin-right: 8px;
  vertical-align: middle; border: 2px solid var(--ink-color); border-radius: 50%;
  color: var(--ink-color); background: var(--paper, #f5f1ea);
  box-shadow: 2px 2px 0 var(--ink-color); cursor: pointer;
}
html .standalone-page .gg-voice-btn:disabled { box-shadow: none; cursor: default; }
@media (prefers-reduced-motion: reduce) {
  html .standalone-page button { transition: none; }
}
