/* Functional component geometry is kept separate from the visual system.
   Screen styles can refine shared primitives without a specificity contest. */
@layer components, design, screens;
@import url("/classly-icons-47522608278dea640610.css");
@import url("/classly-sidebar-47522608278dea640610.css");
@import url("/tokens-47522608278dea640610.css");
@import url("/design-47522608278dea640610.css") layer(design);
@import url("/auth-design-47522608278dea640610.css") layer(screens);
@import url("/classly-auth-47522608278dea640610.css") layer(screens);
@import url("/auth-showcase-47522608278dea640610.css") layer(screens);
@import url("/account-design-47522608278dea640610.css") layer(screens);
@import url("/learning-design-47522608278dea640610.css") layer(screens);
@import url("/tasks-design-47522608278dea640610.css") layer(screens);
@import url("/gift-cards-47522608278dea640610.css");
@import url("/billing-gift-layout-47522608278dea640610.css");
@import url("/billing-47522608278dea640610.css");

@layer components {
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1:focus {
  outline: none;
}
svg {
  width: 21px;
  height: 21px;
  flex: none;
}
strong {
  font-weight: 600;
}
[hidden] {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.spacer {
  flex: 1;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 100;
  background: var(--surface);
  padding: 14px;
  border-radius: var(--radius-control);
}
.skip-link:focus {
  top: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -1.2px;
  color: var(--ink);
  width: max-content;
}
.brand:hover {
  text-decoration: none;
}
.brand-dot {
  margin-left: -9px;
  color: var(--accent);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 11px;
  font-size: 29px;
  font-weight: 650;
  line-height: 1;
  padding-bottom: 4px;
  letter-spacing: -2px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--button-radius);
  padding: 11px 18px;
  font-weight: 600;
  font-size: 13px;
  transition:
    background 0.15s,
    transform 0.15s;
  white-space: nowrap;
}
.button:hover {
  text-decoration: none;
}
.button:active {
  transform: translateY(1px);
}
.button.primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 2px 2px var(--button-shadow);
}
.button.primary:hover {
  background: var(--accent-hover);
}
.button.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.button.secondary:hover {
  background: var(--canvas);
}
.button.danger {
  background: var(--danger-button);
  color: var(--on-danger);
  border-color: var(--danger-button);
}
.button.danger:hover {
  background: var(--danger-hover);
}
.button.small {
  min-height: 38px;
  padding: 8px 13px;
  font-size: 12px;
}
.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 600;
  text-underline-offset: 4px;
}
.text-button:hover {
  text-decoration: underline;
}
.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  flex: none;
  border: 0;
  background: transparent;
  border-radius: var(--radius-control);
  color: var(--muted);
}
.icon-button:hover {
  background: var(--soft);
  color: var(--accent);
}
.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
}
.account-button .avatar {
  width: 30px;
  height: 30px;
  border: 0;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
}
.account-menu a,
.account-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 36px;
  padding: 9px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  text-align: left;
}
.account-menu a:hover,
.account-menu button:hover {
  background: var(--nav-hover);
  text-decoration: none;
}
.name {
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.name small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.avatar {
  width: 37px;
  height: 37px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--avatar);
  border: 3px solid var(--avatar-ring);
  color: var(--avatar-ink);
  font-family: Georgia, serif;
  font-size: 16px;
}
.avatar.large {
  width: 66px;
  height: 66px;
  font-size: 30px;
  background: var(--avatar-large);
  border: 4px solid var(--surface);
  box-shadow: 0 2px 8px var(--avatar-shadow);
}
.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.page-content {
  width: 100%;
  max-width: 1190px;
  padding: 45px 46px 35px;
  margin: 0 auto;
  flex: 1;
}
.page-content:has(.coming-soon) {
  display: flex;
  flex-direction: column;
}
.coming-soon {
  margin: auto;
  padding: 72px 0 100px;
  max-width: 440px;
  text-align: center;
}
.coming-soon-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--accent);
}
.coming-soon-icon svg {
  width: 25px;
  height: 25px;
}
.placeholder-page {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.coming-soon h2 {
  margin-bottom: 24px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}
.coming-soon-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
}
.coming-soon-link svg {
  width: 16px;
  height: 16px;
}
.settings-nav {
  display: flex;
  gap: 24px;
  margin: 28px 0;
  border-bottom: 1px solid var(--line);
}
.settings-nav a {
  padding: 0 0 13px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
}
.settings-nav a:hover {
  color: var(--ink);
  text-decoration: none;
}
.settings-nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.page-heading {
  margin-bottom: 28px;
}
.page-title {
  margin: 0;
  font-family: var(--font);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.8px;
  color: var(--ink);
}
.page-heading,
.settings-heading,
.friends-heading,
.school-years-heading,
.grades-heading,
.cal-heading,
.planner-heading {
  min-height: 44px;
}
.page-heading,
.settings-heading {
  display: flex;
  align-items: center;
}
.profile-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 17px;
  margin-bottom: 28px;
  background: var(--profile-surface);
  border: 1px solid var(--profile-border);
  border-radius: 12px;
  padding: 24px;
}
.profile-hero h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.4px;
  overflow-wrap: anywhere;
}
.profile-hero p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
  overflow-wrap: anywhere;
}
.profile-hero > .pill {
  margin-left: auto;
  background: var(--pill-surface);
}
.profile-hero > div {
  min-width: 0;
}
.profile-picture-button {
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  flex: none;
}
.profile-picture-button:hover {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.profile-picture-actions[hidden] {
  display: none;
}
.profile-picture-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-basis: 100%;
}
.picture-editor {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.picture-editor[hidden] {
  display: none;
}
.picture-editor canvas {
  display: block;
  width: min(200px, 100%);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  margin-inline: auto;
  border: 1px solid var(--line);
}
.picture-editor input[type="range"] {
  width: 100%;
  height: 32px;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  accent-color: var(--accent);
}
.picture-dialog .dialog-body {
  gap: 12px;
}
.picture-dialog footer {
  position: sticky;
  bottom: 0;
  z-index: 1;
}
#picture-file {
  max-width: 100%;
  min-width: 0;
}
.pill {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 30px;
  white-space: nowrap;
  color: var(--muted);
  background: var(--canvas);
}
.pill.positive {
  background: var(--soft);
  color: var(--accent);
  border-color: var(--positive-border);
}
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(240px, 1fr);
  gap: 24px;
  align-items: start;
}
.stack {
  display: grid;
  gap: 23px;
}
.aside-stack {
  display: grid;
  gap: 22px;
}
.appearance-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.panel-header {
  padding: 23px 25px 21px;
  border-bottom: 1px solid var(--line);
}
.panel-header h2 {
  font-size: 14px;
  letter-spacing: -0.2px;
  font-weight: 600;
}
.panel-header p {
  font-size: 11px;
  line-height: 1.65;
  color: var(--muted);
  margin-top: 7px;
}
.panel-body {
  padding: 24px 25px;
  font-size: 12px;
  line-height: 1.7;
}
.panel-body > p {
  margin-top: 9px;
}
.panel-body > .button {
  margin-top: 16px;
}
.plan-label {
  font-family: Georgia, serif;
  font-size: 34px;
  letter-spacing: -1px;
}
.settings-form {
  padding: 24px 25px;
  display: grid;
  gap: 22px;
}
.field {
  display: grid;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  min-width: 0;
}
.field input,
.field select,
.inline-form input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-control);
  padding: 11px 13px;
  color: var(--ink);
  min-height: 44px;
  font-size: 13px;
  box-shadow: 0 1px 2px var(--input-shadow);
}
.field input::placeholder,
.inline-form input::placeholder {
  color: var(--placeholder);
}
.field input:hover,
.field select:hover {
  border-color: var(--input-hover);
}
.field small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.65;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
#profile-form .form-footer {
  justify-content: flex-end;
}
.form-footer > span {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.6;
}
.setting-row {
  padding: 20px 25px;
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  font-size: 12px;
}
.setting-row + .setting-row {
  border-top: 1px solid var(--line);
}
.setting-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.setting-row small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 6px;
}
.check-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  cursor: pointer;
}
.check-field:first-of-type {
  padding-top: 2px;
}
.check-field small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  margin-top: 5px;
}
.check-field input {
  appearance: none;
  flex: none;
  margin: 0;
  width: 36px;
  height: 21px;
  border-radius: 20px;
  border: 1px solid var(--switch-border);
  background: var(--switch-track);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.check-field input:before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 15px;
  height: 15px;
  background: var(--switch-thumb);
  border-radius: 50%;
  box-shadow: 0 1px 2px #0002;
  transition: transform 0.2s;
}
.check-field input:checked:before {
  background: var(--switch-thumb-checked);
}
.check-field input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.check-field input:checked:before {
  transform: translateX(15px);
}
.danger-panel {
  border-color: var(--danger-border);
}
.danger-panel strong {
  color: var(--danger);
}
.menu-backdrop,
#mobile-menu {
  display: none;
}
.inline-form {
  display: flex;
  gap: 12px;
  max-width: 540px;
  margin: 8px 0 30px;
}
.segmented {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.segmented button {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.segmented button[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 650;
}
.segmented button:hover {
  color: var(--accent);
}
.list-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 25px;
}
.list-row + .list-row {
  border-top: 1px solid var(--line);
}
.row-main {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.row-title {
  font-size: 13px;
  font-weight: 600;
}
.row-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
.empty-state {
  padding: 58px 24px 66px;
  text-align: center;
  display: flex;
  align-items: center;
  flex-direction: column;
}
.empty-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: var(--soft);
  color: var(--accent);
  margin-bottom: 23px;
  transform: rotate(-6deg);
}
.empty-icon svg {
  width: 29px;
  height: 29px;
  transform: rotate(6deg);
}
.empty-state h3 {
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 400;
  letter-spacing: -0.6px;
}
.empty-state p {
  margin-top: 13px;
  max-width: 300px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.load-more {
  display: flex;
  margin: 22px auto;
}
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border: 1px solid var(--warning-border);
  background: var(--warning-surface);
  color: var(--warning-ink);
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.banner .text-button {
  flex: none;
}
.form-error {
  font-size: 12px;
  line-height: 1.65;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--danger);
  background: var(--danger-surface);
}
.loading-skeleton {
  width: 100%;
  visibility: hidden;
  animation: skeleton-reveal 0s 500ms forwards;
}
.skeleton-content {
  display: grid;
  gap: 16px;
}
.skeleton-item {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 88px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.skeleton-shape,
.skeleton-line {
  display: block;
  border-radius: 8px;
  background: var(--skeleton);
}
.skeleton-shape {
  flex: none;
  width: 40px;
  height: 40px;
}
.skeleton-copy {
  display: grid;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.skeleton-line {
  height: 12px;
  width: 65%;
}
.skeleton-line + .skeleton-line {
  height: 10px;
  width: 40%;
}
.skeleton-cards .skeleton-content {
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}
.skeleton-cards .skeleton-item {
  align-items: stretch;
  flex-direction: column;
  min-height: 164px;
  gap: 24px;
}
.skeleton-calendar .skeleton-content {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.skeleton-calendar .skeleton-item {
  flex-direction: column;
  align-items: stretch;
  min-height: 300px;
  padding: 16px;
}
.skeleton-calendar .skeleton-shape {
  width: 65%;
  height: 12px;
}
.skeleton-calendar .skeleton-copy {
  display: block;
}
.skeleton-calendar .skeleton-line {
  width: 100%;
  height: 58px;
  margin-top: 24px;
}
.skeleton-calendar .skeleton-line + .skeleton-line {
  width: 80%;
  margin-top: 48px;
}
.skeleton-compact .skeleton-item {
  border: 0;
  padding: 12px 0;
  min-height: 68px;
}
.friends-list > .loading-skeleton {
  padding: 20px;
}
.boot-skeleton {
  max-width: 300px;
  margin: 24px;
}
@keyframes skeleton-reveal {
  to {
    visibility: visible;
  }
}
@media (max-width: 600px) {
  .skeleton-calendar .skeleton-content {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .skeleton-calendar .skeleton-item:nth-child(n + 4) {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  /* This is a timed visibility switch, not motion. Preserve the 500 ms wait. */
  .loading-skeleton {
    animation: skeleton-reveal 0s 500ms forwards !important;
  }
}
.auth-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.auth-wrap {
  width: 100%;
  max-width: 375px;
}
.auth-wrap > .brand {
  margin-bottom: 48px;
}
.auth-wrap h1 {
  font-family: Georgia, serif;
  font-size: 37px;
  font-weight: 400;
  letter-spacing: -1.2px;
  line-height: 1.2;
}
.auth-description {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 14px;
  margin-bottom: 28px;
  overflow-wrap: anywhere;
}
.auth-form {
  display: grid;
  gap: 21px;
  margin-top: 29px;
}
.auth-form .field input:focus-visible {
  outline-offset: 1px;
}
.auth-form .button {
  width: 100%;
  margin-top: 5px;
}
.auth-form .forgot {
  justify-self: end;
  font-size: 11px;
  margin-top: -10px;
}
.auth-switch {
  text-align: center;
  margin-top: 26px;
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
}
@font-face {
  font-family: "Google Sans";
  src: url("/fonts/google-sans-medium-47522608278dea640610.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
.social-auth {
  display: grid;
  gap: 16px;
  margin-top: 28px;
  width: 100%;
  min-width: 0;
}
.social-auth:empty {
  display: none;
}
.provider-button {
  --provider-font-size: calc(var(--auth-button-height) * 0.43);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--auth-button-height);
  min-width: 0;
  padding: 0 max(12px, 8%);
  border: 0;
  border-radius: var(--button-radius);
  background: #fff;
  color: #1f1f1f;
  font:
    500 var(--provider-font-size) / calc(var(--provider-font-size) * 20 / 14)
      "Google Sans",
    sans-serif;
  white-space: nowrap;
}
.provider-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid #737373;
  border-radius: inherit;
  pointer-events: none;
}
.provider-button img {
  display: block;
  flex: none;
  width: auto;
}
/* Scale Google's reference typography, logo and spacing together. */
.google-signin {
  padding-inline: calc(var(--provider-font-size) * 12 / 14);
}
.google-signin img {
  height: calc(var(--provider-font-size) * 18 / 14);
  margin-right: calc(var(--provider-font-size) * 10 / 14);
}
.apple-signin {
  color: #000;
}
.apple-signin img {
  /* Unmodified medium artwork includes its own logo/title spacing. */
  height: 100%;
}
:root[data-theme="dark"] .apple-signin::after {
  border-color: transparent;
}
.provider-button:disabled {
  opacity: 1;
  cursor: wait;
}
.provider-button:hover::after {
  box-shadow: 0 0 0 1px #737373;
}
.verification-code {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}
.code-control {
  position: relative;
}
.code-input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  border: 0;
  padding: 0;
  border-radius: var(--radius-control);
  font-size: 24px;
  /* The native field stays focusable and available to AutoFill and AT. */
  background: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: transparent;
  cursor: text;
}
.code-input:focus-visible {
  outline: none;
}
.code-input::selection {
  background: transparent;
}
.code-slots {
  position: relative;
  z-index: 2;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-2);
}
.code-slot {
  display: grid;
  place-items: center;
  height: 60px;
  border: 1px solid var(--code-border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font-size: 26px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 2px var(--code-shadow);
}
.code-slot.is-filled {
  border-color: var(--code-hover);
  background: var(--code-filled);
}
.code-input:hover + .code-slots .code-slot {
  border-color: var(--code-hover);
}
.code-input:focus + .code-slots .is-active {
  border-color: var(--accent);
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  background: var(--surface);
}
.code-input:focus + .code-slots .is-active:empty::after {
  content: "";
  height: 24px;
  width: 2px;
  background: var(--accent);
}
.code-input[aria-invalid="true"] + .code-slots .code-slot {
  border-color: var(--danger);
}
.code-input[readonly] + .code-slots {
  opacity: 0.6;
}
.code-help {
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
}
/* One owner per gap: description → field → help at 16px, actions at 24px. */
.auth-verify .auth-description {
  margin: var(--space-3) 0 var(--space-4);
  font-size: 13px;
  line-height: 20px;
}
.auth-verify .auth-form {
  margin-top: 0;
  gap: var(--space-6);
}
.auth-verify .auth-form .button {
  margin-top: 0;
}
.auth-verify .auth-switch {
  margin-top: var(--space-6);
}
@media (forced-colors: active) {
  .code-input:focus + .code-slots .is-active {
    outline-color: Highlight;
  }
  .code-input:focus + .code-slots .is-active:empty::after {
    background: CanvasText;
  }
}
.auth-split {
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(350px, 0.95fr) minmax(420px, 1.05fr);
  gap: 30px;
  align-items: stretch;
  background: var(--canvas);
}
.auth-main {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 55px 25px;
}
.auth-story {
  background: var(--auth-story);
  border-radius: 18px;
  min-height: 720px;
}
.boot {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  width: min(480px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 100px var(--dialog-shadow);
}
dialog.wide {
  width: min(640px, calc(100% - 32px));
}
dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(3px);
}
dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}
dialog h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
#dialog-title:focus {
  outline: none;
}
.dialog-body {
  padding: 25px;
  display: grid;
  gap: 20px;
  font-size: 13px;
  line-height: 1.8;
}
dialog footer {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: var(--ink);
  color: var(--on-toast);
  padding: 14px 21px;
  box-shadow: 0 5px 25px #0002;
  border-radius: 10px;
  max-width: calc(100% - 32px);
  font-size: 12px;
  line-height: 1.6;
  z-index: 40;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (max-width: 1120px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .aside-stack {
    grid-template-columns: 1fr 1fr;
  }
  .page-content {
    padding: 36px 32px;
  }
  .auth-split {
    grid-template-columns: minmax(300px, 0.9fr) minmax(380px, 1.1fr);
    gap: 10px;
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .menu-backdrop {
    position: fixed;
    inset: 0;
    background: var(--menu-backdrop);
    border: 0;
    border-radius: 0;
    z-index: 7;
  }
  .shell.menu-open .menu-backdrop {
    display: block;
  }
  #mobile-menu {
    display: grid;
    margin-bottom: 20px;
  }
  .page-content {
    padding: 30px 21px;
  }
  .coming-soon {
    padding: 48px 0 72px;
  }
  .settings-nav {
    gap: 20px;
  }
  .workspace {
    min-height: 100dvh;
  }
  .settings-grid,
  .aside-stack {
    grid-template-columns: 1fr;
  }
  .profile-hero {
    padding: 20px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .profile-hero h2 {
    font-size: 16px;
  }
  .profile-hero > .pill {
    font-size: 9px;
  }
  .avatar.large {
    width: 53px;
    height: 53px;
    font-size: 25px;
  }
  .panel-header {
    padding: 21px;
  }
  .settings-form {
    padding: 21px;
    gap: 20px;
  }
  .panel-body {
    padding: 22px;
  }
  .setting-row {
    padding: 20px;
    gap: 15px;
  }
  .check-field {
    gap: 16px;
  }
  .auth-split {
    display: flex;
    padding: 36px 24px;
    min-height: 100dvh;
  }
  .auth-story {
    display: none;
  }
  .auth-main {
    padding: 0;
    flex: 1;
    max-width: 400px;
  }
  .auth-wrap > .brand {
    margin-bottom: 42px;
  }
  .auth-wrap h1 {
    font-size: 35px;
  }
  .auth-description {
    font-size: 13px;
  }
  .auth-form .field {
    font-size: 13px;
  }
  .auth-form .field input {
    font-size: 16px;
  }
  .auth-switch {
    font-size: 12px;
  }
  .inline-form {
    gap: 8px;
  }
  .inline-form input {
    min-width: 0;
    font-size: 12px;
  }
  .inline-form .button {
    padding: 10px 12px;
    font-size: 12px;
  }
  .segmented {
    overflow-x: auto;
    gap: 0;
  }
  .segmented button {
    padding: 13px 17px;
    flex: none;
  }
  .empty-state {
    padding: 50px 23px;
  }
  .empty-state h3 {
    font-size: 23px;
  }
  .list-row {
    padding: 18px 16px;
    gap: 12px;
  }
  .list-row .icon-button {
    width: 32px;
  }
  .list-row .button {
    font-size: 11px;
    padding: 7px 10px;
  }
  dialog footer .button {
    font-size: 12px;
  }
  .banner {
    flex-wrap: wrap;
  }
}
@media (max-width: 390px) {
  .field-grid {
    grid-template-columns: 1fr;
  }
  .form-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .form-footer .button {
    width: 100%;
  }
  .setting-row {
    flex-wrap: wrap;
  }
  .profile-hero > .pill {
    margin-left: 65px;
  }
  .segmented button {
    padding: 13px 14px;
  }
  .page-content {
    padding-left: 16px;
    padding-right: 16px;
  }
  .list-row {
    flex-wrap: wrap;
  }
  .auth-page {
    padding-left: 21px;
    padding-right: 21px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}

/* Authentication uses one spacing rhythm for forms, link states, and recovery. */
.auth-page {
  --muted: var(--auth-muted);
}
.auth-wrap:not(.auth-verify) > .auth-description {
  margin: var(--space-3) 0 var(--space-6);
  font-size: 14px;
  line-height: 1.6;
}
.auth-wrap:not(.auth-verify) > .auth-description + .auth-form {
  margin-top: 0;
}
.auth-form {
  gap: var(--space-4);
}
.auth-form .field {
  font-size: 14px;
}
.auth-form .field small {
  font-size: 13px;
  line-height: 1.5;
}
.auth-form .field input {
  min-height: 48px;
  font-size: 16px;
}
.auth-form .button {
  min-height: var(--auth-button-height);
  height: var(--auth-button-height);
  font-size: 14px;
}
.auth-actions {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.auth-actions .button {
  min-height: 48px;
}
.auth-footnote {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin-top: var(--space-4);
}
.auth-switch {
  font-size: 13px;
}
.password-control {
  position: relative;
}
.password-control input {
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--accent);
}
.password-toggle svg {
  width: 18px;
  height: 18px;
}
.password-toggle:hover {
  background: var(--soft);
}
.password-toggle:focus-visible {
  outline-offset: -2px;
}
.auth-form input[aria-invalid="true"] {
  border-color: var(--danger);
}
.auth-form .form-error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 9px;
  background: var(--danger-surface);
  line-height: 1.6;
}
@media (prefers-reduced-motion: reduce) {
  .auth-page *,
  .auth-page *::before,
  .auth-page *::after {
    transition: none;
    animation: none;
  }
}

.invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block: 0;
  align-items: center;
}
.friend-qr {
  display: block;
  width: min(280px, 100%);
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
}
.friend-scanner {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 16px;
}
.friend-scanner[hidden] {
  display: none;
}
.friend-invite-avatar {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 50%;
}

/* Friends stays a quiet account surface; connection tools live in dialogs. */
.friends-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.friends-heading .page-heading {
  margin: 0;
}
.friends-heading > .button {
  flex: none;
}
.friends-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.friend-navigation {
  display: flex;
  gap: 26px;
}
.friend-navigation button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 2px;
  margin-bottom: -1px;
  color: var(--muted);
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font-size: 13px;
  font-weight: 500;
}
.friend-navigation button[aria-pressed="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.friend-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.friend-filters button {
  display: inline-grid;
  place-items: center;
  padding: 8px 14px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
/* Reserve the selected label's width so switching font weight never moves tabs. */
.friend-filters button > span {
  grid-area: 1 / 1;
}
.friend-filters .friend-filter-size {
  visibility: hidden;
  font-weight: 600;
}
.friend-filters button[aria-pressed="true"] {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  font-weight: 600;
}
.friend-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.friend-section-heading h2 {
  font-size: 14px;
  font-weight: 600;
}
.friends-list .list-row {
  padding: 18px 22px;
  min-height: 82px;
}
.friends-list .avatar {
  width: 40px;
  height: 40px;
  border-width: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
}
.friends-list .icon-button {
  width: 44px;
  height: 44px;
  flex: none;
}
.friend-methods {
  display: grid;
  gap: 8px;
}
.friend-method {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.5;
}
.friend-method:hover {
  background: var(--canvas);
  border-color: var(--accent);
  text-decoration: none;
}
.friend-method > svg {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--accent);
}
.friend-method > svg:last-child {
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.friend-method > span {
  flex: 1;
  min-width: 0;
}
.friend-method strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
.friend-method small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}

.invite-actions [hidden] {
  display: none;
}
#invite-status:empty,
#scan-status:empty {
  display: none;
}

.invite-meta {
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 600px) {
  .friends-heading {
    gap: 12px;
  }
  .friends-heading > .button {
    padding: 10px 12px;
    font-size: 12px;
  }
  .friends-list .list-row {
    padding: 15px 14px;
    gap: 10px;
    flex-wrap: nowrap;
  }
  .friends-list .list-row .button {
    min-height: 40px;
  }
  .friend-method {
    padding: 13px;
    gap: 10px;
  }
}

/* Temporary waits are status feedback, not invalid user input. */
.form-error.rate-limit {
  color: var(--ink);
  background: var(--soft);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* School years share the account shell and remain usable on narrow screens. */
.school-years-page {
  max-width: 1100px;
}
.school-years-heading {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.school-years-heading .page-heading {
  margin-bottom: 0;
}
.school-years-empty {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.school-years-empty-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}
.school-years-empty h2 {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.35px;
}
.school-years-empty p {
  max-width: 52ch;
  margin: 10px 0 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.year-source-picker,
.year-source-fields {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.year-source-picker legend {
  padding: 0;
  margin-bottom: 10px;
  font-weight: 500;
}
.year-source-options {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}
.year-source-options label {
  position: relative;
  flex: 1;
  cursor: pointer;
}
.year-source-options span {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
}
.year-source-options input:checked + span {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px var(--dialog-shadow);
}
.year-source-options input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.year-source-options input:disabled + span {
  opacity: 0.5;
  cursor: not-allowed;
}
.year-source-fields {
  display: grid;
  gap: 20px;
}
.school-years-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 16px;
  margin: 20px 0;
}
.school-year-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.school-year-card-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.school-year-card h2 {
  font-size: 24px;
  margin: 0;
  overflow-wrap: anywhere;
}
.school-year-dates {
  font-variant-numeric: tabular-nums;
  margin: 12px 0;
}
.school-year-context {
  line-height: 1.6;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 24px;
}
.school-year-preview {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 16px;
}
.school-year-preview p:last-child {
  margin-bottom: 0;
}
.education-country {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 16px;
}
.school-years-error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--danger-border);
  border-radius: 12px;
  background: var(--danger-surface);
  color: var(--danger);
}
@media (max-width: 760px) {
  .school-years-empty {
    flex-direction: column;
    gap: 16px;
    padding: 24px;
  }
}
@media (max-width: 600px) {
  .school-year-card {
    padding: 20px;
  }
}

/* Keep the email-first options visible on short mobile login/signup pages. */
@media (max-width: 700px) and (max-height: 700px) {
  .auth-split:has(#social-auth:not(:empty)) {
    padding-block: 16px;
  }
  .auth-wrap:has(#social-auth:not(:empty)) > .brand {
    margin-bottom: 20px;
  }
  .auth-wrap:has(#social-auth:not(:empty)) .auth-form {
    margin-top: 20px;
  }
  #social-auth {
    margin-top: 20px;
    gap: 12px;
  }
  .auth-wrap:has(#social-auth:not(:empty)) .auth-switch {
    margin-top: 18px;
  }
}

/* Preserve the scaled Google clear space on the narrowest phone layouts. */
@media (max-width: 360px) {
  .auth-page:has(#social-auth:not(:empty)) {
    padding-inline: 16px;
  }
}

/* School-year subjects and timetables */
.planner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}
.planner-heading,
.planner-toolbar,
.planner-plan {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.planner-heading {
  margin-bottom: 28px;
}
.planner-plan p {
  margin: 4px 0;
}
.planner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.planner-toolbar {
  margin: 20px 0;
}
.planner-toolbar .field {
  margin: 0;
  min-width: 170px;
}
.planner-toolbar [aria-pressed="true"] {
  background: var(--soft);
  color: var(--accent);
  border-color: var(--accent);
}
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 18px;
}
.subject-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--subject-color);
  border-radius: 16px;
  padding: 24px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.subject-card h2 {
  font-size: 20px;
  margin: 0 0 12px;
}
.subject-card p {
  margin: 8px 0;
}
.planner-empty {
  padding: 48px 24px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 20px;
  text-align: center;
}
.planner-empty h2 {
  font-size: 24px;
  margin: 0 0 12px;
}
.planner-empty p {
  margin: 0 0 24px;
  color: var(--muted);
}
.planner-notice {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  margin: 16px 0;
}
.planner-notice p {
  margin-top: 0;
}
.planner-week {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(172px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 16px;
}
.planner-week.single-day {
  grid-auto-flow: row;
  grid-template-columns: minmax(0, 560px);
}
.planner-day {
  min-width: 0;
}
.planner-day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 4px;
}
.planner-day h2 {
  margin: 0;
  font-size: 15px;
}
.planner-day h2 small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  margin-top: 5px;
}
.lesson-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--subject-color);
  border-radius: 12px;
  padding: 16px 12px;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}
