:root {
  color-scheme: light;
  --ink: #1e2925;
  --muted: #68736e;
  --paper: #f5f2ea;
  --paper-deep: #ebe6da;
  --card: rgba(255, 255, 255, 0.82);
  --line: rgba(39, 62, 53, 0.13);
  --green: #246b54;
  --green-dark: #174a3a;
  --green-soft: #e3f0e9;
  --coral: #e7654f;
  --coral-dark: #b94435;
  --amber: #b77519;
  --amber-soft: #fff3da;
  --blue: #47738b;
  --shadow: 0 24px 70px rgba(44, 55, 50, 0.09);
  --radius-lg: 28px;
  --radius-md: 19px;
  --radius-sm: 13px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.58), transparent 40%),
    var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.page-glow {
  position: fixed;
  z-index: -1;
  width: 32rem;
  height: 32rem;
  border-radius: 50%;
  filter: blur(5px);
  pointer-events: none;
}

.page-glow--one {
  top: -17rem;
  right: -9rem;
  background: radial-gradient(circle, rgba(68, 142, 111, 0.17), transparent 67%);
}

.page-glow--two {
  bottom: -20rem;
  left: -12rem;
  background: radial-gradient(circle, rgba(231, 101, 79, 0.11), transparent 67%);
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: calc(22px + env(safe-area-inset-top)) 0 calc(42px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 39px;
  height: 39px;
  color: white;
  border-radius: 13px;
  background: var(--green-dark);
  box-shadow: 0 8px 20px rgba(23, 74, 58, 0.18);
}

.brand__mark span {
  display: block;
  width: 3px;
  border-radius: 5px;
  background: currentColor;
}

.brand__mark span:nth-child(1) { height: 10px; opacity: 0.62; }
.brand__mark span:nth-child(2) { height: 19px; }
.brand__mark span:nth-child(3) { height: 14px; opacity: 0.78; }
.brand__mark span:nth-child(4) { height: 7px; opacity: 0.5; }

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.13rem;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.connection-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
}

.connection-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a0a9a5;
}

.connection-pill.is-online .connection-pill__dot {
  background: #37a575;
  box-shadow: 0 0 0 4px rgba(55, 165, 117, 0.13);
}

.connection-pill.is-offline .connection-pill__dot {
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(231, 101, 79, 0.12);
}

.offline-banner {
  position: sticky;
  z-index: 20;
  top: 0;
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  color: #65400e;
  font-size: 0.84rem;
  font-weight: 650;
  text-align: center;
  background: #ffedc2;
  border-bottom: 1px solid rgba(183, 117, 25, 0.18);
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-view {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.68fr);
  align-items: center;
  gap: clamp(44px, 8vw, 108px);
  min-height: calc(100vh - 120px);
  min-height: calc(100dvh - 120px);
  padding: 48px 5vw 70px;
}

