/* Define o sistema visual e os layouts responsivos da aplicação Koban Hub. */

:root {
  --navy-deep: #031626;
  --navy: #061d30;
  --navy-panel: #08243a;
  --navy-soft: #0c2c44;
  --cream: #f2f0df;
  --cream-soft: #d5d4c8;
  --muted: #91a0aa;
  --line: rgba(242, 240, 223, .13);
  --line-strong: rgba(242, 240, 223, .28);
  --blue: #4d80ef;
  --cyan: #40b5ed;
  --violet: #8258e9;
  --red: #f05b61;
  --green: #78d050;
  --amber: #edb958;
  --rail-width: 88px;
  --rail-expanded: 238px;
  --top-height: 102px;
}

.schedule-repeat-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 2px solid var(--cyan);
  color: var(--muted);
  background: rgba(55, 189, 241, .045);
  border-radius: 0 10px 10px 0;
  font-size: .88rem;
}

.schedule-input-details { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; }
.schedule-input-details summary { padding: 13px 15px; cursor: pointer; color: var(--cream-soft); font-size: .86rem; }
.schedule-input-details summary small { margin-left: 8px; color: var(--cyan); font-size: .72rem; }
.schedule-input-details dl { margin: 0; padding: 0 15px 14px; display: grid; gap: 9px; }
.schedule-input-details dl div { padding-top: 9px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 170px 1fr; gap: 16px; }
.schedule-input-details dt { color: var(--muted); font-size: .72rem; font-weight: 500; }
.schedule-input-details dd { margin: 0; color: var(--cream-soft); font-size: .78rem; line-height: 1.55; }

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--navy-deep); }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow-x: hidden; background: radial-gradient(circle at 18% 0%, #09283f 0, var(--navy-deep) 36%); color: var(--cream); font-family: "Poppins", system-ui, sans-serif; font-size: 15px; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; }
.side-rail { position: fixed; z-index: 1040; inset: 0 auto 0 0; width: var(--rail-width); padding: 24px 16px; overflow: hidden; display: flex; flex-direction: column; align-items: stretch; background: rgba(3, 22, 38, .96); border-right: 1px solid rgba(255,255,255,.025); box-shadow: 10px 0 40px transparent; backdrop-filter: blur(18px); transition: width .24s ease, box-shadow .24s ease; }
.side-rail:hover { width: var(--rail-expanded); box-shadow: 18px 0 50px rgba(0,0,0,.2); }
.logo-button, .rail-button { width: 100%; height: 54px; padding: 0; border: 0; display: flex; align-items: center; justify-content: flex-start; background: transparent; color: var(--cream); }
.logo-button { margin-bottom: 35px; font-size: 2.75rem; }
.logo-button i { filter: drop-shadow(0 0 16px rgba(242,240,223,.12)); }
.rail-primary, .rail-footer { display: flex; flex-direction: column; gap: 9px; }
.rail-button { border-radius: 16px; color: var(--cream-soft); font-size: 1.65rem; transition: .18s ease; }
.rail-button i { width: 54px; flex: 0 0 54px; text-align: center; }
.rail-label { max-width: 0; overflow: hidden; opacity: 0; color: var(--cream-soft); font-size: .72rem; font-weight: 400; white-space: nowrap; transform: translateX(-5px); transition: max-width .24s ease, opacity .15s ease, transform .24s ease; }
.brand-label { color: var(--cream); font-size: .68rem; font-weight: 600; letter-spacing: .15em; }
.side-rail:hover .rail-label { max-width: 145px; opacity: 1; transform: none; transition-delay: .05s; }
.rail-button:hover { background: rgba(255,255,255,.055); color: white; transform: translateY(-1px); }
.rail-footer { margin-top: auto; }
.rail-section-label { margin: 15px 0 4px 17px; color: var(--muted); font-size: .46rem; font-weight: 600; letter-spacing: .1em; }
.rail-recent-chats { min-height: 0; display: grid; gap: 3px; }
.rail-recent-chats > button { width: 100%; min-height: 37px; padding: 0; overflow: hidden; border: 0; border-radius: 11px; display: flex; align-items: center; background: transparent; color: var(--cream-soft); text-align: left; }
.rail-recent-chats > button:hover { background: rgba(255,255,255,.045); }
.rail-recent-chats > button > span { width: 6px; height: 6px; margin: 0 24px; flex: 0 0 auto; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px rgba(64,181,237,.07); }
.rail-recent-chats b { overflow: hidden; font-size: .58rem; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.rail-recent-chats > small { margin: 7px 17px; color: var(--muted); font-size: .52rem; }

.app-main { width: calc(100% - var(--rail-width)); min-width: 0; min-height: 100vh; margin-left: var(--rail-width); }
.top-navigation { height: var(--top-height); padding: 0 31px 0 24px; display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.top-tabs { height: 100%; display: flex; align-items: end; gap: 8px; }
.top-tab { height: 66px; min-width: 190px; padding: 0 26px; border: 0; border-radius: 30px 30px 0 0; position: relative; background: rgba(8, 36, 58, .68); color: var(--cream-soft); font-size: 1.06rem; transition: .18s; }
.top-tab i { margin-right: 10px; font-size: 1.3rem; }
.top-tab:hover, .top-tab.active { background: var(--navy-panel); color: var(--cream); }
.top-tab.active { z-index: 2; }
.top-tab.active::after { content: ""; position: absolute; right: 0; bottom: -5px; left: 0; height: 7px; background: var(--navy-panel); }
.top-tab:focus-visible { outline: 0; box-shadow: inset 0 0 0 1px rgba(242,240,223,.28); }
.account-area { height: 66px; display: flex; align-items: center; gap: 10px; }
.connection-pill { min-height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); }
.connection-pill > span { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.connection-pill.connected > span { background: var(--green); }.connection-pill.disconnected > span { background: var(--red); }
.connection-pill small { font-size: .62rem; }
.account-button { height: 44px; padding: 4px 10px 4px 4px; border: 0; display: flex; align-items: center; gap: 8px; background: transparent; }
.account-button > span { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--cream); color: var(--navy); font-size: .72rem; font-weight: 600; }
.account-button small { color: var(--cream-soft); }
.mobile-menu { display: none; }

.workspace-panel { width: 100%; min-width: 0; min-height: calc(100vh - var(--top-height)); overflow: hidden; border-radius: 0 34px 0 0; background: var(--navy-panel); box-shadow: 0 -20px 80px rgba(0,0,0,.08); }
.route { display: none; min-height: calc(100vh - var(--top-height)); animation: routeIn .24s ease both; }
.route.active { display: block; }
body.chat-route-active { height: 100vh; height: 100dvh; overflow: hidden; }
body.chat-route-active .app-shell, body.chat-route-active .app-main { height: 100%; min-height: 0; }
body.chat-route-active .app-main { display: flex; flex-direction: column; }
body.chat-route-active .top-navigation { flex: 0 0 var(--top-height); }
body.chat-route-active .workspace-panel { min-height: 0; flex: 1 1 auto; }
#route-chat.active { height: 100%; min-height: 0; overflow: hidden; }
@keyframes routeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.dashboard-header { padding: 55px 72px 18px; }
.dashboard-header h1 { margin: 0; font-size: clamp(2.1rem, 3.4vw, 3.35rem); font-weight: 300; letter-spacing: -.035em; }
.dashboard-header p { margin: 8px 0 0; color: var(--muted); font-size: .8rem; text-transform: capitalize; }
.overview-grid { padding: 18px 72px 60px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .65fr); gap: 35px 65px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 15px; }
.section-heading p, .quick-section > p { margin: 0 0 6px; color: var(--cyan); font-size: .62rem; font-weight: 600; letter-spacing: .12em; }
.section-heading h2 { margin: 0; font-size: 1.25rem; font-weight: 400; }
.text-action { padding: 0; border: 0; background: transparent; color: var(--cyan); font-size: .7rem; }
.today-list { min-height: 210px; margin-top: 22px; display: flex; flex-direction: column; gap: 9px; }
.today-empty { min-height: 165px; display: grid; place-items: center; color: var(--muted); font-size: .78rem; border: 1px dashed var(--line); border-radius: 18px; }
.today-item { min-height: 49px; padding: 8px 12px; display: flex; align-items: center; gap: 12px; border-radius: 12px; transition: .15s; }
.today-item:hover { background: rgba(255,255,255,.025); }
.today-item input { appearance: none; width: 16px; height: 16px; border: 1.5px solid var(--event-color); border-radius: 50%; cursor: pointer; }
.today-item input:checked { background: var(--event-color); box-shadow: inset 0 0 0 3px var(--navy-panel); }
.today-item div { flex: 1; display: flex; flex-direction: column; }
.today-item strong { font-size: .83rem; font-weight: 400; }
.today-item small { color: var(--muted); font-size: .63rem; }
.today-item.completed strong { text-decoration: line-through; opacity: .45; }

.mini-calendar-section { align-self: start; padding: 20px; border: 1px solid var(--line); border-radius: 20px; }
.mini-calendar-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mini-calendar-top button, .calendar-controls button { border: 0; background: transparent; color: var(--cream-soft); }
.mini-calendar-top strong { font-size: .9rem; font-weight: 500; text-transform: capitalize; }
.mini-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.mini-calendar span, .mini-calendar button { aspect-ratio: 1; border: 0; border-radius: 8px; display: grid; place-items: center; background: transparent; color: var(--cream-soft); font-size: .66rem; }
.mini-calendar .weekday { aspect-ratio: auto; color: var(--muted); font-size: .53rem; font-weight: 600; }
.mini-calendar .outside { opacity: .25; }.mini-calendar .today { background: var(--cream); color: var(--navy); font-weight: 600; }
.mini-calendar .has-event { position: relative; }.mini-calendar .has-event::after { content: ""; position: absolute; bottom: 2px; width: 3px; height: 3px; border-radius: 50%; background: var(--cyan); }

.weekly-section { min-width: 0; }
.quick-section { display: flex; flex-direction: column; gap: 11px; align-self: end; }
.quick-section > button { min-height: 68px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 15px; display: flex; flex-direction: column; justify-content: center; background: rgba(255,255,255,.02); text-align: left; }
.quick-section > button:hover { border-color: var(--line-strong); background: rgba(255,255,255,.045); }
.quick-section span { font-size: .83rem; }.quick-section small { color: var(--muted); font-size: .63rem; }

.agenda-layout { min-height: 700px; padding: 52px 60px 38px; display: grid; grid-template-columns: minmax(560px, 1.25fr) minmax(260px, .55fr); gap: 70px; }
.calendar-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.calendar-title-row > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 150px; }
.calendar-title-row h1 { margin: 0; font-size: 2.65rem; font-weight: 600; text-transform: capitalize; }
.calendar-title-row strong { font-size: 2rem; }
.calendar-controls { display: flex; align-items: center; gap: 7px; }
.calendar-controls button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; font-size: .68rem; }
.large-calendar { display: grid; grid-template-columns: repeat(7, 1fr); overflow: hidden; border: 2px solid var(--cream-soft); border-radius: 32px; }
.large-calendar .calendar-weekday { padding: 11px 4px; text-align: center; background: var(--cream-soft); color: var(--navy); font-size: .7rem; font-weight: 700; }
.large-calendar .calendar-day { min-height: 91px; padding: 10px; border: 0; position: relative; background: transparent; color: var(--cream); text-align: left; font-size: 1.05rem; font-weight: 600; }
.large-calendar .calendar-day:hover { background: rgba(255,255,255,.035); }.large-calendar .outside { opacity: .2; }.large-calendar .selected { background: rgba(77,128,239,.12); }.large-calendar .today .day-number { width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; background: var(--cream); color: var(--navy); }
.day-dots { position: absolute; right: 10px; bottom: 8px; display: flex; gap: 4px; }.day-dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--event-color); }
.agenda-actions { padding-top: 285px; display: flex; flex-direction: column; gap: 18px; }
.cream-button, .outline-button, .send-button, .danger-button { min-height: 43px; padding: 0 17px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: .72rem; font-weight: 500; transition: .15s; }
.cream-button { border: 0; background: var(--cream); color: var(--navy); }.cream-button:hover { background: white; transform: translateY(-1px); }
.outline-button { border: 1px solid var(--line-strong); background: transparent; color: var(--cream-soft); }.outline-button:hover { color: var(--cream); background: rgba(255,255,255,.04); }
.danger { color: #ff9699; }.danger-button { border: 0; background: var(--red); color: var(--navy); }
.selected-day-card { margin-top: 10px; padding: 20px 0 0; border-top: 1px solid var(--line); }
.selected-day-card > p { margin: 0 0 5px; color: var(--cyan); font-size: .58rem; letter-spacing: .12em; }.selected-day-card h2 { font-size: 1.2rem; font-weight: 400; text-transform: capitalize; }
.selected-event { padding: 9px 0; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); }.selected-event span { width: 7px; height: 7px; border-radius: 50%; background: var(--event-color); }.selected-event div { flex: 1; display: flex; flex-direction: column; }.selected-event strong { font-size: .7rem; font-weight: 400; }.selected-event small { color: var(--muted); font-size: .59rem; }.selected-event button { border: 0; background: transparent; color: var(--muted); font-size: .58rem; }
.selected-events-empty { color: var(--muted); font-size: .67rem; }
.generated-plans { padding: 0 60px 60px; display: grid; gap: 14px; }
.schedule-card { border: 1px solid var(--line); border-radius: 19px; background: rgba(255,255,255,.018); overflow: hidden; }.schedule-card-header { padding: 20px 23px; display: flex; justify-content: space-between; gap: 15px; }.schedule-card-header h2 { margin: 0; font-size: 1.05rem; font-weight: 400; }.schedule-card-header small { color: var(--muted); font-size: .61rem; }.schedule-card-actions { display: flex; gap: 7px; }.schedule-content { padding: 18px 24px 28px; border-top: 1px solid var(--line); color: var(--cream-soft); font-size: .76rem; line-height: 1.65; }.schedule-content h2 { margin: 22px 0 8px; color: var(--cream); font-size: 1rem; }.schedule-content li { margin-bottom: 6px; }.schedule-pending { padding: 22px; color: var(--muted); font-size: .72rem; }