.lesson-card h3 {
  font-size: 16px;
  margin: 10px 0 8px;
}
.lesson-card p {
  font-size: 13px;
  margin: 5px 0;
}
.lesson-card .lesson-time {
  font-size: 12px;
  font-weight: 600;
}
.lesson-card.cancelled h3 {
  text-decoration: line-through;
}
.lesson-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 14px;
}
.lesson-actions .button {
  min-height: 34px;
  font-size: 11px;
  padding: 6px 8px;
}
.planner-badge {
  display: inline-block;
  border-radius: 6px;
  background: var(--soft);
  padding: 4px 7px;
  font-size: 11px;
}
.planner-overlap {
  color: var(--danger);
  font-weight: 600;
}
.planner-free {
  color: var(--muted);
  font-size: 13px;
  padding: 24px 4px;
}
.planner-plans {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding: 24px 0;
}
.planner-plans summary {
  cursor: pointer;
  font-weight: 600;
}
.planner-plan {
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}
.planner-rules {
  flex-basis: 100%;
  font-size: 13px;
}
.planner-rule {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}
.planner-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.planner-form-grid .field {
  margin: 0;
}
.planner-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  line-height: 1.5;
  font-size: 14px;
}
.planner-check input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.import-row,
#import-plan {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
}
.import-row legend {
  padding: 0 8px;
  font-weight: 600;
}
@media (max-width: 640px) {
  .planner-heading {
    align-items: stretch;
  }
  .planner-heading .planner-actions {
    width: 100%;
  }
  .planner-toolbar {
    align-items: stretch;
  }
  .planner-toolbar .field {
    min-width: 140px;
    flex: 1;
  }
  .planner-form-grid {
    grid-template-columns: 1fr;
  }
  .planner-week {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
  }
  .planner-week.single-day {
    grid-template-columns: 1fr;
  }
  .planner-day {
    border-top: 1px solid var(--line);
    padding: 12px 0;
  }
  .lesson-actions .button {
    min-height: 40px;
  }
  .planner-rule {
    flex-wrap: wrap;
  }
}
.planner-slots {
  margin-top: 20px;
}
.planner-slots summary {
  cursor: pointer;
  font-weight: 600;
}
.planner-slot-days {
  display: flex;
  flex-wrap: wrap;
  column-gap: 16px;
  margin: 12px 0;
}

