:root {
  color-scheme: light;
  --canvas: #e8e1d5;
  --paper: #f5f1e8;
  --paper-raised: #fbf9f4;
  --paper-deep: #ebe5d9;
  --ink: #24251f;
  --ink-secondary: #66675f;
  --ink-muted: #939289;
  --line: rgba(36, 37, 31, 0.1);
  --line-strong: rgba(36, 37, 31, 0.18);
  --brand: #2f6b57;
  --brand-hover: #285b4a;
  --brand-soft: #dce9df;
  --brand-ink: #214b3d;
  --apricot: #d87845;
  --apricot-soft: #f3dfcf;
  --apricot-ink: #7d3d21;
  --sun: #e3aa43;
  --sun-soft: #f3e8c9;
  --blue: #537589;
  --blue-soft: #dce7eb;
  --danger: #9a4a42;
  --danger-soft: #f0ddda;
  --radius-control: 10px;
  --radius-surface: 16px;
  --radius-sheet: 24px;
  --shadow-surface:
    0 0 0 1px rgba(36, 37, 31, 0.05),
    0 1px 2px -1px rgba(36, 37, 31, 0.07),
    0 8px 28px rgba(36, 37, 31, 0.07);
  --shadow-sheet:
    0 -1px 0 rgba(36, 37, 31, 0.06),
    0 -18px 52px rgba(36, 37, 31, 0.16);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
}

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

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

button {
  border: 0;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.prototype-shell {
  display: grid;
  grid-template-columns: minmax(270px, 340px) minmax(430px, 1fr);
  min-height: 100dvh;
}

.prototype-rail {
  position: sticky;
  top: 0;
  display: flex;
  height: 100dvh;
  flex-direction: column;
  gap: 32px;
  padding: 40px 36px;
  overflow-y: auto;
  color: #f7f3eb;
  background: #252b27;
}

.rail-brand,
.rail-section {
  display: grid;
  gap: 12px;
}

.rail-brand h1 {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.05em;
}

.rail-brand p,
.rail-note p {
  margin: 0;
  color: rgba(247, 243, 235, 0.66);
  font-size: 1rem;
  line-height: 1.65;
}

.rail-brand .rail-kicker {
  color: #afcdb6;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.rail-section h2 {
  margin: 0;
  color: rgba(247, 243, 235, 0.46);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.screen-index,
.flow-actions {
  display: grid;
  gap: 4px;
}

.screen-index button,
.flow-actions button {
  position: relative;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  color: rgba(247, 243, 235, 0.72);
  background: transparent;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
}

.screen-index button:hover,
.screen-index button[aria-current="page"],
.flow-actions button:hover {
  color: #fffdf8;
  background: rgba(255, 255, 255, 0.08);
}

.screen-index button[aria-current="page"]::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 2px;
  border-radius: 2px;
  background: #9fc8aa;
  content: "";
}

.rail-note {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.rail-note p {
  font-size: 0.875rem;
}

.prototype-stage {
  display: grid;
  min-width: 0;
  min-height: 100dvh;
  padding: 32px;
  place-items: center;
}

.mobile-device {
  position: relative;
  width: min(100%, 430px);
  height: min(860px, calc(100dvh - 64px));
  min-height: 700px;
  overflow: hidden;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow-surface);
}

.app-isolate {
  position: relative;
  isolation: isolate;
  height: 100%;
  overflow: hidden;
}

.app-page {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.app-page::-webkit-scrollbar {
  display: none;
}

.app-page.has-bottom-nav {
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(14px, env(safe-area-inset-top)) 20px 10px;
  background: rgba(245, 241, 232, 0.93);
  backdrop-filter: blur(16px) saturate(135%);
}

.header-copy {
  min-width: 0;
}

.header-copy h1 {
  overflow: hidden;
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-copy p {
  margin: 3px 0 0;
  color: var(--ink-secondary);
  font-size: 0.75rem;
  line-height: 1.45;
}

.view-switcher {
  position: relative;
  min-height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-control);
  color: var(--brand-ink);
  background: var(--brand-soft);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.view-switcher::after,
.compact-action::after,
.bottom-nav button::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100%, 48px);
  height: 48px;
  transform: translate(-50%, -50%);
  content: "";
}

.screen-content {
  display: grid;
  gap: 28px;
  padding: 12px 20px 32px;
}

.child-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--paper-deep);
}