.folders-toolbar { padding: 55px 55px 25px; display: flex; align-items: center; justify-content: space-between; gap: 25px; }.folders-toolbar > div { display: flex; gap: 9px; }
.folder-search { width: min(340px, 100%); min-height: 43px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; display: flex; align-items: center; gap: 9px; color: var(--muted); }.folder-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--cream); font-size: .72rem; }.folder-search input::placeholder { color: var(--muted); }
.folder-grid { padding: 24px 55px 65px; display: grid; grid-template-columns: repeat(4, minmax(190px, 1fr)); gap: 42px 45px; }
.folder-view-heading { grid-column: 1 / -1; min-height: 56px; display: flex; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); }
.folder-view-heading h2 { margin: 0; font-size: 1.25rem; font-weight: 400; }
.folder-view-heading small { color: var(--muted); font-size: .63rem; }
.folder-empty { grid-column: 1 / -1; min-height: 370px; display: grid; place-items: center; color: var(--muted); text-align: center; }.folder-empty div { max-width: 380px; }.folder-empty h2 { margin: 0 0 7px; color: var(--cream); font-size: 1.3rem; font-weight: 400; }.folder-empty p { font-size: .74rem; line-height: 1.6; }
.folder-card, .chat-tile { min-height: 215px; padding: 0; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: transparent; color: var(--cream); position: relative; }
.folder-shape { width: 172px; height: 132px; margin-bottom: 14px; border-radius: 7px 17px 17px 17px; background: var(--cream); position: relative; transition: .18s; }.folder-shape::before { content: ""; position: absolute; left: 0; top: -17px; width: 72px; height: 24px; border-radius: 9px 12px 0 0; background: var(--cream); }.folder-card:hover .folder-shape { transform: translateY(-5px); box-shadow: 0 18px 35px rgba(0,0,0,.15); }.folder-card > span, .chat-tile > span { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }.folder-card > small, .chat-tile > small { color: var(--muted); font-size: .62rem; }
.chat-symbol { width: 132px; height: 132px; margin-bottom: 14px; display: grid; place-items: center; color: var(--cream); font-size: 4.2rem; transition: .18s; }.chat-tile:hover .chat-symbol { transform: translateY(-5px); }.tile-menu { position: absolute; top: 8px; right: 10px; border: 0; background: transparent; color: var(--muted); }

.chat-layout { height: 100%; min-height: 0; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 290px; }
.chat-main { height: 100%; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }.chat-heading { min-height: 110px; padding: 24px 40px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }.chat-heading h1 { max-width: 650px; margin: 4px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.7rem; font-weight: 300; }.chat-heading > div:last-child { display: flex; gap: 8px; }.chat-back { padding: 0; border: 0; background: transparent; color: var(--cyan); font-size: .66rem; }.chat-back i { margin-right: 5px; }
.message-stream { width: 100%; max-width: 1040px; min-height: 0; padding: 32px 35px 26px; margin: 0 auto; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; flex: 1 1 auto; }.message-stream.empty { display: grid; place-items: center; }.new-conversation-copy { margin-top: -50px; text-align: center; }.new-conversation-copy h2 { margin: 0 0 8px; font-size: 1.45rem; font-weight: 300; }.new-conversation-copy p { margin: 0; color: var(--muted); font-size: .74rem; }
.message { margin-bottom: 28px; display: grid; grid-template-columns: 75px minmax(0,1fr); gap: 18px; }.message > div { min-width: 0; }.message.user > div { padding: 14px 17px 9px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }.message.assistant > div { padding-left: 18px; border-left: 2px solid rgba(94,201,219,.34); }.message-role { padding-top: 3px; color: var(--cyan); font-size: .58rem; font-weight: 600; letter-spacing: .08em; }.message-body { color: var(--cream-soft); font-size: .8rem; line-height: 1.68; }.message.user .message-body { color: var(--cream); }.message-body p { margin: 0 0 10px; }.message-body h2, .message-body h3 { margin: 20px 0 8px; color: var(--cream); font-size: 1rem; }.message-meta { margin-top: 8px; color: var(--muted); font-size: .55rem; }.message-evidence { margin: 18px 0 5px; padding-top: 13px; border-top: 1px solid var(--line); }.answer-provider { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .58rem; }.answer-sources { margin-top: 10px; }.answer-sources summary { width: max-content; cursor: pointer; color: var(--cyan); font-size: .63rem; list-style: none; }.answer-sources summary::-webkit-details-marker { display: none; }.answer-sources summary i { margin-right: 5px; }.answer-sources ol { margin: 12px 0 0; padding: 0; display: grid; gap: 8px; list-style: none; }.answer-sources li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); }.answer-sources a { display: grid; gap: 3px; color: var(--cream-soft); text-decoration: none; }.answer-sources a:hover strong { color: var(--cyan); }.answer-sources strong { overflow: hidden; text-overflow: ellipsis; font-size: .65rem; font-weight: 500; transition: color .2s; }.answer-sources small { color: var(--muted); font-size: .54rem; }.answer-sources p { margin: 7px 0 0; color: var(--muted); font-size: .59rem; line-height: 1.45; }.typing-line { display: inline-flex; gap: 4px; }.typing-line span { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: typing 1.1s infinite; }.typing-line span:nth-child(2){animation-delay:.15s}.typing-line span:nth-child(3){animation-delay:.3s}@keyframes typing{50%{transform:translateY(-4px);opacity:.4}}
.chat-composer-wrap { width: calc(100% - 40px); max-width: 1020px; margin: 0 auto; padding: 14px 0 max(14px, env(safe-area-inset-bottom)); position: relative; z-index: 5; flex: 0 0 auto; background: linear-gradient(to bottom, transparent, var(--navy-panel) 18%); }.chat-answer-controls { min-height: 34px; margin-bottom: 7px; padding: 0 4px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }.research-mode-control { display: inline-flex; align-items: center; gap: 7px; color: var(--cream-soft); font-size: .6rem; }.research-mode-control i { color: var(--cyan); }.research-mode-control select { min-height: 30px; padding: 0 28px 0 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--navy-soft); color: var(--cream); font-size: .6rem; outline: none; }.chat-answer-controls small { max-width: 410px; color: var(--muted); font-size: .55rem; text-align: right; }.chat-composer { padding: 13px; border: 1px solid var(--line-strong); border-radius: 19px; background: var(--navy-soft); }.chat-composer textarea { width: 100%; min-height: 51px; max-height: 170px; padding: 6px; resize: none; border: 0; outline: 0; background: transparent; color: var(--cream); font-size: .78rem; }.chat-composer textarea::placeholder { color: var(--muted); }.chat-composer > div { display: flex; justify-content: space-between; gap: 8px; }.attach-button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--cream-soft); font-size: .65rem; }.attach-button i { margin-right: 6px; }.send-button { min-height: 34px; border: 0; background: var(--cream); color: var(--navy); }.chat-composer-wrap > small { display: block; margin-top: 6px; color: var(--muted); font-size: .55rem; text-align: center; }
.pending-source { margin: 0 10px -1px; padding: 10px; border: 1px solid var(--line); border-radius: 12px 12px 0 0; background: var(--navy-soft); }.pending-source-row { display: flex; justify-content: space-between; }.pending-source-row div { display: flex; flex-direction: column; }.pending-source-row strong { font-size: .7rem; }.pending-source-row small { color: var(--muted); font-size: .58rem; }.pending-source-row button { border: 0; background: transparent; color: var(--red); font-size: .6rem; }
.sources-panel { min-height: 0; padding: 27px 20px; overflow-y: auto; border-left: 1px solid var(--line); background: rgba(3,22,38,.28); }.sources-panel > div:first-child { display: flex; justify-content: space-between; align-items: center; }.sources-panel > div:first-child p { margin: 0; color: var(--cyan); font-size: .6rem; letter-spacing: .1em; }.sources-panel > div:first-child button { border: 0; background: transparent; color: var(--cream-soft); font-size: .63rem; }.source-empty { padding: 28px 0; color: var(--muted); font-size: .66rem; line-height: 1.5; }.source-card { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }.source-card-top { display: flex; justify-content: space-between; gap: 8px; }.source-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .68rem; font-weight: 400; }.source-card button { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: .56rem; }.source-card small { color: var(--muted); font-size: .56rem; }.source-status { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--cyan); font-size: .56rem; }.source-status.ready{color:var(--green)}.source-status.error{color:var(--red)}.sources-explanation { margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: .61rem; line-height: 1.55; }

.settings-page { width: min(980px, calc(100% - 70px)); margin: 0 auto; padding: 50px 0; }.settings-heading h1 { margin: 14px 0 3px; font-size: 2.2rem; font-weight: 300; }.settings-heading > p { color: var(--muted); }.settings-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; margin-top: 28px; }.settings-card { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.018); }.settings-card > p:first-child { margin: 0 0 4px; color: var(--cyan); font-size: .58rem; letter-spacing: .11em; }.settings-card h2 { font-size: 1.3rem; font-weight: 400; }.settings-status { margin: 18px 0; padding: 15px 0; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }.settings-status > span { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }.settings-status > span.connected{background:var(--green)}.settings-status > span.disconnected{background:var(--red)}.settings-status div { display: flex; flex-direction: column; }.settings-status strong { font-size: .72rem; font-weight: 400; }.settings-status small { color: var(--muted); font-size: .6rem; }.settings-card dl > div { padding: 10px 0; display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }.settings-card dt, .settings-card dd { margin: 0; font-size: .64rem; }.settings-card dt { color: var(--muted); font-weight: 400; }.settings-copy { color: var(--muted); font-size: .7rem; line-height: 1.6; }.token-help { margin: 18px 0; padding: 15px; border-radius: 13px; background: rgba(64,181,237,.06); }.token-help strong { font-size: .7rem; }.token-help ol { padding-left: 18px; color: var(--muted); font-size: .63rem; line-height: 1.7; }.token-help a { color: var(--cyan); font-size: .66rem; }.token-help code { color: var(--cream); }.settings-card .outline-button { margin: 6px 6px 0 0; }

.modal-content { border: 1px solid var(--line-strong); border-radius: 21px; background: var(--navy-soft); color: var(--cream); box-shadow: 0 30px 90px rgba(0,0,0,.35); }.compact-modal { padding: 24px; }.modal-heading, .planner-modal-top { display: flex; align-items: start; justify-content: space-between; gap: 20px; }.modal-heading p, .planner-modal-top p { margin: 0 0 4px; color: var(--cyan); font-size: .57rem; letter-spacing: .11em; }.modal-heading h2, .planner-modal-top h2 { margin: 0; font-size: 1.4rem; font-weight: 400; }.modal-heading > button, .planner-modal-top > button { border: 0; background: transparent; color: var(--muted); font-size: .63rem; }
.form-field { display: flex; flex-direction: column; gap: 7px; margin-top: 17px; }.form-field > span { color: var(--cream-soft); font-size: .68rem; }.form-field input, .form-field textarea, .form-field select { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: var(--navy-panel); color: var(--cream); font-size: .72rem; }.form-field textarea { resize: vertical; }.form-field input::placeholder, .form-field textarea::placeholder { color: var(--muted); }.form-field select option { background: var(--navy-panel); }.form-columns, .wizard-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }.modal-actions { margin-top: 24px; display: flex; justify-content: end; gap: 8px; }
.planner-modal-content { min-height: min(760px, 89vh); padding: 27px 30px 20px; }.wizard-progress { margin-top: 24px; display: grid; grid-template-columns: repeat(5,1fr); border-bottom: 1px solid var(--line); }.wizard-progress span { padding: 11px; position: relative; color: var(--muted); font-size: .62rem; text-align: center; }.wizard-progress span::after { content:""; position:absolute; right:0; bottom:-1px; left:0; height:2px; background:transparent; }.wizard-progress span.active { color: var(--cream); }.wizard-progress span.active::after { background: var(--cyan); }#plannerForm { min-height: 555px; display: flex; flex-direction: column; }.wizard-body { padding: 29px 2px 18px; flex: 1; }.wizard-step { display: none; padding: 0; border: 0; }.wizard-step.active { display: block; }.wizard-step legend { float: none; width: auto; margin: 0; font-size: 1.35rem; }.wizard-step > p { margin: 5px 0 20px; color: var(--muted); font-size: .67rem; }.wizard-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }.wizard-grid .form-field { margin-top: 0; }.full { grid-column: 1/-1; }.choice-grid { display:grid; gap:8px; }.days-grid { grid-template-columns:repeat(7,1fr); }.methods-grid { grid-template-columns:repeat(3,1fr); }.choice-grid label { position:relative; }.choice-grid input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }.choice-grid span { min-height:42px; padding:7px; border:1px solid var(--line); border-radius:10px; display:grid; place-items:center; color:var(--muted); font-size:.64rem; text-align:center; cursor:pointer; }.choice-grid input:checked+span { border-color:var(--cyan); background:rgba(64,181,237,.1); color:var(--cream); }.review-summary { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }.review-item { padding:13px; border:1px solid var(--line); border-radius:10px; background:var(--navy-panel); }.review-item.wide { grid-column:1/-1; }.review-item span { display:block; margin-bottom:5px; color:var(--cyan); font-size:.55rem; letter-spacing:.08em; }.review-item p { margin:0; color:var(--cream-soft); font-size:.66rem; line-height:1.5; white-space:pre-line; }.consent-line { margin-top:16px; display:flex; gap:9px; color:var(--muted); font-size:.65rem; }.consent-line input { accent-color:var(--cyan); }.wizard-footer { min-height:62px; padding-top:15px; display:flex; align-items:center; justify-content:space-between; border-top:1px solid var(--line); }.wizard-footer>span { color:var(--muted); font-size:.6rem; }.wizard-footer>div { display:flex; gap:8px; }.confirm-modal { padding:24px; }.confirm-modal h2 { font-size:1.25rem; font-weight:400; }.confirm-modal p { color:var(--muted); font-size:.68rem; line-height:1.55; }.confirm-modal>div { display:flex; justify-content:end; gap:8px; }.toast { border:1px solid var(--line-strong); background:var(--navy-soft); color:var(--cream); }.toast-body { font-size:.7rem; }
.rail-backdrop { display:none; }