/* Unified calendar: independent sources, personal visibility, shared plans. */
.calendar-workspace {
  --cal-accent: var(--accent);
  --cal-on-accent: var(--on-accent);
  --cal-line: var(--line);
  --cal-paper: var(--surface);
  --cal-sidebar: var(--sidebar);
  --cal-muted: var(--muted);
  width: 100%;
  max-width: 1800px;
  margin-inline: auto;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.cal-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 30px;
  align-items: stretch;
}
.cal-sidebar {
  padding: 24px 18px;
  background: var(--cal-sidebar);
  border-right: 1px solid var(--cal-line);
  display: flex;
  flex-direction: column;
  gap: 26px;
  min-width: 0;
}
.cal-main {
  min-width: 0;
  padding: 16px 0;
}
.cal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.cal-heading .page-title {
  font-size: 38px;
  letter-spacing: -1.6px;
  font-weight: 500;
  line-height: 1.2;
}
.cal-heading .page-title span {
  color: var(--cal-muted);
  font-weight: 350;
}
.cal-heading-actions,
.cal-manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.calendar-workspace .button {
  font-size: 12px;
  min-height: 36px;
  padding: 8px 13px;
  border-radius: var(--radius-control);
}
.cal-heading-actions .primary {
  background: var(--cal-accent);
  border-color: var(--cal-accent);
  color: var(--cal-on-accent);
}
.cal-heading-actions [data-cal="connections"] {
  background: transparent;
  border-color: transparent;
  color: var(--cal-muted);
}
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--cal-line);
}
.cal-date-nav {
  display: flex;
  align-items: center;
  gap: 5px;
}
.cal-date-nav .icon-button {
  width: 30px;
  height: 32px;
}
.cal-date-nav [data-cal="previous"] svg,
.cal-mini [data-cal="mini-previous"] svg {
  transform: rotate(180deg);
}
.cal-date-nav .button {
  min-height: 32px;
  font-size: 11px;
  padding: 5px 12px;
  margin-right: 5px;
}
.cal-period {
  font-size: 11px;
  color: var(--cal-muted);
  margin-left: 8px;
}
.cal-modes {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--cal-sidebar);
  border: 1px solid var(--cal-line);
  border-radius: 7px;
}
.cal-modes button {
  border: 0;
  border-radius: var(--radius-control);
  padding: 6px 12px;
  font: inherit;
  font-size: 11px;
  color: var(--cal-muted);
  background: transparent;
  cursor: pointer;
}
.cal-modes button[aria-pressed="true"] {
  background: var(--cal-paper);
  color: var(--ink);
  box-shadow: 0 1px 3px var(--popover-shadow);
}
.cal-mini-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 15px;
}
.cal-mini-heading strong {
  font-size: 12px;
  font-weight: 550;
}
.cal-mini-heading > div {
  display: flex;
}
.cal-mini .icon-button {
  width: 25px;
  height: 28px;
}
.cal-mini svg {
  width: 14px;
  height: 14px;
}
.cal-mini-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px 2px;
}
.cal-mini-grid > span,
.cal-mini-grid button {
  height: 25px;
  display: grid;
  place-items: center;
  font-size: 10px;
}
.cal-mini-grid > span {
  color: var(--cal-muted);
}
.cal-mini-grid button {
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
}
.cal-mini-grid .in-week {
  background: color-mix(in srgb, var(--cal-accent) 9%, transparent);
  border-radius: 4px;
}
.cal-mini-grid .outside-month {
  color: var(--cal-muted);
}
.cal-mini-grid button[aria-pressed="true"] {
  background: var(--cal-accent);
  color: var(--cal-on-accent);
  border-radius: 50%;
}
.cal-mini-grid button:hover {
  outline: 1px solid var(--cal-accent);
}
.cal-calendar-list > summary {
  display: none;
}
.cal-sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cal-sidebar-heading h2 {
  font-size: 13px;
  font-weight: 550;
  margin: 0;
}
.cal-sidebar-heading .icon-button {
  width: 28px;
  height: 28px;
}
.cal-group {
  margin-top: 20px;
}
.cal-group h3 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 400;
  color: var(--cal-muted);
}
.cal-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  border-radius: 6px;
}
.cal-row:hover {
  background: color-mix(in srgb, var(--cal-accent) 5%, transparent);
}
.cal-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  font-size: 12px;
  cursor: pointer;
}
.cal-toggle input {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin: 0;
}
.cal-toggle > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.cal-toggle .cal-color {
  display: none;
}
.cal-holiday-label {
  min-width: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.cal-holiday-label small,
.cal-toggle small {
  display: block;
  font-size: 10px;
  color: var(--cal-muted);
}
.cal-row .icon-button {
  width: 26px;
  height: 30px;
  flex: 0 0 26px;
  color: var(--cal-muted);
}
.cal-sidebar-actions {
  display: grid;
  gap: 3px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--cal-line);
}
.cal-sidebar-actions .button {
  background: none;
  border-color: transparent;
  text-align: left;
  justify-content: flex-start;
  padding: 8px 0;
  color: var(--cal-muted);
  font-size: 11px;
  white-space: normal;
}
.cal-next {
  margin-top: auto;
  padding-top: 12px;
}
.cal-next h3 {
  font-size: 10px;
  font-weight: 400;
  color: var(--cal-muted);
}
.cal-next .cal-next-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  font: inherit;
  border: 0;
  background: none;
  padding: 0;
  gap: 7px;
}
.cal-next .cal-event-time {
  order: -1;
  font-size: 22px;
  font-weight: 400;
  opacity: 1;
}
.cal-next .cal-next-card strong {
  font-size: 12px;
}
.cal-week-scroll {
  max-width: 100%;
  overflow: auto;
  border-bottom: 1px solid var(--cal-line);
  max-height: 720px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  overscroll-behavior: contain;
}
.cal-week {
  position: relative;
  min-width: 760px;
  background: var(--cal-paper);
}
.cal-week-heading,
.cal-all-day,
.cal-timeline {
  display: grid;
  grid-template-columns: 48px repeat(7, minmax(0, 1fr));
}
.cal-week-header {
  display: contents;
}
.cal-week-header:has(.cal-all-day .cal-event) {
  display: block;
}
.cal-week-header:has(.cal-all-day .cal-event),
.cal-week-heading {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--cal-paper);
}
.cal-week-heading {
  border-bottom: 1px solid var(--cal-line);
}
.cal-zone {
  align-self: center;
  padding: 5px;
  font-size: 8px;
  color: var(--cal-muted);
  overflow-wrap: anywhere;
  text-align: center;
}
.cal-day {
  min-width: 0;
}
.cal-day header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 15px 5px;
}
.cal-day header > span {
  font-size: 10px;
  color: var(--cal-muted);
}
.cal-day header button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 20px;
  cursor: pointer;
}
.cal-day.is-today header button {
  background: var(--cal-accent);
  color: var(--cal-on-accent);
}
.cal-all-day {
  border-bottom: 1px solid var(--cal-line);
  min-height: 38px;
}
.cal-all-day > span {
  font-size: 9px;
  align-self: center;
  text-align: center;
  color: var(--cal-muted);
  padding: 4px;
  overflow-wrap: anywhere;
}
.cal-all-day > div {
  border-left: 1px solid var(--cal-line);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-timeline {
  height: calc(var(--cal-hours) * 72px);
}
.cal-hours span {
  display: block;
  height: 72px;
  text-align: center;
  font-size: 9px;
  color: var(--cal-muted);
  padding-top: 4px;
}
.cal-time-day {
  position: relative;
  min-width: 0;
  border-left: 1px solid var(--cal-line);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 71px,
    var(--cal-line) 71px,
    var(--cal-line) 72px
  );
}
.cal-time-day.is-today {
  background-color: color-mix(in srgb, var(--cal-accent) 2%, var(--cal-paper));
}
.cal-time-day:nth-child(n + 7),
.cal-week-heading .cal-day:nth-child(n + 7) {
  background-color: var(--cal-sidebar);
}
.cal-slot {
  position: absolute;
  width: 100%;
  height: 72px;
  left: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.cal-slot:hover {
  background: color-mix(in srgb, var(--cal-accent) 6%, transparent);
}
.cal-event {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  border: 1px solid
    color-mix(in srgb, var(--event-color) 15%, var(--cal-line, var(--line)));
  border-radius: 5px;
  padding: 10px;
  color: var(--ink);
  background: color-mix(
    in srgb,
    var(--event-color) 11%,
    var(--cal-paper, var(--surface))
  );
  font: inherit;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.cal-event:hover {
  background: color-mix(
    in srgb,
    var(--event-color) 19%,
    var(--cal-paper, var(--surface))
  );
}
.cal-event strong {
  font-size: 12px;
  line-height: 1.35;
  font-weight: 550;
  order: -1;
}
.cal-event-time {
  font-size: 10px;
  line-height: 1.3;
  opacity: 0.85;
}
.cal-event-location {
  font-size: 10px;
  color: var(--cal-muted, var(--muted));
  margin-top: 6px;
}
.cal-positioned {
  position: absolute;
  overflow: hidden;
  gap: 4px;
  z-index: 1;
  align-items: flex-start;
  justify-content: flex-start;
}
.cal-positioned strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-shrink: 0;
  width: 100%;
}
.cal-short .cal-event-location {
  display: none;
}
.cal-upcoming {
  background: var(--cal-accent);
  color: var(--cal-on-accent);
  border-color: var(--cal-accent);
}
.cal-upcoming:hover {
  background: color-mix(in srgb, var(--cal-accent) 90%, var(--cal-paper));
}
.cal-upcoming .cal-event-location {
  color: inherit;
}
.cal-event.compact {
  padding: 5px 6px;
  gap: 3px;
}
.cal-event.compact strong {
  font-size: 10px;
}
.cal-event.compact .cal-event-time {
  font-size: 9px;
}
.cal-now {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--danger);
  z-index: 2;
  pointer-events: none;
}
.cal-now:before {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  left: -3px;
  top: -2px;
  border-radius: 50%;
  background: var(--danger);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--cal-line);
  border-left: 1px solid var(--cal-line);
  background: var(--cal-paper);
}
.cal-month .cal-day {
  min-height: 120px;
  border-right: 1px solid var(--cal-line);
  border-bottom: 1px solid var(--cal-line);
}
.cal-month .cal-day header {
  justify-content: space-between;
  padding: 6px;
}
.cal-month .cal-day header button {
  font-size: 13px;
  width: 26px;
  height: 26px;
}
.cal-day-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 3px 5px 8px;
}
.cal-month .outside-month {
  opacity: 0.55;
}
.cal-agenda {
  padding: 0 16px;
  background: var(--cal-paper);
  min-height: 400px;
}
.cal-agenda section {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--cal-line);
}
.cal-agenda section h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
}
.cal-agenda section > div {
  display: grid;
  gap: 8px;
}
.cal-agenda .cal-event {
  border: 0;
  border-left: 3px solid var(--event-color);
  border-radius: 0;
  background: none;
  padding: 8px 14px;
}
.cal-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 10px;
  color: var(--cal-muted);
  margin-top: 18px;
  line-height: 1.6;
}
.cal-color {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  flex: 0 0 7px;
}
.cal-notice {
  border: 1px solid var(--warning-border);
  background: var(--warning-surface);
  color: var(--warning-ink);
  border-radius: 7px;
  padding: 13px;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 14px;
}
.cal-empty {
  min-height: 300px;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}