.child-switcher button {
  min-height: 40px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--ink-secondary);
  background: transparent;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.child-switcher button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--paper-raised);
  box-shadow: 0 1px 3px rgba(36, 37, 31, 0.08);
}

.section {
  display: grid;
  gap: 12px;
}

.section-heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-heading p,
.section-heading button {
  margin: 0;
  color: var(--ink-secondary);
  background: transparent;
  font-size: 0.75rem;
}

.section-heading button {
  min-height: 36px;
  cursor: pointer;
}

.voice-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-surface);
  color: #f8f5ef;
  background: var(--brand);
  box-shadow: var(--shadow-surface);
}

.voice-copy {
  min-width: 0;
}

.voice-copy h2,
.voice-copy p {
  margin: 0;
}

.voice-copy h2 {
  font-size: 1.125rem;
  font-weight: 600;
}

.voice-copy p {
  margin-top: 5px;
  color: rgba(248, 245, 239, 0.72);
  font-size: 0.875rem;
  line-height: 1.55;
}

.voice-button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  color: var(--brand-ink);
  background: #f8f5ef;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 2px 0;
}

.summary-item {
  min-width: 0;
  padding: 0 14px;
  border-left: 1px solid var(--line);
}

.summary-item:first-child {
  padding-left: 0;
  border-left: 0;
}

.summary-item:last-child {
  padding-right: 0;
}

.summary-value,
.summary-label {
  margin: 0;
}

.summary-value {
  font-variant-numeric: tabular-nums;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.summary-label {
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-secondary);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--apricot-ink);
  background: var(--apricot-soft);
}

.notice strong,
.notice p {
  margin: 0;
}

.notice strong {
  font-size: 0.875rem;
  font-weight: 600;
}

.notice p {
  font-size: 0.875rem;
  line-height: 1.55;
}

.task-list,
.schedule-list,
.member-list,
.reward-list,
.history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-row,
.schedule-row,
.member-row,
.reward-row,
.history-row {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.task-row:first-child,
.schedule-row:first-child,
.member-row:first-child,
.reward-row:first-child,
.history-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.task-row:last-child,
.schedule-row:last-child,
.member-row:last-child,
.reward-row:last-child,
.history-row:last-child {
  padding-bottom: 0;
}

.task-meta,
.schedule-time {
  width: 46px;
  flex: 0 0 46px;
  padding-top: 2px;
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.task-content,
.schedule-content,
.member-content,
.reward-content,
.history-content {
  min-width: 0;
  flex: 1;
}

.task-title-line {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
}

.task-title,
.schedule-title,
.member-title,
.reward-title,
.history-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.task-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-note,
.schedule-note,
.member-note,
.reward-note,
.history-note {
  margin: 4px 0 0;
  color: var(--ink-secondary);
  font-size: 0.875rem;
  line-height: 1.55;
}

.badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--brand-ink);
  background: var(--brand-soft);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
}

.badge.chore {
  color: var(--apricot-ink);
  background: var(--apricot-soft);
}

.badge.sport {
  color: #405d6d;
  background: var(--blue-soft);
}

.badge.family {
  color: #73531d;
  background: var(--sun-soft);
}

.task-action {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 0 10px;
  border-radius: var(--radius-control);
  color: var(--brand-ink);
  background: var(--brand-soft);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.task-action.primary {
  color: #f9f7f1;
  background: var(--brand);
}

.task-action:disabled {
  color: var(--ink-muted);
  background: var(--paper-deep);
  cursor: default;
}

.energy-inline {
  color: var(--apricot-ink);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.progress-block {
  display: grid;
  gap: 9px;
}

.progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.progress-meta p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.875rem;
}

.progress-meta strong {
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-deep);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.upcoming-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-surface);
  background: var(--paper-raised);
  box-shadow: 0 0 0 1px var(--line);
}

