:root {
  --bg: #eef1f0;
  --surface: #f7f9f8;
  --panel: #ffffff;
  --panel-soft: #f1f5f3;
  --ink: #17201d;
  --muted: #65716d;
  --line: #d9e0dd;
  --accent: #087c68;
  --accent-dark: #05604f;
  --accent-soft: #dff2ed;
  --blue: #376cc4;
  --blue-soft: #e5edfb;
  --coral: #c8606c;
  --coral-soft: #f9e8ea;
  --amber: #a66c08;
  --amber-soft: #fbf0d8;
  --violet: #7359ae;
  --violet-soft: #eee9f8;
  --danger: #b93e4d;
  --danger-soft: #fbeaec;
  --shadow-soft: 0 8px 24px rgba(25, 45, 38, 0.1);
  --shadow-phone: 0 30px 80px rgba(25, 45, 38, 0.18);
  --nav-height: 78px;
}

body.dark-theme {
  --bg: #121816;
  --surface: #151d1a;
  --panel: #1d2824;
  --panel-soft: #22312c;
  --ink: #edf7f4;
  --muted: #9cafaa;
  --line: #30423c;
  --accent: #36c4a9;
  --accent-dark: #72dec9;
  --accent-soft: #143c35;
  --blue: #82aaf4;
  --blue-soft: #1d3053;
  --coral: #ee8b97;
  --coral-soft: #4a2229;
  --amber: #efb85c;
  --amber-soft: #473417;
  --violet: #b7a1f4;
  --violet-soft: #322851;
  --danger: #ff9aa6;
  --danger-soft: #4a2229;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: #dfe6e3;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.dark-theme {
  background: #0e1412;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button,
label[for],
.source-button,
.upload-row,
.small-upload {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(55, 108, 196, 0.24);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
}

h1,
h2,
h3,
p {
  margin: 0;
}

svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

.hidden,
.hidden-panel {
  display: none !important;
}

.shell {
  display: grid;
  grid-template-columns: 412px minmax(320px, 520px);
  gap: 64px;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 28px;
  background:
    linear-gradient(115deg, #e8eeec 0 52%, #dce5e2 52% 100%);
}

.phone {
  position: relative;
  width: 412px;
  height: min(892px, calc(100vh - 40px));
  min-height: 720px;
  overflow: hidden;
  border: 1px solid rgba(23, 32, 29, 0.14);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow-phone);
}

.splash-screen,
.onboarding,
.app-screen,
.classroom-switcher,
.photo-viewer,
.app-dialog {
  position: absolute;
  inset: 0;
}

.splash-screen {
  z-index: 50;
  display: grid;
  place-items: center;
  background: #f9fbfa;
  transition: opacity 220ms ease, visibility 220ms ease;
}

body.dark-theme .splash-screen {
  background: #111916;
}

.splash-screen.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.splash-content {
  display: grid;
  justify-items: center;
  gap: 36px;
  text-align: center;
}

.splash-content h1 {
  font-size: 42px;
  font-weight: 800;
}

.splash-content p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
}

.beta-chip,
.beta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.beta-chip {
  margin-top: 14px;
}

.beta-pill {
  min-height: 21px;
  font-size: 9px;
}

.studapp-logo {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(8, 92, 78, 0.16));
}

.studapp-logo.large {
  width: 156px;
  height: 156px;
  animation: logo-enter 700ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.studapp-logo.small {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 5px 9px rgba(8, 92, 78, 0.12));
}

@keyframes logo-enter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.onboarding {
  z-index: 10;
  overflow-y: auto;
  padding: max(28px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 20% 8%, rgba(8, 124, 104, 0.1), transparent 34%),
    linear-gradient(180deg, var(--surface), var(--panel-soft));
}

body.dark-theme .onboarding {
  background:
    radial-gradient(circle at 20% 8%, rgba(54, 196, 169, 0.16), transparent 34%),
    linear-gradient(180deg, #141d1a, #101614);
}

.onboarding.hidden {
  display: none;
}

.onboarding-step {
  display: grid;
  align-content: center;
  min-height: 100%;
  gap: 24px;
}

.onboarding-step.hidden {
  display: none;
}

#registrationStep {
  align-content: start;
  padding-top: 72px;
  padding-bottom: 20px;
}