.login-copy h1,
.hero-row h1 {
  margin: 14px 0 18px;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.login-view > *,
.login-copy,
.login-card {
  min-width: 0;
}

.login-copy h1 {
  overflow-wrap: anywhere;
}

.login-copy > p:not(.eyebrow) {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.9;
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 650;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feature-list span {
  color: var(--coral);
  font-size: 0.69rem;
  font-weight: 800;
}

.login-card {
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 28px;
  color: white;
  font-family: Georgia, "Songti SC", serif;
  font-size: 1.25rem;
  border-radius: 16px;
  background: var(--green-dark);
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 1.52rem;
}

.login-card > p {
  margin: 0 0 27px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field > span {
  color: #435049;
  font-size: 0.82rem;
  font-weight: 700;
}

.field em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 500;
}

.field input {
  width: 100%;
  min-height: 49px;
  padding: 0 15px;
  color: var(--ink);
  outline: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(250, 249, 246, 0.9);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input:focus {
  border-color: rgba(36, 107, 84, 0.62);
  box-shadow: 0 0 0 4px rgba(36, 107, 84, 0.1);
}

.form-error {
  margin: -6px 0 14px;
  color: var(--coral-dark);
  font-size: 0.79rem;
  line-height: 1.45;
}

.button,
.icon-button,
.record-button,
.mini-button,
.text-button {
  cursor: pointer;
  border: 0;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease,
    background-color 140ms ease;
}

.button:active,
.icon-button:active,
.record-button:active,
.mini-button:active,
.text-button:active {
  transform: translateY(1px);
}

.button:focus-visible,
.icon-button:focus-visible,
.record-button:focus-visible,
.mini-button:focus-visible,
.text-button:focus-visible,
.course-item:focus-visible {
  outline: 3px solid rgba(36, 107, 84, 0.25);
  outline-offset: 3px;
}

.button:disabled,
.icon-button:disabled,
.record-button:disabled,
.mini-button:disabled,
.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 47px;
  padding: 0 19px;
  font-size: 0.87rem;
  font-weight: 750;
  border-radius: 13px;
}

.button--wide { width: 100%; }
.button--primary { color: white; background: var(--green-dark); }
.button--primary:hover { background: #113f31; box-shadow: 0 10px 24px rgba(23, 74, 58, 0.16); }
.button--secondary { color: var(--green-dark); background: var(--green-soft); }
.button--danger { color: var(--coral-dark); background: #f9e6e1; }
.button--quiet { color: var(--ink); background: #ece9e1; }
.button--small { min-height: 38px; padding: 0 13px; font-size: 0.77rem; border: 1px solid var(--line); background: white; }

.app-view {
  padding: clamp(52px, 8vw, 86px) 0 0;
}

.hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin: 0 2px 42px;
}

.hero-row h1 {
  margin: 10px 0 8px;
  font-size: clamp(2.35rem, 5vw, 4.25rem);
}

.hero-row__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.91rem;
}

.today-card {
  flex: 0 0 auto;
  display: grid;
  min-width: 120px;
  padding: 15px 19px;
  text-align: right;
  border-right: 3px solid var(--coral);
}

.today-card span,
.today-card small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.today-card strong {
  margin: 2px 0;
  font-family: Georgia, serif;
  font-size: 2.65rem;
  font-weight: 500;
  line-height: 1;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 2fr);
  gap: 20px;
  align-items: start;
}

.panel {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.course-panel {
  position: sticky;
  top: 20px;
  min-height: 480px;
  padding: 27px 21px;
}

.panel__header,
.recorder-head,
.recorder-title-row,
.status-card__top,
.server-progress,
.recovery-card,
.dialog__header,
.dialog__actions {
  display: flex;
  align-items: center;
}

.panel__header,
.recorder-head,
.dialog__header {
  justify-content: space-between;
  gap: 18px;
}

.panel__header h2,
.recorder-head h2,
.recorder-placeholder h2,
.dialog h2 {
  margin: 6px 0 0;
  font-size: 1.22rem;
  letter-spacing: -0.025em;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: white;
  font-size: 1.25rem;
  border-radius: 13px;
  background: var(--green-dark);
}

.icon-button--plain {
  color: var(--muted);
  background: transparent;
}

.skeleton-list {
  display: grid;
  gap: 11px;
  margin-top: 26px;
}

.skeleton-list span {
  display: block;
  height: 76px;
  border-radius: 16px;
  background: linear-gradient(90deg, #efede7 20%, #f8f7f3 45%, #efede7 70%);
  background-size: 250% 100%;
  animation: shimmer 1.6s infinite linear;
}

@keyframes shimmer {
  to { background-position: -250% 0; }
}

.empty-state {
  display: grid;
  justify-items: center;
  padding: 72px 14px 30px;
  text-align: center;
}

.empty-state__symbol {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  color: var(--green);
  font-size: 1.4rem;
  border: 1px dashed rgba(36, 107, 84, 0.36);
  border-radius: 50%;
}

.empty-state p {
  margin: 8px 0 13px;
  color: var(--muted);
  font-size: 0.8rem;
}

.text-button {
  padding: 4px 0;
  color: var(--green);
  font-size: 0.79rem;
  font-weight: 800;
  background: transparent;
}

.course-list {
  display: grid;
  gap: 9px;
  margin-top: 24px;
}

.course-item {
  position: relative;
  width: 100%;
  min-height: 75px;
  padding: 14px 14px 14px 17px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  outline: none;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.course-item:hover:not(:disabled) {
  background: rgba(240, 238, 231, 0.74);
}

.course-item[aria-selected="true"] {
  border-color: rgba(36, 107, 84, 0.14);
  background: var(--green-soft);
}

.course-item[aria-selected="true"]::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 0;
  width: 3px;
  border-radius: 2px;
  background: var(--green);
}

.course-item strong,
.course-item small {
  display: block;
}

.course-item strong {
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-item small {
  margin-top: 7px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recorder-panel {
  min-height: 630px;
  padding: clamp(25px, 4vw, 42px);
}

.recorder-placeholder {
  display: grid;
  justify-items: center;
  place-content: center;
  min-height: 545px;
  padding: 20px;
  text-align: center;
}

.recorder-placeholder__orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin-bottom: 29px;
  border-radius: 50%;
  background: var(--green-soft);
}

.recorder-placeholder__orb::after {
  content: "";
  position: absolute;
  inset: 13px;
  border: 1px solid rgba(36, 107, 84, 0.2);
  border-radius: inherit;
}

.recorder-placeholder__orb span {
  z-index: 1;
  display: block;
  width: 4px;
  border-radius: 5px;
  background: var(--green);
}

.recorder-placeholder__orb span:nth-child(1) { height: 15px; transform: translate(-9px, 8px); }
.recorder-placeholder__orb span:nth-child(2) { height: 30px; transform: translateY(-15px); }
.recorder-placeholder__orb span:nth-child(3) { height: 21px; transform: translate(9px, -40px); }

.recorder-placeholder p:last-child {
  max-width: 390px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.7;
}

.recorder-head {
  align-items: flex-start;
  margin-bottom: 26px;
}

.recorder-title-row { gap: 10px; }
.recorder-title-row h2 { max-width: min(430px, 60vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { margin: 6px 0 0; color: var(--muted); font-size: 0.78rem; }

.mini-button {
  padding: 4px 8px;
  color: var(--green);
  font-size: 0.69rem;
  font-weight: 800;
  border-radius: 8px;
  background: var(--green-soft);
}

.recording-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 31px;
  padding: 0 11px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  border-radius: 999px;
  background: #f0eee8;
}

.recording-badge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ba39f;
}

.recording-badge.is-recording {
  color: var(--coral-dark);
  background: #fae9e5;
}

.recording-badge.is-recording span {
  background: var(--coral);
  animation: status-pulse 1.45s infinite;
}

.recording-badge.is-paused { color: #8a621d; background: #faf0dc; }
.recording-badge.is-paused span { background: #d19530; }
.recording-badge.is-done { color: var(--green); background: var(--green-soft); }
.recording-badge.is-done span { background: #37a575; }

@keyframes status-pulse {
  50% { box-shadow: 0 0 0 5px rgba(231, 101, 79, 0.14); }
}

.notice,
.recovery-card {
  gap: 13px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 15px;
}

.notice {
  display: flex;
  align-items: flex-start;
}

.notice--info {
  max-width: 820px;
  margin: -22px 0 24px;
  color: #385d70;
  background: #e7f0f4;
  border: 1px solid rgba(71, 115, 139, 0.13);
}

.notice--warning {
  color: #714c10;
  background: var(--amber-soft);
  border: 1px solid rgba(183, 117, 25, 0.13);
}

.processing-failure {
  margin-bottom: 18px;
  padding: 16px;
  color: #71382f;
  border: 1px solid rgba(185, 68, 53, 0.18);
  border-radius: 15px;
  background: #fae9e5;
}

.processing-failure__head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.processing-failure h3,
.processing-failure p {
  margin: 0;
}

.processing-failure h3 {
  font-size: 0.86rem;
}

.processing-failure__head p {
  margin-top: 5px;
  font-size: 0.76rem;
  line-height: 1.55;
}

.processing-failure__code {
  margin: 12px 0 0 37px !important;
  color: #7f4a42;
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

.processing-failure__code code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-weight: 700;
}

.processing-failure__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0 37px;
}

.processing-failure__actions p {
  font-size: 0.72rem;
  line-height: 1.45;
}

.processing-failure__actions .button {
  min-height: 44px;
  color: white;
  background: var(--coral-dark);
}

.notice__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  font-size: 0.72rem;
  font-weight: 900;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.notice strong,
.recovery-card strong { display: block; font-size: 0.82rem; }
.notice p,
.recovery-card p { margin: 4px 0 0; font-size: 0.76rem; line-height: 1.55; }

.recovery-card {
  justify-content: space-between;
  color: #335448;
  background: #eaf3ee;
  border: 1px solid rgba(36, 107, 84, 0.12);
}

.recovery-card__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.recording-stage {
  display: grid;
  place-items: center;
  min-height: 222px;
  margin: 12px 0 20px;
  padding: 34px 18px 27px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 23px;
  background:
    radial-gradient(circle at 50% 28%, rgba(36, 107, 84, 0.07), transparent 42%),
    rgba(248, 247, 243, 0.66);
}

.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 48px;
  margin-bottom: 17px;
  color: #9ca6a1;
}

.waveform i {
  display: block;
  width: 3px;
  height: 8px;
  border-radius: 5px;
  background: currentColor;
  transform-origin: center;
}

.waveform i:nth-child(3n + 1) { height: 18px; }
.waveform i:nth-child(4n + 2) { height: 29px; }
.waveform i:nth-child(5n) { height: 13px; }

.waveform.is-active {
  color: var(--coral);
}

.waveform.is-active i {
  animation: wave 1.05s ease-in-out infinite alternate;
}

.waveform.is-active i:nth-child(2n) { animation-delay: -0.2s; }
.waveform.is-active i:nth-child(3n) { animation-delay: -0.46s; }
.waveform.is-active i:nth-child(5n) { animation-delay: -0.7s; }

@keyframes wave {
  from { transform: scaleY(0.45); opacity: 0.55; }
  to { transform: scaleY(1.35); opacity: 1; }
}

.elapsed-time {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 550;
  letter-spacing: 0.035em;
}

.recording-stage p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.77rem;
}

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

.status-card {
  min-height: 108px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.52);
}

.status-card__top {
  gap: 7px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
}

.status-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-size: 0.68rem;
}

.status-icon--record {
  width: 8px;
  height: 8px;
  margin: 5px;
  border-radius: 50%;
  background: var(--coral);
}

.status-icon--upload { color: var(--blue); font-weight: 900; }
.status-icon--wake { color: var(--amber); }
.status-card strong,
.status-card small { display: block; }
.status-card strong { margin-top: 12px; font-size: 0.86rem; }
.status-card small { margin-top: 5px; color: var(--muted); font-size: 0.66rem; line-height: 1.4; }

.record-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 0;
}

.record-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 23px 0 8px;
  color: white;
  font-size: 0.9rem;
  font-weight: 800;
  border-radius: 999px;
  background: var(--green-dark);
  box-shadow: 0 13px 28px rgba(23, 74, 58, 0.18);
}

.record-button__disc {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.record-button__disc i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--coral);
}

