/* The ballot is a short guided conversation. Everything else waits until the
   student's explicit 'Tornar al portal' action. */
body[data-view="home"].is-guided-ballot { background: #fafaf8; }
body[data-view="home"].is-guided-ballot .shell { background: #fafaf8; }
body[data-view="home"].is-guided-ballot .topbar {
  margin: 0; height: 58px; padding: 0 clamp(18px, 4vw, 48px); background: transparent; border: 0;
}
body[data-view="home"].is-guided-ballot .topbar::before { content: none; }
body[data-view="home"].is-guided-ballot #adminNavButton { display: none; }
body[data-view="home"].is-guided-ballot #homeView {
  margin: 0; padding: 0 22px 40px; min-height: calc(100dvh - 58px);
}
body[data-view="home"].is-guided-ballot #homeView .workspace-sidebar,
body[data-view="home"].is-guided-ballot #homeView .home-hero,
body[data-view="home"].is-guided-ballot #studentAccessNotice { display: none; }
body[data-view="home"].is-guided-ballot #homeView .voting-panel {
  max-width: 640px; background: transparent; padding: 0; margin: 0 auto;
}
body[data-view="home"].is-guided-ballot .proposal-detail-page,
body[data-view="home"].is-guided-ballot .proposal-detail-content { padding: 0; margin: 0; }
#homeView .flow-frame { width: 100%; padding-bottom: 24px; }
#homeView .flow-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 4px 0 30px; }
.flow-brand { display: flex; align-items: center; gap: 10px; color: #37352f; font-size: 15px; font-weight: 650; letter-spacing: -.03em; }
.flow-brand > span { display: grid; place-items: center; width: 30px; height: 32px; border: 1px solid #deded8; border-radius: 5px; background: #fff; font-size: 24px; font-weight: 700; }
#homeView .flow-header > span { font-size: 11px; color: #70716a; text-align: right; line-height: 1.5; }
#homeView .flow-screen {
  display: flex; flex-direction: column; align-items: flex-start; min-height: 420px; padding: clamp(28px, 5vw, 48px);
  border: 1px solid #e5e5df; border-radius: 12px; background: #fff; box-shadow: 0 8px 38px #37352f04;
}
#homeView .flow-screen h2 { margin: 12px 0 18px; max-width: 100%; color: #37352f; font-size: clamp(27px, 4vw, 35px); line-height: 1.2; letter-spacing: -.035em; font-weight: 650; text-transform: none; }
#homeView .flow-screen h2:focus { outline: none; }
#homeView .flow-eyebrow { margin: 0; color: #70716a; font-size: 11px; line-height: 1.5; font-weight: 500; }
#homeView .flow-copy { margin: 0 0 24px; color: #67685f; font-size: 15px; line-height: 1.75; white-space: pre-line; }
#homeView .flow-note { margin: 20px 0 0; color: #70716a; font-size: 11px; line-height: 1.7; max-width: 44em; }
#homeView .flow-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; width: 100%; margin-top: 28px; }
#homeView .flow-button, .invitation-gate .flow-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 12px 20px;
  border-radius: 6px; border: 1px solid transparent; font: inherit; font-size: 13px; font-weight: 550; line-height: 1.4;
  cursor: pointer; transition: transform 130ms cubic-bezier(.23,1,.32,1), background-color 130ms ease, border-color 130ms ease;
}
#homeView .flow-primary, .invitation-gate .flow-primary { background: #373d34; color: #fff; }
#homeView .flow-secondary { background: transparent; border-color: #e5e5df; color: #57594f; }
#homeView .flow-button:active, #homeView .flow-choice:active { transform: scale(.985); }
#homeView .flow-button:disabled { opacity: .55; cursor: default; transform: none; }
#homeView .flow-button:focus-visible, #homeView .flow-choice:focus-visible, #homeView .flow-abstain:focus-visible,
#homeView .flow-footer button:focus-visible, #homeView .flow-full-call summary:focus-visible,
.invitation-gate button:focus-visible { outline: 2px solid #677c56; outline-offset: 4px; }
#homeView .flow-facts { display: grid; gap: 13px; width: 100%; padding: 18px 0; margin: 0 0 12px; border-block: 1px solid #eeeee8; }
#homeView .flow-facts > div { display: grid; grid-template-columns: 85px 1fr; gap: 12px; }
#homeView .flow-facts dt { color: #70716a; font-size: 11px; line-height: 1.65; }
#homeView .flow-facts dd { margin: 0; color: #484b41; font-size: 12px; line-height: 1.65; }
#homeView .flow-full-call { width: 100%; margin: 8px 0; color: #55584d; }
#homeView .flow-full-call summary { cursor: pointer; width: fit-content; font-size: 12px; line-height: 1.7; }
#homeView .flow-full-call > div { margin-top: 16px; padding: 0 0 0 14px; border-left: 2px solid #e7eadf; font-size: 13px; line-height: 1.85; white-space: pre-line; overflow-wrap: anywhere; }
#homeView .flow-source, .invitation-gate .flow-source { display: inline-block; margin-top: 10px; font-size: 12px; color: #526444; text-decoration: underline; text-underline-offset: 3px; }
#homeView .flow-demands { display: grid; gap: 14px; margin: 4px 0 12px; padding: 0; list-style: none; width: 100%; }
#homeView .flow-demands li { position: relative; padding: 16px 18px 16px 36px; background: #f7f8f3; border: 1px solid #e7eade; border-radius: 6px; color: #484e3e; font-size: 15px; line-height: 1.6; }
#homeView .flow-demands li::before { position: absolute; left: 17px; top: 24px; width: 4px; height: 4px; border-radius: 50%; background: #71815b; content: ''; }
#homeView .flow-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; margin: 5px 0 16px; }
#homeView .flow-choice { position: relative; display: flex; flex-direction: column; gap: 7px; align-items: flex-start; min-height: 140px; padding: 23px 22px; border: 1px solid #dfE2d6; border-radius: 8px; background: #fafbf7; color: #373d34; text-align: left; transition: transform 130ms cubic-bezier(.23,1,.32,1), border-color 130ms ease, background-color 130ms ease; }
#homeView .flow-choice strong { font-size: 30px; line-height: 1.1; letter-spacing: -.04em; }
#homeView .flow-choice span { font-size: 12px; line-height: 1.7; }
#homeView .flow-choice i { position: absolute; right: 20px; top: 26px; font-style: normal; font-size: 20px; color: #849171; }
#homeView .flow-choice.is-selected { border-color: #71815b; background: #f3f6ec; }
#homeView .flow-abstain { background: transparent; border: 0; padding: 10px 0; color: #62665a; font-size: 12px; text-align: left; text-decoration: underline; text-underline-offset: 4px; }
#homeView .flow-review { width: 100%; padding: 22px; border: 1px solid #e3e7d8; border-radius: 8px; background: #f7f9f2; }
#homeView .flow-review > span { display: block; font-size: 11px; color: #667355; }
#homeView .flow-review > strong { display: block; margin: 10px 0; font-size: 27px; color: #3e4b32; text-transform: capitalize; }
#homeView .flow-review > p { margin: 0; font-size: 12px; line-height: 1.8; color: #626b56; }
#homeView .flow-success { display: grid; place-items: center; width: 50px; height: 50px; border: 1px solid #dce5d0; border-radius: 50%; background: #f4f8ed; margin-bottom: 26px; }
#homeView .flow-success svg { width: 30px; height: 30px; stroke: #627c4a; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#homeView .flow-final-record { display: grid; gap: 10px; width: 100%; padding: 19px 0; border-block: 1px solid #eaece3; }
#homeView .flow-final-record > span { color: #70716a; font-size: 12px; line-height: 1.6; }
#homeView .flow-final-record > strong { font-size: 16px; color: #3f4b35; }
#homeView .flow-final-record > small { color: #70716a; font-size: 10px; font-variant-numeric: tabular-nums; }
#homeView .flow-footer { display: flex; justify-content: center; margin: 24px 0 0; color: #70716a; font-size: 10px; text-align: center; }
#homeView .flow-footer button { border: 0; background: transparent; padding: 8px 12px; color: #62665a; font-size: 11px; }
#homeView .flow-results { width: 100%; margin: 8px 0 20px; }
#homeView .flow-results .result-bars { display: grid; gap: 18px; }
#homeView .flow-results .result-bar i { display: block; height: 5px; background: #e6eadf; border-radius: 3px; }
#homeView .flow-status-symbol, .invitation-gate .flow-status-symbol { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 28px; border: 1px solid #e2e5da; border-radius: 8px; background: #f8f9f5; color: #74805f; font-size: 24px; }
#homeView .flow-transfer { position: relative; width: 80px; height: 78px; margin: 5px 0 32px; }
#homeView .flow-paper { position: absolute; left: 23px; top: 3px; width: 34px; height: 44px; border: 1px solid #bdc9aa; border-radius: 3px; background: #f6f9f0; z-index: 1; animation: flowPaper 1500ms cubic-bezier(.65,0,.35,1) infinite; }
#homeView .flow-paper i { display: block; height: 2px; margin: 8px 7px 0; background: #cbd5bc; border-radius: 2px; }
#homeView .flow-envelope { position: absolute; left: 9px; bottom: 1px; width: 62px; height: 37px; border: 1px solid #d9decf; border-radius: 5px; background: #fff; z-index: 2; }
#homeView .flow-envelope::after { position: absolute; content: ''; width: 37px; height: 37px; top: -22px; left: 11px; border-right: 1px solid #d9decf; border-bottom: 1px solid #d9decf; transform: rotate(45deg); border-radius: 0 0 5px 0; background: #fff; }
#homeView .flow-loading { width: min(220px,100%); height: 3px; margin: 6px 0; background: #edf0e6; border-radius: 3px; overflow: hidden; }
#homeView .flow-loading > span { display: block; height: 100%; width: 40%; border-radius: inherit; background: #8b9b72; animation: flowLoad 1300ms cubic-bezier(.65,0,.35,1) infinite; }
#homeView .flow-ballots { width: 100%; display: grid; gap: 10px; margin: 0 0 24px; }
#homeView .flow-ballot-link { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 20px; border: 1px solid #e2e5da; border-radius: 7px; background: #fafbf7; text-align: left; color: #373d34; }
#homeView .flow-ballot-link span { font-size: 15px; font-weight: 550; line-height: 1.6; }
#homeView .flow-ballot-link small { font-size: 11px; color: #70716a; }
#homeView .flow-enter { animation: flowEnter 200ms cubic-bezier(.23,1,.32,1) both; }
@keyframes flowEnter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes flowPaper { 0%, 100% { transform: translateY(-2px); opacity: 1; } 65% { transform: translateY(18px); opacity: .45; } }
@keyframes flowLoad { from { transform: translateX(-120%); } to { transform: translateX(350%); } }
@media (hover:hover) and (pointer:fine) {
  #homeView .flow-primary:hover, .invitation-gate .flow-primary:hover { background: #4a5442; }
  #homeView .flow-secondary:hover { background: #f8f9f5; border-color: #cbd3bf; }
  #homeView .flow-choice:hover { border-color: #899b72; background: #f3f6ed; }
}
body[data-invitation-state] #loginView .verify-panel, body[data-invitation-state] #loginView .identity-panel { display: none; }
body[data-invitation-state] #loginView { display: block; padding: 22px; }
.invitation-gate { max-width: 470px; margin: clamp(30px,10vh,100px) auto; padding: 32px; border: 1px solid #e4e6de; border-radius: 10px; background: #fff; color: #373d34; text-align: left; }
.invitation-gate .flow-brand { margin-bottom: 40px; }
.invitation-gate h2 { font-size: 27px; line-height: 1.25; letter-spacing: -.03em; margin: 0 0 20px; }
.invitation-gate p { font-size: 14px; line-height: 1.8; color: #70716a; margin: 0 0 26px; }
@media (max-width:600px) {
  body[data-view="home"].is-guided-ballot #homeView { padding: 0 16px 30px; }
  #homeView .flow-header { margin-bottom: 22px; }
  #homeView .flow-screen { padding: 28px 23px; min-height: 380px; border-radius: 9px; }
  #homeView .flow-screen h2 { font-size: 28px; }
  #homeView .flow-copy { font-size: 14px; }
  #homeView .flow-choices { gap: 9px; }
  #homeView .flow-choice { min-height: 135px; padding: 20px 16px; }
  #homeView .flow-choice span { max-width: 9em; }
  #homeView .flow-choice i { right: 15px; top: 20px; }
  #homeView .flow-primary { width: 100%; }
  #homeView .flow-facts > div { grid-template-columns: 70px 1fr; gap: 8px; }
  .invitation-gate { padding: 28px 24px; }
}
@media (prefers-reduced-motion:reduce) {
  #homeView .flow-enter, #homeView .flow-paper, #homeView .flow-loading > span { animation: none; transform: none; opacity: 1; }
  #homeView .flow-button, #homeView .flow-choice { transition: none; }
  #homeView .flow-button:active, #homeView .flow-choice:active { transform: none; }
}
/* Invitation states use the same quiet frame as the guided ballot; none of the
   legacy login material or navigation should appear behind this message. */
body[data-invitation-state] { min-height: 100dvh; margin: 0; background: #fafaf8; }
body[data-invitation-state] .shell {
  width: 100%; max-width: none; min-height: 100dvh; margin: 0; padding: 0;
  border: 0; border-radius: 0; background: #fafaf8; box-shadow: none; overflow: visible;
}
body[data-invitation-state] .shell::before { display: none; }
body[data-invitation-state] .topbar { display: none; }
body[data-invitation-state] #loginView {
  display: grid; place-items: center; min-height: 100dvh; width: 100%; margin: 0; padding: 24px;
}
body[data-invitation-state] .invitation-gate { width: min(470px,100%); margin: 0; box-sizing: border-box; }
#homeView .flow-header > span { max-width: 230px; overflow-wrap: anywhere; }
@media (max-width:600px) { #homeView .flow-header > span { max-width: 180px; font-size: 10px; } }
/* A brief welcome belongs to the browser. Authentication starts immediately;
   the yellow screen never holds an API slot or invents a verified identity. */
body[data-link-intro] { min-height: 100dvh; margin: 0; background: #fff3a6; }
body[data-link-intro] .shell { visibility: hidden; }
.link-welcome { position: fixed; inset: 0; z-index: 64; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 38px 24px 30px; background: #fff3a6; color: #32362d; }
.welcome-brand { align-self: flex-start; font-size: 16px; font-weight: 650; letter-spacing: -.045em; }
.welcome-center { display: flex; flex-direction: column; align-items: center; width: min(560px,100%); text-align: center; margin-top: -5vh; }
.welcome-mark { display: grid; place-items: center; width: 58px; height: 60px; margin-bottom: 25px; border: 1px solid #c9bd6b; border-radius: 10px; background: #fff9d1; color: #34382e; font-size: 43px; line-height: 1; font-weight: 700; letter-spacing: -.065em; }
.link-welcome h1 { margin: 0 0 18px; color: #34382e; font-family: inherit; font-size: clamp(42px,8vw,66px); line-height: 1.1; letter-spacing: -.055em; font-weight: 650; text-transform: none; overflow-wrap: anywhere; }
.link-welcome p { margin: 0; color: #656141; font-size: 14px; line-height: 1.7; }
.link-welcome > small { color: #77704b; font-size: 11px; }
.welcome-progress { width: 108px; height: 3px; margin-top: 32px; border-radius: 5px; background: #e7d989; overflow: hidden; }
.welcome-progress span { display: block; width: 45%; height: 100%; border-radius: inherit; background: #817344; animation: welcomeProgress 1200ms cubic-bezier(.65,0,.35,1) infinite; }
body[data-link-intro="welcoming"] .welcome-mark { animation: welcomeArrive 220ms cubic-bezier(.23,1,.32,1) both; }
@keyframes welcomeProgress { from { transform: translateX(-110%); } to { transform: translateX(330%); } }
@keyframes welcomeArrive { from { opacity: .5; transform: translateY(5px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
body[data-invitation-state="inactive"], body[data-invitation-state="inactive"] .shell { background: #fff3a6; }
body[data-invitation-state="inactive"] .invitation-gate { background: transparent; border: 0; box-shadow: none; padding: 30px 24px; }
body[data-invitation-state="inactive"] .invitation-gate .flow-brand { margin-bottom: 48px; }
body[data-invitation-state="inactive"] .invitation-gate .flow-status-symbol { background: #fff9d1; border-color: #d9cb7c; color: #796f42; }
body[data-invitation-state="inactive"] .invitation-gate h2 { font-size: clamp(36px,7vw,46px); letter-spacing: -.045em; color: #34382e; }
body[data-invitation-state="inactive"] .invitation-gate p { color: #686242; font-size: 15px; }
body[data-invitation-state="inactive"] .invitation-gate .flow-primary { background: #34382e; }
#homeView .home-dashboard.without-live-stats[data-section="ballots"] { grid-template-columns: 1fr; }
#homeView .home-dashboard.without-live-stats[data-section="ballots"] .dashboard-rail { display: none; }
@media (max-width:600px) { .link-welcome { padding: 28px 23px 26px; } .welcome-center { margin-top: -3vh; } }
@media (prefers-reduced-motion:reduce) { .welcome-progress span, body[data-link-intro="welcoming"] .welcome-mark { animation: none; transform: none; } }
body[data-link-intro][data-view="login"].is-queued::after { background: #fff3a6; }
body[data-link-intro] .splash-screen,
body[data-invitation-state] .splash-screen { display: none; }
.invitation-gate h2:focus { outline: none; }