.auth-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.auth-copy {
  display: grid;
  gap: 8px;
  margin-top: 52px;
}

.auth-copy h1,
.form-intro h1 {
  max-width: 340px;
  font-size: 34px;
  line-height: 1.08;
}

.auth-copy > p:last-child,
.form-intro p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.kicker,
.section-kicker,
.secondary-header p,
.detail-header p,
.context-label,
.detected-card small,
.invite-label,
.drive-folder-row small {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-actions {
  display: grid;
  gap: 12px;
}

.primary-button,
.google-button,
.source-button,
.danger-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
}

.primary-button {
  border: 0;
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.primary-button:disabled {
  background: #cbd4d0;
  color: #78827e;
}

.primary-button.tonal {
  border: 1px solid #b8d8d0;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.google-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(23, 32, 29, 0.06);
}

.demo-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 11px;
  align-items: center;
  width: 100%;
  min-height: 66px;
  padding: 10px 14px;
  border: 1px dashed rgba(55, 108, 196, 0.38);
  border-radius: 14px;
  background: rgba(229, 237, 251, 0.52);
  color: var(--ink);
  text-align: left;
}

.demo-button span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
}

.demo-button strong {
  font-size: 14px;
  font-weight: 900;
}

.demo-button small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

body.dark-theme .google-button {
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

body.dark-theme .demo-button {
  background: rgba(29, 48, 83, 0.44);
}

.google-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
}

.legal-copy {
  max-width: 290px;
  justify-self: center;
  color: #7b8682;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  justify-self: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

body.dark-theme .theme-toggle,
body.dark-theme .google-button,
body.dark-theme .switch-row,
body.dark-theme .student-link,
body.dark-theme .ghost-button {
  background: var(--panel);
}

body.dark-theme .primary-button.tonal {
  border-color: #28685d;
}

body.dark-theme .phone {
  border-color: rgba(255, 255, 255, 0.12);
}

.screen-header,
.secondary-header,
.detail-header,
.page-title-row,
.section-head,
.list-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.screen-header {
  position: absolute;
  top: max(24px, env(safe-area-inset-top));
  right: 24px;
  left: 24px;
}

.icon-button,
.account-button,
.field-icon,
.scan-button,
.clear-search {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #edf2f0;
  color: var(--ink);
}

.filled-icon {
  background: var(--accent);
  color: #ffffff;
}

.step-counter,
.status-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: #e8eeeb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.form-intro {
  display: grid;
  gap: 8px;
}

.form-intro.compact {
  margin-bottom: 4px;
}

#registrationNotice,
#emailLoginAddress {
  overflow-wrap: anywhere;
}

.mobile-form {
  display: grid;
  gap: 16px;
}