.safety-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 23px 4px 0;
  padding-top: 17px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.safety-note > span { color: var(--coral); font-size: 1.1rem; }
.safety-note p { margin: 0; font-size: 0.7rem; line-height: 1.55; }
.safety-note strong { color: #4d5853; }

.server-progress {
  align-items: flex-start;
  gap: 13px;
  margin-top: 20px;
  padding: 15px 17px;
  color: #335448;
  border-radius: 16px;
  background: var(--green-soft);
}

.server-progress__line {
  flex: 0 0 auto;
  overflow: hidden;
  width: 54px;
  height: 5px;
  margin-top: 7px;
  border-radius: 999px;
  background: rgba(36, 107, 84, 0.13);
}

.server-progress__line span {
  display: block;
  width: 25%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 300ms ease;
}

.progress-value--20 { width: 20% !important; }
.progress-value--28 { width: 28% !important; }
.progress-value--48 { width: 48% !important; }
.progress-value--56 { width: 56% !important; }
.progress-value--58 { width: 58% !important; }
.progress-value--64 { width: 64% !important; }
.progress-value--68 { width: 68% !important; }
.progress-value--72 { width: 72% !important; }
.progress-value--78 { width: 78% !important; }
.progress-value--80 { width: 80% !important; }
.progress-value--90 { width: 90% !important; }
.progress-value--92 { width: 92% !important; }

.server-progress strong,
.server-progress span { display: block; }
.server-progress strong { font-size: 0.79rem; }
.server-progress > div:last-child span { margin-top: 4px; color: var(--muted); font-size: 0.7rem; }

.dialog {
  width: min(460px, calc(100% - 28px));
  padding: 0;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  background: #fbfaf7;
  box-shadow: 0 28px 90px rgba(27, 38, 33, 0.28);
}

.dialog::backdrop {
  background: rgba(24, 35, 31, 0.43);
  backdrop-filter: blur(4px);
}

.dialog form { padding: 27px; }
.dialog__header { margin-bottom: 25px; }
.dialog__actions { justify-content: flex-end; gap: 9px; margin-top: 26px; }

.toast {
  position: fixed;
  z-index: 50;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px));
  max-width: min(390px, calc(100% - 36px));
  padding: 13px 17px;
  color: white;
  font-size: 0.79rem;
  line-height: 1.5;
  border-radius: 13px;
  background: #25362f;
  box-shadow: 0 17px 42px rgba(25, 39, 33, 0.24);
}

