:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #65717f;
  --line: #d9dedb;
  --paper: #f6f4ee;
  --panel: #ffffff;
  --green: #1e6f5c;
  --coral: #cf6147;
  --blue: #375f86;
  --gold: #c8942f;
  --shadow: 0 18px 50px rgba(39, 49, 63, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(160deg, rgba(30, 111, 92, 0.16), transparent 36%),
    linear-gradient(20deg, rgba(207, 97, 71, 0.14), transparent 42%),
    var(--paper);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.phone-frame {
  width: min(100%, 430px);
  min-height: min(860px, calc(100vh - 36px));
  max-height: calc(100vh - 36px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(23, 32, 42, 0.08);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.public-frame {
  grid-template-rows: auto 1fr;
}

.landing-hero {
  padding: 28px 22px 18px;
  background:
    linear-gradient(135deg, rgba(30, 111, 92, 0.12), rgba(207, 97, 71, 0.1)),
    #ffffff;
  border-bottom: 1px solid var(--line);
}

.landing-hero h1 {
  max-width: 360px;
  margin: 6px 0 10px;
  font-size: 2rem;
}

.hero-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.public-screen {
  padding-top: 16px;
}

.info-panel,
.auth-panel {
  padding: 16px;
  margin-bottom: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px 12px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.text-action {
  padding: 0;
  color: var(--blue);
  background: transparent;
  border: 0;
  font-size: 0.8rem;
  font-weight: 900;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 22px 16px;
}

.eyebrow,
.result-count {
  margin: 0;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 300px;
  margin-bottom: 0;
  font-size: 1.55rem;
  line-height: 1.08;
}

h2 {
  margin-bottom: 10px;
  font-size: 1rem;
}

p {
  color: var(--muted);
  line-height: 1.45;
}

.credit-pill {
  min-width: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 12px;
  color: #734b02;
  background: #fff2c7;
  border-radius: 999px;
  font-weight: 900;
}

.credit-pill.neutral {
  color: var(--blue);
  background: #eef5fb;
}

.credit-pill.admin {
  color: #6d493c;
  background: #f5dfd6;
}

.portal-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 14px 12px;
}

.portal-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 850;
}

.portal-button svg {
  width: 17px;
  height: 17px;
}

.portal-button.is-active {
  color: var(--ink);
  border-color: rgba(30, 111, 92, 0.35);
  background: #e6f2ee;
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 6px;
  padding: 0 14px 14px;
}

.tab {
  height: 58px;
  display: grid;
  place-items: center;
  gap: 3px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 12px;
}

.tab span {
  font-size: 0.72rem;
  font-weight: 750;
}

.tab.is-active {
  color: var(--green);
  background: #e6f2ee;
}

.screen {
  overflow: auto;
  padding: 0 18px 22px;
}

.controls,
.booking-panel,
.wallet-panel,
.history-panel,
.payout-panel,
.profile-panel {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.controls {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.compact-controls {
  margin-bottom: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  color: var(--ink);
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30, 111, 92, 0.12);
}

textarea {
  min-height: 120px;
  padding-block: 12px;
  resize: vertical;
  line-height: 1.4;
}

.search-field {
  position: relative;
}

.search-field svg {
  position: absolute;
  left: 12px;
  bottom: 13px;
  color: var(--muted);
}

.search-field input {
  padding-left: 42px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.result-count {
  margin: 12px 2px;
}

.tutor-list {
  display: grid;
  gap: 12px;
}

.tutor-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tutor-card.is-selected {
  border-color: var(--green);
}

.card-button {
  width: 100%;
  display: flex;
  gap: 12px;
  padding: 14px;
  text-align: left;
  color: inherit;
  background: transparent;
  border: 0;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--green));
  border-radius: 16px;
  font-weight: 900;
}

.avatar.large {
  width: 62px;
  height: 62px;
  border-radius: 20px;
}

.avatar.mini {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 0.76rem;
}

.headshot {
  width: 78px;
  height: 92px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(55, 95, 134, 0.72), rgba(30, 111, 92, 0.86)),
    #d8e5df;
  border: 3px solid #ffffff;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(23, 32, 42, 0.12);
  font-size: 1.1rem;
  font-weight: 950;
}

.card-body {
  min-width: 0;
  flex: 1;
}

.card-title,
.profile-head {
  display: flex;
  gap: 12px;
}

.card-title {
  align-items: center;
  justify-content: space-between;
}

.card-title h2 {
  margin: 0;
}

.rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #7a550b;
  font-weight: 900;
}

.rating svg {
  width: 16px;
  height: 16px;
  fill: #f3bc42;
  stroke: #a77511;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0;
}

.chips span {
  padding: 6px 9px;
  color: var(--blue);
  background: #eef5fb;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 0;
}