@media (max-width: 1200px) {
  .cal-layout {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 22px;
  }
  .cal-sidebar {
    padding: 20px 14px;
  }
  .cal-heading .page-title {
    font-size: 32px;
  }
  .cal-heading {
    flex-wrap: wrap;
  }
  .cal-toolbar {
    flex-wrap: wrap;
  }
  .cal-period {
    font-size: 10px;
  }
}
@media (max-width: 850px) {
  .cal-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .cal-sidebar {
    padding: 0;
    background: none;
    border: 0;
    gap: 0;
  }
  .cal-mini,
  .cal-next {
    display: none;
  }
  .cal-calendar-list {
    padding: 12px 14px;
    background: var(--cal-sidebar);
    border: 1px solid var(--cal-line);
    border-radius: 7px;
  }
  .cal-calendar-list > summary {
    display: list-item;
    cursor: pointer;
    font-size: 12px;
  }
  .cal-sidebar-heading {
    margin-top: 12px;
  }
  .cal-sidebar-heading h2 {
    font-size: 12px;
  }
  .cal-group {
    margin-top: 12px;
  }
  .cal-sidebar-actions {
    grid-template-columns: 1fr 1fr;
    margin-top: 12px;
  }
  .cal-main {
    padding: 8px 0;
  }
  .cal-heading {
    align-items: center;
    gap: 15px;
    margin-bottom: 23px;
  }
  .cal-heading .page-title {
    font-size: 34px;
  }
  .cal-heading-actions {
    gap: 4px;
  }
  .cal-heading-actions .button {
    font-size: 11px;
    padding: 8px 10px;
  }
  .cal-toolbar {
    gap: 14px;
    padding-bottom: 16px;
  }
  .cal-week-scroll {
    max-height: 650px;
  }
  .cal-month .cal-day {
    min-height: 95px;
  }
  .cal-month .cal-day header > span {
    display: none;
  }
  .cal-month .cal-event strong {
    font-size: 9px;
  }
  .cal-month .cal-event-time {
    display: none;
  }
  .cal-agenda {
    padding: 0 3px;
  }
  .cal-agenda section {
    grid-template-columns: 85px 1fr;
    gap: 12px;
  }
  .cal-agenda section h3 {
    font-size: 11px;
  }
  .cal-modes {
    margin-left: auto;
  }
}
@media (max-width: 480px) {
  .cal-heading .page-title {
    font-size: 30px;
  }
  .cal-heading .page-title span {
    font-size: 24px;
  }
  .cal-heading-actions {
    width: 100%;
  }
  .cal-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .cal-date-nav {
    justify-content: space-between;
  }
  .cal-modes {
    margin-left: 0;
  }
  .cal-modes button {
    flex: 1;
  }
  .cal-month .cal-event {
    padding: 4px 2px;
  }
  .cal-footer {
    font-size: 9px;
  }
}