.date-tile {
  display: grid;
  width: 48px;
  height: 54px;
  align-content: center;
  border-radius: 10px;
  color: #f9f7f1;
  background: var(--apricot);
  text-align: center;
}

.date-tile strong,
.date-tile span {
  display: block;
}

.date-tile strong {
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.date-tile span {
  font-size: 0.6875rem;
}

.upcoming-copy {
  min-width: 0;
}

.upcoming-copy h3,
.upcoming-copy p {
  margin: 0;
}

.upcoming-copy h3 {
  font-size: 1rem;
  font-weight: 600;
}

.upcoming-copy p {
  margin-top: 5px;
  color: var(--ink-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

.bottom-nav {
  position: absolute;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 10px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(251, 249, 244, 0.96);
  backdrop-filter: blur(16px) saturate(135%);
}

.bottom-nav button {
  position: relative;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 10px;
  color: var(--ink-muted);
  background: transparent;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.bottom-nav button[aria-current="page"] {
  color: var(--brand-ink);
  background: var(--brand-soft);
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.day-button {
  display: grid;
  min-width: 0;
  min-height: 56px;
  align-content: center;
  gap: 3px;
  padding: 5px 2px;
  border-radius: 10px;
  color: var(--ink-secondary);
  background: transparent;
  cursor: pointer;
}

.day-button span,
.day-button strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-button span {
  font-size: 0.6875rem;
}

.day-button strong {
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.day-button[aria-pressed="true"] {
  color: #f8f5ef;
  background: var(--brand);
}

.schedule-time strong {
  display: block;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
}

.schedule-owner {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--ink-secondary);
  background: var(--paper-deep);
  font-size: 0.6875rem;
  font-weight: 600;
}

.schedule-heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.schedule-heading .schedule-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  gap: 10px;
  padding: 28px 18px;
  border-radius: var(--radius-surface);
  color: var(--ink-secondary);
  background: var(--paper-deep);
  text-align: center;
}

.empty-state h3,
.empty-state p {
  margin: 0;
}

.empty-state h3 {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
}

.empty-state p {
  font-size: 0.875rem;
  line-height: 1.55;
}

.pet-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
  overflow: hidden;
  border-radius: var(--radius-surface);
  background: #e5eee4;
  box-shadow: var(--shadow-surface);
}

.pet-panel.away {
  background: #e8e5dc;
}

.pet-scene {
  position: relative;
  display: grid;
  min-height: 218px;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background:
    radial-gradient(circle at 20% 24%, rgba(255, 255, 255, 0.8) 0 4px, transparent 5px),
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.7) 0 3px, transparent 4px),
    linear-gradient(#d4e6db 0 64%, #b8d1b4 64% 100%);
}

.pet-scene::after {
  position: absolute;
  right: -16%;
  bottom: -44px;
  left: -16%;
  height: 100px;
  border-radius: 50%;
  background: #91b493;
  content: "";
}

.pet {
  position: relative;
  z-index: 2;
  width: 132px;
  height: 124px;
}

.pet-body {
  position: absolute;
  right: 21px;
  bottom: 4px;
  width: 90px;
  height: 78px;
  border-radius: 44% 44% 38% 38%;
  background: #d87845;
  box-shadow: inset 0 -8px 0 rgba(125, 61, 33, 0.12);
}

.pet-head {
  position: absolute;
  top: 10px;
  left: 30px;
  width: 76px;
  height: 72px;
  border-radius: 42% 42% 48% 48%;
  background: #e18b58;
}

.pet-head::before,
.pet-head::after {
  position: absolute;
  top: -17px;
  width: 27px;
  height: 34px;
  border-radius: 6px 20px 4px 20px;
  background: #d87845;
  content: "";
}

.pet-head::before {
  left: 4px;
  transform: rotate(-20deg);
}

.pet-head::after {
  right: 4px;
  transform: scaleX(-1) rotate(-20deg);
}

.pet-face {
  position: absolute;
  top: 39px;
  left: 51px;
  z-index: 3;
  width: 34px;
  height: 16px;
  border-top: 4px dotted #3c322a;
}

.pet-face::after {
  position: absolute;
  top: 5px;
  left: 13px;
  width: 8px;
  height: 5px;
  border-radius: 0 0 8px 8px;
  border-bottom: 2px solid #3c322a;
  content: "";
}

.pet-tail {
  position: absolute;
  right: 3px;
  bottom: 24px;
  width: 53px;
  height: 24px;
  border-radius: 50%;
  border: 14px solid #d87845;
  border-left-color: transparent;
  transform: rotate(-24deg);
}

.pet-shadow {
  position: absolute;
  z-index: 1;
  bottom: 20px;
  width: 148px;
  height: 22px;
  border-radius: 50%;
  background: rgba(42, 71, 53, 0.18);
}

.pet-away-card {
  position: relative;
  z-index: 2;
  display: grid;
  max-width: 245px;
  gap: 8px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(251, 249, 244, 0.94);
  box-shadow: var(--shadow-surface);
  transform: rotate(-1deg);
}

.pet-away-card h3,
.pet-away-card p {
  margin: 0;
}

.pet-away-card h3 {
  font-size: 1rem;
  font-weight: 600;
}

.pet-away-card p {
  color: var(--ink-secondary);
  font-size: 0.875rem;
  line-height: 1.55;
}

.pet-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.pet-summary h2,
.pet-summary p {
  margin: 0;
}

.pet-summary h2 {
  font-size: 1.125rem;
  font-weight: 600;
}

.pet-summary p {
  margin-top: 5px;
  color: var(--ink-secondary);
  font-size: 0.875rem;
  line-height: 1.55;
}

.energy-count {
  flex: 0 0 auto;
  color: var(--apricot-ink);
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  min-height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  color: #f9f7f1;
  background: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.btn-primary:hover {
  background: var(--brand-hover);
  box-shadow: 0 0 0 1px var(--brand-hover);
}

.btn-secondary {
  color: var(--ink);
  background: var(--paper-raised);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.btn-soft {
  color: var(--brand-ink);
  background: var(--brand-soft);
}

.btn-danger-soft {
  color: var(--danger);
  background: var(--danger-soft);
}

.btn:disabled {
  color: var(--ink-muted);
  background: var(--paper-deep);
  box-shadow: none;
  cursor: default;
}

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

.badge-stat {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  background: var(--paper-raised);
  box-shadow: 0 0 0 1px var(--line);
}

.badge-stat strong,
.badge-stat span {
  display: block;
}

.badge-stat strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.badge-stat span {
  overflow: hidden;
  color: var(--ink-secondary);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reward-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-surface);
  color: #5f4318;
  background: var(--sun-soft);
}

.reward-panel h2,
.reward-panel p {
  margin: 0;
}

.reward-panel h2 {
  font-size: 1.125rem;
  font-weight: 600;
}

.reward-panel p {
  margin-top: 5px;
  color: rgba(95, 67, 24, 0.76);
  font-size: 0.875rem;
  line-height: 1.55;
}

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

.reward-progress div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.46);
}

.reward-progress strong,
.reward-progress span {
  display: block;
}

.reward-progress strong {
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.reward-progress span {
  color: rgba(95, 67, 24, 0.72);
  font-size: 0.6875rem;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  color: var(--brand-ink);
  background: var(--brand-soft);
  font-size: 0.875rem;
  font-weight: 600;
  place-items: center;
}

.avatar.apricot {
  color: var(--apricot-ink);
  background: var(--apricot-soft);
}

.avatar.blue {
  color: #405d6d;
  background: var(--blue-soft);
}

.member-role {
  flex: 0 0 auto;
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.compact-action {
  position: relative;
  min-height: 36px;
  flex: 0 0 auto;
  padding: 0 9px;
  color: var(--brand-ink);
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.sheet-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(25, 27, 23, 0.38);
  backdrop-filter: blur(3px);
}

.sheet {
  width: min(100%, 430px);
  max-height: min(86dvh, 760px);
  overflow: hidden;
  border-radius: var(--radius-sheet);
  background: var(--paper-raised);
  box-shadow: var(--shadow-sheet);
}

.sheet-header {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line);
}

.sheet-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sheet-close {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: var(--ink-secondary);
  background: var(--paper-deep);
  font-size: 1.25rem;
  cursor: pointer;
  place-items: center;
}

.sheet-close::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
  content: "";
}

.sheet-body {
  display: grid;
  max-height: calc(min(86dvh, 760px) - 62px);
  gap: 18px;
  padding: 18px;
  overflow-y: auto;
}

.field-group {
  display: grid;
  gap: 7px;
}

.field-group label,
.field-legend {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.field,
.select-field,
.textarea-field {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line-strong);
  font-size: 1rem;
}

.textarea-field {
  min-height: 78px;
  resize: vertical;
  line-height: 1.55;
}

.helper-text {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.transcript {
  padding: 14px;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line);
}

.transcript p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
}