.metrics div,
.summary-grid div {
  min-width: 0;
  padding: 10px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

dt,
.summary-grid span,
.wallet-balance span,
.history-item span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

dd,
.summary-grid strong,
.wallet-balance strong {
  display: block;
  margin: 4px 0 0;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.profile-panel,
.booking-panel,
.wallet-panel,
.history-panel,
.payout-panel {
  margin-bottom: 12px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin: 12px 0;
  background: #eef1ef;
  border-radius: 8px;
}

.segmented.three {
  grid-template-columns: repeat(3, 1fr);
}

.compact-segment {
  margin-bottom: 10px;
}

.segmented button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.segmented button.is-active {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(23, 32, 42, 0.1);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

.summary-grid.compact {
  margin-top: 10px;
}

.primary-action {
  width: 100%;
  min-height: 52px;
  color: #ffffff;
  background: var(--green);
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.primary-action.is-secondary {
  color: #6d493c;
  background: #f5cbbb;
}

.small-action {
  min-width: 86px;
  min-height: 38px;
  padding: 0 12px;
  color: #ffffff;
  background: var(--blue);
  border: 0;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 900;
}

.small-action.is-muted {
  color: var(--ink);
  background: #eef1ef;
}

.request-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.wallet-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  margin-bottom: 14px;
  background: #e6f2ee;
  border-radius: 8px;
}

.wallet-balance strong {
  font-size: 2rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.history-item div {
  display: grid;
  gap: 2px;
}

.notification-item,
.session-card {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.simulator-panel {
  padding: 16px;
  margin-bottom: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.simulator-track {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.sim-step {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 10px 10px 10px 38px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sim-step::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 14px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #c6cfca;
}

.sim-step.is-active {
  border-color: rgba(30, 111, 92, 0.38);
  background: #e6f2ee;
}

.sim-step.is-active::before {
  background: var(--green);
}

.sim-step span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.simulator-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.simulator-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.notification-item:first-of-type,
.session-card:first-of-type {
  border-top: 0;
}

.notification-item span,
.session-card span,
.review-summary {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.session-card {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.review-box {
  display: grid;
  gap: 8px;
}

.review-box textarea {
  min-height: 78px;
}

.schedule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.schedule-row div {
  display: grid;
  gap: 2px;
}

.schedule-row span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.schedule-row.is-booked {
  opacity: 0.68;
}

.microcopy {
  margin: 10px 0 14px;
  font-size: 0.8rem;
}

.section-head h2 {
  margin-bottom: 4px;
}

.favorite-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(132px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.favorite-tutor {
  min-height: 98px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 6px;
  padding: 12px;
  color: var(--ink);
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.favorite-tutor.is-active {
  border-color: rgba(30, 111, 92, 0.45);
  background: #e6f2ee;
}

.favorite-tutor strong {
  font-size: 0.82rem;
}

.favorite-tutor span:last-child {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
}

.selected-tutor-head {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.selected-tutor-head h2 {
  margin-bottom: 4px;
}

.selected-tutor-head p:last-child {
  margin-bottom: 0;
}

.student-slot-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.student-slot {
  min-height: 68px;
  display: grid;
  justify-items: start;
  gap: 3px;
  padding: 12px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.student-slot.is-active {
  border-color: rgba(30, 111, 92, 0.5);
  background: #e6f2ee;
}

.student-slot span,
.student-slot small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.duration-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.duration-toggle button {
  min-height: 38px;
  color: var(--muted);
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 900;
}

.duration-toggle button.is-active {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

.availability-grid {
  display: grid;
  gap: 10px;
}

.availability-day {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 10px;
  align-items: stretch;
}

.day-label {
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px;
  background: #eef5fb;
  border-radius: 8px;
}

.day-label strong {
  color: var(--blue);
  font-size: 0.9rem;
}

.day-label span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.time-tile {
  min-height: 54px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 8px;
  background: #ffffff;
  border: 1px dashed #b8c4be;
  border-radius: 8px;
  color: var(--ink);
}

.time-tile strong {
  font-size: 0.86rem;
}

.time-tile span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.time-tile.available {
  border-style: solid;
  border-color: rgba(30, 111, 92, 0.32);
  background: #e6f2ee;
}

.time-tile.booked {
  cursor: not-allowed;
  border-style: solid;
  border-color: #ead0c7;
  background: #f5dfd6;
}

.time-tile.dual-slot {
  place-items: stretch;
  gap: 8px;
  padding: 8px;
  border-style: solid;
}

.time-tile.dual-slot > strong {
  text-align: center;
}

.slot-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.slot-actions button,
.slot-pill {
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 5px 6px;
  border-radius: 7px;
  font-size: 0.68rem;
  font-weight: 900;
}

.slot-actions button {
  color: var(--blue);
  background: #eef5fb;
  border: 1px dashed rgba(55, 95, 134, 0.45);
}

.slot-pill.available {
  color: var(--green);
  background: #e6f2ee;
}

.slot-pill.booked {
  color: #6d493c;
  background: #f5dfd6;
}

.opportunity-card,
.account-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.opportunity-card:first-of-type,
.account-row:first-of-type {
  border-top: 0;
}

.opportunity-card p {
  margin: 6px 0 0;
}

.account-row div {
  display: grid;
  gap: 3px;
}

.account-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.empty {
  margin-bottom: 0;
}

@media (max-width: 380px) {
  .app-shell {
    padding: 0;
  }

  .phone-frame {
    min-height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: 0;
  }

  .topbar {
    padding-inline: 16px;
  }

  .screen {
    padding-inline: 14px;
  }

  .metrics,
  .summary-grid,
  .opportunity-card,
  .account-row,
  .schedule-row,
  .availability-day,
  .session-card {
    grid-template-columns: 1fr;
  }

  .portal-button span {
    font-size: 0.72rem;
  }
}