.cal-form-grid,
.cal-conflict {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.cal-form-grid .field {
  min-width: 0;
}
.cal-read-field {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
  padding-top: 5px;
}
.cal-read-field span {
  color: var(--muted);
}
.cal-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  font-size: 13px;
}
.cal-check input {
  width: 16px;
  height: 16px;
  margin: 0;
}
.cal-description {
  white-space: pre-wrap;
}
.cal-manage-actions {
  margin: 18px 0;
}
.cal-holiday-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 20px 0;
}
.cal-holiday-option {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  padding: 13px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 12px;
}
.cal-holiday-option small,
.cal-share-list small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
  font-size: 10px;
}
.cal-holiday-option > span:last-child {
  font-size: 10px;
  white-space: nowrap;
  color: var(--muted);
}
.cal-providers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0;
}
.cal-provider {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 14px;
  padding: 20px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.cal-provider:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.cal-provider strong {
  font-size: 12px;
}
.cal-provider small {
  font-size: 10px;
  color: var(--muted);
}
.cal-provider-mark {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 32px;
  width: 32px;
  color: var(--accent);
  font-weight: 700;
}
.cal-connections {
  display: grid;
  gap: 12px;
}
.cal-connections > section {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}
.cal-connections > section > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.cal-connections p,
.cal-status {
  font-size: 11px;
  color: var(--muted);
}
.cal-status {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 3px 8px;
}
.cal-share-list > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cal-conflict {
  margin: 24px 0;
}
.cal-conflict section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.cal-conflict h3 {
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 850px) {
  .cal-holiday-list {
    grid-template-columns: 1fr;
  }
  .cal-form-grid,
  .cal-conflict {
    grid-template-columns: 1fr;
  }
  .cal-providers {
    grid-template-columns: 1fr;
  }
  .cal-provider {
    flex-direction: row;
    align-items: center;
    padding: 12px;
  }
  .cal-provider small {
    margin-left: auto;
  }
}

/* Personal grades */
.grades-page {
  max-width: 1180px;
  margin: 0 auto;
}
.grades-heading,
.grade-detail-heading,
.grade-editor-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.grades-heading {
  margin-bottom: 28px;
}
.grade-setup {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--sidebar);
}
.grade-setup-icon {
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
}
.grade-setup-icon svg {
  width: 24px;
  height: 24px;
}
.grade-setup-content {
  min-width: 0;
}
.grade-setup h2 {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.5px;
}
.grade-setup p {
  max-width: 48ch;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.grade-setup .button {
  margin-top: 24px;
  gap: 16px;
  box-shadow: none;
}
.grade-setup .button svg {
  width: 16px;
  height: 16px;
}
@media (max-width: 540px) {
  .grade-setup {
    flex-direction: column;
    gap: 20px;
    padding: 24px;
  }
  .grade-setup-icon {
    width: 48px;
    height: 48px;
    flex-basis: auto;
  }
  .grade-setup h2 {
    font-size: 20px;
  }
}
.grade-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.grade-toolbar .field {
  flex: 1 1 180px;
  margin: 0;
}
.grade-toolbar button {
  margin-bottom: 0;
}
.grade-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 28px;
}
.grade-subjects {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}
.grade-subjects button {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  padding: 13px 12px;
  color: var(--muted);
  text-align: left;
  font: inherit;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.grade-subjects button:hover {
  background: var(--nav-hover);
}
.grade-subjects button[aria-pressed="true"] {
  background: var(--soft);
  color: var(--ink);
  border-color: var(--positive-border);
  font-weight: 600;
}
.grade-detail {
  min-width: 0;
}
.grade-detail-heading {
  margin-bottom: 16px;
}
.grade-detail-heading h2,
.grade-detail-heading h3 {
  margin: 0;
}
.grade-list {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  margin-bottom: 18px;
}
.grade-row {
  display: flex;
  align-items: start;
  gap: 18px;
  padding: 20px;
}
.grade-row + .grade-row {
  border-top: 1px solid var(--line);
}
.grade-result {
  min-width: 64px;
  max-width: 160px;
  background: var(--soft);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.grade-row-copy {
  flex: 1;
  min-width: 0;
}
.grade-row-copy h3 {
  margin: 0 0 6px;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.grade-row-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.grade-row-copy .grade-note {
  margin-top: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.grade-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.grade-entry-fields {
  padding: 0;
  margin: 0;
  border: 0;
  min-width: 0;
}
.grade-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.grade-form-grid .field {
  margin: 0;
}
.grade-form-grid [data-scale-numbers] {
  display: grid;
  gap: 12px;
}
.grade-form-grid [hidden] {
  display: none;
}
.grade-form-grid .grade-span {
  grid-column: 1 / -1;
}
.grade-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}
.grade-editor-row .field,
.grade-period-row .field {
  margin: 0;
}
.grade-period-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 140px auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 16px;
}
.grade-forecast {
  margin-top: 20px;
  padding: 20px;
  border-radius: 12px;
  background: var(--soft);
  line-height: 1.6;
}
.grade-forecast strong {
  font-size: 20px;
}
.grade-file-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.grade-file-row > div {
  flex: 1;
  min-width: 0;
}
.grade-file-row strong {
  display: block;
  overflow-wrap: anywhere;
}
.grade-file-row small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}
.grade-image-preview {
  display: block;
  max-width: 100%;
  max-height: 500px;
  object-fit: contain;
  margin: 18px auto;
  border-radius: 10px;
}
.storage-header {
  padding: 24px 24px 0;
}
.storage-header h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.storage-header p {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.storage-body {
  padding: 24px;
}
.storage-amount {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.storage-amount strong {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -1px;
}
.storage-amount span {
  font-size: 12px;
  color: var(--muted);
}
.storage-usage progress {
  appearance: none;
  display: block;
  width: 100%;
  height: 6px;
  margin: 16px 0 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
  accent-color: var(--accent);
}
.storage-usage progress::-webkit-progress-bar {
  background: var(--soft);
  border-radius: 999px;
}
.storage-usage progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 999px;
}
.storage-usage progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 999px;
}
.storage-limit,
.storage-cleanup,
.storage-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.storage-cleanup {
  margin-top: 8px;
}
.storage-action {
  width: 100%;
  justify-content: space-between;
  margin-top: 24px;
  white-space: normal;
  text-align: left;
}
.storage-action svg {
  width: 16px;
  height: 16px;
}
@media (max-width: 760px) {
  .grades-heading {
    align-items: start;
    flex-direction: column;
  }
  .grade-layout {
    display: block;
  }
  .grade-subjects {
    flex-direction: row;
    overflow-x: auto;
    margin-bottom: 24px;
    padding-bottom: 6px;
  }
  .grade-subjects button {
    flex-shrink: 0;
  }
  .grade-row {
    flex-wrap: wrap;
    padding: 16px;
    gap: 12px;
  }
  .grade-row-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .grade-form-grid {
    grid-template-columns: 1fr;
  }
  .grade-period-row {
    grid-template-columns: 1fr 1fr;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
  }
  .grade-period-row > .field:first-child {
    grid-column: 1 / -1;
  }
  .grade-file-row {
    flex-wrap: wrap;
  }
  .grade-file-row > div {
    flex-basis: 100%;
  }
}
@media (max-width: 400px) {
  .grade-editor-row {
    grid-template-columns: minmax(0, 1fr) 90px;
  }
}

/* Custom dropdowns shared with the support UI. */
.select-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}
.select-trigger:hover:not(:disabled) {
  border-color: var(--muted);
  background: var(--canvas);
}
.select-trigger[aria-expanded="true"] {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--soft);
}
.select-trigger:focus-visible {
  outline-offset: 2px;
}
.select-trigger:disabled {
  cursor: not-allowed;
  background: var(--soft);
  opacity: 0.55;
}
.select-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.select-trigger > svg,
.select-option > svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.select-trigger > svg {
  color: var(--muted);
  transition: transform 140ms ease;
}
.select-trigger[aria-expanded="true"] > svg {
  transform: rotate(180deg);
}
.select-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 5px;
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 12px 32px var(--popover-shadow);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}
.select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: var(--radius-control);
  cursor: pointer;
  user-select: none;
}
.select-option[hidden] {
  display: none;
}
.select-option > span {
  overflow-wrap: anywhere;
}
.select-option > svg {
  opacity: 0;
}
.select-option[aria-selected="true"] {
  font-weight: 550;
}
.select-option[aria-selected="true"] > svg {
  opacity: 1;
}
.select-option.is-active {
  background: var(--soft);
}
.select-option[aria-disabled="true"] {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.5;
}
@media (pointer: coarse) {
  .select-trigger,
  .select-option {
    min-height: 44px;
  }
}

