@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --accent: #2b59c3;
  --accent-dark: #1f45a0;
  --accent-tint: #e6edfb;
  --accent-ink: #1a3a8a;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --ink: #14161b;
  --ink-2: #4a505c;
  --muted: #5b616e;
  --nav-muted: #626875;
  --line: #e4e6ea;
  --line-strong: #d5d8de;
  --past: #eceef1;
  --dark-2: #2e323b;
  --on-dark: #c9cdd6;
  --danger: #b42318;
  --now: #d92d20;
  --amber-ink: #5c3d00;
  --amber-tint: #fff1c2;
  --amber-label: #7a5200;
  --hour: 60px;
  --gutter: 20px;
  --column: 480px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }

html {
  height: 100%;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* The page itself never scrolls: each screen has one scroll area of its own. */
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
}

/* What people may want to copy stays selectable. */
input,
textarea,
a:not([data-link]),
.status-sub,
.status-time,
.room-chip,
.row-meta,
.alert-body,
.tt-block span,
.deadline-name,
.deadline-line,
.course-professor,
.course-email {
  -webkit-user-select: text;
  user-select: text;
}

a, button, input, label, select, textarea, summary { touch-action: manipulation; }

a[data-link] { -webkit-touch-callout: none; }

h1, h2, h3, p { margin: 0; }

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.scroller:focus { outline: none; }

[hidden] { display: none !important; }

/* ----- App frame: fixed header and tab bar around one scroll area ----- */

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
}

.view {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.view-header {
  flex-shrink: 0;
  padding-top: calc(var(--safe-top) + 24px);
  padding-bottom: 14px;
}

.view-header:empty { display: none; }

.scroller {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.view-footer { flex-shrink: 0; }
.view-footer:empty { display: none; }
.view-footer .column { padding-top: 12px; padding-bottom: max(16px, calc(var(--safe-bottom) + 8px)); }

.screen-header,
.column {
  max-width: var(--column);
  margin-left: auto;
  margin-right: auto;
  padding-left: max(var(--gutter), var(--safe-left));
  padding-right: max(var(--gutter), var(--safe-right));
}

.column { padding-top: 2px; padding-bottom: 24px; }
.view-header:empty + .scroller .column { padding-top: calc(var(--safe-top) + 24px); }

.nav {
  flex-shrink: 0;
  order: 1;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 6px max(8px, var(--safe-right)) var(--safe-bottom) max(8px, var(--safe-left));
}

/* As in the mockup: the form has its own button at the bottom, not the tab bar. */
.app[data-screen="corrigir"] .nav { display: none; }

.nav-brand { display: none; }

.nav-links { display: flex; justify-content: space-around; max-width: 480px; margin: 0 auto; }

.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 64px;
  min-height: 48px;
  color: var(--nav-muted);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 10px;
}

.nav-link:hover { color: var(--nav-muted); }
.nav-link[aria-current="page"], .nav-link[aria-current="page"]:hover { color: var(--accent); }

/* ----- Common pieces ----- */

.screen { display: flex; flex-direction: column; gap: 16px; }

.screen-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.screen-header-stacked { flex-direction: column; align-items: flex-start; gap: 0; }
.screen-header h1 { margin-top: 2px; font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pill-class {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
}

.badge {
  flex-shrink: 0;
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--bg);
  color: var(--fg);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}

.badge-small { padding: 3px 6px; border-radius: 6px; font-size: 10px; }

.pill {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}

.pill-test { --fg: var(--amber-ink); --bg: var(--amber-tint); }
.pill-delivery { --fg: var(--accent-ink); --bg: var(--accent-tint); }

.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack-tight { gap: 8px; }

.section-title { margin-bottom: 2px; font-size: 15px; font-weight: 700; line-height: 1.5; }

.empty {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
}

.cards { display: flex; flex-direction: column; gap: 10px; }

.card { padding: 14px; border-radius: 18px; background: var(--surface); }

.loading { padding: 40px 0; color: var(--muted); text-align: center; }

.stale {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--amber-tint);
  color: var(--amber-ink);
  font-size: 13px;
  line-height: 1.4;
}