.recording-state {
  display: grid;
  min-height: 150px;
  place-items: center;
  text-align: center;
}

.recording-state div {
  display: grid;
  gap: 12px;
}

.recording-state strong,
.recording-state p {
  margin: 0;
}

.recording-state strong {
  font-size: 1.125rem;
  font-weight: 600;
}

.recording-state p {
  max-width: 28ch;
  color: var(--ink-secondary);
  font-size: 0.875rem;
  line-height: 1.55;
}

.recording-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.recording-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  animation: pulse 900ms ease-in-out infinite alternate;
}

.recording-dots span:nth-child(2) {
  animation-delay: 150ms;
}

.recording-dots span:nth-child(3) {
  animation-delay: 300ms;
}

.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.choice-stack {
  display: grid;
  gap: 8px;
}

.choice-button {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ink-secondary);
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line);
  text-align: left;
  cursor: pointer;
}

.choice-button[aria-checked="true"],
.choice-button[aria-pressed="true"] {
  color: var(--brand-ink);
  background: var(--brand-soft);
  box-shadow: 0 0 0 2px rgba(47, 107, 87, 0.28);
}

.choice-button strong,
.choice-button span {
  display: block;
}

.choice-button strong {
  font-size: 0.875rem;
  font-weight: 600;
}

.choice-button span {
  font-size: 0.75rem;
}