.select-trigger[aria-invalid="true"] {
  border-color: var(--danger);
}
.select-group-label {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
@media (prefers-reduced-motion: reduce) {
  .select-trigger,
  .select-trigger > svg {
    transition: none;
  }
}

/* Device information describes one signed-in session, including older clients. */
.session-card {
  padding: 24px;
}
.session-card + .session-card {
  border-top: 1px solid var(--line);
}
.session-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.session-device-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}
.session-device-icon svg {
  width: 22px;
  height: 22px;
}
.session-title {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.session-title h3 {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
}
.session-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.session-heading > .button,
.session-heading > .pill {
  flex: none;
}
.session-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 24px;
  margin: 0;
}
.session-details dt {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 5px;
}
.session-details dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.session-details small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}
.session-ip {
  font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
  .session-card {
    padding: 20px;
  }
  .session-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 16px;
  }
  .session-heading {
    flex-wrap: wrap;
    gap: 10px;
  }
  .session-title {
    flex-basis: calc(100% - 52px);
  }
  .session-heading > .button,
  .session-heading > .pill {
    margin-left: 52px;
  }
}

/* Native language names make the picker recognizable in every locale. */
.language-picker {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
}
.panel-body > .language-picker {
  margin-top: 16px;
}
.language-picker > span {
  color: var(--muted);
}
.language-picker .select-trigger {
  min-width: 0;
  max-width: 100%;
}
.language-picker select {
  max-width: 100%;
}

