:root {
  color-scheme: light;
  --bg: #f0f2f4;
  --surface: #ffffff;
  --surface-muted: #f0f2f4;
  --surface-muted-strong: #e3e6ea;
  --surface-active: #e2f5f2;
  --surface-active-strong: #b9e7e0;
  --text: #000000;
  --text-muted: #99a3b2;
  --accent: #17b198;
  --danger: #f25b78;
  --border: #dde2e7;
  --shadow: 0 14px 32px rgba(0, 0, 0, 0.12);
  --radius: 10px;
  --font-main: Inter, "Segoe UI", sans-serif;
}

@font-face {
  font-family: "Inter";
  src: url("./inter-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("./inter-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("./inter-700.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
}

button,
input,
a {
  font: inherit;
}

a {
  color: inherit;
}

button {
  border: 0;
}

#app {
  min-height: 100vh;
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 80px;
}

.site-header-shell {
  width: 100%;
  background: var(--surface);
  border-radius: 0 0 var(--radius) var(--radius);
}

.site-header {
  width: min(1200px, calc(100% - 32px));
  min-height: 100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.logo-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.logo-image {
  display: block;
  width: 228px;
  height: auto;
}

.logout-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 50px;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.logout-button:hover {
  filter: brightness(0.98);
}

.logout-icon-image {
  display: block;
  width: 120px;
  height: 50px;
  border-radius: 10px;
  pointer-events: none;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(320px, 400px);
  gap: 28px;
  align-items: stretch;
}

.main-grid-auth {
  align-items: stretch;
}

.content-stack {
  display: grid;
  gap: 28px;
  padding-top: 28px;
}

.crumbs {
  display: flex;
  flex-wrap: nowrap;
  margin: 0;
  overflow: hidden;
}

.crumb {
  position: relative;
  flex: 0 1 auto;
  height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 28px 0 36px;
  background: var(--surface-muted-strong);
  color: var(--text);
  border: 0;
  text-decoration: none;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%, 18px 50%);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, filter 0.15s ease;
}

.crumb.is-first {
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%);
  padding-left: 20px;
}

.crumb:hover:not(:disabled) {
  filter: brightness(0.98);
}

.crumb.is-current {
  background: var(--surface-muted-strong);
  color: var(--text);
}

.crumb:disabled {
  cursor: default;
}

.crumb span {
  font-size: 16px;
  pointer-events: none;
  white-space: nowrap;
}

.crumb + .crumb {
  margin-left: -12px;
}

.service-card {
  background: var(--surface);
  border-radius: var(--radius);
  height: 100%;
}

.service-card-copy {
  min-height: 520px;
  padding: 22px 40px 28px;
}

.service-card-actions {
  min-height: 520px;
  padding: 40px;
  display: grid;
  align-content: start;
}

.page-title {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.214;
  font-weight: 600;
}

.screen-subtitle {
  margin: 0 0 10px;
  color: #17b198;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
}

.service-description {
  font-size: 18px;
  max-width: 680px;
  line-height: 1.45;
}

.service-description-preview > p {
  display: none;
}

.service-description h2 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 24px;
  line-height: 1.25;
}

.service-description.is-main-menu h2 {
  color: var(--text);
}

.service-description h3,
.service-description h4,
.service-description p {
  margin: 0 0 14px;
}

.service-description .service-inline-title {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 400 !important;
  letter-spacing: 0;
  color: var(--text);
  font-family: inherit;
}

.service-description .service-inline-title * {
  font-size: inherit;
  line-height: inherit;
  font-weight: 400 !important;
  color: inherit;
  font-family: inherit;
}

.service-description .service-inline-title.service-inline-title-emphasis,
.service-description .service-inline-title.service-inline-title-emphasis * {
  font-weight: 700 !important;
}

.service-description strong,
.service-description b {
  font-weight: 600;
}

.service-description a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.credential-field {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.credential-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 14px;
  align-items: start;
}

.credential-field-wrap {
  min-width: 0;
}

.credential-fields .credential-field,
.credential-field-wrap .credential-field {
  margin: 0;
}