.form-hint {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.form-hint svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.field {
  display: grid;
  gap: 7px;
}

.field > span,
.picker-field legend {
  color: #4f5d58;
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid #cfd8d4;
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
}

textarea {
  min-height: 88px;
  padding-block: 13px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #9ba5a1;
}

input[readonly] {
  background: var(--panel-soft);
  color: var(--muted);
}

.password-field,
.input-action {
  position: relative;
}

.password-field input,
.input-action input {
  padding-right: 54px;
}

.field-icon {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transform: translateY(-50%);
}

.field-icon.standalone {
  background: var(--panel-soft);
}

.picker-field {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.avatar-choice {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  font-size: 25px;
}

.avatar-choice.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px rgba(8, 124, 104, 0.12);
}

.classroom-picker .avatar-choice {
  color: var(--amber);
  font-size: 22px;
}

.choice-list {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.choice-row,
.upload-row,
.settings-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.choice-row.featured {
  border-color: #9fcfc2;
  background: #f8fcfb;
}

.choice-row > svg,
.upload-row > svg,
.settings-row > svg {
  width: 18px;
  color: #8b9692;
}

.choice-row span:nth-child(2),
.upload-row span:nth-child(2),
.settings-row span:nth-child(2) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.choice-row strong,
.upload-row strong,
.settings-row strong {
  font-size: 15px;
}

.choice-row small,
.upload-row small,
.settings-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice-icon,
.settings-icon,
.sync-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.choice-icon.coral,
.settings-icon.coral {
  background: var(--coral-soft);
  color: var(--coral);
}

.choice-icon.amber,
.settings-icon.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.settings-icon.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.settings-icon.violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.settings-icon.teal {
  background: var(--accent-soft);
  color: var(--accent);
}

.back-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-self: start;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.forgot-link {
  justify-self: end;
  min-height: 36px;
  margin-top: -12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.back-link svg {
  width: 17px;
}

.upload-row {
  cursor: pointer;
}

.upload-row input,
.source-button input,
.small-upload input {
  display: none;
}

.qr-input input {
  padding-right: 92px;
}

.scan-button {
  position: absolute;
  top: 5px;
  right: 5px;
  grid-auto-flow: column;
  gap: 6px;
  width: 78px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.inline-status {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.inline-status.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.app-screen {
  z-index: 5;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.app-screen[aria-hidden="true"] {
  display: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 76px;
  padding: max(12px, env(safe-area-inset-top)) 18px 10px;
  border-bottom: 1px solid rgba(217, 224, 221, 0.68);
  background: rgba(247, 249, 248, 0.96);
}

.classroom-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.classroom-heading-copy {
  display: grid;
  min-width: 0;
}

.classroom-heading small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classroom-heading strong {
  max-width: 220px;
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classroom-chevron {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--muted);
}

.classroom-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 21px;
  font-weight: 900;
}

.top-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.top-actions .icon-button {
  background: transparent;
}

.notification-button {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--coral);
}

.notification-dot.hidden {
  display: none;
}

.account-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  font-size: 21px;
  box-shadow: 0 4px 12px rgba(23, 32, 29, 0.08);
}

.view-container {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.view {
  display: none;
  height: 100%;
  overflow-y: auto;
  padding: 20px 18px calc(var(--nav-height) + 36px);
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.view::-webkit-scrollbar,
.viewer-strip::-webkit-scrollbar,
.recent-strip::-webkit-scrollbar,
.filter-chips::-webkit-scrollbar,
.day-selector::-webkit-scrollbar {
  display: none;
}

.view.active {
  display: block;
}

.secondary-view {
  position: absolute;
  inset: 0;
  z-index: 8;
  padding: 0;
  background: var(--surface);
}

.page-intro {
  display: grid;
  gap: 3px;
}

.page-intro > p {
  color: var(--muted);
  font-size: 13px;
}

.page-intro h1 {
  font-size: 28px;
  line-height: 1.15;
}

.home-intro {
  margin-bottom: 18px;
}

.next-class-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 8px;
  background: #176f62;
  color: #ffffff;
}

.next-class-card::after {
  content: "";
  position: absolute;
  right: -36px;
  bottom: -68px;
  width: 148px;
  height: 148px;
  border: 26px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
}

.next-class-top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.next-class-card .context-label {
  color: rgba(255, 255, 255, 0.75);
}

.class-badge {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 11px;
  font-weight: 800;
}

.next-class-card h2 {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  font-size: 25px;
}

.next-class-card > p {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.capture-action {
  position: relative;
  z-index: 1;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  margin-top: 18px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.sync-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  width: 100%;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.sync-strip > span:nth-child(2) {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sync-strip strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-strip small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-strip > svg {
  width: 17px;
  color: #8c9692;
}

.sync-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
}

.content-section {
  margin-top: 26px;
}

.section-head {
  margin-bottom: 12px;
}

.section-head h2,
.list-heading h2 {
  margin-top: 2px;
  font-size: 18px;
}

.text-button {
  min-height: 36px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.event-list,
.member-list,
.toggle-list,
.capture-result-list,
.class-list {
  display: grid;
  gap: 10px;
}

.event-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.event-date-box {
  display: grid;
  place-items: center;
  width: 42px;
  height: 46px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.event-date-box strong {
  font-size: 17px;
  line-height: 1;
}

.event-item > div:nth-child(2) {
  min-width: 0;
}

.event-item h3 {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-item p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.event-type {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.event-type.exam {
  background: var(--coral-soft);
  color: var(--coral);
}

.event-type.task {
  background: var(--amber-soft);
  color: var(--amber);
}

.recent-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 148px;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}

.recent-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  scroll-snap-align: start;
}

.recent-card button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.recent-card img {
  display: block;
  width: 100%;
  height: 92px;
  object-fit: cover;
}

.recent-meta {
  display: grid;
  gap: 2px;
  padding: 9px;
}

.recent-meta strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-meta span {
  color: var(--muted);
  font-size: 10px;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 18px;
  border: 1px dashed #cdd7d3;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-state .empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--accent);
}

.empty-state strong {
  color: var(--ink);
  font-size: 14px;
}

.empty-state p {
  max-width: 250px;
  font-size: 12px;
  line-height: 1.4;
}

.secondary-header {
  min-height: 76px;
  padding: max(12px, env(safe-area-inset-top)) 18px 10px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.secondary-header > div,
.detail-header > div {
  flex: 1;
  min-width: 0;
}

.secondary-header h1,
.detail-header h1 {
  overflow: hidden;
  margin-top: 2px;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capture-scroll,
.account-scroll {
  height: calc(100% - 76px);
  overflow-y: auto;
  padding: 16px 18px 32px;
}

.camera-frame {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: #26322e;
}

.camera-frame img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-frame.has-image img {
  display: block;
}

.camera-frame.has-image .empty-preview {
  display: none;
}

.empty-preview {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: #ffffff;
  text-align: center;
}

.empty-preview strong {
  font-size: 16px;
}

.empty-preview p {
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
}

.camera-outline {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 4px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
}

.camera-outline svg {
  width: 26px;
  height: 26px;
}

.photo-source-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.source-button {
  min-height: 48px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
}

.source-button.primary-source {
  border-color: #acd1c7;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.capture-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.detected-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #bcd8d1;
  border-radius: 8px;
  background: #f8fcfb;
}

.detected-card > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.detected-card strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detected-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.capture-subject-fields,
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.chip-picker,
.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.check-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-chip span,
.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: #56635e;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.check-chip input:checked + span,
.filter-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.sticky-submit {
  margin-top: 2px;
}

.page-title-row {
  margin-bottom: 16px;
}

.page-title-row h1 {
  margin-top: 2px;
  font-size: 28px;
}

.search-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 0 10px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.search-field > svg {
  color: var(--muted);
}

.search-field input {
  min-height: 46px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
}

.clear-search {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--muted);
}

.filter-chips {
  margin-top: 12px;
  padding-bottom: 2px;
}

.filter-chip {
  flex: 0 0 auto;
  cursor: pointer;
}

.search-results {
  margin-top: 22px;
}

.list-heading {
  margin-bottom: 10px;
}

.list-heading > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.subject-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.subject-row {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.subject-color {
  width: 8px;
  height: 46px;
  border-radius: 4px;
}

.subject-row > span:nth-child(2) {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.subject-row strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subject-row small {
  color: var(--muted);
  font-size: 11px;
}

.subject-count {
  display: grid;
  justify-items: end;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
}

.subject-count strong {
  color: var(--ink);
  font-size: 15px;
}

.subject-row > svg {
  width: 18px;
  color: #8b9692;
}

.inline-header {
  margin: -20px -18px 8px;
}

.color-field input {
  padding: 6px;
}

.detail-header {
  min-height: 60px;
  margin: -8px 0 18px;
}

.detail-header p {
  color: var(--muted);
}

.subject-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.summary-stat {
  display: grid;
  gap: 4px;
  padding: 12px 8px;
  background: #ffffff;
  text-align: center;
}

.summary-stat strong {
  font-size: 18px;
}

.summary-stat span {
  color: var(--muted);
  font-size: 10px;
}

.class-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.class-number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--accent);
  font-size: 15px;
  font-weight: 900;
}

.class-row > span:nth-child(2) {
  min-width: 0;
}

.class-row h3 {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-row p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.class-row > svg {
  width: 18px;
  color: #8b9692;
}

.class-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.photo-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.photo-card > button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.photo-card-image {
  position: relative;
  height: 118px;
  overflow: hidden;
  background: #dde4e1;
}

.photo-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-comment-count {
  position: absolute;
  right: 7px;
  bottom: 7px;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(23, 32, 29, 0.82);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
}

.photo-comment-count svg {
  width: 12px;
  height: 12px;
}

.photo-card-meta {
  display: grid;
  gap: 3px;
  padding: 9px;
}

.photo-card-meta strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-card-meta small {
  color: var(--muted);
  font-size: 10px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.tag-list span {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 9px;
  font-weight: 800;
}

.capture-result {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.capture-result img {
  width: 62px;
  height: 62px;
  border-radius: 6px;
  object-fit: cover;
}

.capture-result > span {
  min-width: 0;
}

.capture-result strong,
.capture-result small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capture-result strong {
  font-size: 13px;
}

.capture-result small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.capture-result > svg {
  width: 17px;
  color: #8b9692;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 12px;
  background: #e8edeb;
}

.segmented-control button {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.segmented-control button.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 3px 10px rgba(23, 32, 29, 0.08);
}

.day-selector {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 54px;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.day-button {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-height: 62px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
}

.day-button span {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.day-button strong {
  font-size: 16px;
}

.day-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.day-schedule {
  display: grid;
  gap: 0;
  margin-top: 4px;
}

.schedule-item {
  display: grid;
  grid-template-columns: 58px 12px minmax(0, 1fr);
  gap: 8px;
  min-height: 84px;
}

.schedule-time {
  padding-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

.schedule-line {
  position: relative;
  border-left: 2px solid var(--line);
}

.schedule-line::before {
  content: "";
  position: absolute;
  top: 4px;
  left: -6px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--subject-color, var(--accent));
}

.schedule-card {
  align-self: start;
  padding: 12px;
  border-left: 5px solid var(--subject-color, var(--accent));
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 3px 12px rgba(23, 32, 29, 0.06);
}

.schedule-card strong {
  font-size: 14px;
}

.schedule-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

#eventsPanel .filter-chips {
  margin: 0 0 14px;
}

.clean-switch {
  border: 1px solid var(--line);
}

.classroom-identity {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 8px;
  background: #176f62;
  color: #ffffff;
}

.classroom-logo-large {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 26px;
  font-weight: 900;
}

.classroom-identity h2 {
  font-size: 18px;
}

.classroom-identity p {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.settings-group {
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.settings-row {
  min-height: 70px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row:hover {
  background: #f9fbfa;
}

.settings-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.settings-panel .mobile-form {
  margin-top: 8px;
}

.invite-card {
  display: grid;
  justify-items: center;
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.qr-code {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  grid-template-rows: repeat(11, 1fr);
  width: 196px;
  height: 196px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  gap: 3px;
}

.qr-cell {
  border-radius: 1px;
  background: #e6ece9;
}

.qr-cell.on {
  background: var(--ink);
}

.invite-label {
  margin-top: 18px;
  color: var(--muted);
}

.invite-card > strong {
  margin: 6px 0 18px;
  font-size: 25px;
  letter-spacing: 0;
}

.invite-card .primary-button + .primary-button {
  margin-top: 10px;
}

.role-legend {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
}

.role-legend p {
  color: #385a94;
  font-size: 11px;
  line-height: 1.45;
}

.member-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.member-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.member-row > span:nth-child(2) {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.member-row strong,
.member-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-row strong {
  font-size: 13px;
}

.member-row small {
  color: var(--muted);
  font-size: 10px;
}

.member-menu-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--muted);
}

.member-menu {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.role-select {
  min-height: 40px;
}

.remove-member {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
}

.drive-hero {
  display: grid;
  justify-items: center;
  padding: 26px 18px;
  text-align: center;
}

.drive-hero > span {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  border-radius: 18px;
  background: var(--blue-soft);
  color: var(--blue);
}

.drive-hero > span svg {
  width: 30px;
  height: 30px;
}

.drive-hero h2 {
  font-size: 20px;
}

.drive-hero p {
  max-width: 280px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.drive-folder-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.drive-folder-row > svg {
  color: var(--amber);
}

.drive-folder-row span {
  display: grid;
  gap: 2px;
}

.school-preview {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.school-logo {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 12px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 23px;
  font-weight: 900;
}

.school-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.small-upload {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.profile-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 8px;
  background: #176f62;
  color: #ffffff;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #ffffff;
  color: var(--ink);
  font-size: 24px;
}

.large-avatar {
  width: 64px;
  height: 64px;
  font-size: 31px;
}

.profile-hero h2 {
  font-size: 19px;
}

.profile-hero p {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.profile-hero span {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.88);
  font-size: 9px;
  font-weight: 800;
}

.account-section {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.account-section .section-head {
  margin-bottom: 0;
}

.switch-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.switch-row > span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.switch-row strong {
  font-size: 13px;
}

.switch-row small {
  color: var(--muted);
  font-size: 10px;
}

.switch-row input {
  position: relative;
  appearance: none;
  width: 42px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #cbd4d0;
  cursor: pointer;
  transition: background 160ms ease;
}

.switch-row input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(23, 32, 29, 0.26);
  transition: transform 160ms ease;
}

.switch-row input:checked {
  background: var(--accent);
}

.switch-row input:checked::after {
  transform: translateX(18px);
}

.danger-section {
  padding-bottom: 12px;
}

.danger-button {
  border: 1px solid #edc7cc;
  background: var(--danger-soft);
  color: var(--danger);
}

.suggestion-form {
  display: grid;
  gap: 10px;
}

.suggestion-form textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  background: #ffffff;
}

body.dark-theme .suggestion-form textarea,
body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea {
  background: #111916;
}

body.dark-theme .bottom-nav,
body.dark-theme .topbar,
body.dark-theme .settings-row,
body.dark-theme .event-item,
body.dark-theme .subject-row,
body.dark-theme .class-row,
body.dark-theme .photo-card,
body.dark-theme .tool-card,
body.dark-theme .tools-panel,
body.dark-theme .classroom-switcher-sheet,
body.dark-theme .dialog-sheet,
body.dark-theme .install-prompt {
  background: var(--panel);
}

body.dark-theme .camera-frame,
body.dark-theme .detected-card,
body.dark-theme .next-class-card,
body.dark-theme .sync-strip,
body.dark-theme .content-section,
body.dark-theme .settings-group,
body.dark-theme .account-section {
  border-color: var(--line);
}

.bottom-nav {
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) 76px repeat(3, minmax(0, 1fr));
  align-items: center;
  min-height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding: 6px 8px env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.tab {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 58px;
  padding: 7px 2px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #75807c;
  font-size: 9px;
  font-weight: 800;
}

.fab-space {
  width: 76px;
  min-width: 76px;
  height: 58px;
}

.tab svg {
  width: 20px;
  height: 20px;
}

.tab.active {
  color: var(--accent);
}

.tab.active svg {
  fill: rgba(8, 124, 104, 0.12);
}

.fab {
  position: absolute;
  z-index: 9;
  right: 50%;
  bottom: calc(var(--nav-height) - 23px + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 5px solid var(--surface);
  border-radius: 19px;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(8, 96, 79, 0.3);
  transform: translateX(50%);
}

.fab svg {
  width: 26px;
  height: 26px;
}

.app-screen.secondary-mode .topbar,
.app-screen.secondary-mode .bottom-nav,
.app-screen.secondary-mode .fab {
  display: none;
}

.photo-viewer {
  z-index: 30;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #101613;
  color: #ffffff;
}

.photo-viewer.hidden {
  display: none;
}

.tools-sheet {
  position: absolute;
  inset: 0;
  z-index: 42;
  display: grid;
  align-items: end;
}

.tools-sheet.hidden {
  display: none;
}

.tools-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(16, 22, 19, 0.46);
}

.tools-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  max-height: min(760px, calc(100% - 34px));
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: var(--surface);
  box-shadow: 0 -18px 48px rgba(23, 32, 29, 0.18);
  animation: sheet-up 220ms ease both;
}

.tools-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.tools-head p {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
}

.tools-head h2 {
  margin-top: 2px;
  font-size: 22px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.tool-group-label {
  grid-column: 1 / -1;
  color: var(--accent);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.tool-group-label.aula-label {
  margin-top: 6px;
  color: var(--blue);
}

.tool-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 72px;
  padding: 9px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.tool-card svg {
  width: 21px;
  height: 21px;
}

.tool-card.active {
  border-color: rgba(8, 124, 104, 0.32);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.tool-content {
  min-height: 0;
  margin-top: 14px;
  overflow-y: auto;
}

.tool-panel {
  display: none;
}

.tool-panel.active {
  display: grid;
  gap: 12px;
}

.calculator-display {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #ffffff;
  font-size: 24px;
  font-weight: 900;
  text-align: right;
}

.calculator-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.calculator-keys button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.calculator-keys .calc-equals {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.tool-form {
  display: grid;
  gap: 9px;
}

.tool-form.two-cols {
  grid-template-columns: minmax(0, 1fr) 132px;
}

.tool-form.two-cols button {
  grid-column: 1 / -1;
}

.tool-form input,
.tool-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  font-weight: 800;
}

.tool-form textarea {
  resize: vertical;
}

.tool-list {
  display: grid;
  gap: 8px;
}

.tool-item {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.tool-item header {
  display: flex;
  gap: 10px;
  align-items: start;
  justify-content: space-between;
}

.tool-item strong {
  font-size: 14px;
}

.tool-item p,
.tool-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.tool-options {
  display: grid;
  gap: 6px;
}

.tool-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 800;
}

.tool-option button,
.tool-delete {
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  padding: 0 9px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
}

.tool-delete {
  background: var(--danger-soft);
  color: var(--danger);
}

.game-card {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.game-card strong {
  font-size: 18px;
}

.game-card p,
.game-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quiz-options {
  display: grid;
  gap: 8px;
}

.quiz-options button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  font-weight: 900;
  text-align: left;
  padding: 0 12px;
}

.viewer-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: max(12px, env(safe-area-inset-top)) 16px 10px;
}

.viewer-head > div {
  min-width: 0;
  text-align: center;
}

.viewer-head p {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.56);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
}

.viewer-head h2 {
  margin-top: 2px;
  font-size: 15px;
}

.dark-button {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.viewer-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
}

.viewer-slide {
  display: grid;
  grid-template-rows: minmax(300px, 54vh) auto;
  min-width: 0;
  overflow-y: auto;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.viewer-image-wrap {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 6px 12px 16px;
}

.viewer-image-wrap img {
  display: block;
  width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.viewer-details {
  min-height: 280px;
  padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  background: #f7f9f8;
  color: var(--ink);
}

.viewer-details h3 {
  font-size: 18px;
}

.viewer-details > p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.viewer-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #684602;
  font-size: 12px;
  line-height: 1.4;
}

.comments-heading {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  margin-bottom: 8px;
}

.comments-heading h4 {
  margin: 0;
  font-size: 14px;
}

.comments-heading span {
  color: var(--muted);
  font-size: 11px;
}

.comment-list {
  display: grid;
  gap: 7px;
}

.comment-row {
  padding: 9px 10px;
  border-radius: 8px;
  background: #ffffff;
  font-size: 11px;
  line-height: 1.4;
}

.comment-row strong {
  display: block;
  margin-bottom: 2px;
  font-size: 10px;
}

.comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  margin-top: 10px;
}

.comment-form input {
  min-height: 42px;
}

.comment-form button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #ffffff;
}

.classroom-switcher {
  z-index: 55;
  display: grid;
  align-items: end;
}

.classroom-switcher.hidden {
  display: none;
}

.classroom-switcher-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(16, 22, 19, 0.48);
}

.classroom-switcher-sheet {
  position: relative;
  display: grid;
  gap: 14px;
  max-height: min(650px, 82%);
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  background: #ffffff;
  animation: sheet-up 220ms ease both;
}

.classroom-switcher-sheet > .dialog-handle {
  justify-self: center;
  margin-bottom: 0;
}

.classroom-switcher-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.classroom-switcher-head p {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
}

.classroom-switcher-head h2 {
  margin-top: 2px;
  font-size: 22px;
}

.classroom-switcher-list {
  display: grid;
  gap: 6px;
}

.classroom-option,
.add-classroom-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 24px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 64px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.classroom-option.active {
  border-color: #b9ddd4;
  background: var(--accent-soft);
}

.classroom-option-icon,
.add-classroom-row > span:first-child {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 20px;
  font-weight: 900;
}

.classroom-option > span:nth-child(2),
.add-classroom-row > span:nth-child(2) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.classroom-option strong,
.add-classroom-row strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classroom-option small,
.add-classroom-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classroom-option > svg,
.add-classroom-row > svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.classroom-option.active > svg {
  color: var(--accent);
}

.add-classroom-row {
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.add-classroom-row > span:first-child {
  background: var(--accent-soft);
  color: var(--accent);
}

.add-classroom-row > span:first-child svg {
  width: 21px;
  height: 21px;
}

.app-dialog {
  z-index: 60;
  display: grid;
  align-items: end;
}

.app-dialog.hidden {
  display: none;
}

.dialog-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(16, 22, 19, 0.54);
}

.dialog-sheet {
  position: relative;
  display: grid;
  justify-items: center;
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: #ffffff;
  text-align: center;
  animation: sheet-up 220ms ease both;
}

.dialog-handle {
  width: 42px;
  height: 4px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: #d6ddda;
}

.dialog-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--accent);
}

.dialog-icon.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.dialog-sheet h2 {
  margin-top: 12px;
  font-size: 20px;
}

.dialog-body {
  width: 100%;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.tutorial-list {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  text-align: left;
}

.tutorial-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.tutorial-list i,
.tutorial-list svg {
  color: var(--accent);
}

.tutorial-list span {
  display: grid;
  gap: 2px;
}

.tutorial-list strong {
  color: var(--ink);
  font-size: 13px;
}

.tutorial-list small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 20px;
}

.qr-scanner {
  position: relative;
  display: grid;
  place-items: center;
  width: 190px;
  height: 190px;
  margin: 14px auto 0;
  overflow: hidden;
  border-radius: 8px;
  background: #18221e;
  color: rgba(255, 255, 255, 0.76);
}

.qr-scanner::before,
.qr-scanner::after {
  content: "";
  position: absolute;
}

.qr-scanner::before {
  inset: 28px;
  border: 2px solid #ffffff;
  border-radius: 8px;
}

.qr-scanner::after {
  right: 24px;
  left: 24px;
  height: 2px;
  background: #52d8ba;
  box-shadow: 0 0 12px #52d8ba;
  animation: scan 1.8s ease-in-out infinite alternate;
}

@keyframes scan {
  from { top: 42px; }
  to { top: 146px; }
}

@keyframes sheet-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.toast {
  position: absolute;
  z-index: 80;
  right: 16px;
  bottom: calc(var(--nav-height) + 18px);
  left: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #17201d;
  color: #ffffff;
  box-shadow: var(--shadow-soft);
  font-size: 13px;
  font-weight: 700;
}

.toast.hidden {
  display: none;
}

.toast svg {
  color: #78d8c1;
}

.install-prompt {
  position: absolute;
  z-index: 75;
  right: 14px;
  bottom: calc(var(--nav-height) + 16px);
  left: 14px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 34px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(8, 124, 104, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
}

.install-prompt.hidden {
  display: none;
}

.install-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.install-prompt strong,
.install-prompt small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.install-prompt strong {
  font-size: 13px;
}

.install-prompt small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.compact-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
}

.mini-button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.desktop-preview {
  max-width: 500px;
}

.preview-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 22px;
}

.desktop-preview h2 {
  max-width: 460px;
  margin-top: 54px;
  font-size: 48px;
  line-height: 1.02;
}

.desktop-preview > p {
  max-width: 440px;
  margin-top: 16px;
  color: #4f5d58;
  font-size: 17px;
  line-height: 1.5;
}

.preview-points {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 26px;
}

.preview-points span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid rgba(23, 32, 29, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: #3e4b47;
  font-size: 12px;
  font-weight: 800;
}

.preview-points svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.preview-actions {
  margin-top: 22px;
}

.preview-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(8, 124, 104, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.preview-link svg {
  width: 17px;
  height: 17px;
}

@media (max-width: 900px) {
  body {
    background: var(--surface);
  }

  .shell {
    display: block;
    min-height: 100vh;
    padding: 0;
    background: var(--surface);
  }

  .phone {
    width: 100%;
    height: 100vh;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .desktop-preview {
    display: none;
  }
}

@media (max-width: 360px) {
  .onboarding {
    padding-inline: 18px;
  }

  .auth-copy {
    margin-top: 24px;
  }

  .auth-copy h1,
  .form-intro h1 {
    font-size: 30px;
  }

  .view {
    padding-inline: 14px;
  }

  .topbar {
    padding-inline: 14px;
  }

  .classroom-heading strong {
    max-width: 170px;
  }

  .capture-subject-fields,
  .form-grid,
  .photo-source-row {
    grid-template-columns: 1fr;
  }

  .class-photo-grid {
    grid-template-columns: 1fr;
  }
}

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