:root {
  color-scheme: light;
  --ink: #101315;
  --muted: #687076;
  --line: #dfe4e6;
  --paper: #f7f8f6;
  --surface: #ffffff;
  --cyan: #12aaa8;
  --cyan-dark: #087f80;
  --lime: #a8d63f;
  --sidebar-width: 276px;
  font-family: 'Manrope', sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
}

.sidebar {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 28px 22px 20px;
  background: var(--ink);
  color: #f8faf9;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  flex: 0 0 auto;
  border-radius: 10px;
}

.brand-lockup div {
  display: grid;
  line-height: 1.05;
}

.brand-lockup strong {
  font-size: 17px;
  letter-spacing: 0;
}

.brand-lockup span {
  margin-top: 5px;
  color: #b6bec1;
  font-size: 13px;
}

.new-session {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  margin: 32px 0 28px;
  padding: 0 15px;
  border: 1px solid #343c40;
  border-radius: 7px;
  background: #1a1f22;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.new-session:hover {
  border-color: var(--cyan);
  background: #20272a;
}

.new-session span {
  color: var(--cyan);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}

.menu-label {
  margin: 0 0 10px 12px;
  color: #7f898d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.coach-menu {
  display: grid;
  gap: 5px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 6px;
  color: #bfc6c8;
  font-size: 13px;
  font-weight: 500;
}

.menu-item.active {
  background: #1f292b;
  color: #fff;
}

.menu-icon {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: var(--cyan);
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
}

.trust-note {
  display: flex;
  gap: 11px;
  margin-top: auto;
  padding: 15px;
  border: 1px solid #30373a;
  border-radius: 7px;
  background: #151a1c;
}

.verified-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgb(168 214 63 / 12%);
}

.trust-note strong {
  font-size: 12px;
}

.trust-note p {
  margin: 5px 0 0;
  color: #8f999d;
  font-size: 11px;
  line-height: 1.5;
}

.sidebar-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 18px;
  color: #697276;
  font-size: 10px;
}

.sidebar-footer a {
  color: #8d979a;
  text-decoration: none;
}

.sidebar-footer a:hover {
  color: #fff;
}

.sidebar-footer span:last-child {
  flex-basis: 100%;
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  padding: 0 28px 28px;
  background:
    linear-gradient(rgb(16 19 21 / 2%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(16 19 21 / 2%) 1px, transparent 1px), var(--paper);
  background-size: 28px 28px;
}

.workspace-header {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 106px;
  padding: 16px 2px 14px;
}

.workspace-title {
  min-width: 0;
}

.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--cyan-dark);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-title h1 {
  margin: 0;
  font-family: 'DM Serif Display', serif;
  font-size: clamp(25px, 3vw, 38px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.connection-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.connection-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgb(255 255 255 / 78%);
  cursor: pointer;
}

.icon-button:hover {
  border-color: #afb8bb;
  background: #fff;
}

.menu-button {
  display: none;
}

.menu-button span {
  display: block;
  width: 17px;
  height: 1.5px;
  margin: 2px 0;
  background: var(--ink);
}

.fullscreen-icon {
  width: 15px;
  height: 15px;
  border: solid var(--ink);
  border-width: 1.5px 0 0 1.5px;
  box-shadow:
    5px 5px 0 -3.5px var(--paper),
    5px 5px 0 -2px var(--ink);
}

.coach-frame {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #cfd6d8;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 50px rgb(16 19 21 / 8%);
}

.frame-accent {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan) 0 72%, var(--lime) 72% 100%);
}

.coach-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.frame-loading {
  position: absolute;
  z-index: 3;
  inset: 3px 0 0;
  display: grid;
  place-content: center;
  justify-items: center;
  background: var(--surface);
  color: var(--muted);
  transition: opacity 200ms ease;
}

.frame-loading img {
  border-radius: 12px;
  animation: breathe 1.4s ease-in-out infinite;
}

.frame-loading p {
  margin: 16px 0 0;
  font-size: 12px;
}

.frame-loading.loaded {
  pointer-events: none;
  opacity: 0;
}

.mobile-scrim {
  position: fixed;
  z-index: 15;
  inset: 0;
  background: rgb(8 10 11 / 48%);
  backdrop-filter: blur(2px);
}

@keyframes breathe {
  50% {
    transform: translateY(-3px);
    opacity: 0.76;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 310px);
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .workspace {
    width: 100%;
    height: 100dvh;
    padding: 0;
    background: var(--surface);
  }

  .workspace-header {
    min-height: 72px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
  }

  .menu-button {
    display: grid;
  }

  .workspace-title .eyebrow,
  .connection-state {
    display: none;
  }

  .workspace-title h1 {
    overflow: hidden;
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .coach-frame {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .frame-accent {
    display: none;
  }
}

@media (max-width: 460px) {
  .workspace-header {
    min-height: 64px;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .session-actions {
    gap: 8px;
  }
}

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