/* Produto v3: componentes de estudo e estados reais */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(330px,.78fr) minmax(520px,1.22fr); background: radial-gradient(circle at 12% 15%, #0a2b43 0, var(--navy-deep) 44%); }
.login-brand { min-height: 100vh; padding: 58px 6vw; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); }
.login-brand-mark { width: 82px; height: 82px; display: grid; place-items: center; }
.login-brand-mark img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: screen; }
.login-brand-copy span { color: var(--cream); font-size: .73rem; font-weight: 600; letter-spacing: .18em; }
.login-brand-copy p { max-width: 390px; margin: 13px 0 0; color: var(--cream-soft); font-size: clamp(1.6rem,3vw,2.8rem); font-weight: 300; line-height: 1.25; letter-spacing: -.035em; }
.login-panel { min-height: 100vh; padding: 45px; display: grid; place-items: center; }
.login-card { width: min(440px,100%); padding: 38px; border: 1px solid var(--line); border-radius: 25px; background: rgba(8,36,58,.7); box-shadow: 0 30px 90px rgba(0,0,0,.18); backdrop-filter: blur(14px); }
.login-heading > p { margin: 0 0 8px; color: var(--cyan); font-size: .57rem; font-weight: 600; letter-spacing: .13em; }
.login-heading h1 { margin: 0 0 9px; color: var(--cream); font-size: 2rem; font-weight: 300; letter-spacing: -.03em; }
.login-heading > span { color: var(--muted); font-size: .68rem; line-height: 1.6; }
.auth-mode-tabs { margin-bottom: 26px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; display: grid; grid-template-columns: 1fr 1fr; background: rgba(3,22,38,.25); }
.auth-mode-tabs button { min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: .66rem; }
.auth-mode-tabs button.active { background: var(--navy-soft); color: var(--cream); box-shadow: inset 0 0 0 1px var(--line); }
.login-card form { margin-top: 26px; }
.password-field { min-height: 43px; border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; background: var(--navy-panel); }
.password-field:focus-within { outline: 2px solid var(--cyan); outline-offset: 2px; }
.password-field input { min-width: 0; border: 0; background: transparent; }
.password-field input:focus-visible { outline: 0; }
.password-field button { padding: 0 12px; border: 0; background: transparent; color: var(--cyan); font-size: .6rem; }
.login-options { margin: 15px 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.login-options label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .61rem; }
.login-options input { accent-color: var(--cyan); }
.login-options button { padding: 0; border: 0; background: transparent; color: var(--cream-soft); font-size: .61rem; }
.login-options button:hover { color: var(--cyan); }
.login-error { margin: -5px 0 15px; padding: 10px 12px; border: 1px solid rgba(240,91,97,.25); border-radius: 9px; background: rgba(240,91,97,.06); color: #ffb1b4; font-size: .61rem; line-height: 1.5; }
.login-message { margin: -5px 0 15px; padding: 10px 12px; border: 1px solid rgba(120,208,80,.25); border-radius: 9px; background: rgba(120,208,80,.06); color: #bdeca8; font-size: .61rem; line-height: 1.5; }
.login-submit { width: 100%; }
.login-submit:disabled { opacity: .55; transform: none; }
.login-support { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .58rem; line-height: 1.55; text-align: center; }
.wordmark-small { width: 54px; height: 54px; flex: 0 0 54px; display: grid; place-items: center; }
.wordmark-small img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: screen; }
.empty-copy { min-height: 145px; padding: 30px; border: 1px dashed var(--line); border-radius: 16px; display: grid; place-items: center; color: var(--muted); text-align: center; }
.empty-copy.compact { min-height: 120px; padding: 18px; }
.empty-copy h3 { margin: 0 0 6px; color: var(--cream); font-size: 1rem; font-weight: 400; }
.empty-copy p { margin: 0; font-size: .68rem; line-height: 1.55; }
.today-item > span:first-child { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--event-color); }
.metric-strip { margin-top: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.metric-strip > div { min-height: 70px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; display: flex; flex-direction: column; justify-content: center; }
.metric-strip strong { font-size: 1.02rem; font-weight: 500; }
.metric-strip small { color: var(--muted); font-size: .56rem; }

.large-calendar .large-weekday { padding: 10px 4px; border-bottom: 1px solid var(--line-strong); display: block; color: var(--muted); font-size: .59rem; font-weight: 600; text-align: center; }
.day-events { position: absolute; right: 7px; bottom: 7px; left: 7px; display: flex; flex-direction: column; gap: 3px; }
.day-events > span { max-width: 100%; padding: 2px 5px; overflow: hidden; border-left: 3px solid var(--event-color); border-radius: 3px; background: color-mix(in srgb, var(--event-color) 16%, transparent); color: var(--cream-soft); font-size: .48rem; font-weight: 400; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.event-inline-actions { flex: 0 0 auto !important; flex-direction: row !important; gap: 3px; }
.selected-event.completed strong { opacity: .55; text-decoration: line-through; }
.schedule-section { padding-top: 15px; border-top: 1px solid var(--line); }
.schedule-section > .section-heading { padding: 0 60px 20px; }
.schedule-state { display: inline-block; margin-bottom: 6px; color: var(--cyan); font-size: .55rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.schedule-state.accepted { color: var(--green); }
.schedule-state.error { color: var(--red); }
.schedule-assumptions { margin: 18px 0; padding: 14px; border-radius: 12px; background: rgba(255,255,255,.025); }
.schedule-assumptions strong { color: var(--cream); font-size: .68rem; }
.schedule-assumptions ul { margin: 8px 0 0; padding-left: 18px; }
.proposal-events { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.proposal-event { padding: 11px; border: 1px solid var(--line); border-radius: 11px; display: flex; gap: 9px; }
.proposal-event > span { width: 7px; height: 7px; margin-top: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--event-color); }
.proposal-event > div { min-width: 0; }
.proposal-event strong { display: block; color: var(--cream); font-size: .68rem; font-weight: 400; }
.proposal-event small { display: block; color: var(--muted); font-size: .55rem; }
.proposal-event p { margin: 5px 0 0; color: var(--cream-soft); font-size: .58rem; line-height: 1.45; }
.schedule-decision { padding: 20px 24px; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(210px,.42fr) minmax(0,1fr); gap: 25px; align-items: end; background: rgba(64,181,237,.025); }
.schedule-decision form { display: flex; align-items: end; gap: 10px; }
.schedule-decision .form-field { margin: 0; flex: 1; }
.schedule-decision textarea { min-height: 76px; }
.folder-suggestion { padding: 20px 24px; border-top: 1px solid var(--line); }
.folder-suggestion strong { font-size: .76rem; font-weight: 400; }
.folder-suggestion p { margin: 4px 0 12px; color: var(--muted); font-size: .62rem; }
.subject-checks { margin-bottom: 13px; display: flex; flex-wrap: wrap; gap: 7px; }
.subject-checks label { position: relative; }
.subject-checks input { position: absolute; opacity: 0; }
.subject-checks span { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; display: inline-flex; align-items: center; color: var(--muted); font-size: .62rem; cursor: pointer; }
.subject-checks input:checked + span { border-color: var(--cyan); background: rgba(64,181,237,.08); color: var(--cream); }
.folder-suggestion .text-action { margin-left: 10px; }

.folder-breadcrumbs { min-height: 34px; padding: 0 55px; display: flex; align-items: center; gap: 8px; }
.folder-breadcrumbs button { padding: 0; border: 0; background: transparent; color: var(--cream-soft); font-size: .66rem; }
.folder-breadcrumbs span { color: var(--muted); font-size: .6rem; }
.folder-shape, .folder-shape::before { background: color-mix(in srgb, var(--folder-color) 17%, var(--cream)); }
.folder-shape { box-shadow: inset 0 4px 0 color-mix(in srgb, var(--folder-color) 76%, transparent); }
.chat-symbol { width: 122px; height: 122px; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 1.2rem; font-weight: 500; letter-spacing: .08em; }
.folder-color-picker { display: flex; gap: 11px; }
.folder-color-picker label { position: relative; }
.folder-color-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.folder-color-picker span { width: 34px; height: 34px; border: 5px solid var(--navy-soft); border-radius: 50%; display: block; background: var(--swatch); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.folder-color-picker input:checked + span { box-shadow: 0 0 0 2px var(--cream); }

.composer-actions { justify-content: flex-end !important; }
.voice-button.recording { border-color: var(--red); color: #ffb4b7; background: rgba(240,91,97,.08); }
.source-warning { display: block; margin-top: 5px; color: var(--amber) !important; }

.study-page { width: 100%; min-width: 0; padding: 52px 55px 65px; overflow: hidden; }
.study-heading p { margin: 0 0 5px; color: var(--cyan); font-size: .59rem; font-weight: 600; letter-spacing: .11em; }
.study-heading h1 { margin: 0 0 7px; font-size: 2.25rem; font-weight: 300; }
.study-heading span { color: var(--muted); font-size: .7rem; }
.study-controls { margin: 29px 0; padding: 18px; border: 1px solid var(--line); border-radius: 17px; display: grid; grid-template-columns: minmax(250px, 1fr) 160px auto; align-items: end; gap: 14px; }
.study-controls .form-field { margin: 0; }
.study-generate-actions { display: flex; gap: 7px; }
.study-layout { width: 100%; min-width: 0; min-height: 520px; display: grid; grid-template-columns: minmax(240px,285px) minmax(0,1fr); gap: 18px; overflow: hidden; }
.study-layout > * { min-width: 0; max-width: 100%; }
.artifact-list-panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 17px; }
.artifact-list-panel #artifactList { width: 100%; min-width: 0; margin-top: 15px; display: grid; gap: 7px; }
.artifact-list-item { width: 100%; min-width: 0; max-width: 100%; padding: 12px; overflow: hidden; border: 1px solid transparent; border-radius: 11px; display: flex; flex-direction: column; background: transparent; text-align: left; }
.artifact-list-item:hover, .artifact-list-item.active { border-color: var(--line); background: rgba(255,255,255,.035); }
.artifact-list-item > span { color: var(--cyan); font-size: .52rem; letter-spacing: .08em; }
.artifact-list-item strong { max-width: 100%; margin: 3px 0; overflow: hidden; color: var(--cream); font-size: .7rem; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.artifact-list-item small { max-width: 100%; overflow: hidden; color: var(--muted); font-size: .54rem; text-overflow: ellipsis; white-space: nowrap; }
.artifact-workspace { width: 100%; min-width: 0; max-width: 100%; padding: 25px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.014); }
.artifact-empty { min-height: 460px; display: grid; place-items: center; text-align: center; }
.artifact-empty > div { width: min(100%,470px); min-width: 0; }
.artifact-empty h2 { font-size: 1.4rem; font-weight: 300; }
.artifact-empty p { color: var(--muted); font-size: .7rem; line-height: 1.7; }
.artifact-top { margin-bottom: 22px; display: flex; align-items: start; gap: 12px; }
.artifact-top > div { min-width: 0; flex: 1; }
.artifact-top span { color: var(--cyan); font-size: .54rem; letter-spacing: .09em; }
.artifact-top h2 { max-width: 100%; margin: 4px 0 0; overflow-wrap: anywhere; font-size: 1.35rem; font-weight: 400; }
.artifact-top > small { margin-left: auto; color: var(--muted); font-size: .6rem; }
.summary-document { width: 100%; max-width: 100%; padding: 25px; overflow: hidden; overflow-wrap: anywhere; border-radius: 14px; background: rgba(3,22,38,.3); color: var(--cream-soft); font-size: .76rem; line-height: 1.75; }
.summary-document h2, .summary-document h3 { margin: 25px 0 8px; color: var(--cream); font-size: 1.05rem; }
.summary-document p, .summary-document li { margin-bottom: 9px; }
.flashcard-review { min-height: 340px; padding: 40px; border: 1px solid var(--line-strong); border-radius: 20px; display: flex; flex-direction: column; justify-content: center; align-items: center; background: var(--navy-soft); text-align: center; }
.flashcard-review > span, .flashcard-answer > span { color: var(--cyan); font-size: .54rem; letter-spacing: .1em; }
.flashcard-review h3 { max-width: 650px; margin: 12px 0 26px; font-size: 1.35rem; font-weight: 400; line-height: 1.45; }
.flashcard-answer { width: 100%; padding-top: 26px; border-top: 1px solid var(--line); }
.flashcard-answer p { max-width: 700px; margin: 10px auto 0; color: var(--cream-soft); font-size: .8rem; line-height: 1.65; }
.review-answer-actions { margin-top: 14px; display: flex; justify-content: center; gap: 10px; }
.quiz-review h3 { margin: 0 0 24px; font-size: 1.15rem; font-weight: 400; line-height: 1.5; }
.quiz-options { display: grid; gap: 9px; }
.quiz-option { min-height: 52px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; gap: 12px; background: transparent; color: var(--cream-soft); font-size: .72rem; text-align: left; }
.quiz-option > span { width: 28px; height: 28px; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; font-size: .62rem; }
.quiz-option:hover:not(:disabled) { border-color: var(--cyan); background: rgba(64,181,237,.05); }
.quiz-option.correct { border-color: var(--green); background: rgba(120,208,80,.07); color: var(--cream); }
.quiz-option.wrong { border-color: var(--red); background: rgba(240,91,97,.07); }
.quiz-explanation { margin-top: 18px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; }
.quiz-explanation strong { font-size: .74rem; font-weight: 500; }
.quiz-explanation p { color: var(--muted); font-size: .68rem; line-height: 1.6; }
.artifact-complete { min-height: 450px; display: grid; place-items: center; align-content: center; text-align: center; }
.artifact-complete > span { color: var(--cyan); font-size: .55rem; letter-spacing: .1em; }
.artifact-complete h2 { margin: 8px 0 25px; font-size: 1.45rem; font-weight: 300; }
.artifact-complete > strong { font-size: 2.5rem; font-weight: 500; }
.artifact-complete p { color: var(--muted); font-size: .68rem; }

.settings-card-wide { grid-column: 1 / -1; }
.settings-form .cream-button { margin-top: 18px; }
.setting-toggle { padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.setting-toggle > span { display: flex; flex-direction: column; }
.setting-toggle strong { font-size: .72rem; font-weight: 400; }
.setting-toggle small { color: var(--muted); font-size: .58rem; }
.setting-toggle input { width: 35px; height: 20px; accent-color: var(--cyan); }
.wizard-note { margin-top: 15px; padding: 10px 13px; border: 1px solid rgba(64,181,237,.18); border-radius: 10px; background: rgba(64,181,237,.05); color: var(--cream-soft); font-size: .62rem; }

@media (max-width: 1120px) {
  .top-tab { min-width: 145px; }
  .overview-grid { padding-inline: 45px; gap: 30px 40px; }
  .dashboard-header { padding-inline: 45px; }
  .folder-grid { grid-template-columns: repeat(3,minmax(180px,1fr)); }
  .agenda-layout { gap: 35px; padding-inline: 40px; }
  .calendar-title-row > div:first-child { gap: 55px; }
  .study-controls { grid-template-columns: minmax(220px,1fr) 130px; }
  .study-generate-actions { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .side-rail { transform: translateX(-100%); transition: transform .2s, width .2s; }.side-rail.open { width:var(--rail-expanded); transform:none; box-shadow:18px 0 50px rgba(0,0,0,.25); }.side-rail.open .rail-label { max-width:145px; opacity:1; transform:none; }.rail-backdrop { position:fixed; z-index:1035; inset:0; background:rgba(0,0,0,.55); }.rail-backdrop.show { display:block; }
  .app-main { width:100%; margin-left:0; }.top-navigation { height:78px; padding:0 18px; align-items:center; }.mobile-menu { width:40px; height:40px; border:1px solid var(--line); border-radius:11px; display:grid; place-items:center; background:transparent; }.top-tabs { height:auto; margin-right:auto; }.top-tab { min-width:auto; height:44px; padding:0 14px; border-radius:13px; }.top-tab i { margin:0; }.top-tab span { display:none; }.account-area { height:auto; }.workspace-panel { min-height:calc(100vh - 78px); border-radius:25px 25px 0 0; }.route,.chat-layout { min-height:calc(100vh - 78px); }
  .top-tab.active::after { display:none; }
  .login-screen { grid-template-columns:1fr; }.login-brand { min-height:auto; padding:28px 35px; border-right:0; border-bottom:1px solid var(--line); flex-direction:row; align-items:center; }.login-brand-mark { width:50px; height:50px; font-size:1.25rem; }.login-brand-copy { text-align:right; }.login-brand-copy p { margin:5px 0 0; font-size:.72rem; }.login-panel { min-height:calc(100vh - 107px); padding:35px; }
  .overview-grid { grid-template-columns:1fr; }.agenda-layout { grid-template-columns:1fr; }.agenda-actions { padding-top:0; }.large-calendar .calendar-day { min-height:75px; }.folder-grid { grid-template-columns:repeat(2,1fr); }.chat-layout { grid-template-columns:1fr; }.sources-panel { display:none; }.settings-grid { grid-template-columns:1fr; }.chat-answer-controls { align-items:flex-start; flex-direction:column; gap:5px; }.chat-answer-controls small { text-align:left; }
  .study-page { padding-inline: 35px; }.study-layout { grid-template-columns: 1fr; }.artifact-list-panel #artifactList { grid-template-columns: repeat(3,minmax(0,1fr)); }.proposal-events { grid-template-columns:1fr; }.schedule-decision { grid-template-columns:1fr; }.settings-card-wide { grid-column:auto; }
  body.chat-route-active .top-navigation { flex-basis: 78px; }
  .planner-subject-row { grid-template-columns: minmax(0,1fr) minmax(130px,.5fr); }.planner-subject-row .subject-name,.planner-subject-row .subject-notes { grid-column:1/-1; }.subject-remove { grid-column:1/-1; justify-self:end; }
}

@media (max-width: 600px) {
  .connection-pill, .account-button small { display:none; }.account-button { padding:0; }.dashboard-header { padding:38px 22px 10px; }.dashboard-header h1 { font-size:2rem; }.overview-grid { padding:15px 22px 45px; gap:28px; }.today-list { min-height:auto; }.metric-strip { grid-template-columns:repeat(2,1fr); }.weekly-chart { height:220px; }.agenda-layout { min-height:auto; padding:34px 18px; }.calendar-title-row { align-items:flex-start; flex-direction:column; }.calendar-title-row > div:first-child { width:100%; gap:15px; }.calendar-title-row h1 { font-size:2rem; }.large-calendar { border-radius:21px; }.large-calendar .large-weekday { font-size:.5rem; }.large-calendar .calendar-day { min-height:58px; padding:5px; font-size:.75rem; }.large-calendar .today .day-number { width:24px; height:24px; }.day-events { display:none; }.agenda-actions .cream-button { width:100%; }.schedule-section > .section-heading { padding-inline:18px; }.generated-plans { padding:0 18px 45px; }.schedule-card-header { align-items:stretch; flex-direction:column; }.schedule-decision form { align-items:stretch; flex-direction:column; }.folder-suggestion .text-action { margin:10px 0 0; display:block; }.folders-toolbar { padding:35px 20px 18px; align-items:stretch; flex-direction:column; }.folders-toolbar > div { display:grid; grid-template-columns:1fr 1fr; }.folder-breadcrumbs { padding-inline:20px; }.folder-grid { padding:20px; grid-template-columns:1fr 1fr; gap:23px 9px; }.folder-shape { width:125px; height:98px; }.folder-shape::before { top:-13px; width:55px; height:18px; }.folder-card,.chat-tile { min-height:170px; }.chat-symbol { width:98px; height:98px; font-size:1rem; }.folder-card>span,.chat-tile>span { max-width:135px; font-size:.75rem; }.chat-heading { padding:18px 15px; }.chat-heading h1 { max-width:50vw; font-size:1.25rem; }.chat-heading .outline-button { min-height:32px; padding:0 8px; border:0; }.message-stream { padding:25px 17px 40px; }.message { grid-template-columns:1fr; gap:5px; }.chat-composer-wrap { width:calc(100% - 22px); }.composer-actions .attach-button span { display:none; }.settings-page { width:calc(100% - 34px); padding-top:35px; }.planner-modal-content { min-height:100%; padding:20px 17px; border-radius:0; }.modal-dialog { min-height:100%; margin:0; }.wizard-progress { overflow-x:auto; grid-template-columns:repeat(5,minmax(100px,1fr)); }.wizard-grid,.wizard-grid.three,.form-columns,.review-summary { grid-template-columns:1fr; }.days-grid { grid-template-columns:repeat(2,1fr); }.methods-grid { grid-template-columns:repeat(2,1fr); }.wizard-footer { align-items:stretch; flex-direction:column; }.study-page { padding:35px 18px; }.study-heading h1 { font-size:1.75rem; }.study-controls { grid-template-columns:1fr; }.study-generate-actions { grid-column:auto; flex-direction:column; }.artifact-list-panel #artifactList { grid-template-columns:1fr 1fr; }.artifact-workspace { padding:16px; }.artifact-top { flex-wrap:wrap; }.flashcard-review { min-height:300px; padding:24px 18px; }.flashcard-review h3 { font-size:1.05rem; }.folder-color-picker { flex-wrap:wrap; }
  .login-brand { padding:20px; }.login-brand-copy p { display:none; }.login-panel { min-height:calc(100vh - 91px); padding:22px 16px; }.login-card { padding:28px 21px; }.login-heading h1 { font-size:1.7rem; }.login-options { align-items:flex-start; flex-direction:column; gap:10px; }
  .planner-subject-row { grid-template-columns:1fr; }.planner-subject-row .subject-name,.planner-subject-row .subject-notes,.subject-remove { grid-column:auto; }.scope-picker-panel { position:fixed; z-index:1060; top:80px; right:14px; bottom:14px; left:14px; width:auto; max-height:none; border-radius:16px; }
}

@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; } }

/* Ajustes de hierarquia, tarefas em segundo plano e cronograma compacto */
.folder-card-wrap { min-width: 0; min-height: 235px; position: relative; display: grid; place-items: center; }
.folder-card-wrap .folder-card { width: 100%; }
.folder-delete-button { min-height: 28px; padding: 0 10px; border: 1px solid transparent; border-radius: 99px; position: absolute; right: 8px; bottom: 0; background: transparent; color: var(--muted); font-size: .56rem; opacity: 0; transition: .16s; }
.folder-card-wrap:hover .folder-delete-button, .folder-delete-button:focus-visible { border-color: rgba(240,91,97,.28); color: #ff9da1; opacity: 1; }

.planner-modal-content { max-height: 89vh; overflow: hidden; }
.wizard-progress button { padding: 11px; border: 0; position: relative; background: transparent; color: var(--muted); font-size: .62rem; text-align: center; cursor: pointer; }
.wizard-progress button::after { content:""; position:absolute; right:0; bottom:-1px; left:0; height:2px; background:transparent; }
.wizard-progress button:hover { color: var(--cream-soft); background: rgba(255,255,255,.025); }
.wizard-progress button.active { color: var(--cream-soft); }
.wizard-progress button.active::after { background: rgba(64,181,237,.42); }
.wizard-progress button.current { color: var(--cream); background: rgba(64,181,237,.055); }
.wizard-progress button.current::after { height: 3px; background: var(--cyan); }
#plannerForm { min-height: 0; height: min(570px, calc(89vh - 175px)); overflow: hidden; }
.wizard-body { min-height: 0; overflow-y: auto; scrollbar-color: var(--line-strong) transparent; }
.wizard-footer { padding: 15px 2px 0; position: sticky; z-index: 3; bottom: 0; flex: 0 0 auto; background: var(--navy-soft); box-shadow: 0 -18px 30px rgba(12,44,68,.94); }

.background-tasks { width: min(430px, calc(100vw - 30px)); position: fixed; z-index: 1060; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.background-tasks article { min-height: 72px; padding: 13px 14px; border: 1px solid var(--line-strong); border-radius: 16px; display: flex; align-items: center; gap: 12px; background: rgba(3,22,38,.96); box-shadow: 0 20px 55px rgba(0,0,0,.32); backdrop-filter: blur(18px); }
.background-tasks article > div { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.background-tasks strong { font-size: .69rem; font-weight: 400; }
.background-tasks small { overflow: hidden; color: var(--muted); font-size: .55rem; text-overflow: ellipsis; white-space: nowrap; }
.background-tasks button { padding: 0; border: 0; background: transparent; color: var(--cyan); font-size: .56rem; white-space: nowrap; }
.task-spinner { width: 23px; height: 23px; flex: 0 0 auto; border: 2px solid rgba(64,181,237,.18); border-top-color: var(--cyan); border-radius: 50%; animation: taskSpin .8s linear infinite; }
@keyframes taskSpin { to { transform: rotate(360deg); } }
.schedule-generating .schedule-pending { min-height: 125px; padding: 24px; display: flex; align-items: center; gap: 17px; }
.schedule-generating .schedule-pending > div { flex: 1; }
.schedule-generating .schedule-pending strong { color: var(--cream); font-size: .78rem; font-weight: 400; }
.schedule-generating .schedule-pending p { margin: 5px 0 13px; color: var(--muted); font-size: .62rem; }
.generation-lines { display: grid; gap: 5px; }
.generation-lines i { width: 88%; height: 5px; border-radius: 5px; display: block; background: linear-gradient(90deg, rgba(64,181,237,.08), rgba(64,181,237,.3), rgba(64,181,237,.08)); background-size: 220% 100%; animation: generationLine 1.7s ease infinite; }
.generation-lines i:nth-child(2) { width: 63%; animation-delay: .18s; }
.generation-lines i:nth-child(3) { width: 74%; animation-delay: .34s; }
@keyframes generationLine { 0% { background-position: 100% 0; } 100% { background-position: -120% 0; } }
.compact-schedule-content > p { max-width: 850px; margin: 0 0 17px; }
.schedule-overview { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.schedule-overview > div { min-height: 66px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; display: flex; flex-direction: column; justify-content: center; }
.schedule-overview strong { color: var(--cream); font-size: .82rem; font-weight: 500; text-transform: capitalize; }
.schedule-overview small { color: var(--muted); font-size: .53rem; }
.schedule-subjects { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.schedule-subjects span { min-height: 29px; padding: 0 10px; border: 1px solid var(--line); border-radius: 99px; display: inline-flex; align-items: center; color: var(--cream-soft); font-size: .55rem; }
.schedule-event-details, .schedule-assumptions { margin-top: 13px; border-top: 1px solid var(--line); }
.schedule-event-details > summary, .schedule-assumptions > summary { padding: 13px 2px; color: var(--cyan); font-size: .61rem; cursor: pointer; }
.schedule-event-details[open] > summary, .schedule-assumptions[open] > summary { color: var(--cream); }
.schedule-event-details .proposal-events { max-height: 430px; padding: 4px 2px 8px; overflow-y: auto; }
.schedule-assumptions { padding: 0; border-radius: 0; background: transparent; }
.schedule-assumptions ul { margin-top: 0; }
.schedule-error-copy small { color: var(--muted); font-size: .58rem; }

.study-controls .form-field > small { color: var(--muted); font-size: .54rem; line-height: 1.45; }
.scope-tree { max-height: 330px; padding: 8px; overflow-y: auto; }
.scope-tree-row { width: 100%; min-height: 47px; padding: 6px 12px 6px calc(12px + var(--tree-indent)); border: 1px solid transparent; border-radius: 9px; position: relative; display: flex; align-items: center; gap: 10px; background: transparent; color: var(--cream-soft); text-align: left; }
.scope-tree-row::before { content: ""; width: 1px; position: absolute; top: -9px; bottom: 50%; left: calc(21px + var(--tree-indent)); background: var(--line-strong); transform: translateX(-28px); }
.scope-tree-row::after { content: ""; width: 17px; height: 1px; position: absolute; top: 50%; left: calc(21px + var(--tree-indent)); background: var(--line-strong); transform: translateX(-28px); }
.scope-tree-row.root::before, .scope-tree-row.root::after { display: none; }
.scope-tree-row:hover { background: rgba(255,255,255,.025); }
.scope-tree-row.active { border-color: rgba(64,181,237,.42); background: rgba(64,181,237,.07); color: var(--cream); }
.tree-node { width: 13px; height: 13px; flex: 0 0 auto; border: 2px solid var(--node-color,var(--cyan)); border-radius: 4px; position: relative; z-index: 1; background: var(--navy-panel); }
.scope-tree-row.chat .tree-node { width: 9px; height: 9px; margin-left: 2px; border-width: 1px; border-radius: 50%; --node-color: var(--muted); }
.scope-tree-row.root .tree-node { border-radius: 50%; }

#studyScope { display: none; }
.study-scope-field { min-width: 0; position: relative; }
.scope-picker { position: relative; }
.scope-picker-toggle { width: 100%; min-height: 48px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 12px; display: flex; align-items: center; gap: 15px; background: rgba(3,22,38,.2); color: var(--cream); text-align: left; }
.scope-picker-toggle > span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-picker-toggle i { color: var(--muted); transition: transform .18s ease; }
.scope-picker-toggle.open { border-color: rgba(64,181,237,.55); border-radius: 12px 12px 0 0; }
.scope-picker-toggle.open i { transform: rotate(180deg); }
.scope-picker-panel { width: 100%; max-height: min(430px,55vh); padding: 7px; position: absolute; z-index: 30; top: calc(100% - 1px); left: 0; overflow: auto; border: 1px solid rgba(64,181,237,.42); border-radius: 0 0 14px 14px; background: #071f33; box-shadow: 0 24px 55px rgba(0,0,0,.36); }

.subject-builder { margin-bottom: 22px; }
.subject-builder-heading { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.subject-builder-heading > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.subject-builder-heading > div > span { color: var(--cyan); font-size: .58rem; font-weight: 600; letter-spacing: .1em; }
.subject-builder-heading small { color: var(--muted); font-size: .54rem; font-weight: 400; }
#plannerSubjectList { display: grid; gap: 9px; }
.planner-subject-row { padding: 13px; border: 1px solid var(--line); border-radius: 13px; display: grid; grid-template-columns: minmax(210px,1.35fr) minmax(135px,.55fr) minmax(120px,.45fr) minmax(210px,1fr) auto; align-items: end; gap: 9px; background: rgba(3,22,38,.18); }
.planner-subject-row .form-field { margin: 0; min-width: 0; }
.subject-remove { min-height: 46px; padding: 0 10px; border: 0; background: transparent; color: #ff9a9e; font-size: .66rem; }
.subject-remove:hover { color: #ffc0c2; }
.tree-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.tree-copy strong { overflow: hidden; font-size: .65rem; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.tree-copy small { color: var(--muted); font-size: .5rem; }
.tree-level { color: var(--muted); font-size: .49rem; text-transform: uppercase; letter-spacing: .06em; }

@media (max-width: 900px) {
  .schedule-overview { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .folder-delete-button { opacity: 1; }
}
@media (max-width: 600px) {
  #plannerForm { height: calc(100vh - 185px); }
  .wizard-footer { padding-bottom: 2px; }
  .wizard-footer > div { display: grid; grid-template-columns: 1fr 1fr; }
  .wizard-footer .cream-button, .wizard-footer .outline-button { width: 100%; }
  .background-tasks { right: 10px; bottom: 10px; }
  .background-tasks article { align-items: flex-start; flex-wrap: wrap; }
  .background-tasks article > div { width: calc(100% - 40px); }
  .background-tasks button { margin-left: 35px; }
  .schedule-overview { grid-template-columns: 1fr 1fr; }
  .proposal-events { grid-template-columns: 1fr; }
  .scope-tree-row { padding-right: 7px; }
  .tree-level { display: none; }
  .folder-card-wrap { min-height: 188px; }
}

/* Chat: leitura ampla, ações rápidas e fontes organizadas */
.chat-layout { grid-template-columns: minmax(0,1fr) 350px; }
.chat-sources-toggle, #closeSourcesButton { display: none; }
.chat-quick-actions { width: calc(100% - 64px); max-width: 1160px; min-height: 58px; margin: 14px auto 0; padding: 8px 10px; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 16px; background: rgba(3,22,38,.25); }
.chat-quick-actions > span { margin: 0 5px; color: var(--muted); font-size: .52rem; font-weight: 600; letter-spacing: .09em; white-space: nowrap; }
.chat-quick-actions button { min-height: 38px; padding: 0 13px; border: 1px solid transparent; border-radius: 10px; background: rgba(64,181,237,.06); color: var(--cream-soft); font-size: .61rem; white-space: nowrap; }
.chat-quick-actions button:hover { border-color: rgba(64,181,237,.28); background: rgba(64,181,237,.11); color: var(--cream); }
.chat-quick-actions button i { margin-right: 6px; color: var(--cyan); }
.chat-quick-actions button:disabled { opacity: .55; }

.message-stream { max-width: 1180px; padding: 30px 42px 34px; }
.message { margin-bottom: 34px; grid-template-columns: 72px minmax(0,1fr); gap: 16px; }
.message-role { padding-top: 17px; }
.message-card { min-width: 0; }
.message.assistant .message-card { padding: 25px 27px 19px; border: 1px solid rgba(64,181,237,.14); border-radius: 20px; background: linear-gradient(145deg,rgba(12,44,68,.72),rgba(6,29,48,.92)); box-shadow: 0 18px 46px rgba(0,0,0,.12); }
.message.user { margin-left: clamp(0px,7vw,90px); }
.message.user .message-card { padding: 17px 19px 12px; border: 1px solid var(--line-strong); border-radius: 17px; background: rgba(255,255,255,.035); }
.message.message-error .message-card { border-color: rgba(240,91,97,.3); background: rgba(240,91,97,.045); }
.message-body { font-size: .84rem; line-height: 1.82; }
.message-body p { margin: 0 0 14px; }
.message-body p:last-child { margin-bottom: 0; }
.message-body h2 { margin: 28px 0 11px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 1.2rem; font-weight: 500; }
.message-body h3 { margin: 24px 0 8px; font-size: 1rem; font-weight: 500; }
.message-body ul, .message-body ol { margin: 10px 0 17px; padding-left: 23px; }
.message-body li { margin: 6px 0; padding-left: 4px; }
.message-body blockquote { margin: 17px 0; padding: 13px 16px; border-left: 3px solid var(--cyan); border-radius: 0 11px 11px 0; background: rgba(64,181,237,.055); color: var(--cream-soft); }
.message-body code { padding: 2px 5px; border-radius: 5px; background: rgba(3,22,38,.5); color: #bfe9fb; font-size: .78rem; }
.message-body pre { margin: 17px 0; padding: 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #031626; }
.message-body pre code { padding: 0; background: transparent; }
.message-body hr { margin: 22px 0; border-color: var(--line); }
.message-footer { margin-top: 17px; padding-top: 11px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .54rem; }
.message-footer > div { display: flex; gap: 5px; }
.message-footer button { min-height: 29px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: .55rem; }
.message-footer button:hover { border-color: var(--line); color: var(--cream-soft); }
.message-footer button i { margin-right: 5px; }

.message-evidence { margin: 23px 0 0; padding-top: 15px; }
.answer-provider { margin-bottom: 11px; color: var(--muted); }
.answer-provider i { color: var(--cyan); }
.answer-sources { padding: 15px; border: 1px solid rgba(64,181,237,.18); border-radius: 16px; background: rgba(9,65,105,.28); }
.answer-sources > header { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; color: var(--cyan); font-size: .58rem; font-weight: 600; letter-spacing: .09em; }
.answer-sources > header b { min-width: 22px; height: 22px; margin-left: auto; border-radius: 99px; display: grid; place-items: center; background: rgba(64,181,237,.12); font-size: .58rem; }
.answer-sources > div { display: grid; gap: 7px; }
.scientific-source-row { min-height: 51px; padding: 8px 10px; border: 1px solid rgba(242,240,223,.1); border-radius: 12px; display: flex; align-items: center; gap: 9px; color: var(--cream-soft); text-decoration: none; }
.scientific-source-row:hover { border-color: rgba(64,181,237,.35); background: rgba(255,255,255,.025); }
.source-domain-mark { width: 29px; height: 29px; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; background: var(--cream); color: var(--navy); font-size: .61rem; font-weight: 700; }
.source-row-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.source-row-copy strong { overflow: hidden; font-size: .64rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.source-row-copy small { overflow: hidden; color: var(--muted); font-size: .52rem; text-overflow: ellipsis; white-space: nowrap; }
.source-badge { min-height: 24px; padding: 0 8px; border: 1px solid rgba(120,208,80,.24); border-radius: 99px; display: inline-flex; align-items: center; color: #9cdd83; font-size: .49rem; font-style: normal; white-space: nowrap; }
.source-badge.official { border-color: rgba(64,181,237,.32); color: #77d0f5; }
.source-badge.trusted { border-color: var(--line-strong); color: var(--muted); }
.scientific-source-row > i, .panel-scientific-source > i { color: var(--muted); font-size: .65rem; }

.sources-panel { padding: 0; overflow-x: hidden; background: #041a2b; }
.sources-panel-heading { min-height: 86px; padding: 20px; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.sources-panel-heading > div { min-width: 0; display: flex; flex-direction: column; }
.sources-panel-heading p { margin: 0; color: var(--cream); font-size: .66rem; font-weight: 600; letter-spacing: .08em; }
.sources-panel-heading span { margin-top: 4px; color: var(--muted); font-size: .52rem; }
.source-panel-section { padding: 19px 17px; border-bottom: 1px solid var(--line); }
.source-panel-section > header { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.source-panel-section > header > div { display: flex; align-items: center; gap: 7px; color: var(--cyan); }
.source-panel-section > header span { font-size: .54rem; font-weight: 600; letter-spacing: .09em; }
.source-panel-section > header b { min-width: 21px; height: 21px; border-radius: 99px; display: grid; place-items: center; background: rgba(64,181,237,.1); font-size: .52rem; }
.source-panel-section > header button { padding: 0; border: 0; background: transparent; color: var(--cream-soft); font-size: .57rem; }
.source-panel-section .source-empty { padding: 17px 2px 3px; }
.source-empty.compact { margin: 0; font-size: .57rem; }
.panel-scientific-source { min-height: 54px; margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 11px; display: flex; align-items: center; gap: 8px; color: var(--cream-soft); text-decoration: none; }
.panel-scientific-source > span:nth-child(2) { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.panel-scientific-source strong { overflow: hidden; font-size: .6rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.panel-scientific-source small { overflow: hidden; color: var(--muted); font-size: .49rem; text-overflow: ellipsis; white-space: nowrap; }
.panel-scientific-source .source-badge { display: none; }
.pinned-artifact { width: 100%; min-height: 53px; margin-top: 8px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 11px; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.018); color: var(--cream-soft); text-align: left; }
.pinned-artifact > i:first-child { width: 29px; height: 29px; border-radius: 9px; display: grid; place-items: center; background: rgba(64,181,237,.09); color: var(--cyan); }
.pinned-artifact > span { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.pinned-artifact strong { overflow: hidden; font-size: .61rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.pinned-artifact small { color: var(--muted); font-size: .49rem; }
.pinned-artifact > i:last-child { color: var(--muted); }
.sources-panel > .sources-explanation { margin: 0; padding: 18px; border-top: 0; }

.edit-message-bar { min-height: 37px; margin: 0 8px 7px; padding: 0 11px; border: 1px solid rgba(64,181,237,.25); border-radius: 10px; display: flex; align-items: center; justify-content: space-between; background: rgba(64,181,237,.07); color: var(--cream-soft); font-size: .59rem; }
.edit-message-bar span i { margin-right: 7px; color: var(--cyan); }
.edit-message-bar button { padding: 0; border: 0; background: transparent; color: var(--cyan); font-size: .56rem; }
.inline-spinner { width: 13px; height: 13px; margin-right: 6px; border: 2px solid rgba(255,255,255,.22); border-top-color: currentColor; border-radius: 50%; display: inline-block; vertical-align: middle; animation: taskSpin .8s linear infinite; }
.quiz-difficulty { min-height: 27px; padding: 0 10px; margin-bottom: 13px; border: 1px solid rgba(64,181,237,.28); border-radius: 99px; display: inline-flex; align-items: center; color: var(--cyan); font-size: .52rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.error-notebook-section { grid-column: 1 / -1; min-width: 0; }
.error-notebook { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.error-notebook-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; background: rgba(3,22,38,.18); }
.error-notebook-card > span { color: #ff9da1; font-size: .53rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.error-notebook-card > span i { margin-right: 6px; }
.error-notebook-card strong { margin: 8px 0 5px; overflow: hidden; font-size: .7rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.error-notebook-card p { margin: 0; color: var(--cream-soft); font-size: .61rem; line-height: 1.55; }
.error-notebook-card small { margin-top: 8px; color: var(--muted); font-size: .52rem; }
.error-notebook-card button { margin-top: 12px; padding: 0; border: 0; align-self: flex-start; background: transparent; color: var(--cyan); font-size: .57rem; }
.login-error { margin-top: 1px; padding: 13px; display: flex; align-items: flex-start; gap: 10px; }
.login-error > i { margin-top: 2px; color: #ff8f94; font-size: .88rem; }
.login-error > span { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.login-error strong { color: #ffc1c4; font-size: .67rem; font-weight: 600; }
.login-error b { color: #ffb1b4; font-size: .59rem; font-weight: 400; line-height: 1.5; }
.login-error small { padding-top: 5px; border-top: 1px solid rgba(240,91,97,.16); color: var(--muted); font-size: .53rem; line-height: 1.45; }
.study-controls { grid-template-columns: minmax(250px,1fr) 145px 190px; }
.study-generate-actions { grid-column: 1 / -1; justify-content: flex-end; }

@media (max-width: 900px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sources-toggle { display: inline-flex; }
  #closeSourcesButton { width: 34px; height: 34px; margin-left: auto; border: 1px solid var(--line); border-radius: 9px; place-items: center; background: transparent; color: var(--cream-soft); }
  .sources-panel { width: min(380px,92vw); position: fixed; z-index: 1080; top: 0; right: 0; bottom: 0; display: block; transform: translateX(102%); transition: transform .22s ease; box-shadow: -24px 0 60px rgba(0,0,0,.38); }
  .sources-panel.open { transform: none; }
  .sources-panel.open #closeSourcesButton { display: grid; }
  .chat-quick-actions { width: calc(100% - 34px); overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .chat-quick-actions::-webkit-scrollbar { display: none; }
  .message-stream { padding-inline: 24px; }
  .error-notebook { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .chat-heading > div:last-child { gap: 3px; }
  .chat-heading .danger { display: none; }
  .chat-sources-toggle { font-size: 0; }
  .chat-sources-toggle i { font-size: .85rem; }
  .chat-quick-actions { margin-top: 9px; padding: 7px; border-radius: 13px; }
  .chat-quick-actions > span { display: none; }
  .chat-quick-actions button { min-height: 36px; padding-inline: 11px; }
  .message-stream { padding: 22px 13px 35px; }
  .message { margin: 0 0 26px; grid-template-columns: 1fr; gap: 6px; }
  .message.user { margin-left: 24px; }
  .message-role { padding: 0 4px; }
  .message.assistant .message-card { padding: 21px 17px 15px; border-radius: 17px; }
  .message-body { font-size: .79rem; line-height: 1.74; }
  .answer-sources { margin-inline: -5px; padding: 11px; }
  .source-badge { display: none; }
  .scientific-source-row { padding-inline: 8px; }
  .message-footer button { font-size: 0; }
  .message-footer button i { margin: 0; font-size: .7rem; }
  .study-controls { grid-template-columns: 1fr; }
  .study-generate-actions { grid-column: auto; }
  .error-notebook { grid-template-columns: 1fr; }
}

/* Chat amplo com a base de conhecimento em uma gaveta lateral recolhível */
.chat-layout { grid-template-columns: minmax(0,1fr); }
.chat-main { width: 100%; }
.chat-heading { min-height: 92px; padding-block: 17px; }
.chat-sources-toggle { display: inline-flex; align-items: center; gap: 6px; }
#closeSourcesButton { width: 34px; height: 34px; margin-left: auto; border: 1px solid var(--line); border-radius: 9px; display: grid; place-items: center; background: transparent; color: var(--cream-soft); }
.sources-panel { width: min(430px,95vw); position: fixed; z-index: 1080; top: 0; right: 0; bottom: 0; display: block; transform: translateX(103%); transition: transform .22s ease; box-shadow: -24px 0 60px rgba(0,0,0,.38); }
.sources-panel.open { transform: none; }
.sources-panel-backdrop { position: fixed; z-index: 1070; inset: 0; border: 0; display: block; background: rgba(0,10,18,.38); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.sources-panel-backdrop.show { opacity: 1; pointer-events: auto; }
.message-stream { width: 100%; max-width: 1480px; padding: 34px clamp(28px,5vw,82px) 38px; }
.chat-composer-wrap { width: calc(100% - clamp(32px,8vw,130px)); max-width: 1380px; }
.chat-quick-actions { width: calc(100% - clamp(32px,8vw,130px)); max-width: 1420px; }

/* Cards extras exibidos dentro das pastas */
.chat-card-wrap { min-width: 0; min-height: 235px; position: relative; display: grid; place-items: center; }
.chat-card-wrap .chat-tile { width: 100%; }
.chat-card-delete { min-height: 28px; padding: 0 10px; border: 1px solid rgba(240,91,97,.14); border-radius: 99px; position: absolute; right: 8px; bottom: 0; background: transparent; color: #d98d91; font-size: .56rem; opacity: .82; transition: .16s; }
.chat-card-delete i { margin-right: 5px; }
.chat-card-wrap:hover .chat-card-delete, .chat-card-delete:focus-visible { border-color: rgba(240,91,97,.28); color: #ff9da1; opacity: 1; }
.chat-symbol i { color: var(--cyan); font-size: 1.35rem; }
.material-folder-tile { min-width: 0; min-height: 235px; padding: 22px 14px 17px; border: 1px solid transparent; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: transparent; color: var(--cream-soft); text-align: center; }
.material-folder-tile:hover { border-color: var(--line); background: rgba(255,255,255,.025); }
.material-folder-tile > span { width: 104px; height: 104px; margin-bottom: 16px; border: 1px solid rgba(64,181,237,.2); border-radius: 24px; display: grid; place-items: center; background: linear-gradient(145deg,rgba(64,181,237,.12),rgba(3,22,38,.1)); }
.material-folder-tile > span i { color: var(--cyan); font-size: 1.55rem; }
.material-folder-tile strong { max-width: 180px; overflow: hidden; font-size: .72rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.material-folder-tile small { margin-top: 5px; color: var(--muted); font-size: .54rem; }

/* Estado atual da navegação lateral */
.rail-button.active { background: rgba(64,181,237,.1); color: var(--cyan); box-shadow: inset 2px 0 0 var(--cyan); }
.rail-recent-chats > button.active { background: rgba(64,181,237,.08); color: var(--cream); }

@media (max-width: 900px) {
  .message-stream { padding-inline: 24px; }
  .chat-composer-wrap, .chat-quick-actions { width: calc(100% - 34px); }
  .chat-card-delete { opacity: 1; }
}

@media (min-width: 901px) {
  body.chat-route-active .top-navigation { display: none; }
}

@media (max-width: 600px) {
  .message-stream { padding-inline: 13px; }
  .sources-panel { width: min(380px,95vw); }
}

/* Navegação superior com estado ativo mais luminoso e fácil de identificar */
.top-tab.active {
  border: 1px solid rgba(111, 213, 255, .34);
  border-bottom-color: transparent;
  background: linear-gradient(180deg, rgba(46, 145, 207, .34), rgba(9, 51, 80, .96));
  color: #dbf6ff;
  box-shadow: inset 0 1px 0 rgba(190, 239, 255, .18), 0 -4px 26px rgba(64, 181, 237, .2);
  text-shadow: 0 0 16px rgba(110, 218, 255, .45);
}
.top-tab.active i { color: #7edaff; filter: drop-shadow(0 0 7px rgba(64,181,237,.7)); }
.top-tab.active::after { height: 4px; bottom: 0; border-radius: 99px 99px 0 0; background: #61cdf9; box-shadow: 0 0 12px rgba(83,204,255,.95), 0 0 24px rgba(64,181,237,.55); }

/* Chamada principal da visão geral */
.dashboard-new-chat {
  width: calc(100% - 110px);
  min-height: 118px;
  margin: 12px 55px 3px;
  padding: 22px 27px;
  border: 1px solid rgba(87, 203, 250, .34);
  border-radius: 22px;
  display: grid;
  grid-template-columns: 62px minmax(0,1fr) 44px;
  align-items: center;
  gap: 20px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(112deg, rgba(30, 131, 193, .23), rgba(8, 42, 67, .72) 58%, rgba(4, 28, 47, .9));
  color: var(--cream);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(198,240,255,.08), 0 15px 42px rgba(0,0,0,.12);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.dashboard-new-chat::before { content:""; width: 240px; height: 240px; position:absolute; top:-115px; left:-40px; border-radius:50%; background:rgba(64,181,237,.12); filter:blur(8px); }
.dashboard-new-chat:hover { transform: translateY(-2px); border-color: rgba(106,215,255,.66); box-shadow: inset 0 1px 0 rgba(198,240,255,.14), 0 0 30px rgba(64,181,237,.12), 0 20px 45px rgba(0,0,0,.16); }
.dashboard-new-chat > span { width: 62px; height: 62px; z-index:1; border:1px solid rgba(126,218,255,.34); border-radius:18px; display:grid; place-items:center; background:rgba(64,181,237,.13); color:#89ddff; box-shadow:0 0 24px rgba(64,181,237,.13); }
.dashboard-new-chat > span i { font-size:1.35rem; }
.dashboard-new-chat > div { min-width:0; z-index:1; }
.dashboard-new-chat small { display:block; margin-bottom:4px; color:#79d7ff; font-size:.54rem; font-weight:600; letter-spacing:.12em; }
.dashboard-new-chat strong { display:block; font-size:1.22rem; font-weight:450; }
.dashboard-new-chat p { margin:6px 0 0; color:var(--muted); font-size:.67rem; line-height:1.5; }
.dashboard-new-chat > i { z-index:1; color:#80d8ff; font-size:1.15rem; transition:transform .18s ease; }
.dashboard-new-chat:hover > i { transform:translateX(5px); }

/* Gráfico de setores para o desempenho nas questões */
.question-accuracy-chart { min-height: 260px; margin-top: 15px; padding: 22px; border: 1px solid var(--line); border-radius: 19px; display: grid; grid-template-columns: minmax(180px,.75fr) minmax(210px,1fr); align-items: center; gap: clamp(22px,4vw,58px); background: linear-gradient(145deg,rgba(10,50,77,.35),rgba(3,22,38,.12)); }
.accuracy-donut { width: min(210px,100%); aspect-ratio:1; margin:auto; border-radius:50%; position:relative; display:grid; place-items:center; background:conic-gradient(#68d5ff 0 var(--correct-angle), #ff7e86 var(--correct-angle) 360deg); box-shadow:0 0 34px rgba(64,181,237,.1); }
.accuracy-donut::before { content:""; width:66%; aspect-ratio:1; border:1px solid rgba(255,255,255,.06); border-radius:50%; position:absolute; background:#08263d; box-shadow:inset 0 0 24px rgba(0,0,0,.22); }
.accuracy-donut.empty { background:conic-gradient(rgba(127,166,186,.22) 0 360deg); }
.accuracy-donut > div { z-index:1; display:flex; flex-direction:column; align-items:center; }
.accuracy-donut strong { color:var(--cream); font-size:1.55rem; font-weight:500; }
.accuracy-donut small { margin-top:3px; color:var(--muted); font-size:.55rem; }
.accuracy-legend { display:grid; gap:10px; }
.accuracy-legend > div { min-height:58px; padding:10px 12px; border:1px solid var(--line); border-radius:12px; display:flex; align-items:center; gap:11px; background:rgba(255,255,255,.018); }
.accuracy-legend > div > span { width:9px; height:34px; flex:0 0 auto; border-radius:99px; background:var(--muted); }
.accuracy-legend .correct > span { background:#68d5ff; box-shadow:0 0 12px rgba(104,213,255,.35); }
.accuracy-legend .wrong > span { background:#ff7e86; box-shadow:0 0 12px rgba(255,126,134,.24); }
.accuracy-legend .total > span { background:#7396a9; }
.accuracy-legend p { margin:0; display:flex; flex-direction:column; }
.accuracy-legend strong { color:var(--cream); font-size:.88rem; font-weight:500; }
.accuracy-legend small { color:var(--muted); font-size:.55rem; }

/* A base de conhecimento funciona como uma barra lateral direita no desktop */
@media (min-width: 901px) {
  .chat-layout { grid-template-columns:minmax(0,1fr) 0; transition:grid-template-columns .24s ease; }
  .chat-layout.sources-open { grid-template-columns:minmax(0,1fr) minmax(330px,430px); }
  .sources-panel { width:100%; min-width:0; height:100%; position:relative; z-index:2; inset:auto; transform:none; visibility:hidden; opacity:0; pointer-events:none; border-left:1px solid rgba(87,203,250,.2); box-shadow:-16px 0 36px rgba(0,0,0,.12); transition:opacity .16s ease; }
  .sources-panel.open { visibility:visible; opacity:1; pointer-events:auto; transform:none; }
  .sources-panel-backdrop, .sources-panel-backdrop.show { display:none; }
  .chat-layout.sources-open .chat-sources-toggle { border-color:rgba(96,209,255,.5); background:rgba(64,181,237,.11); color:#bdeeff; box-shadow:0 0 18px rgba(64,181,237,.12); }
}

/* Exclusões discretas: aparecem ao passar o mouse ou ao navegar por teclado */
.chat-card-delete,
.material-folder-delete,
.artifact-list-delete,
.artifact-delete-button,
#deleteChatButton { opacity:0; visibility:hidden; pointer-events:none; transition:opacity .16s ease, visibility .16s ease, color .16s ease, border-color .16s ease; }
.chat-card-wrap:hover .chat-card-delete,
.chat-card-wrap:focus-within .chat-card-delete,
.material-folder-wrap:hover .material-folder-delete,
.material-folder-wrap:focus-within .material-folder-delete,
.artifact-list-item-wrap:hover .artifact-list-delete,
.artifact-list-item-wrap:focus-within .artifact-list-delete,
.artifact-workspace:hover .artifact-delete-button,
.artifact-workspace:focus-within .artifact-delete-button,
.chat-heading:hover #deleteChatButton,
.chat-heading:focus-within #deleteChatButton { opacity:1; visibility:visible; pointer-events:auto; }
.material-folder-wrap { min-width:0; min-height:235px; position:relative; display:grid; place-items:center; }
.material-folder-wrap .material-folder-tile { width:100%; }
.material-folder-delete { min-height:28px; padding:0 10px; border:1px solid transparent; border-radius:99px; position:absolute; right:8px; bottom:0; background:transparent; color:var(--muted); font-size:.56rem; }
.material-folder-delete i { margin-right:5px; }
.material-folder-delete:hover { border-color:rgba(240,91,97,.28); color:#ff9da1; }
.artifact-list-item-wrap { min-width:0; position:relative; }
.artifact-list-item-wrap .artifact-list-item { padding-right:38px; }
.artifact-list-delete { width:28px; height:28px; border:1px solid transparent; border-radius:8px; position:absolute; top:50%; right:7px; display:grid; place-items:center; transform:translateY(-50%); background:rgba(3,22,38,.88); color:var(--muted); font-size:.61rem; }
.artifact-list-delete:hover { border-color:rgba(240,91,97,.28); color:#ff9da1; }

/* Arrastar e soltar entre pastas */
[data-drag-library-type] { cursor:grab; }
[data-drag-library-type]:active { cursor:grabbing; }
[data-drag-library-type].dragging { opacity:.38; transform:scale(.98); }
.folder-card.library-drop-target .folder-shape { transform:translateY(-5px) scale(1.035); box-shadow:0 0 0 3px rgba(96,209,255,.32), 0 0 34px rgba(64,181,237,.34); }
.folder-card.library-drop-target > span:nth-last-child(2) { color:#a9e8ff; }
.folder-breadcrumbs button.library-drop-target { padding:7px 10px; border-radius:9px; background:rgba(64,181,237,.15); color:#9ee5ff; box-shadow:0 0 16px rgba(64,181,237,.13); }

@media (max-width: 900px) {
  .dashboard-new-chat { width:calc(100% - 44px); margin:8px 22px 0; }
  .question-accuracy-chart { grid-template-columns:1fr 1fr; }
  .sources-panel { width:min(380px,92vw); height:auto; position:fixed; z-index:1080; top:0; right:0; bottom:0; transform:translateX(102%); visibility:visible; opacity:1; pointer-events:auto; }
  .sources-panel.open { transform:none; }
  .sources-panel-backdrop { display:block; }
  .chat-card-delete, .material-folder-delete, .artifact-list-delete, .artifact-delete-button { opacity:1; visibility:visible; pointer-events:auto; }
}

@media (max-width: 600px) {
  .dashboard-new-chat { min-height:108px; padding:18px; grid-template-columns:48px minmax(0,1fr); gap:14px; }
  .dashboard-new-chat > span { width:48px; height:48px; border-radius:14px; }
  .dashboard-new-chat > i { display:none; }
  .dashboard-new-chat strong { font-size:.88rem; }
  .dashboard-new-chat p { font-size:.58rem; }
  .question-accuracy-chart { padding:18px; grid-template-columns:1fr; }
  .accuracy-donut { width:175px; }
  .accuracy-legend { width:100%; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
  .accuracy-legend > div { min-height:76px; padding:8px; align-items:flex-start; flex-direction:column; }
  .accuracy-legend > div > span { width:100%; height:5px; }
}

/* Materiais anexados ao chat e identidade visual por tipo */
.chat-attached-materials { margin-top:10px; padding:7px 10px; border:1px solid rgba(86,198,240,.2); border-radius:99px; display:flex; align-items:center; gap:8px; background:rgba(64,181,237,.055); }
.chat-attached-materials > span { display:flex; }
.chat-attached-materials i { width:9px; height:9px; margin-left:-2px; border:2px solid var(--navy-panel); border-radius:50%; background:var(--material-color); box-shadow:0 0 9px color-mix(in srgb,var(--material-color) 48%,transparent); }
.chat-attached-materials b { color:#a8d8e9; font-size:.5rem; font-weight:500; }
.material-folder-wrap .material-folder-tile { border-color:color-mix(in srgb,var(--material-color) 18%,transparent); background:linear-gradient(160deg,color-mix(in srgb,var(--material-color) 7%,transparent),rgba(3,22,38,.08)); }
.material-folder-wrap .material-folder-tile:hover { border-color:color-mix(in srgb,var(--material-color) 42%,transparent); box-shadow:0 0 24px color-mix(in srgb,var(--material-color) 12%,transparent); }
.material-folder-wrap .material-folder-tile > span { border-color:color-mix(in srgb,var(--material-color) 38%,transparent); background:color-mix(in srgb,var(--material-color) 12%,rgba(3,22,38,.2)); }
.material-folder-wrap .material-folder-tile > span i,
.artifact-list-item-wrap .artifact-list-item > span { color:var(--material-color); }
.artifact-list-item-wrap .artifact-list-item.active { border-color:color-mix(in srgb,var(--material-color) 42%,transparent); box-shadow:inset 3px 0 0 var(--material-color),0 0 18px color-mix(in srgb,var(--material-color) 9%,transparent); }
.artifact-list-item > span { display:flex; align-items:center; gap:6px; }

/* Chat amplo: cabeçalho menor, ações próximas do campo e documentos em tela grande */
.chat-heading { min-height:76px; padding:13px clamp(20px,3.2vw,48px); }
.chat-heading h1 { margin-top:2px; font-size:clamp(1.08rem,2vw,1.45rem); }
.chat-composer-wrap { padding-top:8px; }
.chat-composer-wrap .chat-quick-actions { width:100%; max-width:none; min-height:auto; margin:0 0 7px; padding:6px 8px; border-radius:13px; }
.chat-composer-wrap .chat-quick-actions button.material-action.summary { --action-color:#55a9e8; }
.chat-composer-wrap .chat-quick-actions button.material-action.flashcards { --action-color:#51c991; }
.chat-composer-wrap .chat-quick-actions button.material-action.quiz { --action-color:#a879e9; }
.chat-composer-wrap .chat-quick-actions button.material-action { border-color:color-mix(in srgb,var(--action-color) 20%,transparent); background:color-mix(in srgb,var(--action-color) 9%,transparent); }
.chat-composer-wrap .chat-quick-actions button.material-action i { color:var(--action-color); }
.chat-composer-wrap .chat-quick-actions button.material-action:hover { border-color:color-mix(in srgb,var(--action-color) 48%,transparent); box-shadow:0 0 15px color-mix(in srgb,var(--action-color) 13%,transparent); }
.chat-materials-dock { margin-bottom:6px; padding:6px 8px; border:1px solid rgba(86,198,240,.16); border-radius:13px; display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:8px; background:rgba(3,22,38,.56); }
.chat-materials-dock header { margin:0; display:flex; align-items:center; gap:7px; color:#9edff6; font-size:.5rem; font-weight:600; letter-spacing:.08em; white-space:nowrap; }
.chat-materials-dock header b { min-width:20px; height:20px; border-radius:99px; display:grid; place-items:center; background:rgba(64,181,237,.11); font-size:.5rem; }
#chatInlineMaterials { display:flex; gap:7px; overflow-x:auto; scrollbar-width:none; }
#chatInlineMaterials::-webkit-scrollbar { display:none; }
.chat-material-chip { min-width:170px; max-width:235px; min-height:38px; padding:5px 8px; border:1px solid color-mix(in srgb,var(--material-color) 26%,transparent); border-radius:10px; display:flex; align-items:center; gap:7px; background:color-mix(in srgb,var(--material-color) 7%,rgba(3,22,38,.3)); color:var(--cream-soft); text-align:left; }
.chat-material-chip > i:first-child { width:27px; height:27px; flex:0 0 auto; border-radius:8px; display:grid; place-items:center; background:color-mix(in srgb,var(--material-color) 16%,transparent); color:var(--material-color); }
.chat-material-chip > span { min-width:0; flex:1; display:flex; flex-direction:column; }
.chat-material-chip strong,.chat-material-chip small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-material-chip strong { font-size:.59rem; font-weight:500; }.chat-material-chip small { color:var(--material-color); font-size:.47rem; }.chat-material-chip > i:last-child { color:var(--muted); }
.stop-button { min-height:34px; padding:0 13px; border:1px solid rgba(255,126,134,.35); border-radius:99px; background:rgba(255,126,134,.09); color:#ffabb0; font-size:.62rem; }
.stop-button i { margin-right:5px; }
.message-state { margin-left:8px; padding:3px 7px; border-radius:99px; display:inline-flex; align-items:center; gap:5px; }
.message-state.generating { background:rgba(64,181,237,.09); color:#91dcf8; }.message-state.generating i { width:5px; height:5px; border-radius:50%; background:#64cff5; animation:pulse-led 1s infinite; }
.message-state.interrupted { background:rgba(225,168,91,.09); color:#e8bd82; }
@keyframes pulse-led { 50% { opacity:.35; box-shadow:0 0 12px #64cff5; } }
.message-body table,.summary-document table { width:100%; margin:16px 0; border-collapse:collapse; font-size:.72rem; }
.message-body th,.message-body td,.summary-document th,.summary-document td { padding:9px 10px; border:1px solid var(--line); text-align:left; vertical-align:top; }
.message-body th,.summary-document th { background:rgba(64,181,237,.08); color:var(--cream); }
.message-body pre,.summary-document pre { max-width:100%; padding:13px; overflow:auto; border:1px solid var(--line); border-radius:11px; background:#031522; }
.message-body blockquote,.summary-document blockquote { margin:14px 0; padding:10px 14px; border-left:3px solid var(--cyan); background:rgba(64,181,237,.05); }

.chat-document-view { height:100%; min-height:0; display:flex; flex-direction:column; background:linear-gradient(145deg,#08283f,#061d30 58%,#041827); }
.chat-document-view[hidden] { display:none; }
.chat-main.document-open > .chat-heading,.chat-main.document-open > .message-stream,.chat-main.document-open > .chat-composer-wrap { display:none; }
.chat-document-heading { min-height:82px; padding:15px clamp(22px,4vw,64px); flex:0 0 auto; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:20px; border-bottom:1px solid var(--line); background:rgba(3,22,38,.46); }
.chat-document-heading button { min-height:36px; padding:0 12px; border:1px solid var(--line); border-radius:10px; background:transparent; color:var(--cream-soft); font-size:.6rem; }.chat-document-heading button i { margin-right:6px; }
.chat-document-heading > div { min-width:0; }.chat-document-heading span { color:var(--cyan); font-size:.52rem; font-weight:600; letter-spacing:.1em; }.chat-document-heading h2 { margin:3px 0 0; overflow:hidden; font-size:1.08rem; font-weight:500; text-overflow:ellipsis; white-space:nowrap; }
.chat-document-body { width:100%; max-width:1180px; min-height:0; margin:0 auto; padding:38px clamp(24px,5vw,76px) 70px; overflow-y:auto; flex:1; }
.source-document { padding:clamp(22px,4vw,46px); border:1px solid rgba(64,181,237,.16); border-radius:20px; background:rgba(3,22,38,.46); box-shadow:0 24px 60px rgba(0,0,0,.14); }
.source-document > span { color:var(--cyan); font-size:.57rem; font-weight:600; letter-spacing:.1em; }.source-document > div { margin-top:22px; color:var(--cream-soft); font-size:.79rem; line-height:1.9; }
.document-study-list { display:grid; gap:16px; }.document-flashcard,.document-question { padding:24px; border:1px solid var(--line); border-radius:17px; background:rgba(3,22,38,.42); }.document-flashcard { border-left:3px solid #51c991; }.document-question { border-left:3px solid #a879e9; }.document-study-list article > span { color:var(--cyan); font-size:.53rem; letter-spacing:.08em; }.document-study-list h3 { margin:9px 0 16px; font-size:.9rem; line-height:1.55; }.document-study-list details { padding:12px 14px; border-radius:11px; background:rgba(255,255,255,.03); }.document-study-list summary { cursor:pointer; color:var(--cream); font-size:.65rem; }.document-study-list p,.document-study-list li { color:var(--cream-soft); font-size:.7rem; line-height:1.65; }

/* Fontes clicáveis na barra lateral */
.source-card { padding:8px; position:relative; }.source-card.readable { border-color:rgba(64,181,237,.2); }.source-card-open { width:100%; padding:4px!important; display:flex; flex-direction:column; align-items:flex-start; text-align:left; }.source-card-open strong { max-width:calc(100% - 28px); }.source-card-open em { margin-top:8px; color:var(--cyan); font-size:.5rem; font-style:normal; }.source-card-open em i { margin-right:5px; }.source-card-open:disabled { cursor:default; }.source-remove { width:26px; height:26px; position:absolute; top:8px; right:8px; display:grid; place-items:center; border-radius:7px!important; }.source-remove:hover { background:rgba(255,126,134,.08)!important; color:#ff9da1!important; }
.pinned-artifact { border-color:color-mix(in srgb,var(--material-color) 22%,transparent); }.pinned-artifact > i:first-child { background:color-mix(in srgb,var(--material-color) 14%,transparent); color:var(--material-color); }.pinned-artifact:hover { border-color:color-mix(in srgb,var(--material-color) 42%,transparent); }

@media (max-width:900px) {
  .chat-heading { min-height:68px; padding:10px 15px; }
  .chat-composer-wrap .chat-quick-actions { width:100%; }
  .chat-materials-dock { margin-inline:0; grid-template-columns:1fr; }.chat-materials-dock header { display:none; }
  .chat-document-heading { grid-template-columns:1fr auto; padding:12px 15px; }.chat-document-heading > div { grid-column:1/-1; grid-row:2; }.chat-document-heading h2 { font-size:.92rem; }.chat-document-body { padding:22px 14px 50px; }
  .message-footer { align-items:flex-start; flex-direction:column; }.message-footer > div { width:100%; overflow-x:auto; }
}

@media (max-width:600px) {
  .chat-composer-wrap .chat-quick-actions > span { display:none; }
  .chat-material-chip { min-width:155px; }
  .chat-document-heading button { padding-inline:9px; font-size:.54rem; }
  .source-document { padding:19px 16px; }.source-document > div { font-size:.72rem; }
}

/* Chat final: área de leitura ampla, materiais no cabeçalho e fontes recolhidas em miniaturas */
.chat-layout { grid-template-columns:minmax(0,1fr) 58px; transition:grid-template-columns .22s ease; }
.chat-layout.sources-open { grid-template-columns:minmax(0,1fr) minmax(350px,430px); }
.chat-heading { min-height:108px; padding:12px clamp(20px,3vw,46px); display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:18px; }
.chat-heading-primary { min-width:0; }
.chat-title-row { min-width:0; margin-top:2px; display:flex; align-items:center; gap:5px; }
.chat-title-row h1 { min-width:0; max-width:min(700px,65vw); margin:0; }
.chat-title-pencil { width:25px; height:25px; flex:0 0 auto; padding:0; border:1px solid transparent; border-radius:7px; display:grid; place-items:center; background:transparent; color:var(--muted); opacity:0; visibility:hidden; pointer-events:none; font-size:.57rem; transition:.16s; }
.chat-title-row:hover .chat-title-pencil,.chat-title-row:focus-within .chat-title-pencil { opacity:1; visibility:visible; pointer-events:auto; }
.chat-title-pencil:hover { border-color:rgba(91,205,250,.28); background:rgba(64,181,237,.08); color:#9ee7ff; }
.chat-heading-actions { display:flex; align-items:center; gap:7px; }
.chat-heading .chat-quick-actions { width:auto; max-width:100%; min-height:34px; margin:7px 0 0; padding:0; overflow-x:auto; border:0; border-radius:0; background:transparent; scrollbar-width:none; }
.chat-heading .chat-quick-actions::-webkit-scrollbar { display:none; }
.chat-heading .chat-quick-actions > span { margin-left:0; font-size:.47rem; }
.chat-heading .chat-quick-actions button { min-height:30px; padding:0 9px; border-radius:8px; font-size:.55rem; }
.chat-heading .chat-quick-actions button.material-action.summary { --action-color:#55a9e8; }
.chat-heading .chat-quick-actions button.material-action.flashcards { --action-color:#51c991; }
.chat-heading .chat-quick-actions button.material-action.quiz { --action-color:#a879e9; }
.chat-heading .chat-quick-actions button.material-action { border-color:color-mix(in srgb,var(--action-color) 20%,transparent); background:color-mix(in srgb,var(--action-color) 8%,transparent); }
.chat-heading .chat-quick-actions button.material-action i { color:var(--action-color); }
.message-stream { width:100%; max-width:1600px; padding:32px clamp(25px,4.6vw,74px) 30px; }
.chat-composer-wrap { width:calc(100% - clamp(32px,7vw,110px)); max-width:1500px; padding-top:7px; }

.sources-panel { width:100%; min-width:0; height:100%; position:relative; z-index:2; inset:auto; display:block; transform:none; visibility:visible; opacity:1; pointer-events:auto; overflow:hidden; border-left:1px solid rgba(87,203,250,.2); background:#041a2b; box-shadow:-12px 0 30px rgba(0,0,0,.1); }
.sources-expanded-content { height:100%; overflow-y:auto; }
.sources-panel:not(.open) .sources-expanded-content { display:none; }
.sources-panel.open .sources-collapsed-rail { display:none; }
.sources-collapsed-rail { height:100%; padding:12px 7px; display:flex; align-items:center; flex-direction:column; gap:10px; background:linear-gradient(180deg,rgba(16,58,85,.82),rgba(4,26,43,.96)); }
.sources-collapsed-rail > button { width:40px; height:40px; flex:0 0 auto; border:1px solid rgba(96,209,255,.23); border-radius:12px; display:grid; place-items:center; background:rgba(64,181,237,.09); color:#8edfff; box-shadow:0 0 18px rgba(64,181,237,.08); }
#collapsedSourceThumbs { width:100%; min-height:0; padding-top:4px; overflow-y:auto; display:flex; align-items:center; flex-direction:column; gap:8px; scrollbar-width:none; }
#collapsedSourceThumbs::-webkit-scrollbar { display:none; }
.collapsed-source-thumb,.collapsed-rail-empty { width:39px; height:43px; flex:0 0 auto; border:1px solid rgba(255,255,255,.09); border-radius:11px; display:grid; place-items:center; background:rgba(255,255,255,.035); color:#a9c8d6; font-size:.73rem; }
.collapsed-source-thumb:hover { border-color:rgba(95,208,250,.42); background:rgba(64,181,237,.1); color:#a9ebff; box-shadow:0 0 15px rgba(64,181,237,.11); }
.collapsed-source-thumb.source-audio { color:#e1a85b; }.collapsed-source-thumb.source-image { color:#71cbe8; }
.collapsed-source-thumb.artifact-thumb { border-color:color-mix(in srgb,var(--material-color) 27%,transparent); color:var(--material-color); }
.collapsed-source-thumb:disabled { opacity:.42; cursor:wait; }
.collapsed-rail-empty { border-style:dashed; color:var(--muted); }
#closeSourcesButton { display:grid; }
.source-overview-action { min-height:30px; margin:7px 4px 2px; padding:0 9px!important; border:1px solid rgba(225,168,91,.24)!important; border-radius:8px!important; background:rgba(225,168,91,.07)!important; color:#e6b774!important; font-size:.52rem!important; }
.source-overview-action i { margin-right:6px; }

/* Escolha de complexidade para a visão geral de uma aula transcrita */
.overview-options-modal { max-height:min(780px,92vh); overflow-y:auto; }
.overview-options-copy { margin:0 0 17px; color:var(--muted); font-size:.65rem; line-height:1.55; }
.overview-style-grid { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.overview-style-grid label { min-width:0; cursor:pointer; }
.overview-style-grid input { position:absolute; opacity:0; pointer-events:none; }
.overview-style-grid label > span { min-height:84px; padding:14px; border:1px solid var(--line); border-radius:13px; display:grid; grid-template-columns:30px minmax(0,1fr); column-gap:10px; align-content:center; background:rgba(255,255,255,.018); transition:.16s; }
.overview-style-grid label > span > i { grid-row:1/3; color:var(--muted); font-size:.85rem; align-self:center; }
.overview-style-grid strong { font-size:.68rem; font-weight:500; }.overview-style-grid small { margin-top:3px; color:var(--muted); font-size:.55rem; line-height:1.45; }
.overview-style-grid input:checked + span { border-color:rgba(98,210,255,.54); background:linear-gradient(135deg,rgba(64,181,237,.16),rgba(64,181,237,.05)); box-shadow:0 0 20px rgba(64,181,237,.09); }
.overview-style-grid input:checked + span > i,.overview-style-grid input:checked + span strong { color:#a9eaff; }
.overview-custom-option { grid-column:1/-1; }
.overview-custom-option > span { min-height:72px!important; }
.overview-custom-prompt { margin-top:13px; }

@media (max-width:900px) {
  .chat-layout,.chat-layout.sources-open { grid-template-columns:minmax(0,1fr); }
  .chat-heading { min-height:101px; padding:10px 13px; gap:8px; }
  .chat-heading-actions .danger { display:none; }
  .chat-heading .chat-quick-actions { max-width:calc(100vw - 118px); }
  .chat-heading .chat-quick-actions > span { display:none; }
  .chat-title-row h1 { max-width:calc(100vw - 150px); }
  .chat-title-pencil { opacity:1; visibility:visible; pointer-events:auto; }
  .sources-panel { width:42px; height:auto; position:fixed; z-index:1030; top:78px; right:0; bottom:0; left:auto; transform:none; box-shadow:-8px 0 22px rgba(0,0,0,.12); }
  .sources-collapsed-rail { padding-inline:4px; }
  .sources-collapsed-rail > button,.collapsed-source-thumb,.collapsed-rail-empty { width:34px; }
  .sources-panel.open { width:min(390px,95vw); height:auto; position:fixed; z-index:1080; top:0; right:0; bottom:0; transform:none; box-shadow:-24px 0 60px rgba(0,0,0,.38); }
  .sources-panel.open .sources-expanded-content { display:block; }
  .sources-panel-backdrop { display:block; }
  .message-stream { padding-left:18px; padding-right:54px; }
  .chat-composer-wrap { width:auto; margin-left:14px; margin-right:54px; }
}

@media (max-width:600px) {
  .chat-heading { grid-template-columns:minmax(0,1fr) auto; }
  .chat-heading-actions { display:none; }
  .chat-title-row h1 { max-width:calc(100vw - 74px); }
  .chat-heading { padding-right:52px; }
  .overview-style-grid { grid-template-columns:1fr; }
  .overview-custom-option { grid-column:auto; }
}

/* Fontes científicas compactas: a primeira fica visível e as demais abrem sob demanda. */
.message-evidence { margin-top:16px; padding-top:10px; }
.answer-sources { max-width:760px; padding:9px 10px; border-radius:12px; background:rgba(9,65,105,.18); }
.answer-sources > header { min-height:20px; margin-bottom:6px; font-size:.5rem; }
.answer-sources > header b { min-width:19px; height:19px; font-size:.48rem; }
.answer-sources .scientific-source-row { min-height:39px; padding:5px 7px; border-radius:9px; }
.answer-sources .source-domain-mark { width:24px; height:24px; font-size:.52rem; }
.answer-sources .source-row-copy strong { font-size:.58rem; }
.answer-sources .source-row-copy small { font-size:.47rem; }
.answer-sources .source-badge { min-height:20px; font-size:.44rem; }
.answer-sources details { margin-top:5px; }
.answer-sources details > summary { min-height:27px; padding:0 5px; display:flex; align-items:center; gap:5px; color:#8edfff; font-size:.52rem; }
.answer-sources details[open] > summary i { transform:rotate(180deg); }
.answer-sources details > div { margin-top:5px; display:grid; gap:5px; }

/* Configuração de questões geradas dentro do chat. */
.quiz-options-modal { max-height:min(820px,94vh); overflow-y:auto; }
.quiz-choice-group { margin:0 0 18px; padding:0; border:0; }
.quiz-choice-group legend { margin-bottom:9px; color:var(--cream); font-size:.68rem; font-weight:500; }
.segmented-choice { display:grid; grid-template-columns:repeat(5,1fr); gap:7px; }
.segmented-choice label,.quiz-level-grid label { cursor:pointer; }
.segmented-choice input,.quiz-level-grid input { position:absolute; opacity:0; pointer-events:none; }
.segmented-choice span { min-height:42px; border:1px solid var(--line); border-radius:10px; display:grid; place-items:center; color:var(--cream-soft); font-size:.7rem; }
.segmented-choice input:checked + span { border-color:#a879e9; background:rgba(168,121,233,.17); color:#e3cfff; box-shadow:0 0 17px rgba(168,121,233,.11); }
.quiz-level-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.quiz-level-grid label > span { min-height:78px; padding:12px; border:1px solid var(--line); border-radius:12px; display:grid; grid-template-columns:27px minmax(0,1fr); column-gap:8px; align-content:center; }
.quiz-level-grid i { grid-row:1/3; align-self:center; color:var(--muted); }
.quiz-level-grid strong { font-size:.65rem; font-weight:500; }
.quiz-level-grid small { margin-top:3px; color:var(--muted); font-size:.52rem; line-height:1.4; }
.quiz-level-grid input:checked + span { border-color:#a879e9; background:rgba(168,121,233,.13); box-shadow:0 0 18px rgba(168,121,233,.1); }
.quiz-level-grid input:checked + span i,.quiz-level-grid input:checked + span strong { color:#dec8ff; }

/* Questões interativas e documentos longos dentro do chat. */
.chat-document-body .summary-document { color:var(--cream-soft); font-size:.84rem; line-height:1.86; }
.chat-document-body .summary-document h1 { font-size:1.55rem; }
.chat-document-body .summary-document h2 { margin-top:34px; font-size:1.18rem; }
.chat-document-body .summary-document h3 { margin-top:25px; font-size:.97rem; }
.chat-quiz-document { max-width:980px; margin:0 auto; }
.chat-quiz-document > header { margin-bottom:18px; }
.chat-quiz-document > header span { color:#caa8f7; font-size:.55rem; font-weight:600; letter-spacing:.1em; }
.chat-quiz-document > header p { margin:5px 0 0; color:var(--muted); font-size:.63rem; }
.chat-quiz-toolbar,.quiz-item-toolbar { margin-bottom:10px; display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--muted); font-size:.58rem; }
.chat-quiz-toolbar button,.quiz-item-toolbar button { min-height:30px; padding:0 9px; border:1px solid rgba(255,126,134,.18); border-radius:8px; background:transparent; color:#e99ca2; font-size:.53rem; }
.chat-quiz-toolbar button i,.quiz-item-toolbar button i { margin-right:5px; }
.quiz-option { align-items:flex-start; }
.quiz-option-copy { width:auto!important; height:auto!important; min-width:0; flex:1; border:0!important; border-radius:0!important; display:flex!important; align-items:flex-start!important; flex-direction:column; gap:5px; }
.quiz-option-copy strong { font-size:.69rem; font-weight:500; line-height:1.5; }
.quiz-option-copy small { color:var(--muted); font-size:.58rem; line-height:1.55; }
.quiz-option.correct .quiz-option-copy small b { color:#9cdd83; }
.quiz-option.wrong .quiz-option-copy small b { color:#ff9da1; }

@media (max-width:600px) {
  .segmented-choice { grid-template-columns:repeat(5,minmax(48px,1fr)); overflow-x:auto; }
  .quiz-level-grid { grid-template-columns:1fr; }
  .answer-sources .source-badge { display:none; }
}
