:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --sidebar: #f2f2f7;
  --label: #1d1d1f;
  --secondary: #6e6e73;
  --tertiary: #a1a1a6;
  --separator: rgba(60, 60, 67, 0.18);
  --separator-strong: rgba(60, 60, 67, 0.28);
  --accent: #007aff;
  --accent-soft: rgba(0, 122, 255, 0.12);
  --red: #ff3b30;
  --orange: #ff9500;
  --green: #34c759;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--label);
  background: var(--bg);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(0, 122, 255, 0.24);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.skip-link {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  z-index: 20;
  border-radius: 999px;
  background: var(--label);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 650;
  padding: 9px 13px;
  transform: translateY(-140%);
  transition: transform 160ms ease-out;
}

.skip-link:focus {
  transform: translateY(0);
}

.auth-view {
  position: relative;
  display: grid;
  min-height: 100dvh;
  overflow: hidden;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(245, 245, 247, 0.38)),
    repeating-linear-gradient(
      90deg,
      rgba(60, 60, 67, 0.045) 0,
      rgba(60, 60, 67, 0.045) 1px,
      transparent 1px,
      transparent 88px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(60, 60, 67, 0.04) 0,
      rgba(60, 60, 67, 0.04) 1px,
      transparent 1px,
      transparent 88px
    ),
    var(--bg);
  padding: max(22px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(22px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.auth-shell {
  position: relative;
  display: grid;
  width: min(920px, 100%);
  min-height: 560px;
  grid-template-columns: minmax(300px, 1fr) minmax(360px, 430px);
  gap: 18px;
  align-items: stretch;
}

.auth-preview {
  display: grid;
  min-width: 0;
  align-items: center;
}

.auth-preview-card {
  display: grid;
  gap: 28px;
  min-height: 500px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(22px);
  padding: 30px;
}

.auth-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--secondary);
  font-size: 0.82rem;
  font-weight: 680;
}

.auth-preview-top strong {
  color: var(--accent);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.auth-preview-date {
  align-self: end;
}

.auth-preview-date span {
  display: block;
  color: var(--secondary);
  font-size: 1rem;
  font-weight: 640;
}

.auth-preview-date strong {
  display: block;
  margin-top: 4px;
  color: var(--label);
  font-size: 7.2rem;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  line-height: 0.86;
}

.auth-preview-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 9px;
}

.auth-preview-grid span {
  aspect-ratio: 1;
  border-radius: 11px;
  background: rgba(118, 118, 128, 0.1);
}

.auth-preview-grid .is-filled {
  background: rgba(0, 122, 255, 0.2);
}

.auth-preview-grid .is-today {
  background: var(--accent);
  box-shadow: 0 8px 22px rgba(0, 122, 255, 0.22);
}

.auth-preview-event {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: auto;
  color: var(--secondary);
  font-size: 0.92rem;
  line-height: 1.55;
}

.auth-preview-event span {
  width: 4px;
  height: 100%;
  min-height: 44px;
  border-radius: 999px;
  background: var(--accent);
}

.auth-card {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--separator);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.1);
  padding: 34px;
}

.auth-mark {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 9px;
  margin-bottom: 28px;
  color: var(--secondary);
  font-size: 0.76rem;
  font-weight: 700;
}

.auth-mark-icon {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--accent);
}

.auth-mark-icon::before {
  position: absolute;
  top: 6px;
  right: 5px;
  left: 5px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  content: "";
}

.auth-mark-icon::after {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  height: 8px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.92);
  content: "";
}

.auth-card h1 {
  font-size: clamp(2.2rem, 5vw, 3.3rem);
  font-weight: 760;
  line-height: 0.96;
}

.auth-copy {
  margin-top: 14px;
  color: var(--secondary);
  font-size: 1rem;
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 30px;
}

.auth-password-label {
  gap: 8px;
}

.auth-password-label span {
  color: var(--secondary);
  font-size: 0.82rem;
  font-weight: 680;
}

.auth-password-label input {
  height: 52px;
  border-radius: 14px;
  background: #fbfbfd;
  font-size: 16px;
  padding: 0 14px;
}

.auth-submit {
  min-height: 52px;
  border-radius: 14px;
}