.toast.is-error { background: #7d332b; }

@media (max-width: 820px) {
  .shell { width: min(100% - 28px, 680px); }
  .login-view { grid-template-columns: 1fr; gap: 38px; padding: 64px 0 30px; }
  .login-copy h1 { font-size: clamp(2.55rem, 12vw, 4rem); }
  .login-copy > p:not(.eyebrow) { max-width: 520px; }
  .login-card { max-width: 520px; }
  .workspace-grid { grid-template-columns: 1fr; }
  .course-panel { position: static; min-height: auto; }
  .course-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recorder-panel { min-height: auto; }
  .recorder-placeholder { min-height: 420px; }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 22px, 520px);
    padding-top: calc(14px + env(safe-area-inset-top));
  }
  .brand small { display: none; }
  .connection-pill { padding: 0 10px; font-size: 0.72rem; }
  .login-view { min-height: auto; padding-top: 58px; }
  .login-copy h1 { font-size: clamp(1.95rem, 9vw, 3.4rem); }
  .login-card { width: 100%; max-width: 100%; }
  .feature-list { display: grid; gap: 12px; margin-top: 26px; }
  .login-card { padding: 26px 21px; }
  .app-view { padding-top: 47px; }
  .hero-row { align-items: flex-start; margin-bottom: 29px; }
  .hero-row h1 { font-size: 2.35rem; }
  .today-card { min-width: 68px; padding: 8px 9px; }
  .today-card span { display: none; }
  .today-card strong { font-size: 2.15rem; }
  .today-card small { font-size: 0.58rem; white-space: nowrap; }
  .course-panel { padding: 22px 16px; border-radius: 22px; }
  .course-list { display: flex; overflow-x: auto; margin: 20px -16px -5px; padding: 0 16px 7px; scroll-snap-type: x proximity; }
  .course-item { flex: 0 0 72%; max-width: 250px; border-color: var(--line); background: rgba(255,255,255,.45); scroll-snap-align: start; }
  .recorder-panel { padding: 23px 15px 25px; border-radius: 22px; }
  .recorder-head { gap: 9px; }
  .recorder-title-row h2 { max-width: 55vw; }
  .recording-badge { padding: 0 9px; }
  .recovery-card { align-items: flex-start; flex-direction: column; }
  .recovery-card__actions { width: 100%; }
  .recovery-card__actions .button { flex: 1; }
  .processing-failure__code,
  .processing-failure__actions { margin-left: 0 !important; }
  .processing-failure__actions .button { width: 100%; }
  .recording-stage { min-height: 205px; padding-inline: 10px; }
  .waveform { gap: 3px; transform: scaleX(.9); }
  .status-grid { grid-template-columns: 1fr 1fr; }
  .status-card:last-child { grid-column: 1 / -1; min-height: 90px; }
  .record-actions { display: grid; grid-template-columns: 1fr; }
  .record-actions .button,
  .record-button { width: 100%; }
  .record-button { justify-content: center; }
  .dialog { margin-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .dialog form { padding: 23px 20px; }
}

@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;
  }
}