.credential-label {
  font-size: 18px;
  line-height: 1.45;
}

.credential-copy-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  transition: filter 0.15s ease, background 0.15s ease;
}

.credential-copy-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credential-copy-button::after {
  content: "▣";
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
}

.credential-copy-button:hover {
  filter: brightness(0.98);
}

.copy-link-anchor {
  text-decoration: none;
  text-underline-offset: 2px;
  word-break: break-all;
}

.copy-link-anchor:hover {
  text-decoration: underline;
}

.nested-list-indent {
  display: inline-block;
  width: 1.25em;
}

.service-description blockquote {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

.service-description blockquote + br,
.service-description blockquote + br + br {
  display: none;
}

.service-buttons {
  display: grid;
  gap: 15px;
}

.service-buttons-slots {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.service-buttons-slot-footer {
  margin-top: 20px;
}

.service-buttons-status-footer {
  margin-top: 15px;
}

.teachers-directory {
  display: grid;
  gap: 15px;
}

.teachers-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px 76px;
  gap: 15px;
}

.teacher-name-tile,
.teacher-link {
  min-height: 60px;
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.teacher-name-tile {
  display: flex;
  align-items: center;
  padding: 0 24px;
  font-size: 18px;
  font-weight: 600;
}

.teacher-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 60px;
  overflow: hidden;
  transition: filter 0.15s ease, background 0.15s ease;
}

.teacher-link:hover {
  background: var(--surface-muted-strong);
  filter: brightness(0.98);
}

.teacher-link-empty {
  cursor: default;
}

.teacher-link-empty:hover {
  background: var(--surface-muted);
  filter: none;
}

.teacher-link-icon {
  display: block;
  width: 34px;
  height: 34px;
  max-width: 34px;
  max-height: 34px;
  flex: 0 0 34px;
  object-fit: contain;
}

.teachers-directory-footer {
  margin-top: 5px;
}

.service-buttons-row {
  display: grid;
  gap: 15px;
}

.service-buttons-row-slots {
  display: contents;
}

.service-button {
  position: relative;
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  padding: 0 30px;
  border-radius: var(--radius);
  background: var(--surface-muted);
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  text-align: left;
  white-space: pre-line;
  cursor: pointer;
  isolation: isolate;
  overflow: hidden;
  transition: filter 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.service-button-slot {
  width: 100%;
  min-height: 56px;
  justify-content: center;
  padding: 0 10px;
  border-radius: 10px;
  text-align: center;
  font-size: 17px;
}

.service-button:hover {
  background: var(--surface-muted-strong);
  filter: brightness(0.98);
}

.service-button-slot.is-selected {
  background: var(--surface-active);
  color: var(--accent);
}

.service-button.is-disabled {
  color: var(--text-muted);
  cursor: default;
  background: var(--surface-muted);
}

.service-button.is-disabled:hover {
  filter: none;
}

.service-button.is-disabled::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(153, 163, 178, 0.08),
    rgba(153, 163, 178, 0.08) 6px,
    rgba(255, 255, 255, 0) 6px,
    rgba(255, 255, 255, 0) 12px
  );
}

.service-button-status {
  min-height: 60px;
  padding-top: 0;
  padding-bottom: 0;
  justify-content: center;
  align-items: center;
  cursor: default;
  background: var(--surface-active);
  color: var(--accent);
  text-align: center;
}

.service-button-status:hover {
  background: var(--surface-active);
  filter: none;
}

.service-button-status-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  line-height: 1.2;
}

.service-button.is-disabled::after {
  content: none;
}

.service-button.is-disabled span,
.service-button.is-disabled {
  pointer-events: none;
}

.auth-panel {
  display: flex;
  width: 100%;
  justify-content: stretch;
}

.auth-card {
  width: 100%;
  min-height: 250px;
  padding: 32px;
  border-radius: var(--radius);
  background: var(--surface);
  display: grid;
  align-content: start;
  gap: 18px;
}

.auth-lockup {
  display: none;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 600;
}

.auth-lock-icon {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
}