.invite-code {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: var(--radius-surface);
  background: var(--brand-soft);
  text-align: center;
}

.invite-code strong,
.invite-code span {
  display: block;
}

.invite-code strong {
  color: var(--brand-ink);
  font-size: 1.75rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.invite-code span {
  color: var(--ink-secondary);
  font-size: 0.8125rem;
}

.toast {
  position: fixed;
  z-index: 200;
  right: 50%;
  bottom: 28px;
  max-width: min(86vw, 360px);
  padding: 11px 14px;
  border-radius: 12px;
  color: #f9f7f1;
  background: #252b27;
  box-shadow: 0 8px 24px rgba(25, 27, 23, 0.2);
  font-size: 0.875rem;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(50%, 0);
}

@keyframes pulse {
  from {
    opacity: 0.35;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(-2px);
  }
}

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

  .prototype-rail {
    display: none;
  }

  .prototype-stage {
    min-height: 100dvh;
    padding: 0;
  }

  .mobile-device {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sheet-backdrop {
    padding: 0;
  }

  .sheet {
    width: 100%;
    border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  }
}

@media (max-width: 360px) {
  .screen-content {
    padding-right: 16px;
    padding-left: 16px;
  }

  .app-header {
    padding-right: 16px;
    padding-left: 16px;
  }

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

  .voice-button {
    width: 100%;
  }

  .task-meta,
  .schedule-time {
    width: 42px;
    flex-basis: 42px;
  }

  .badge-grid,
  .reward-progress {
    gap: 5px;
  }

  .badge-stat,
  .reward-progress div {
    padding: 9px 7px;
  }
}

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