/* A calm, full-page workspace for school-year setup. */
.year-wizard {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 0 48px;
}
.year-wizard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 28px;
  color: var(--muted);
  font-size: 0.875rem;
}
.year-wizard-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: var(--surface);
  min-height: 580px;
}
.year-wizard-aside {
  padding: 40px 30px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}
.year-wizard-mark,
.year-card-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--accent);
}
.year-wizard-aside h1 {
  font-size: 1.65rem;
  letter-spacing: -0.045em;
  line-height: 1.2;
  margin: 24px 0 16px;
}
.year-wizard-aside p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--muted);
}
.year-progress {
  list-style: none;
  padding: 0;
  margin: 38px 0 0;
  display: grid;
  gap: 22px;
}
.year-progress li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}
.year-progress li > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 0.75rem;
}
.year-progress [aria-current] {
  color: var(--ink);
  font-weight: 600;
}
.year-progress [aria-current] > span {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.year-wizard-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 44px;
}
.year-wizard-main h2 {
  margin: 0 0 14px;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
  line-height: 1.25;
}
.year-wizard-main h2:focus {
  outline: none;
}
.year-wizard-main .muted {
  line-height: 1.7;
  font-size: 0.9rem;
}
.year-eyebrow {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin: 0 0 16px;
}
.year-source-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
}
.year-source-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}
.year-source-card strong {
  font-size: 1.05rem;
}
.year-source-card > span:not(.year-card-icon):not(.year-card-link) {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
}
.year-card-link {
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: auto;
  padding-top: 16px;
}
.year-source-card:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 28px #0000000b;
}
.year-choice-grid {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}
.year-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  width: 100%;
  text-align: left;
  padding: 19px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.year-option:hover,
.year-option.selected {
  border-color: var(--accent);
  background: var(--sidebar);
}
.year-wizard-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 36px;
}
.year-review-card {
  padding: 26px;
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--sidebar);
}
.year-review-card .school-year-preview {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.year-review-card strong {
  font-size: 2rem;
  letter-spacing: -0.04em;
}
.year-wizard .field {
  margin-top: 24px;
}
.year-wizard [hidden] {
  display: none !important;
}
@media (max-width: 850px) {
  .year-wizard-layout {
    grid-template-columns: 1fr;
  }
  .year-wizard-aside {
    padding: 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .year-wizard-mark,
  .year-wizard-aside > p {
    display: none;
  }
  .year-wizard-aside h1 {
    margin: 0 0 24px;
    font-size: 1.4rem;
  }
  .year-progress {
    display: flex;
    justify-content: space-between;
    margin: 0;
    gap: 12px;
  }
  .year-progress li {
    gap: 7px;
    font-size: 0.75rem;
  }
  .year-wizard-main {
    padding: 28px;
  }
}
@media (max-width: 520px) {
  .year-source-cards {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }
  .year-source-card {
    gap: 12px;
    padding: 20px;
  }
  .year-card-icon {
    width: 36px;
    height: 36px;
  }
  .year-card-link {
    padding-top: 0;
  }
  .year-wizard-main {
    padding: 24px 20px;
  }
  .year-wizard-main h2 {
    font-size: 1.45rem;
  }
  .year-wizard .field-grid {
    grid-template-columns: 1fr;
  }
  .year-wizard-footer .button {
    padding-inline: 14px;
  }
  .year-progress li {
    flex-direction: column;
    text-align: center;
  }
}

/* Account consent has a single focused column and explicit, touch-friendly permissions. */
.connection-page.auth-split {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 24px;
  background: var(--canvas);
}
.connection-page .auth-story {
  display: none;
}
.connection-page .auth-main {
  width: 100%;
  max-width: 520px;
  padding: 0;
}
.connection-page .auth-wrap {
  max-width: none;
}
.connection-page .auth-wrap > .brand {
  margin-bottom: 36px;
}
.connection-page .auth-wrap h1 {
  font-family: var(--font);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -1.1px;
  line-height: 1.2;
  margin: 0 0 12px;
}
.connection-page .consent-intro {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}
.consent-identity {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.consent-app {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
}
.consent-app-icon {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--sidebar);
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.consent-app-icon svg {
  width: 22px;
  height: 22px;
}
.consent-app > div {
  min-width: 0;
}
.consent-app strong {
  display: block;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.consent-origin {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.consent-account {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 20px;
  padding: 12px 20px;
  background: var(--sidebar);
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
}
.consent-account > span {
  color: var(--muted);
}
.consent-account strong {
  font-weight: 550;
  overflow-wrap: anywhere;
  min-width: 0;
}
.consent-notice {
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
  margin: 12px 2px 28px;
}
#app-consent fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
#app-consent legend {
  padding: 0;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
}
.consent-permissions {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.consent-permission {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 16px 20px;
  cursor: pointer;
  background: var(--surface);
}
.consent-permission + .consent-permission {
  border-top: 1px solid var(--line);
}
.consent-permission:has(input:checked) {
  background: var(--sidebar);
}
@media (hover: hover) {
  .consent-permission:hover {
    background: var(--soft);
  }
}
.consent-permission:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: -3px;
  z-index: 1;
}
.consent-permission-icon {
  color: var(--muted);
  display: grid;
  place-items: center;
}
.consent-permission-icon svg {
  width: 21px;
  height: 21px;
}
.consent-permission-copy {
  display: grid;
  gap: 4px;
  overflow-wrap: anywhere;
}
.consent-permission-copy strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}
.consent-permission-copy > span {
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}
#app-consent .consent-input {
  position: absolute;
  inset-inline-end: 19px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.checkbox-indicator {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1.5px solid var(--input-border);
  border-radius: 6px;
  background: var(--surface);
}
.checkbox-indicator svg {
  width: 18px;
  height: 18px;
  stroke: var(--on-accent);
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  visibility: hidden;
}
:is(.consent-permission, .cal-toggle, .support-consent) input:checked ~ .checkbox-indicator {
  background: var(--accent);
  border-color: var(--accent);
}
:is(.consent-permission, .cal-toggle, .support-consent) input:checked ~ .checkbox-indicator svg {
  visibility: visible;
}
.consent-sharing {
  margin: 20px 0 24px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
}
.consent-actions {
  display: grid;
  gap: 10px;
}
.consent-actions .button {
  width: 100%;
  min-height: 48px;
  justify-content: center;
  gap: 10px;
}
.consent-actions .primary svg {
  width: 17px;
  height: 17px;
}
.consent-actions .secondary {
  box-shadow: none;
}
#consent-error {
  color: var(--danger);
  background: var(--danger-surface);
  border: 1px solid var(--danger-border);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.5;
}
#consent-error:empty {
  display: none;
}
@media (max-width: 520px) {
  .connection-page.auth-split {
    padding: 28px 20px;
  }
  .connection-page .auth-wrap > .brand {
    margin-bottom: 28px;
  }
  .connection-page .auth-wrap h1 {
    font-size: 28px;
    letter-spacing: -0.8px;
  }
  .consent-app {
    padding: 16px;
  }
  .consent-account {
    padding: 12px 16px;
  }
  #app-consent .consent-input {
    inset-inline-end: 13px;
  }
  .consent-permission {
    padding: 14px;
    grid-template-columns: 24px minmax(0, 1fr) 22px;
    gap: 10px;
  }
}
@media (forced-colors: active) {
  :is(.consent-permission, .cal-toggle, .support-consent) input:checked ~ .checkbox-indicator {
    background: Highlight;
    border-color: Highlight;
    forced-color-adjust: none;
  }
  .checkbox-indicator svg {
    stroke: HighlightText;
  }
}