.auth-note {
  margin-top: 22px;
  color: var(--tertiary);
  font-size: 0.82rem;
  line-height: 1.5;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(650px, 1fr) 380px;
  width: min(1420px, calc(100vw - 28px));
  min-height: calc(100dvh - 28px);
  margin: 14px auto;
  overflow: hidden;
  border: 1px solid var(--separator);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.calendar-surface {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 22px;
  background: var(--surface-solid);
}

.day-drawer {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
  border-left: 1px solid var(--separator);
  background: var(--sidebar);
  padding: 22px;
}

.hero,
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero h1 {
  font-size: clamp(2rem, 3vw, 3.3rem);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1;
}

.hero-note {
  margin-top: 8px;
  color: var(--secondary);
  font-size: 0.96rem;
}

.kicker {
  margin-bottom: 6px;
  color: var(--secondary);
  font-size: 0.78rem;
  font-weight: 680;
}

.drawer-header h2 {
  font-size: 1.45rem;
  font-weight: 720;
  line-height: 1.15;
}

.hero-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--separator);
  border-radius: 12px;
  background: #f5f5f7;
  padding: 2px;
}

.icon-button,
.plain-button,
.primary-button,
.empty-action,
.event-actions button,
.year-event-item {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  color: var(--label);
  font-weight: 620;
  transition:
    opacity 160ms ease-out,
    transform 160ms ease-out,
    background-color 160ms ease-out;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  place-items: center;
  background: transparent;
  font-size: 1.28rem;
  line-height: 1;
}

.plain-button {
  background: transparent;
  padding: 0 12px;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  padding: 0 16px;
}

.voice-button {
  display: inline-grid;
  width: 40px;
  place-items: center;
  padding: 0;
}

.button-mic,
.voice-mic {
  position: relative;
  display: inline-block;
}

.button-mic {
  width: 14px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.button-mic::before {
  position: absolute;
  right: -5px;
  bottom: -6px;
  left: -5px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  border-radius: 0 0 999px 999px;
  content: "";
}

.button-mic::after {
  position: absolute;
  bottom: -11px;
  left: 50%;
  width: 12px;
  height: 2px;
  background: currentColor;
  content: "";
  transform: translateX(-50%);
}

.icon-button:hover,
.plain-button:hover,
.event-actions button:hover,
.year-event-item:hover {
  background: rgba(118, 118, 128, 0.12);
}

.primary-button:hover,
.empty-action:hover {
  opacity: 0.86;
}

.primary-button:active,
.icon-button:active,
.plain-button:active,
.event-actions button:active,
.year-event-item:active {
  transform: scale(0.98);
}

.summary-strip {
  display: grid;
  grid-template-columns: 130px 130px minmax(0, 1fr);
  gap: 10px;
  margin: 14px 0 0;
}

.summary-strip div {
  min-width: 0;
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  background: #fbfbfd;
  padding: 13px 14px;
}

.summary-strip span {
  display: block;
  overflow: hidden;
  color: var(--label);
  font-size: 1.28rem;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-strip p {
  margin-top: 5px;
  color: var(--secondary);
  font-size: 0.78rem;
  font-weight: 590;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  color: var(--secondary);
  font-size: 0.78rem;
  font-weight: 660;
  text-align: center;
}

.weekday-row span {
  padding: 9px 4px;
}

.calendar-grid {
  flex: 1;
  overflow: hidden;
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  background: var(--separator);
  gap: 1px;
}

.day-cell {
  position: relative;
  display: flex;
  min-height: 112px;
  flex-direction: column;
  gap: 8px;
  border: 0;
  background: #fff;
  color: var(--label);
  padding: 10px;
  text-align: left;
  transition:
    background-color 160ms ease-out,
    box-shadow 160ms ease-out;
}

.day-cell:hover {
  background: #f9f9fb;
  z-index: 2;
}

.day-cell.is-outside {
  background: #fafafa;
  color: var(--tertiary);
}

.day-cell.is-selected {
  background: #f2f8ff;
  box-shadow: inset 0 0 0 2px var(--accent);
  z-index: 3;
}

.day-number {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  font-weight: 680;
  line-height: 1;
}

.day-cell.is-today .day-number {
  background: var(--accent);
  color: #fff;
}

.day-events {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.event-chip {
  overflow: hidden;
  border-radius: 7px;
  background: var(--accent-soft);
  color: #0059c8;
  font-size: 0.74rem;
  font-weight: 610;
  line-height: 1.25;
  padding: 5px 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-chip.is-important {
  background: rgba(255, 149, 0, 0.13);
  color: #a45b00;
}

.event-chip.is-critical {
  background: rgba(255, 59, 48, 0.12);
  color: #c3271f;
}

.more-chip {
  color: var(--secondary);
  font-size: 0.74rem;
  font-weight: 610;
}

.event-form {
  display: grid;
  gap: 14px;
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  padding: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--secondary);
  font-size: 0.82rem;
  font-weight: 610;
}

label.wide {
  grid-column: 1 / -1;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--separator);
  border-radius: 10px;
  background: #fff;
  color: var(--label);
  font-size: 16px;
  padding: 10px 11px;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--tertiary);
}

fieldset {
  display: grid;
  gap: 9px;
  margin: 0;
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  padding: 12px;
}

legend {
  padding: 0 6px;
  color: var(--secondary);
  font-size: 0.8rem;
  font-weight: 650;
}

.checkbox-line {
  display: flex;
  align-items: center;
  color: var(--label);
}

.checkbox-line input {
  width: auto;
  accent-color: var(--accent);
}

.form-error {
  min-height: 1.25em;
  color: var(--red);
  font-size: 0.84rem;
  line-height: 1.35;
}

.form-actions,
.event-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.event-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 2px;
}