.auth-label {
  font-size: 18px;
  font-weight: 600;
}

.auth-card input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  outline: 0;
  border-radius: var(--radius);
  background: var(--surface);
}

.auth-help {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.submit-button {
  width: 100%;
  min-height: 48px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.submit-button:hover {
  filter: brightness(0.97);
}

.status-note {
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.35;
}

.status-note.is-success {
  background: #e2f5f2;
  color: #0f8d78;
}

.status-note.is-error {
  background: #fdecef;
  color: #be3551;
}

.site-footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  padding-top: 42px;
  font-size: 16px;
}

.site-footer a {
  text-decoration: none;
  text-underline-offset: 2px;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 1100px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    justify-content: flex-start;
  }

  .service-card-actions,
  .service-card-copy {
    min-height: auto;
  }

  .service-buttons-slots {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 24px, 1200px);
    padding-bottom: 48px;
  }

  .content-stack {
    gap: 12px;
    padding-top: 12px;
  }

  .main-grid-auth {
    gap: 12px;
  }

  .site-header {
    width: min(100% - 24px, 1200px);
    min-height: 84px;
    padding: 0 16px;
  }

  .logo-image {
    width: 180px;
  }

  .crumb,
  .crumb.is-first {
    height: 42px;
    padding: 0 22px 0 28px;
  }

  .crumb.is-first {
    padding-left: 16px;
  }

  .crumb span {
    font-size: 15px;
  }

  .logout-button,
  .logout-icon-image {
    width: 104px;
    height: 44px;
  }

  .service-card-copy,
  .service-card-actions {
    padding: 20px;
  }

  .main-grid:not(.main-grid-auth) {
    gap: 0;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
  }

  .main-grid:not(.main-grid-auth) .service-card {
    background: transparent;
    border-radius: 0;
  }

  .main-grid:not(.main-grid-auth) .service-card-copy {
    padding-bottom: 10px;
  }

  .main-grid:not(.main-grid-auth) .service-card-actions {
    padding-top: 10px;
  }

  .page-title {
    font-size: 24px;
  }

  .screen-subtitle {
    font-size: 18px;
    line-height: 1.3;
  }

  .service-description,
  .service-description h2 {
    font-size: 18px;
  }

  .service-description h2 {
    line-height: 1.3;
  }

  .service-button {
    padding: 0 30px;
  }

  .service-button-slot {
    width: 100%;
    min-height: 52px;
    padding: 0 8px;
    font-size: 15px;
  }

  .service-buttons-slots {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .teachers-row {
    grid-template-columns: minmax(0, 1fr) 72px 72px;
    gap: 12px;
  }

  .teacher-link {
    width: 72px;
    height: 60px;
  }

  .teacher-name-tile {
    padding: 0 20px;
    font-size: 18px;
  }

  .auth-card {
    width: 100%;
    padding: 20px;
  }

  .site-footer {
    justify-content: center;
    gap: 12px;
    padding-top: 12px;
    font-size: 14px;
  }
}

@media (max-width: 420px) {
  .site-header {
    width: min(100% - 16px, 1200px);
    min-height: 76px;
    padding: 0 12px;
  }

  .logo-image {
    width: 152px;
  }

  .logout-button,
  .logout-icon-image {
    width: 92px;
    height: 40px;
  }

  .crumb {
    height: 40px;
    padding: 0 18px 0 24px;
  }

  .crumb.is-first {
    padding-left: 14px;
  }

  .crumb span {
    font-size: 14px;
  }

  .teachers-row {
    grid-template-columns: minmax(0, 1fr) 64px 64px;
    gap: 10px;
  }

  .teacher-name-tile,
  .teacher-link {
    min-height: 56px;
  }

  .teacher-link {
    width: 64px;
    height: 56px;
  }

  .teacher-name-tile {
    padding: 0 16px;
    font-size: 17px;
  }

  .teacher-link-icon {
    width: 30px;
    height: 30px;
    max-width: 30px;
    max-height: 30px;
    flex-basis: 30px;
  }
}
