@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;450;500;550;600;650;700&display=swap');

:root {
  color-scheme: light;
  --ink: #26364a;
  --muted: #738195;
  --green: #376a94;
  --line: #e0e7ef;
  --paper: #ffffff;
  --bg: #f4f7fa;
  font: 14px/1.6 "DM Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
button, input, select, textarea { font: inherit; }
button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  background: #fff;
  color: var(--ink);
  font-weight: 550;
  transition: background .15s, border-color .15s;
}
button:hover { background: #f1f5fa; border-color: #b8cadb; }
button:disabled { opacity: .45; }
.primary { color: #fff; background: var(--green); border-color: var(--green); }
.primary:hover { color: #fff; background: #2d587d; border-color: #2d587d; }
:focus-visible { outline: 3px solid #96bad9; outline-offset: 3px; }
a { color: var(--green); text-underline-offset: 3px; }
.app { grid-template-columns: 220px minmax(0, 1fr); }
.app aside {
  background: #f7f9fc;
  padding: 30px 18px 20px;
  gap: 10px;
}
.brand { gap: 10px; margin-bottom: 26px; align-items: center; }
.brand b { font-size: 18px; letter-spacing: -.65px; color: #253e57; }
.brand small { color: #7c8a9a; font-size: 9px; letter-spacing: 1.35px; line-height: 1.6; font-weight: 500; }
.app .mark { width: 34px; height: 39px; border-radius: 6px 10px 10px 6px; background: #416f95; color: #fff; font-size: 20px; }
#studySidebar > button {
  text-align: left;
  padding: 12px 13px;
  border-color: transparent;
  background: transparent;
  color: #6d7f91;
  font-weight: 500;
  border-radius: 8px;
  font-size: 13px;
}
#studySidebar > button:hover { background: #edf2f7; }
#studySidebar > button[aria-current="page"] { color: #2d618e; background: #e8f0f8; font-weight: 600; }
#legacyNotebooks { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
#studySidebar summary { color: #718093; font-size: 11px; font-weight: 500; }
#studySidebar details { margin-block: 6px; }
#studySidebar .label { font-size: 9px; margin-top: 15px; color: #8b98a6; }
.app .tec-book-button, .app .tec-book-button.selected { background: #eef3f8; color: #4b6580; border: 1px solid var(--line); }
.aside-bottom { font-size: 11px; padding-top: 16px; }
.aside-bottom b { font-weight: 500; color: #667b90; }
.device-help { color: #8a97a5; font-size: 10px; }
.aside-bottom button { font-size: 10px; background: transparent; padding: 5px 7px; }
.topbar { min-height: 64px; background: #ffffffb8; border-color: var(--line); padding-inline: 30px; gap: 12px; }
.breadcrumb { font-size: 11px; color: #7d8c9d; }
.saved { background: #eaf3ee; color: #5b816b; font-size: 10px; padding: 4px 9px; font-weight: 500; }
.mobile-menu { background: transparent; border-color: transparent; color: #65819a; font-size: 17px; padding: 4px 8px; }
.layout { max-width: 1400px; padding: 32px clamp(18px, 3vw, 44px) 48px; }
.book { background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.layout .tec-library-detail { padding: 0; }
.layout .tec-library-detail > h2 { font: 550 clamp(25px, 3vw, 34px)/1.25 "DM Sans","Segoe UI",sans-serif; color: #283e56; letter-spacing: -1px; margin: 4px 0 28px; }
.collection-filters { gap: 12px; margin: 22px 0 16px; }
.collection-filters label { font-size: 11px; color: #7a8999; font-weight: 500; }
.app input, .app select, .app textarea,
.app #tecAddForm input, .app #tecRename,
.layout .question-panel input, .layout .question-panel select {
  color: #334b61;
  background: #fff;
  border: 1px solid var(--line);
}
.collection-filters input, .collection-filters select { padding: 10px 12px; border-radius: 8px; font-size: 12px; }
input::placeholder, textarea::placeholder { color: #9aa7b4; }
.planning-management { font-size: 11px; color: var(--muted); margin-bottom: 20px; }
.planning-management > summary { font-size: 11px; font-weight: 500; }
.planning-summary { font-size: 11px; margin: 24px 0 12px; color: #7e8b99; }
.planning-grid { gap: 9px; }
.planning-card { background: #fff; padding: 17px 20px 11px; border: 1px solid var(--line); border-radius: 10px; }
.planning-main { gap: 12px 18px; align-items: center; }
.planning-identity { display: flex; flex-direction: column-reverse; gap: 3px; flex-basis: 22rem; }
.planning-discipline { margin: 0; color: #8191a0; text-transform: uppercase; letter-spacing: 1.05px; font-size: 9px; font-weight: 550; }
.planning-card h4 { font-size: 14px; font-weight: 550; color: #2a4057; }
.planning-position { color: #93a1af; font-weight: 400; margin-right: 4px; }
.planning-status { background: #f6f2e9; color: #9c845d; font-size: 10px; font-weight: 500; padding: 3px 8px; }
.planning-status[data-status="Concluída"] { background: #eef5ee; color: #6e8a71; }
.planning-status[data-status="Ignorada"] { background: #f0f2f5; color: #8b97a4; }
.planning-actions { gap: 8px 14px; }
.planning-actions button { background: #f5f8fc; color: #3c6c93; border-color: #dbe5ef; font-size: 11px; padding: 8px 12px; }
.planning-actions a { font-size: 11px; color: #7e91a5; text-decoration: none; }
.planning-options { margin-top: 10px; }
.planning-options > summary { color: #97a3af; font-size: 10px; font-weight: 450; }
.planning-option-content { margin-top: 12px; padding-top: 12px; }
.planning-option-content > p { font-size: 11px; }
.planning-option-content button, .planning-material button { font-size: 11px; }
.planning-material summary, .planning-option-content summary { font-size: 11px; color: #7f8fa0; }
.error-notebook-context { margin: 25px 0 8px; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: #8192a4; }
.error-notebook-actions { gap: 8px 12px; margin: 18px 0; }
.error-notebook-actions button { font-size: 11px; padding: 9px 12px; }
.error-notebook-actions a { margin-right: auto; font-size: 11px; text-decoration: none; }
.reader-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin: 20px 0 12px; }
.reader-tabs > button { background: transparent; border-color: transparent; color: #7e8fa0; padding: 7px 16px; font-size: 12px; }
.reader-tabs > button[aria-selected="true"] { border-color: var(--line); background: #fff; color: #345e80; box-shadow: 0 2px 6px #20456807; }
.reader-tabs label { margin-left: auto; color: #8998a8; font-size: 11px; }
.reader-tabs select { max-width: min(380px, 70vw); padding: 6px; border-radius: 6px; }
.html-reader { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px #1a416605; }
.html-reader-caption { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; padding: 12px 20px; font-size: 10px; color: #8396a8; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.error-document-frame { display: block; width: 100%; height: 76vh; height: 76dvh; min-height: 420px; border: 0; background: #fff; }
.html-source-editor { display: block; width: 100%; min-height: 65vh; padding: 22px; resize: vertical; border: 0 !important; border-radius: 0; outline-offset: -4px; font: 12px/1.7 ui-monospace,monospace !important; white-space: pre; }
.html-reader-empty { padding: 70px 20px; text-align: center; color: #8899a9; }
.html-empty-icon { display: inline-block; padding: 10px 12px; background: #edf3f9; color: #487396; border-radius: 8px; font: 12px ui-monospace,monospace; }
.html-reader-empty h3 { color: #405a72; font-size: 18px; font-weight: 500; margin: 20px 0 6px; }
.html-reader-empty p { margin: 0 0 22px; font-size: 12px; }
.error-catalog { display: grid; gap: 10px; margin-top: 24px; }
.error-catalog-row { display: flex; align-items: center; gap: 20px; background: #fff; padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; }
.error-catalog-row div { flex: 1; min-width: 0; }
.error-catalog-row small { color: #8798a8; font-size: 10px; }
.error-catalog-row h3 { font-size: 14px; font-weight: 500; margin: 5px 0; overflow-wrap: anywhere; }
.error-catalog-row button { font-size: 11px; }
.reader-focused .app { grid-template-columns: minmax(0, 1fr); }
.reader-focused #studySidebar, .reader-focused .topbar,
.reader-focused .error-notebook-context, .reader-focused #tecBookDetail > h2,
.reader-focused #tecBookDetail > button { display: none; }
.reader-focused .layout { max-width: 1600px; padding-block: 8px; }
.reader-focused .error-document-frame { height: 84vh; height: 84dvh; }
#notice { background: #283f56; color: #fff; font-size: 12px; z-index: 10; box-shadow: 0 6px 24px #213f6120; }
#cloudLoginDialog { border-radius: 14px; padding: 30px; box-shadow: 0 18px 80px #243c6126; }
#cloudLoginDialog::backdrop { background: #c1cddc88; backdrop-filter: blur(4px); }
#cloudLogin input { background: #f8fafc; color: #30485e; }
#cloudLoginDialog h2 { color: #2d4660; font-weight: 550; }
#cloudLoginDialog .primary { color: #fff; }
.layout .question-panel { background: #fff; }
.layout .question-toolbar { background: #f0f4f8; border-color: var(--line); }
.notes-library-card { background: #fff; }
@media (max-width: 1050px) {
  .planning-main { gap: 10px; }
  .planning-actions { width: 100%; }
}
@media (max-width: 780px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .app aside { height: auto; }
  .menu-open .app aside { border-bottom: 1px solid var(--line); }
  .layout { padding: 24px 16px 40px; }
  .topbar { padding-inline: 14px; }
  .saved { max-width: 43%; }
  .planning-card { padding: 14px; }
  .planning-identity { flex-basis: 100%; }
  .reader-tabs label { width: 100%; margin-top: 8px; margin-left: 0; }
  .reader-tabs select { max-width: calc(100vw - 125px); }
  .error-document-frame { height: 72vh; height: 72dvh; }
  .html-reader-caption { padding: 10px 12px; }
  .error-catalog-row { flex-wrap: wrap; padding: 14px; gap: 10px; }
  .error-catalog-row button { width: 100%; }
  .html-reader-empty { padding: 48px 14px; }
}
@media print {
  #studySidebar, .topbar, .error-notebook-actions, .reader-tabs { display: none; }
}
.notebook-readings { flex: 1 1 100%; padding: 14px 16px; border: 1px solid var(--border, #dce5ef); border-radius: 12px; background: var(--surface, #fff); display: grid; gap: 8px; min-width: 0; }
.notebook-readings > label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.notebook-readings input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: #326fa8; }
.notebook-readings > span, .notebook-readings li { font-size: 13px; color: #536780; }
.notebook-readings summary { cursor: pointer; }
.notebook-readings form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin: 12px 0; }
.notebook-readings form label { display: grid; gap: 5px; }
.notebook-readings ol { max-height: 240px; overflow: auto; padding-left: 22px; }