.event-card {
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  background: var(--surface-solid);
  padding: 14px;
}

.event-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.event-card time {
  color: var(--secondary);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  font-weight: 640;
}

.priority-pill,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 0.72rem;
  font-weight: 650;
}

.priority-pill {
  background: var(--accent-soft);
  color: #0059c8;
}

.priority-pill.is-important {
  background: rgba(255, 149, 0, 0.13);
  color: #a45b00;
}

.priority-pill.is-critical {
  background: rgba(255, 59, 48, 0.12);
  color: #c3271f;
}

.event-card h3 {
  color: var(--label);
  font-size: 1.04rem;
  font-weight: 690;
  line-height: 1.32;
}

.event-meta,
.event-notes {
  margin-top: 7px;
  color: var(--secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag-row span {
  background: rgba(118, 118, 128, 0.12);
  color: var(--secondary);
}

.event-actions {
  margin-top: 12px;
}

.event-actions button {
  min-height: 30px;
  background: transparent;
  color: var(--accent);
  padding: 0 9px;
}

.event-actions button[data-action="delete"] {
  color: var(--red);
}

.empty-state {
  display: grid;
  gap: 12px;
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  color: var(--secondary);
  line-height: 1.55;
  padding: 28px 18px;
  text-align: center;
}

.empty-action {
  justify-self: center;
  background: var(--accent);
  color: #fff;
  padding: 0 13px;
}

.logout-link {
  width: fit-content;
  margin-top: auto;
  border: 0;
  background: transparent;
  color: var(--secondary);
  font-size: 0.86rem;
  font-weight: 610;
  padding: 8px 0;
}

.logout-link:hover {
  color: var(--red);
}

.year-sheet,
.voice-sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  justify-items: end;
  background: rgba(0, 0, 0, 0.24);
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.year-panel,
.voice-panel {
  display: flex;
  width: min(520px, 100%);
  max-height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--separator);
  border-radius: 22px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
}

.year-header,
.voice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--separator);
  padding: 18px 18px 14px;
}

.year-header h2,
.voice-header h2 {
  font-size: 1.5rem;
  font-weight: 730;
  line-height: 1.15;
}

.voice-body {
  display: grid;
  gap: 16px;
  overflow: auto;
  padding: 16px 18px 20px;
}

.voice-stage {
  display: grid;
  justify-items: center;
  gap: 12px;
  border: 1px solid var(--separator);
  border-radius: 24px;
  background: #fbfbfd;
  padding: 26px 18px;
  text-align: center;
}

.voice-record-button {
  display: grid;
  width: 108px;
  height: 108px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 18px 38px rgba(0, 122, 255, 0.28);
  transition:
    opacity 160ms ease-out,
    transform 160ms ease-out,
    background-color 160ms ease-out;
}

.voice-record-button:disabled {
  background: rgba(118, 118, 128, 0.18);
  color: var(--secondary);
}

.voice-record-button.is-recording {
  background: var(--red);
  box-shadow: 0 18px 38px rgba(255, 59, 48, 0.24);
  transform: scale(1.02);
}

.voice-mic {
  width: 34px;
  height: 48px;
  border: 4px solid currentColor;
  border-radius: 999px;
}

.voice-mic::before {
  position: absolute;
  right: -12px;
  bottom: -15px;
  left: -12px;
  height: 20px;
  border-right: 4px solid currentColor;
  border-bottom: 4px solid currentColor;
  border-left: 4px solid currentColor;
  border-radius: 0 0 999px 999px;
  content: "";
}