.error-state { display: flex; flex-direction: column; gap: 10px; padding-top: 40px; }
.error-state h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.error-state p { color: var(--muted); }

.primary-button {
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.primary-button:hover { background: var(--accent-dark); }
.primary-button:disabled { opacity: 0.6; cursor: default; }

/* ----- Hoje ----- */

.hoje-grid { display: flex; flex-direction: column; gap: 16px; }

.status {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  background: var(--ink);
  color: #fff;
}

.status-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.status-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--on-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.status-label.is-live { color: #7fe0c4; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3dd6a8; }

.status-time { color: var(--on-dark); font-size: 13px; text-align: right; }
.status-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.status-sub { margin-top: 4px; color: var(--on-dark); font-size: 14px; }

.progress { height: 6px; border-radius: 3px; background: var(--dark-2); }
.progress-bar { height: 6px; border-radius: 3px; background: #3dd6a8; }

.status-note { color: var(--on-dark); font-size: 13px; }
.status-note strong { color: #fff; font-weight: 600; }

.status-next {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--dark-2);
}

.status-next-label { color: #9aa0ac; font-size: 12px; }
.status-next-name { margin-top: 2px; font-size: 15px; font-weight: 600; line-height: 1.3; }

.room-chip {
  flex-shrink: 0;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--dark-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff4d6;
  color: #3d2c00;
}

.alert > svg { flex-shrink: 0; margin-top: 1px; color: var(--amber-label); }
.alert-title { color: #6b4700; font-size: 13px; font-weight: 700; }
.alert-body { margin-top: 3px; font-size: 14px; line-height: 1.4; }

.alert-blue { background: var(--accent-tint); color: #1a2f66; }
.alert-blue > svg { color: var(--accent-dark); }
.alert-blue .alert-title { color: var(--accent-dark); }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 16px;
  background: var(--surface);
}

.row-time { flex-shrink: 0; width: 44px; font-size: 13px; font-weight: 600; line-height: 1.35; }
.row-time span { display: block; color: var(--muted); font-weight: 500; }
.row-main { flex: 1; min-width: 0; }
.row-name { font-size: 15px; font-weight: 600; line-height: 1.35; }
.row-meta { margin-top: 2px; color: var(--muted); font-size: 12px; }

.row-side { display: flex; flex-direction: column; flex-shrink: 0; align-items: flex-end; }

.row-link {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.row.is-past { background: var(--past); }
.row.is-past .row-time, .row.is-past .row-name { color: var(--ink-2); }

.row.is-cancelled .row-name, .tt-block.is-cancelled b { text-decoration: line-through; }

/* ----- Semana ----- */

/* A narrower gutter than other screens, so room names fit their phone columns. */
.app[data-screen="semana"] { --gutter: 16px; }
.screen-week { gap: 14px; }

.week-buttons { display: flex; gap: 6px; flex-shrink: 0; }

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
}

.icon-button:hover { background: var(--past); }

.timetable { padding: 12px 10px 14px 6px; border-radius: 20px; background: var(--surface); }

.tt-head { display: flex; gap: 4px; margin-bottom: 10px; }
.tt-corner { flex-shrink: 0; width: 30px; }

.tt-day { flex: 1 1 0; min-width: 0; text-align: center; }
.tt-day-name { color: var(--muted); font-size: 11px; font-weight: 600; }

.tt-day-number {
  width: 30px;
  height: 30px;
  margin: 2px auto 0;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  line-height: 30px;
}

.tt-day.is-today .tt-day-name { color: var(--accent); font-weight: 700; }
.tt-day.is-today .tt-day-number { background: var(--accent); color: #fff; }

.tt-body { display: flex; gap: 4px; }

.tt-hours { position: relative; flex-shrink: 0; width: 30px; height: calc(var(--hour) * var(--hours)); }

.tt-hour {
  position: absolute;
  left: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 12px;
  transform: translateY(-6px);
}

.tt-hour:first-child { transform: none; }
.tt-hour:last-child { transform: translateY(-12px); }

.tt-grid {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
  height: calc(var(--hour) * var(--hours));
  background: repeating-linear-gradient(var(--past) 0 1px, transparent 1px var(--hour));
}

.tt-column { position: relative; min-width: 0; }

.tt-block {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
}

.tt-block b { font-size: 12px; font-weight: 700; line-height: 1.3; }
.tt-block span { font-size: 11px; font-weight: 500; line-height: 1.3; }
.tt-block .tt-test { font-weight: 700; }
.tt-block .tt-name { display: none; }

.tt-block.is-changed { border: 2px solid var(--accent); padding: 4px; }
.tt-block.is-cancelled { opacity: 0.55; }

.tt-now { position: absolute; left: -4px; right: -2px; z-index: 2; height: 2px; background: var(--now); }

.tt-now::before {
  content: "";
  position: absolute;
  left: -2px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--now);
}

.legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 12px;
  padding: 0 4px;
  color: #3a3f49;
  font-size: 12px;
}

.legend-item { display: flex; align-items: center; gap: 7px; min-width: 0; }

.swatch { flex-shrink: 0; width: 18px; height: 14px; border-radius: 5px; }
.swatch-changed { border: 2px solid var(--accent); }
.swatch-test { background: var(--amber-tint); }

/* ----- Prazos ----- */

.segmented { display: flex; gap: 3px; padding: 3px; border-radius: 12px; background: var(--line); }

.segmented button {
  position: relative;
  flex: 1;
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}

.segmented button.is-on { background: var(--surface); color: var(--ink); }

/* Stretches the tap area to 44px without changing how the control looks. */
.segmented button::after,
.chip-button::after {
  content: "";
  position: absolute;
  top: -4px;
  right: 0;
  bottom: -4px;
  left: 0;
}

/* Measured from inside the 1.5px border, so these reach further to make 44px. */
.chip-button::after { top: -5.5px; bottom: -5.5px; }

.deadline { display: flex; gap: 14px; align-items: center; }
.deadline.is-cancelled { opacity: 0.6; }
.deadline.is-cancelled .deadline-name { text-decoration: line-through; }

.countdown {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
}

.countdown-test { background: var(--amber-tint); color: var(--amber-ink); }
.countdown-delivery { background: var(--accent-tint); color: var(--accent-ink); }
.countdown-number { font-size: 26px; font-weight: 700; line-height: 1; }
.countdown-unit { font-size: 11px; font-weight: 600; }
.countdown-today { font-size: 17px; font-weight: 700; }

.deadline-main { flex: 1; min-width: 0; }
.deadline-kind { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; }
.kind-test { color: var(--amber-label); }
.kind-delivery { color: var(--accent-dark); }
.deadline-name { margin-top: 2px; font-size: 16px; font-weight: 600; line-height: 1.35; }
.deadline-line { margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.4; }

.subscribe {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  background: var(--ink);
  color: #fff;
}

.subscribe > div { flex: 1; min-width: 0; }
.subscribe-title { font-size: 15px; font-weight: 600; }
.subscribe-text { margin-top: 3px; color: var(--on-dark); font-size: 12px; line-height: 1.4; }

.subscribe-button {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.subscribe-button:not(.is-soon) { position: relative; }
.subscribe-button:not(.is-soon)::after { content: ""; position: absolute; top: -2px; right: 0; bottom: -2px; left: 0; }
.subscribe-button:hover { color: var(--ink); }
.subscribe-button:not(.is-soon):active { background: var(--line-strong); }

.subscribe > .subscribe-actions { display: flex; flex: 0 0 auto; flex-direction: column; align-items: stretch; gap: 8px; }
.subscribe-actions .subscribe-button { justify-content: center; }
.subscribe-copy { display: none; }
.subscribe-copy .chip-button { width: 100%; justify-content: center; border-color: var(--dark-2); background: transparent; color: #fff; }
.subscribe-copy .chip-button:hover, .subscribe-copy .chip-button:active { background: var(--dark-2); color: #fff; }
.subscribe-copy .course-email { display: block; max-width: 240px; margin-top: 6px; color: var(--on-dark); }

@media (hover: hover) and (pointer: fine) {
  .subscribe-copy { display: block; }
}

.subscribe-button.is-soon { background: var(--dark-2); color: var(--on-dark); font-weight: 600; }

/* ----- Cadeiras ----- */

.course { display: flex; flex-direction: column; gap: 8px; padding: 13px 14px; }
.course-top { display: flex; align-items: center; gap: 10px; }
.course-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.35; }
.course-professor { color: var(--muted); font-size: 13px; }
.course-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.course-email { align-self: center; font-size: 12px; overflow-wrap: anywhere; }

.chip-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 11px;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.chip-button:hover { background: var(--bg); color: var(--ink); }

/* ----- Sugerir correção ----- */

.back-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 4px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.plain-title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }

.correction-form { display: flex; flex-direction: column; gap: 18px; max-width: 560px; }

.form-summary { display: flex; gap: 12px; align-items: center; }
.form-summary-name { font-size: 15px; font-weight: 600; line-height: 1.35; }
.form-summary-line { font-size: 13px; }

.options { display: flex; flex-direction: column; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.options legend { margin-bottom: 10px; padding: 0; font-size: 13px; font-weight: 600; }
.options-list { display: flex; flex-wrap: wrap; gap: 8px; }

.option {
  position: relative;
  min-height: 40px;
  padding: 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

/* Reaches from inside the border to make a 44px tap area. */
.option::after { content: ""; position: absolute; top: -3.5px; right: 0; bottom: -3.5px; left: 0; }

.option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-ink); }
.option:active { background: var(--past); }
.option[aria-pressed="true"]:active { background: var(--line-strong); }

.field { display: flex; flex: 1; flex-direction: column; gap: 8px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; }
.field-hint { color: var(--muted); font-weight: 500; }
.field-row { display: flex; gap: 12px; }

.field input,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.field input { height: 50px; padding: 0 16px; }
.field textarea { display: block; padding: 12px 16px; resize: none; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.form-note { color: var(--muted); font-size: 13px; line-height: 1.45; }

.submit-button { display: block; width: 100%; max-width: 560px; min-height: 54px; border-radius: 16px; }

.sent-message { display: flex; flex-direction: column; gap: 10px; max-width: 560px; padding: 20px; }
.sent-message h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.sent-message p { color: var(--muted); font-size: 14px; line-height: 1.45; }

.link-button { display: flex; align-items: center; justify-content: center; margin-top: 6px; text-decoration: none; }
.link-button, .link-button:hover { color: #fff; }

/* ----- Admin ----- */

.admin-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 640px;
  min-height: 100%;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 24px) max(var(--gutter), var(--safe-right)) calc(var(--safe-bottom) + 24px) max(var(--gutter), var(--safe-left));
}

.admin-card { display: flex; flex-direction: column; gap: 4px; }
.admin-change { margin-top: 4px; font-size: 14px; font-weight: 600; -webkit-user-select: text; user-select: text; }
.admin-actions { display: flex; gap: 8px; margin-top: 10px; }
.admin-button { flex: 1; min-height: 44px; border-radius: 12px; font-size: 14px; font-weight: 600; }

.secondary-button { border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.secondary-button:active:not(:disabled) { background: var(--past); }
.secondary-button:disabled { opacity: 0.6; cursor: default; }

/* ----- Entrar ----- */

.entrar-scroll {
  height: 100%;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.entrar-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 440px;
  min-height: 100%;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 24px) max(24px, var(--safe-right)) calc(var(--safe-bottom) + 24px) max(24px, var(--safe-left));
}

.entrar-center { display: flex; flex: 1 0 auto; flex-direction: column; justify-content: center; gap: 28px; }

.entrar-header { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.entrar-header h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.entrar-header p { margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.45; }

.entrar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: var(--ink);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.entrar-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: 22px;
  background: var(--surface);
}

.entrar-card label { font-size: 13px; font-weight: 600; }

.entrar-card input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  background: #f8f9fa;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.entrar-card input::placeholder { color: var(--muted); font-weight: 500; }
.entrar-card input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.entrar-card input[aria-invalid="true"] { border-color: var(--danger); }

.entrar-help { margin-top: 2px; color: var(--muted); font-size: 13px; text-align: center; }

.error { color: var(--danger); font-size: 14px; }

.install-hint {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--accent-tint);
  color: var(--accent-dark);
}

.install-hint svg { flex-shrink: 0; }
.install-hint p { color: #1a2f66; font-size: 13px; line-height: 1.45; }
.install-hint p + p { margin-top: 4px; }
.install-hint strong { font-weight: 700; }

/* The install hint is only useful on touch devices. */
@media (hover: hover) and (pointer: fine) {
  .install-hint { display: none; }
}

/* ----- The narrowest phones: "Algo errado?" moves below, so names keep their room ----- */

@media (max-width: 359px) {
  .row { flex-wrap: wrap; row-gap: 0; }
  .row-main { flex-basis: calc(100% - 130px); }
  .row-side { flex-direction: row; align-items: center; gap: 10px; margin-left: 56px; }
}

/* ----- Pressed states, replacing the tap highlight ----- */

.nav-link:active,
.back-link:active,
.row-link:active,
a.chip-button:active { opacity: 0.6; }

.primary-button:active:not(:disabled) { background: var(--accent-dark); }
.icon-button:active,
.chip-button:active { background: var(--past); }
.segmented button:active:not(.is-on) { background: var(--line-strong); }
.segmented button.is-on:active { background: var(--past); }

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ----- Tablets: more room, same tab bar ----- */

@media (min-width: 700px) {
  :root { --hour: 72px; --gutter: 28px; --column: 860px; }

  .app[data-screen="semana"] { --gutter: 28px; }

  .segmented { max-width: 420px; }

  .hoje-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 20px; }

  .cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

  .legend { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .tt-block { padding: 8px; }
  .tt-block.is-changed { padding: 6px; }
  .tt-block b { font-size: 13px; }
  .tt-block span { font-size: 12px; }
  .tt-block .tt-name { display: block; }
}

/* ----- Desktop: floating sidebar instead of the tab bar ----- */

@media (min-width: 1024px) {
  :root { --gutter: 32px; --column: 1120px; }

  .app { padding-left: 232px; }

  .app[data-screen="semana"] { --gutter: 32px; }

  .view-header { padding-top: 32px; }

  .column { padding-bottom: 40px; }

  .app[data-screen="corrigir"] .nav { display: flex; }

  .nav {
    position: fixed;
    top: 16px;
    left: 16px;
    right: auto;
    bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 200px;
    padding: 16px 12px;
    border: 1px solid var(--line);
    border-radius: 22px;
  }

  .nav-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; font-size: 15px; font-weight: 700; }

  .nav-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--ink);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
  }

  .nav-links { flex-direction: column; justify-content: flex-start; gap: 4px; max-width: none; margin: 0; }

  .nav-link {
    flex-direction: row;
    gap: 10px;
    min-height: 44px;
    padding: 0 10px;
    color: var(--ink-2);
    font-size: 14px;
  }

  .nav-link:hover { background: var(--bg); color: var(--ink); }
  .nav-link[aria-current="page"], .nav-link[aria-current="page"]:hover { background: var(--accent-tint); color: var(--accent); }

  .cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

  .subscribe { max-width: 640px; }

  .legend { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

/* ----- Keyboard open with little height left, as on a phone in landscape ----- */

.keyboard-short .view-header { display: none; }
.keyboard-short .column { padding-top: 12px; }
.keyboard-short .view-footer .column { padding-top: 8px; padding-bottom: 8px; }
