/* © 2026 Yuri Zivago Yung Grillo (尤立) · Jornada Chinesa (jornadachinesa.com.br). Todos os direitos reservados. Proibida a cópia ou republicação sem autorização. */
/* Tokens compartilhados por todas as telas. A identidade dos perfis é local. */
body, body[data-theme="claro"] {
  --page-bg:#eee7d8; --page-bg-secondary:#faf7ef; --surface:#fffcf5;
  --surface-alt:#f1ede3; --text:#282c27; --text-muted:#60675e;
  --border:#c9cbbd; --accent:#386451; --accent-hover:#294c3e;
  --input-bg:#fffdf8; --input-text:#282c27; --button-text:#ffffff;
  --danger:#a3312b; --shadow:0 5px 18px #2835280a; --ornament:#667d6412;
  --paper:var(--page-bg); --paper-dark:var(--surface-alt); --panel:var(--surface);
  --ink:var(--text); --soft-ink:var(--text-muted); --jade:var(--accent);
  --jade-dark:var(--accent); --jade-soft:var(--surface-alt); --red:var(--danger);
  color-scheme:light;
}
body[data-theme="suave"] {
  --page-bg:#c2d8cd; --page-bg-secondary:#e2ece4; --surface:#fafbf5;
  --surface-alt:#e6eee6; --border:#a9bdb0; --text:#263c32;
  --text-muted:#536a5c; --accent:#315e4b; --accent-hover:#244937;
  --ornament:#466c591b;
}
body[data-theme="escuro"] {
  --page-bg:#15231f; --page-bg-secondary:#27352f; --surface:#24332d;
  --surface-alt:#2e4037; --text:#edf1e8; --text-muted:#bbcabe;
  --border:#53685a; --accent:#a4d3b6; --accent-hover:#c4e8d1;
  --input-bg:#192820; --input-text:#edf1e8; --button-text:#17291e;
  --danger:#f1a197; --shadow:0 5px 18px #00000018; --ornament:#8fae8710;
  color-scheme:dark;
}
body {
  background:radial-gradient(ellipse at 80% 0%,var(--page-bg-secondary),transparent 65%),var(--page-bg);
  background-attachment:fixed; color:var(--text);
}
.ink-mountain {background:var(--ornament);}
.app-header {background:var(--surface); border-color:var(--border); padding:14px 28px; flex-wrap:wrap;}
.header-actions {flex-wrap:wrap;}
.app-brand {min-width:0;}
#userInfo {overflow-wrap:anywhere;}
.identity-sidebar {position:absolute; top:118px; left:28px; width:220px; padding:22px 16px; background:var(--surface); border:1px solid var(--border); border-radius:8px; box-shadow:var(--shadow);}
.identity-mark {width:46px;height:46px;display:grid;place-items:center;background:var(--accent);color:var(--button-text);font-family:serif;font-size:26px;border-radius:5px;margin-bottom:15px;}
.identity-sidebar>strong {display:block;font-family:Georgia,serif;font-size:1.2rem;overflow-wrap:anywhere;}
.identity-sidebar>p {color:var(--text-muted);font-size:.82rem;margin-top:7px;}
#socialNavigation {display:flex;flex-direction:column;gap:7px;margin-top:24px;}
#socialNavigation button {width:100%;margin:0;min-height:44px;padding:10px;text-align:left;border:1px solid transparent;background:transparent;color:var(--text);font-size:.88rem;border-radius:5px;}
#socialNavigation button:hover,#socialNavigation button[aria-current] {background:var(--surface-alt);border-color:var(--border);}
#socialNavigation button[aria-current] {border-left:3px solid var(--accent);font-weight:700;}
.appearance-version {display:block;margin-top:28px;padding-top:16px;border-top:1px solid var(--border);color:var(--text-muted);font-size:.73rem;letter-spacing:.12em;}
.dashboard {width:auto;max-width:1280px;margin-left:280px;margin-right:32px;padding:36px 0 64px;}
.dashboard>h1 {font-size:2rem;}
.dashboard-grid {gap:16px;margin-top:24px;grid-template-columns:repeat(2,minmax(0,1fr));}
.dashboard-card {min-height:142px;padding:20px 22px;background:var(--surface);box-shadow:var(--shadow);border-radius:8px;}
.dashboard-card .card-icon {font-size:1.4rem;}
.dashboard-card h3 {margin-top:12px;font-size:1.18rem;}
.dashboard-card p {font-size:.85rem;}
body :is(.login-card,.section-page,.social-card,.student-form-section,.class-current-card,.class-history-card,.student-week-card,.class-history-details,.database-table-wrap,.attendance-table-wrap,.payment-table-wrap,.task-editor,.student-week-empty,.student-week-unlinked) {background:var(--surface);color:var(--text);border-color:var(--border);box-shadow:var(--shadow);}
body :is(.student-editor-nav,.attendance-summary-card,.payment-summary-card,.weekly-exercise-summary-card,.class-diary-attendance-row,.module-indicator,.social-state,th) {background:var(--surface-alt);color:var(--text);border-color:var(--border);}
body :is(td,tr,.class-presentes-block,.class-diary-attendance-editor,.divider::before,.divider::after) {border-color:var(--border);}
body :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select,option,dialog) {background:var(--input-bg);color:var(--input-text);border-color:var(--border);}
body :is(input,textarea)::placeholder {color:var(--text-muted);opacity:1;}
body :is(input,select,textarea,button,a,summary):focus-visible {outline:3px solid var(--accent);outline-offset:3px;}
body :is(input,select,textarea,button):disabled {opacity:.65;cursor:not-allowed;}
body :is(input[type="checkbox"],input[type="radio"]) {accent-color:var(--accent);width:18px;height:18px;}
body input::file-selector-button {background:var(--surface-alt);color:var(--text);border:1px solid var(--border);padding:8px 12px;border-radius:4px;margin-right:12px;}
body :is(.database-button,.back-button,.table-edit-button,.logout-button,.secondary-button,.attendance-remove-button,.payment-remove-button,.small-close-button) {background:var(--surface);color:var(--accent);border:1px solid var(--border);border-radius:5px;}
body :is(.primary-button,.database-primary-button,.mode-button) {background:var(--accent);color:var(--button-text);border-color:var(--accent);border-radius:5px;}
body :is(.primary-button,.database-primary-button,.mode-button):hover {background:var(--accent-hover);}
body :is(.database-button,.back-button,.table-edit-button):hover {background:var(--surface-alt);}
body :is(.danger-button,.attendance-remove-button,.payment-remove-button,.logout-button) {color:var(--danger);}
body :is(.social-card h3,.class-current-card h3,.class-history-card h3) {color:var(--accent);}
body .typing-hint {color:var(--text-muted);}
body .login-card footer {color:var(--text-muted);}
#socialSection {max-width:none;margin-top:24px;}
#welcomeTitle,#modeDescription {display:none;}
#socialSection {margin-top:0;}
.social-content>.social-card:first-child {margin-top:0;}
.social-content>h2:first-child {margin-top:0;margin-bottom:20px;}
.social-content>h3 {margin-top:24px;margin-bottom:10px;}
.social-back {margin-top:24px;}
.learning [hidden] {display:none!important;}
.learning-targets {padding:12px;border:1px solid var(--border);border-radius:6px;margin:12px 0;}
.learning-target-options {display:flex;flex-wrap:wrap;gap:16px;}
.learning .learning-targets label:has(input[type="checkbox"]) {display:flex;flex-direction:row;align-items:center;gap:8px;margin:10px 0;}
.learning .learning-targets input[type="checkbox"] {width:18px;height:18px;flex:none;padding:0;}
.sentence-pieces {display:flex;flex-wrap:wrap;gap:10px;margin:16px 0;}
.sentence-pieces button {font-size:1.35rem;overflow-wrap:anywhere;max-width:100%;}
.sentence-answer {min-height:76px;padding:14px;border:2px dashed var(--border);border-radius:8px;background:var(--surface-alt);align-items:center;}
.section-page:not(.hidden) {display:flex;flex-direction:column;margin-top:0;}
.section-footer {order:100;margin-top:28px;}
.section-page>section>:is(h2,.database-header,.student-week-header):first-child {margin-top:0;}
#socialSection>[role="status"]:empty {display:none;}
.identity-sidebar {top:114px;}
.identity-sidebar>strong:empty {display:none;}
.dashboard-grid {margin-top:0;}
.classmates-grid {grid-template-columns:repeat(3,minmax(0,1fr));}
.classmates-grid .social-card {padding:18px;min-width:0;}
.class-presentes-list {display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;}
.class-present-profile {padding:16px;min-width:0;width:100%;}
.task-followup-list {display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:8px;margin:18px 0;}
#taskManagement:empty {display:none;}
#taskManagement button {margin:6px 8px 6px 0;}
.lifecycle-actions {display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin-top:8px;max-width:240px;white-space:normal;}
.lifecycle-actions button {width:auto;min-width:0;min-height:34px;white-space:nowrap;padding:6px 11px;font-size:.82rem;}
/* O painel precisa de margem interna também fora dos cartões. */
#sectionPlaceholder {padding:clamp(16px,2vw,28px);min-width:0;}
:is(#studentTasksSection,#studentClassSection) > :is(.student-week-header,.database-message) {margin-left:24px;margin-right:24px;}
#tasksDatabaseView > :is(.database-header,.database-toolbar,.database-message) {margin-left:14px;margin-right:14px;}
#tasksDatabaseView .tasks-table {min-width:0;table-layout:fixed;overflow-wrap:anywhere;}
#tasksDatabaseView .tasks-table :is(th,td):first-child {width:24%;}
#tasksDatabaseView .tasks-table :is(th,td):nth-child(5) {width:17%;}
#tasksDatabaseView .tasks-table .table-edit-button {max-width:100%;}
@media(max-width:960px) {
  #tasksDatabaseView .tasks-table {min-width:900px;}
  :is(#studentTasksSection,#studentClassSection) > :is(.student-week-header,.database-message) {margin-left:16px;margin-right:16px;}
}
.participation-group {margin:28px 0;padding:20px 0;border-top:1px solid var(--border);}
.participant-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:20px;}
.participant-card {display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:16px;border:1px solid var(--border);border-radius:8px;background:var(--surface-alt);}
.participant-card .social-avatar {width:48px;height:48px;object-fit:cover;border-radius:50%;}
.participant-card select {width:100%;}
.class-presentes-list > .participation-group {grid-column:1/-1;}
.social-card > small {display:block;margin:12px 0;}
.social-card > button {margin:8px 8px 8px 0;}
.lifecycle-actions [role="status"] {font-size:.85rem;}
.lifecycle-actions [role="status"]:empty {display:none;}
.gap-group {margin:24px 0;padding:20px;border:1px solid var(--border);border-radius:10px;background:var(--surface-alt);}
.gap-group h4 {margin-bottom:16px;}
.word-bank {display:flex;flex-wrap:wrap;gap:12px;margin:16px 0;}
.word-bank span {padding:8px 14px;border-radius:8px;background:var(--surface);font-size:1.3rem;}
.gap-line {white-space:pre-line;line-height:2.6;font-size:1.15rem;margin:12px 0;overflow-wrap:anywhere;}
.gap-line input {display:inline-block;width:clamp(100px,24vw,180px);max-width:100%;padding:6px 8px;margin:0 5px;border:0;border-bottom:2px solid var(--accent);font-size:inherit;vertical-align:baseline;}
.gap-photo {position:relative;overflow:hidden;width:100%;max-width:426px;border-radius:12px;margin:16px 0;}
.gap-photo img {position:absolute;max-width:none;height:auto;}
.exercise-original {display:block;width:100%;max-width:640px;max-height:480px;height:auto;object-fit:contain;margin:16px auto;}
.exercise-original[hidden] {display:none;}
.image-drop {border:2px dashed var(--border);padding:24px;text-align:center;min-height:150px;display:grid;place-items:center;cursor:pointer;background:var(--surface);border-radius:10px;}
.image-drop.drag-over {border-color:var(--accent);background:var(--surface-alt);}
.exercise-builder label {display:block;margin:14px 0;}
.exercise-builder label :is(input,textarea,select) {display:block;width:100%;margin-top:6px;}
.exercise-builder textarea {min-height:120px;resize:vertical;}
.exercise-builder button,.model-toolbar button {margin:6px 8px 6px 0;}
.exercise-builder :is(input,textarea,select),.board-tools select {padding:9px 12px;border:1px solid var(--border);border-radius:5px;font-size:1rem;max-width:100%;}
.exercise-builder button,.board-tools button {padding:9px 14px;border:1px solid var(--border);border-radius:5px;background:var(--surface);color:var(--accent);font-size:.95rem;cursor:pointer;}
.exercise-builder [role="status"] {margin-top:12px;}
.word-slot {min-width:100px;max-width:100%;margin:0 5px;padding:5px 12px;border:1px dashed var(--accent);border-bottom:2px solid var(--accent);background:var(--surface);font:inherit;color:var(--text);}
.word-bank button {font-size:1.25rem;padding:8px 14px;cursor:grab;}
.word-bank button[aria-pressed="true"] {outline:3px solid var(--accent);outline-offset:2px;}
.board-tools {display:flex;flex-wrap:wrap;gap:14px;align-items:end;margin:20px 0;}
.board-tools label {display:flex;flex-direction:column;gap:6px;font-size:.9rem;}
.board-tools input[type="color"] {width:64px;height:42px;padding:3px;}
.board-tools input[type="range"] {width:110px;}
.board-frame {border:1px solid var(--border);border-radius:10px;overflow:hidden;background-color:#183c30;background-position:0 0;}
.board-frame[data-grid="square"] {background-image:linear-gradient(#80808060 1px,transparent 1px),linear-gradient(90deg,#80808060 1px,transparent 1px);background-size:4% 6.4%;}
.board-frame[data-grid="dots"] {background-image:radial-gradient(#80808090 1px,transparent 2px);background-size:4% 6.4%;}
.board-frame canvas {display:block;width:100%;height:auto;touch-action:none;cursor:crosshair;}
.board-status {margin:10px 0;font-size:.9rem;}
.board-tools {gap:8px;margin:0 0 6px;align-items:end;}
.board-tools label {gap:3px;font-size:.75rem;}
.board-tools select,.board-tools button {padding:5px 8px;font-size:.8rem;min-height:32px;}
.board-tools input[type="color"] {height:32px;width:42px;}
.board-tools input[type="range"] {width:76px;height:32px;}
.board-tools :is([data-undo],[data-redo]) {font-size:1.3rem;line-height:1;padding:3px 8px;}
.board-status {margin:3px 0 6px;font-size:.72rem;}
.answer-slot {min-width:70px;min-height:44px;vertical-align:middle;max-width:100%;margin:0 5px;padding:5px 10px;border:1px dashed var(--accent);background:var(--surface);font:inherit;color:var(--text);}
.answer-slot:empty::after {content:'\00a0';}
.answer-bank button[hidden] {display:none!important;}
.answer-bank button[aria-pressed="true"] {outline:3px solid var(--accent);outline-offset:2px;}
.answer-feedback {display:inline-block;font:normal .85rem Arial,sans-serif;margin:4px 8px;}
.answer-feedback.correct {color:var(--accent);}
.answer-feedback.incorrect {color:var(--danger);}
.exercise-score {font-size:1.15rem;font-weight:700;margin:12px 0;}
.teacher-answer-key {margin:18px 0;padding:16px;border:1px solid var(--border);border-radius:8px;}
.closed-exercise-row {display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid var(--border);padding:12px 0;}
.closed-exercise-row button {text-align:left;}
.profile-award-stars {display:flex;gap:10px;margin:12px 0;}
.award-star {position:relative;font-size:30px;line-height:1;cursor:help;text-shadow:0 1px 2px #0004;}
.award-place-1 {color:#c89510;}.award-place-2 {color:#929da7;}.award-place-3 {color:#b46c37;}
.award-tooltip {display:none;position:absolute;z-index:5;top:100%;left:0;min-width:200px;max-width:280px;padding:10px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:6px;font:normal .85rem/1.4 Arial,sans-serif;}
.award-star:is(:hover,:focus) .award-tooltip {display:block;}
.recommendation-card a {display:block;margin:12px 0;overflow-wrap:anywhere;color:var(--accent);}
.social-card > label {display:block;margin:14px 0;}
.social-card > label :is(input,textarea) {display:block;width:100%;margin-top:6px;}
@media(max-width:560px){.gap-group{padding:12px;}.gap-line{font-size:1.05rem;}}
.avatar-placeholder {display:grid;place-items:center;background:var(--profile-bg);font-size:32px;}
.compact-composer {max-width:760px;margin:20px 0;padding:20px;}
.compact-composer[hidden] {display:none!important;}
.compact-composer textarea {min-height:96px;resize:vertical;}
.compact-composer > .composer-checkbox {display:flex;align-items:center;gap:10px;}
.compact-composer > .composer-checkbox input {width:auto;margin:0;flex:none;}
.recommendation-card,.publication-card {display:grid;grid-template-columns:110px minmax(0,1fr);gap:24px;}
.post-author {display:flex;flex-direction:column;align-items:center;gap:10px;min-width:0;text-align:center;}
.post-author .social-avatar {width:64px;height:64px;border-radius:50%;object-fit:cover;display:grid;place-items:center;font-size:32px;}
.post-author button {max-width:100%;padding:6px 10px;white-space:normal;overflow-wrap:anywhere;}
.post-body {min-width:0;overflow-wrap:anywhere;}
.post-body h3 {margin:0 0 12px;}
.post-body h4 {margin:16px 0 6px;}
.post-body > small {display:block;margin:14px 0;}
.post-body > button {margin:6px 8px 6px 0;}
@media(max-width:560px){
 .recommendation-card,.publication-card {grid-template-columns:1fr;gap:18px;padding:16px;}
 .post-author {justify-self:start;max-width:160px;}
 .compact-composer {padding:16px;}
}
@media(min-width:1500px){.classmates-grid{grid-template-columns:repeat(4,minmax(0,1fr));}}
@media(max-width:1100px){.classmates-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:560px){.classmates-grid{grid-template-columns:1fr;}}
body :is(.csv-panel,.weekly-exercise-table-wrap,.student-week-block,.task-recipient-option,.historical-result-row,.access-action-button) {background:var(--surface);color:var(--text);border-color:var(--border);}
body :is(.weekly-exercise-table input,.weekly-exercise-table select,.historical-result-row input,.historical-result-row select,.student-delivery-box input,.student-delivery-box textarea,.access-link-select) {background:var(--input-bg);color:var(--input-text);border-color:var(--border);}
body .identity-mark img {width:100%;height:100%;object-fit:cover;border-radius:5px;}
body a {color:var(--accent);}
.social-grid .social-card {margin:0;}
/* Shared learning areas retain the same scale as the published content. */
.learning {min-width:0;}
.learning h2 {margin:0 0 16px;}
.learning-actions {display:flex;flex-wrap:wrap;gap:8px;margin:12px 0;}
.learning .database-button {width:auto;min-height:40px;padding:8px 12px;font-size:1rem;}
.learning-card {margin:16px 0;padding:20px;overflow-wrap:anywhere;}
.learning label {display:flex;flex-direction:column;gap:6px;margin:12px 0;color:var(--text);}
.learning :is(input,textarea,select) {box-sizing:border-box;width:100%;max-width:100%;padding:10px;font:inherit;border:1px solid var(--border);border-radius:5px;background:var(--input-bg);color:var(--input-text);}
.learning textarea {resize:vertical;min-height:90px;}
.learning-cards-editor {display:grid;gap:12px;}
.learning-edit-card {min-width:0;border:1px solid var(--border);border-radius:8px;padding:12px;display:grid;grid-template-columns:1fr;gap:12px;align-items:end;}
.learning-edit-card label {margin:0;}
.learning-edit-card button {justify-self:start;}
.learning-list-row {display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px;align-items:center;padding:14px 0;border-bottom:1px solid var(--border);}
.learning-list-row:last-child {border-bottom:0;}
.learning-prompt {font-size:1.5rem;white-space:pre-wrap;margin:6px 0 18px;}
.learning-reading {white-space:pre-wrap;line-height:1.9;text-indent:0;}
.learning-status:empty {display:none;}
.learning .prize-1 {color:#997512;}.learning .prize-2 {color:#697786;}.learning .prize-3 {color:#a16435;}
.board-tools {display:flex;flex-wrap:wrap;align-items:end;gap:8px;margin:0 0 8px;}
.board-tools label {display:flex;flex-direction:column;gap:3px;margin:0;font-size:.8rem;}
.board-tools :is(button,select,input) {font-size:.9rem;min-height:34px;margin:0;padding:5px 8px;width:auto;}
.board-tools input[type=range] {width:90px;}.board-tools input[type=color] {width:44px;height:34px;padding:2px;}
.board-tools button[data-undo],.board-tools button[data-redo] {font-size:1.3rem;width:38px;padding:2px;}
.board-status {font-size:.85rem;margin:4px 0 8px;}
@media(min-width:961px){.identity-sidebar {max-height:calc(100vh - 160px);overflow-y:auto;}#socialNavigation {gap:4px;}#socialNavigation button {padding-top:10px;padding-bottom:10px;}}
@media(max-width:650px){.learning-edit-card {grid-template-columns:1fr;}.learning-card {padding:16px;}.learning-actions .database-button {flex:1 1 auto;}}
.social-card {padding:22px;}
.social-card p+p {margin-top:9px;}
/* Paletas controladas do perfil: mesmas cores para qualquer visitante/tema. */
body [data-profile-color] {--profile-bg:#e2eee4;--profile-border:#52765e;--profile-text:#233c2d;--profile-muted:#496352;}
body [data-profile-color="terracota"] {--profile-bg:#f7e6df;--profile-border:#aa5a43;--profile-text:#502e25;--profile-muted:#775044;}
body [data-profile-color="azul"] {--profile-bg:#e2edf8;--profile-border:#547ba4;--profile-text:#223b55;--profile-muted:#4c627a;}
body [data-profile-color="lavanda"] {--profile-bg:#ece5f5;--profile-border:#8565a3;--profile-text:#423050;--profile-muted:#695776;}
body [data-profile-color="dourado"] {--profile-bg:#f6edcf;--profile-border:#9b7929;--profile-text:#483b1f;--profile-muted:#716139;}
body[data-theme] .social-card[data-profile-color],body[data-theme] .class-present-profile {background:var(--profile-bg);color:var(--profile-text);border-color:var(--profile-border);}
body[data-theme] [data-profile-color] :is(h3,p,strong,.social-text,.class-present-profile-name) {color:var(--profile-text);}
body[data-theme] [data-profile-color] :is(small,.class-present-profile-action) {color:var(--profile-muted);}
body[data-theme] [data-profile-color] button {background:var(--profile-bg);color:var(--profile-text);border-color:var(--profile-border);}
@media(min-width:1600px) {.dashboard-grid {grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:960px) {
  .identity-sidebar {position:static;width:auto;margin:20px 24px 0;padding:16px;}
  .identity-mark {display:none;}
  #socialNavigation {flex-direction:row;flex-wrap:wrap;gap:6px;margin-top:12px;}
  #socialNavigation button {width:auto;flex:1 1 150px;text-align:center;}
  .appearance-version {display:none;}
  .dashboard {margin:0 24px;padding-top:26px;}
}
@media(max-width:560px) {
  .app-header {padding:16px;gap:12px;}
  .header-actions {gap:8px;}
  .identity-sidebar {margin:16px 16px 0;}
  .dashboard {margin:0 16px;}
  .dashboard-grid {grid-template-columns:1fr;gap:12px;}
  .dashboard-card {min-height:120px;padding:18px;}
  .dashboard>h1 {font-size:1.7rem;}
}