.voice-mic::after {
  position: absolute;
  bottom: -26px;
  left: 50%;
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  transform: translateX(-50%);
}

.voice-record-text {
  color: var(--label);
  font-size: 1.12rem;
  font-weight: 720;
}

.voice-status {
  color: var(--secondary);
  font-size: 0.9rem;
  line-height: 1.45;
}

.voice-transcript-card,
.voice-manual {
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 13px;
}

.voice-transcript-text {
  min-height: 1.45em;
  color: var(--label);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.45;
}

.voice-manual summary {
  cursor: pointer;
  color: var(--secondary);
  font-size: 0.88rem;
  font-weight: 650;
}

.voice-manual label {
  margin-top: 12px;
}

.voice-transcript-label {
  font-size: 0.84rem;
}

.voice-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.voice-preview {
  display: grid;
  gap: 10px;
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  background: #fbfbfd;
  padding: 14px;
}

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

.voice-preview-grid div {
  min-width: 0;
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  background: #fff;
  padding: 11px;
}

.voice-preview-grid .wide {
  grid-column: 1 / -1;
}

.voice-preview-grid span {
  display: block;
  color: var(--secondary);
  font-size: 0.76rem;
  font-weight: 620;
  margin-bottom: 4px;
}

.voice-preview-grid strong {
  display: block;
  overflow: hidden;
  color: var(--label);
  font-size: 0.98rem;
  font-weight: 690;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-candidates {
  display: grid;
  gap: 8px;
}

.voice-candidate {
  min-height: 40px;
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  background: #fff;
  color: var(--label);
  font-weight: 650;
  padding: 0 12px;
  text-align: left;
}

.voice-candidate:hover,
.voice-candidate.is-selected {
  border-color: rgba(0, 122, 255, 0.55);
  background: var(--accent-soft);
}

.year-event-list {
  display: grid;
  gap: 18px;
  overflow: auto;
  padding: 16px 18px 20px;
}

.year-month-section {
  display: grid;
  gap: 8px;
}

.year-month-section h3 {
  color: var(--secondary);
  font-size: 0.88rem;
  font-weight: 680;
}

.year-event-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  align-items: start;
  border: 1px solid var(--separator);
  background: #fbfbfd;
  padding: 12px;
  text-align: left;
}

.year-event-item time {
  color: var(--secondary);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.year-event-content {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.year-event-item strong {
  overflow: hidden;
  color: var(--label);
  font-size: 0.98rem;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.year-event-meta {
  overflow: hidden;
  color: var(--secondary);
  font-size: 0.82rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.year-event-item.is-important {
  border-left: 4px solid var(--orange);
}

.year-event-item.is-critical {
  border-left: 4px solid var(--red);
}

.year-empty {
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  color: var(--secondary);
  padding: 28px 18px;
  text-align: center;
}

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

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: min(100vw - 22px, 860px);
    overflow: visible;
  }

  .day-drawer {
    border-top: 1px solid var(--separator);
    border-left: 0;
  }
}

@media (max-width: 860px) {
  .auth-shell {
    width: min(430px, 100%);
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .auth-preview {
    display: none;
  }

  .auth-card {
    min-height: min(640px, calc(100dvh - 44px));
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: 100%;
    min-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .calendar-surface,
  .day-drawer,
  .auth-card {
    padding: 16px;
  }

  .auth-view {
    place-items: stretch;
    padding: 0;
  }

  .auth-shell {
    width: 100%;
  }

  .auth-card {
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
      max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  }

  .auth-mark {
    margin-bottom: 34px;
  }

  .auth-card h1 {
    font-size: 2.7rem;
  }

  .hero {
    align-items: stretch;
    flex-direction: column;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    justify-content: space-between;
  }

  .segmented-control {
    width: 100%;
    justify-content: space-between;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .day-cell {
    min-height: 78px;
    padding: 8px;
  }

  .day-number {
    width: 26px;
    height: 26px;
  }

  .event-chip {
    display: none;
  }

  .more-chip {
    width: 7px;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--accent);
    color: transparent;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  .year-sheet,
  .voice-sheet {
    align-items: end;
    justify-items: stretch;
    padding: 0;
  }

  .year-panel,
  .voice-panel {
    width: 100%;
    max-height: 88dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
  }

  .year-event-item {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .year-event-meta {
    white-space: normal;
  }

  .voice-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .voice-stage {
    padding: 24px 16px;
  }

  .voice-record-button {
    width: 104px;
    height: 104px;
  }

  .voice-preview-grid {
    grid-template-columns: 1fr;
  }
}