/* Connected assistants: separate identities, capabilities and recent activity. */
[data-component="connected-apps"] .panel-header p {
  max-width: 62ch;
}
.connected-app-list {
  display: grid;
  gap: 16px;
  padding: 24px;
}
.connected-app-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.connected-app-heading {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
}
.connected-app-symbol {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--sidebar);
  color: var(--ink);
}
.connected-app-symbol svg {
  width: 22px;
  height: 22px;
}
.connected-app-identity h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.connected-app-since {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.connected-app-disconnect {
  min-height: 40px;
  padding-inline: 16px;
}
.connected-app-access {
  border-top: 1px solid var(--line);
  padding: 20px 24px 24px;
}
.connected-app-access h4 {
  margin: 0 0 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.connected-app-access ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 32px;
  padding: 0;
  margin: 0;
}
.connected-app-detail {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.connected-app-scope-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  background: var(--sidebar);
  border-radius: 8px;
  color: var(--muted);
}
.connected-app-scope-icon svg {
  width: 17px;
  height: 17px;
}
.connected-app-detail > span:last-child {
  min-width: 0;
  display: grid;
  gap: 4px;
  overflow-wrap: anywhere;
}
.connected-app-detail strong {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}
.connected-app-detail > span > span,
.connected-app-detail > span > time {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  max-width: 44ch;
}
.connected-app-expiry {
  background: var(--sidebar);
  padding: 12px 24px;
  border-top: 1px solid var(--line);
}
.connected-app-activity {
  padding: 0 24px;
}
.connected-app-activity h3 {
  margin: 4px 0 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}
.connected-app-activity ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.connected-app-activity li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px 0;
}
.connected-app-activity li + li {
  border-top: 1px solid var(--line);
}
.connected-app-activity-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
}
.connected-app-activity-icon svg {
  width: 15px;
  height: 15px;
}
.connected-app-activity-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.connected-app-activity-copy strong {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}
.connected-app-activity-copy > span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.connected-app-activity time {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.connected-app-footnote {
  margin: 8px 24px 24px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}
.connected-app-empty {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px 24px;
}
.connected-app-empty p {
  margin: 0;
  max-width: 48ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
@media (max-width: 600px) {
  .connected-app-list {
    padding: 16px;
  }
  .connected-app-heading {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 16px;
    gap: 12px;
  }
  .connected-app-heading .connected-app-symbol {
    width: 40px;
    height: 40px;
  }
  .connected-app-disconnect {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 44px;
    margin-top: 4px;
  }
  .connected-app-access {
    padding: 18px 16px;
  }
  .connected-app-access ul {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .connected-app-expiry {
    padding: 12px 16px;
  }
  .connected-app-activity {
    padding: 0 20px;
  }
  .connected-app-activity li {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 3px 10px;
    padding: 14px 0;
  }
  .connected-app-activity-icon {
    width: 28px;
    height: 28px;
    grid-row: 1 / 3;
    align-self: start;
  }
  .connected-app-activity time {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    text-align: left;
  }
  .connected-app-footnote {
    margin: 8px 20px 20px;
  }
  .connected-app-empty {
    padding: 24px 20px;
    align-items: flex-start;
  }
}

/* Membership cards share the account palette, with a blue accent for Pro. */
.membership-card {
  display: grid;
  gap: 16px;
}
.membership-card p,
.membership-plan p {
  margin: 0;
}
.membership-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.membership-heading h3 {
  margin: 0;
  font-size: 16px;
}
.membership-badge {
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface);
}
.membership-pro {
  background: linear-gradient(155deg, var(--surface) 15%, var(--soft));
}
.membership-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.membership-actions .button {
  flex: 1 1 auto;
}
.membership-date {
  font-size: 12px;
}
.membership-notice {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--warning-surface);
  color: var(--warning-ink);
}
.membership-plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.membership-plan {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 20px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.membership-plan.membership-pro {
  border-color: var(--input-border);
}
.membership-plan-title {
  font-family: Georgia, serif;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.6px;
}
.membership-features {
  list-style: none;
  padding: 0;
  margin: 6px 0 20px;
  display: grid;
  gap: 18px;
}
.membership-features li {
  display: flex;
  align-items: center;
  gap: 12px;
}
.membership-pro .membership-features svg {
  color: var(--accent);
}
@media (max-width: 600px) {
  .membership-plans {
    grid-template-columns: 1fr;
  }
  .membership-plan {
    padding: 20px;
  }
  .membership-plan-title {
    font-size: 25px;
  }
}

}

@layer components {
  .sharing-table {
    overflow-x: auto;
    margin-block: 1rem;
  }
  .sharing-table table {
    width: 100%;
    border-collapse: collapse;
    text-align: start;
  }
  .sharing-table th,
  .sharing-table td {
    padding: 0.65rem;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
  }
  .sharing-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 0.75rem;
  }
  .sharing-link small {
    display: block;
  }
  .sharing-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .sharing-qr {
    display: block;
    margin: 1.5rem auto;
    max-width: 100%;
  }
  .sharing-public {
    width: min(100%, 52rem);
    max-width: 52rem;
  }
}

@layer components {
  .sharing-public h1 {
    margin-bottom: 0.75rem;
  }
  .sharing-public h2 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
  }
  .sharing-public p {
    margin-block: 0.75rem;
  }
  .sharing-public .notice {
    padding: 1rem;
    background: var(--soft);
    border-radius: var(--radius-control);
  }
  @media (max-width: 540px) {
    .sharing-table table {
      font-size: 0.8rem;
    }
    .sharing-table th,
    .sharing-table td {
      padding: 0.5rem 0.3rem;
      white-space: normal;
      overflow-wrap: anywhere;
    }
    .sharing-table td:nth-child(2) {
      min-width: 5rem;
    }
  }
}

/* Local brand artwork is decorative; adjacent names remain the accessible label. */
@layer components {
.provider-logo {
  display: block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  object-fit: contain;
}
:root[data-theme="dark"] .provider-logo--monochrome {
  filter: invert(1);
}
.setting-row .provider-name,
.cal-connections .provider-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.provider-name .provider-logo {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
}
}
