:root {
  --bg: #efe7d9;
  --paper: #faf6ee;
  --paper-warm: #f4ebdc;
  --panel: rgba(250, 246, 238, 0.84);
  --panel-soft: rgba(244, 235, 220, 0.82);
  --line: rgba(40, 35, 28, 0.09);
  --text: #171411;
  --muted: #7b7061;
  --accent: #171411;
  --accent-warm: #8d5c27;
  --chip: #e9dcc7;
  --chip-hover: #dfcfb4;
  --user: #171411;
  --user-text: #fff8ea;
  --assistant: rgba(250, 246, 238, 0.38);
  --shadow: 0 24px 80px rgba(33, 25, 14, 0.1);
  --shadow-soft: 0 10px 28px rgba(33, 25, 14, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #f3eee5;
  color: var(--text);
  font-family: "Manrope", "Noto Serif SC", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0));
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.18));
}

body::after {
  display: none;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)) 14px;
}

.chat-frame {
  width: min(840px, 100%);
  min-height: calc(100vh - 28px);
  min-height: calc(100dvh - 28px);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  position: relative;
}

.chat-frame::before {
  display: none;
}

.top-line {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 118px;
  padding: 20px 12px 8px;
}

.top-line-inner {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
}

.hero-mark {
  margin: 0;
  color: rgba(23, 20, 17, 0.44);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.34em;
}

.hero-line-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(88px, 15vh, 136px);
  padding: 0 52px;
  animation: page-rise 420ms ease-out both;
}

.hero-logout {
  position: absolute;
  top: 0;
  right: 0;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 252, 245, 0.78);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(50, 39, 22, 0.06);
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.hero-logout:hover {
  transform: translateY(-1px);
  background: #fffaf1;
  color: var(--text);
}

.hero-feedback {
  position: absolute;
  top: 0;
  left: 0;
}

.daily-line {
  margin: 0;
  max-width: 30rem;
  color: #322c23;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.08rem, 2vw, 1.32rem);
  line-height: 1.72;
  text-align: center;
  letter-spacing: 0.01em;
  text-wrap: balance;
  text-shadow: none;
}

.top-reminder {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: min(100%, 36rem);
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(25, 25, 20, 0.06);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: center;
}

.top-reminder[data-visible="true"] {
  display: inline-flex;
}

.top-reminder-title {
  color: var(--text);
  font-weight: 700;
}

.top-reminder-detail {
  color: var(--muted);
}

.chat-window {
  min-height: 0;
  display: flex;
}

.conversation-rail {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 0 10px 10px;
  color: var(--muted);
}

.conversation-rail[data-visible="true"] {
  display: flex;
}

.conversation-rail-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(155, 106, 50, 0.08), rgba(155, 106, 50, 0.32), rgba(155, 106, 50, 0.08));
}

.conversation-rail-text {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-body {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom)) 16px;
}

.ops-body {
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)) 16px;
}

.ops-shell {
  width: min(920px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.ops-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 2px 10px;
}

.ops-title {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.25;
}

.ops-back,
.ops-card-head button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.ops-card {
  padding: 18px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.9), rgba(250, 244, 234, 0.78));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

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

.ops-chip-card {
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 245, 0.82);
  box-shadow: 0 10px 28px rgba(50, 39, 22, 0.06);
}

.ops-chip-card span,
.ops-chip-card strong {
  display: block;
}

.ops-chip-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.ops-chip-card strong {
  margin-top: 6px;
  color: var(--text);
  font-size: 1.3rem;
}

.ops-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ops-card-head h2 {
  margin: 0;
  font-size: 1rem;
}

.ops-count {
  color: var(--muted);
  font-size: 0.86rem;
}

.ops-output {
  margin: 0;
  overflow-x: auto;
  padding: 14px;
  border-radius: 18px;
  background: rgba(244, 242, 235, 0.9);
  color: #4f4a40;
  font-size: 0.86rem;
  line-height: 1.7;
}

.ops-brief {
  margin: 0;
  color: #5f5a4d;
  line-height: 1.75;
}

.ops-lookup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 12px;
}

.ops-lookup-form button {
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 18px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.ops-user-result {
  display: grid;
  gap: 10px;
}

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

.ops-diagnostic-grid span {
  min-height: 58px;
  padding: 10px 11px;
  border-radius: 16px;
  border: 1px solid rgba(25, 25, 20, 0.06);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.ops-diagnostic-grid b {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 1.08rem;
}

.ops-user-timeline {
  display: grid;
  gap: 8px;
}

.ops-timeline-item {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border-radius: 16px;
  border: 1px solid rgba(25, 25, 20, 0.06);
  background: rgba(255, 255, 255, 0.74);
}

.ops-timeline-item time {
  color: var(--muted);
  font-size: 0.74rem;
}

.ops-timeline-item strong {
  color: var(--text);
  font-size: 0.9rem;
}

.ops-timeline-item span {
  color: #5f5a4d;
  font-size: 0.82rem;
  line-height: 1.6;
}

.ops-timeline-item[data-tone="success"] {
  border-color: rgba(43, 107, 57, 0.18);
  background: rgba(232, 248, 235, 0.76);
}

.ops-timeline-item[data-tone="warning"] {
  border-color: rgba(171, 125, 38, 0.18);
  background: rgba(255, 245, 220, 0.76);
}

.ops-timeline-item[data-tone="danger"] {
  border-color: rgba(171, 76, 64, 0.18);
  background: rgba(255, 235, 232, 0.78);
}

.ops-mini-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ops-mini-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(244, 242, 235, 0.96);
  border: 1px solid rgba(25, 25, 20, 0.06);
  color: #5c5649;
  font-size: 0.8rem;
  font-weight: 600;
}

.ops-event-list {
  display: grid;
  gap: 10px;
}

.ops-event,
.ops-empty {
  margin: 0;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(25, 25, 20, 0.07);
  background: rgba(247, 246, 241, 0.86);
}

.ops-event {
  display: grid;
  gap: 7px;
}

.ops-event[data-tone="warning"] {
  border-color: rgba(171, 125, 38, 0.22);
  background: rgba(255, 245, 220, 0.92);
}

.ops-event[data-tone="danger"] {
  border-color: rgba(171, 76, 64, 0.22);
  background: rgba(255, 235, 232, 0.9);
}

.ops-event[data-tone="success"] {
  border-color: rgba(43, 107, 57, 0.22);
  background: rgba(232, 248, 235, 0.92);
}

.ops-event-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.76rem;
}

.ops-event strong {
  color: var(--text);
}

.ops-event p {
  margin: 0;
  color: #5f5a4d;
  line-height: 1.72;
}

.ops-event small {
  color: var(--muted);
}

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

.ops-action-row button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(25, 25, 20, 0.08);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.ops-action-row button:disabled {
  opacity: 0.52;
  cursor: default;
}

.ops-trace-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ops-empty {
  color: var(--muted);
  line-height: 1.75;
}

.ops-empty[data-tone="warning"] {
  border-color: rgba(171, 125, 38, 0.22);
  background: rgba(255, 245, 220, 0.92);
  color: #8b6d2f;
}

.ops-empty[data-tone="danger"] {
  border-color: rgba(171, 76, 64, 0.22);
  background: rgba(255, 235, 232, 0.9);
  color: #ab4c40;
}

.ops-empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.ops-empty p {
  margin: 0 0 10px;
}

.ops-inline-link {
  color: var(--text);
  font-weight: 700;
}

.login-shell {
  width: min(430px, 100%);
}

.login-panel {
  padding: 8px 4px 28px;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  position: relative;
  overflow: hidden;
}

.login-panel::before {
  display: none;
}

.login-brand {
  margin: 0 0 28px;
  color: rgba(23, 20, 17, 0.46);
  font-size: 0.82rem;
  letter-spacing: 0.28em;
  font-weight: 800;
}

.login-title {
  margin: 0;
  font-size: clamp(1.8rem, 6vw, 2.36rem);
  line-height: 1.18;
  font-weight: 600;
  font-family: "Noto Serif SC", serif;
  letter-spacing: -0.01em;
}

.login-copy {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.85;
  max-width: 30rem;
}

.login-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.login-trust-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(25, 25, 20, 0.05);
  color: #5c5649;
  font-size: 0.8rem;
  font-weight: 700;
}

.auth-journey-card {
  margin-top: 22px;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  display: grid;
  gap: 14px;
}

.auth-journey-head {
  display: grid;
  gap: 4px;
}

.auth-journey-head strong {
  color: var(--text);
  font-size: 0.98rem;
}

.auth-journey-head span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.auth-journey-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.auth-journey-step {
  display: grid;
  gap: 5px;
  padding: 10px 0;
  border-radius: 0;
  border: 0;
  border-top: 1px solid rgba(25, 25, 20, 0.08);
  background: transparent;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.auth-journey-step span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(25, 25, 20, 0.08);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.auth-journey-step strong {
  color: var(--text);
  font-size: 0.88rem;
}

.auth-journey-step small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.auth-journey-step[data-active="true"] {
  border-color: rgba(25, 25, 20, 0.12);
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-1px);
}

.auth-journey-step[data-active="true"] span,
.auth-journey-step[data-complete="true"] span {
  background: var(--accent);
  color: #fff;
}

.auth-journey-card[data-mode="register"] .auth-journey-step[data-step="verify"][data-active="true"] {
  background: rgba(255, 245, 220, 0.86);
}

.auth-transition {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.96), rgba(244, 243, 238, 0.84) 18rem),
    rgba(244, 243, 238, 0.72);
  backdrop-filter: blur(18px);
}

.auth-transition[data-open="true"] {
  display: grid;
  animation: auth-transition-in 180ms ease-out both;
}

.auth-transition-card {
  width: min(100%, 360px);
  padding: 26px 24px;
  border-radius: 30px;
  border: 1px solid rgba(25, 25, 20, 0.08);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 70px rgba(20, 20, 16, 0.12);
  text-align: center;
  display: grid;
  gap: 12px;
}

.auth-transition-mark {
  justify-self: center;
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: var(--accent);
  color: #fff;
  font-family: "Noto Serif SC", serif;
  font-size: 1.25rem;
}

.auth-transition-card strong {
  color: var(--text);
  font-family: "Noto Serif SC", serif;
  font-size: 1.3rem;
}

.auth-transition-card p {
  margin: 0;
  color: #655f50;
  line-height: 1.75;
}

.login-actions {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.login-entry {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.login-entry:hover {
  border-color: rgba(25, 25, 20, 0.1);
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.login-entry strong {
  font-size: 1rem;
}

.login-entry span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.case-form {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.case-form + .case-form {
  margin-top: 18px;
}

.case-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.case-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
}

.case-input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 20px;
  border: 1px solid rgba(25, 25, 20, 0.07);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font: inherit;
}

.case-submit {
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.case-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.auth-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 28px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
}

.auth-tab {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(20, 20, 16, 0.06);
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.auth-field {
  display: grid;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-submit:disabled,
.login-entry:disabled {
  opacity: 0.72;
  cursor: default;
}

.auth-status {
  margin: 14px 0 0;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.auth-status[data-tone="pending"] {
  border-color: rgba(171, 125, 38, 0.34);
  background: rgba(255, 245, 220, 0.92);
  color: #8b6d2f;
}

.auth-status[data-tone="error"] {
  border-color: rgba(171, 76, 64, 0.34);
  background: rgba(255, 235, 232, 0.9);
  color: #ab4c40;
}

.login-body[data-auth-error="true"] .auth-form {
  animation: auth-form-nudge 180ms ease-out both;
}

.login-body[data-auth-error="true"] .case-input:focus {
  border-color: rgba(171, 76, 64, 0.28);
  box-shadow: 0 0 0 4px rgba(171, 76, 64, 0.08);
}

.auth-status[data-tone="success"] {
  border-color: rgba(43, 107, 57, 0.34);
  background: rgba(232, 248, 235, 0.92);
  color: #2b6b39;
}

.privacy-link {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.7;
}

.privacy-link a {
  color: var(--text);
  font-weight: 700;
}

.legal-body {
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)) 16px;
}

.legal-shell {
  width: min(720px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.legal-back {
  width: fit-content;
}

.legal-card {
  padding: 30px;
  border-radius: 30px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.legal-card h1 {
  margin: 0 0 18px;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(2rem, 5vw, 3rem);
}

.legal-card p {
  margin: 0 0 14px;
  color: #5f5a4d;
  line-height: 1.9;
}

.messages {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 4px 18px;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  mask-image: linear-gradient(180deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}

.messages[data-empty="true"] {
  justify-content: flex-end;
  padding-top: clamp(48px, 18vh, 148px);
}

.loading-state,
.empty-state,
.fatal-state {
  align-self: center;
  justify-self: center;
  width: min(100%, 560px);
  margin: auto;
  padding: 12px 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: center;
  line-height: 1.75;
  animation: page-rise 420ms ease-out both;
}

.empty-state {
  display: grid;
  gap: 16px;
  text-align: center;
}

.empty-state-eyebrow {
  justify-self: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(244, 242, 235, 0.96);
  color: #6d6657;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}

.empty-state-title,
.empty-state-copy {
  margin: 0;
}

.empty-state-title {
  color: var(--text);
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.24rem, 3vw, 1.72rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.empty-state-copy {
  color: #6d6254;
  line-height: 1.8;
}

.empty-state-examples {
  display: grid;
  gap: 10px;
}

.empty-state-example {
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-top: 1px solid rgba(40, 35, 28, 0.08);
  border-radius: 0;
  background: transparent;
  color: #544a3a;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.62;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, color 160ms ease;
}

.empty-state-example:hover {
  transform: translateX(3px);
  color: var(--text);
}

.empty-state-promises {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.empty-state-promises span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(25, 25, 20, 0.06);
  background: rgba(255, 255, 255, 0.82);
  color: #5f5a4d;
  font-size: 0.8rem;
  font-weight: 700;
}

.empty-state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.empty-state-chip {
  background: rgba(244, 242, 235, 0.96);
}

.fatal-state {
  display: grid;
  gap: 14px;
  color: #6d6254;
}

.fatal-state p {
  margin: 0;
}

.fatal-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.fatal-actions button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.fatal-actions button + button {
  background: rgba(25, 25, 20, 0.07);
  color: var(--text);
}

.message-row {
  display: flex;
  width: 100%;
  animation: message-in 260ms ease-out both;
}

.message-row.user {
  justify-content: flex-end;
}

.message-row.assistant {
  justify-content: flex-start;
}

.message-row.assistant .message-card {
  position: relative;
  padding-left: 18px;
}

.message-row.assistant .message-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 8px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(155, 106, 50, 0.12), rgba(155, 106, 50, 0.46), rgba(155, 106, 50, 0.12));
}

.message-card {
  width: min(100%, 720px);
  padding: 4px 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.message-row.user .message-card {
  width: fit-content;
  max-width: min(86%, 560px);
  padding: 14px 18px 15px;
  border-radius: 24px 24px 7px 24px;
  background: var(--user);
  color: var(--user-text);
  box-shadow: 0 14px 32px rgba(36, 31, 23, 0.14);
}

.message-row[data-pending="true"] {
  opacity: 0.72;
}

.message-row.assistant[data-pending="true"] .message-card {
  max-width: min(100%, 38rem);
  padding: 14px 16px;
  border-radius: 22px 22px 22px 8px;
  border: 1px solid rgba(48, 42, 31, 0.07);
  background: var(--assistant);
  box-shadow: var(--shadow-soft);
}

.message-row.assistant[data-type="welcome"] .message-text {
  color: #766f61;
}

.message-row.assistant[data-pending="true"] .message-text::after {
  content: "";
  display: inline-block;
  width: 1.1em;
  height: 1em;
  margin-left: 0.25em;
  background: radial-gradient(circle, currentColor 28%, transparent 32%) 0.05em 55% / 0.34em 0.34em repeat-x;
  opacity: 0.45;
  animation: pending-dots 1s steps(3, end) infinite;
}

.message-role {
  display: none;
}

.message-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.92;
  font-size: 1rem;
}

.message-body {
  display: grid;
  gap: 10px;
}

.message-stage {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(244, 242, 235, 0.96);
  color: #6d6254;
  font-size: 0.76rem;
  font-weight: 700;
}

.message-row.user .message-stage,
.message-row.user .message-outcome {
  background: rgba(255, 248, 234, 0.14);
  color: rgba(255, 248, 234, 0.88);
}

.message-outcome {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.message-outcome[data-tone="success"] {
  background: rgba(232, 248, 235, 0.95);
  color: #2b6b39;
}

.message-outcome[data-tone="neutral"] {
  background: rgba(244, 242, 235, 0.96);
  color: #5f5a4d;
}

.message-outcome[data-tone="warning"] {
  background: rgba(255, 245, 220, 0.95);
  color: #8b6d2f;
}

.message-stamp {
  color: rgba(134, 130, 116, 0.92);
  font-size: 0.76rem;
  line-height: 1.3;
}

.message-row.assistant .message-text {
  max-width: 44rem;
  line-height: 1.95;
  font-size: 1.01rem;
}

.message-row.assistant .message-stamp {
  justify-self: start;
}

.message-row.user .message-text {
  line-height: 1.75;
  color: var(--user-text);
}

.message-row.user .message-stamp {
  justify-self: end;
  color: rgba(255, 248, 234, 0.62);
}

.meta-chip-list,
.natural-summary,
.summary-grid,
.timeline-list,
.todo-list,
.conflict-list,
.insight-list {
  margin-top: 12px;
}

.meta-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-strip {
  display: none;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: none;
}

.chip-strip[data-visible="true"] {
  display: flex;
}

.chip-strip::-webkit-scrollbar {
  display: none;
}

.chip {
  appearance: none;
  -webkit-appearance: none;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 252, 245, 0.74);
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.chip:hover {
  color: var(--text);
  background: #fffaf1;
}

.meta-section {
  margin-top: 12px;
}

.meta-section-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.action-chip-list {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.action-chip-list::-webkit-scrollbar {
  display: none;
}

.meta-chip,
.action-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--chip);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
}

.action-chip {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.7);
}

.message-brief {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.message-brief-text {
  color: #5f5a4d;
  font-size: 0.9rem;
  line-height: 1.72;
}

.meta-inline-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta-fold {
  margin-top: 12px;
  border-radius: 20px;
  border: 1px solid rgba(25, 25, 20, 0.06);
  background: rgba(255, 255, 255, 0.48);
  overflow: hidden;
}

.meta-fold > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 0 16px;
  cursor: pointer;
  color: #5f5a4d;
  font-size: 0.88rem;
  font-weight: 600;
}

.meta-fold > summary::-webkit-details-marker {
  display: none;
}

.meta-fold > summary::after {
  content: "展开";
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.meta-fold[open] > summary::after {
  content: "收起";
}

.meta-fold-content {
  padding: 0 14px 14px;
}

.summary-grid,
.timeline-list,
.todo-list,
.conflict-list,
.insight-list,
.relationship-list {
  display: grid;
  gap: 10px;
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
}

.summary-item,
.natural-summary,
.timeline-item,
.todo-item,
.conflict-item,
.insight-item,
.relationship-item {
  padding: 14px 15px;
  border-radius: 20px;
  background: rgba(255, 252, 245, 0.76);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.summary-item-primary {
  background: #f0ece2;
  border-color: rgba(25, 25, 20, 0.1);
}

.summary-item-primary strong {
  color: #151515;
}

.natural-summary {
  line-height: 1.8;
  color: var(--text);
  font-size: 0.95rem;
}

.conflict-item {
  border-color: rgba(178, 72, 54, 0.22);
  background: #fcf1ee;
}

.conflict-item strong {
  color: #9d3f33;
}

.summary-item span,
.timeline-item span,
.todo-item span,
.conflict-item span,
.insight-item span,
.relationship-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}

.relationship-list {
  margin-top: 12px;
}

.relationship-graph {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.relationship-node {
  padding: 13px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 242, 235, 0.92));
  border: 1px solid rgba(25, 25, 20, 0.08);
}

.relationship-node span,
.relationship-node strong,
.relationship-node div {
  display: block;
}

.relationship-node span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.relationship-node strong {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 0.96rem;
}

.relationship-node div {
  color: #5f5a4d;
  font-size: 0.86rem;
  line-height: 1.65;
}

.relationship-item strong {
  display: block;
  margin-bottom: 4px;
}

.relationship-summary {
  color: var(--text);
  line-height: 1.7;
}

.relationship-status {
  margin: 8px 0 0;
  color: #6d6657;
  font-size: 0.84rem;
  line-height: 1.65;
}

.relationship-latest,
.relationship-milestones {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

.relationship-milestones {
  color: #706a5a;
}

.relationship-memory-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.relationship-memory-item {
  padding: 10px 11px;
  border-radius: 14px;
  background: rgba(244, 241, 232, 0.9);
  border: 1px solid rgba(25, 25, 20, 0.06);
}

.relationship-memory-item span,
.relationship-memory-item strong,
.relationship-memory-item div {
  display: block;
}

.relationship-memory-item span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
}

.relationship-memory-item strong {
  color: var(--text);
  font-size: 0.9rem;
}

.relationship-memory-item div {
  margin-top: 4px;
  color: #655f50;
  font-size: 0.82rem;
  line-height: 1.6;
}

.table-wrap {
  margin-top: 14px;
  overflow-x: auto;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(12px);
}

.table-wrap table {
  min-width: 580px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  font-size: 0.92rem;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.totals {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.totals span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
}

.inline-notice {
  width: fit-content;
  max-width: min(100%, 560px);
  margin: 6px auto 2px;
  padding: 10px 13px;
  border-radius: 16px;
  border: 1px solid rgba(25, 25, 20, 0.08);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
  text-align: center;
}

.inline-notice[data-tone="error"] {
  border-color: rgba(171, 76, 64, 0.28);
  background: rgba(255, 235, 232, 0.9);
  color: #ab4c40;
}

.inline-notice[data-tone="success"] {
  border-color: rgba(43, 107, 57, 0.28);
  background: rgba(232, 248, 235, 0.92);
  color: #2b6b39;
}

.feedback-sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.feedback-sheet[data-open="true"] {
  display: flex;
}

.feedback-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 22, 18, 0.22);
  backdrop-filter: blur(8px);
}

.feedback-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  display: grid;
  gap: 12px;
  padding: 22px;
  border-radius: 30px;
  border: 1px solid rgba(25, 25, 20, 0.08);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.96), transparent 12rem),
    rgba(255, 252, 245, 0.96);
  box-shadow: 0 24px 76px rgba(50, 39, 22, 0.2);
}

.feedback-close {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(25, 25, 20, 0.06);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.feedback-title {
  margin: 0;
  padding-right: 52px;
  color: var(--text);
  font-family: "Noto Serif SC", serif;
  font-size: 1.28rem;
  font-weight: 600;
}

.feedback-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.feedback-meta {
  margin: -2px 0 0;
  color: #6c6657;
  font-size: 0.8rem;
  line-height: 1.65;
}

.feedback-input {
  min-height: 116px;
  padding: 14px;
  border: 1px solid rgba(25, 25, 20, 0.08);
  border-radius: 20px;
  background: rgba(247, 246, 241, 0.9);
}

.feedback-submit {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.feedback-submit:disabled {
  opacity: 0.68;
  cursor: default;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.feedback-actions button,
.feedback-actions a {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(25, 25, 20, 0.08);
  background: rgba(247, 246, 241, 0.95);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.feedback-actions button:disabled {
  opacity: 0.68;
  cursor: default;
}

.composer {
  position: sticky;
  bottom: 0;
  padding: 16px 26px max(10px, env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(239, 231, 217, 0) 0%, rgba(239, 231, 217, 0.72) 20%, rgba(239, 231, 217, 0.94) 54%, rgba(239, 231, 217, 1) 100%);
}

body[data-keyboard-focus="true"] .composer {
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}

.composer-box {
  border: 1px solid rgba(40, 35, 28, 0.1);
  border-radius: 28px;
  background: rgba(250, 246, 238, 0.8);
  box-shadow: none;
  backdrop-filter: blur(18px);
  padding: 10px 12px;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.composer-box[data-voice-state="recording"] {
  border-color: rgba(22, 22, 22, 0.18);
  box-shadow: 0 18px 40px rgba(20, 20, 16, 0.08);
}

.composer-box[data-voice-state="connecting"],
.composer-box[data-voice-state="processing"] {
  border-color: rgba(22, 22, 22, 0.12);
}

.composer-box[data-has-text="true"] {
  border-color: rgba(23, 20, 17, 0.28);
  box-shadow:
    0 12px 30px rgba(33, 25, 14, 0.08),
    0 0 0 5px rgba(23, 20, 17, 0.035);
}

.composer-box[data-entry-ready="true"] {
  border-color: rgba(23, 20, 17, 0.34);
  box-shadow:
    0 14px 34px rgba(33, 25, 14, 0.1),
    0 0 0 6px rgba(23, 20, 17, 0.04);
  animation: composer-ready-pulse 1.4s ease-in-out 2;
}

.composer-live {
  display: none;
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 6px;
  padding: 7px 10px;
  border-radius: 18px;
  border: 1px solid rgba(25, 25, 20, 0.06);
  background: rgba(247, 246, 241, 0.88);
}

.composer-live[data-visible="true"] {
  display: flex;
}

.voice-live-main {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.voice-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.voice-status[data-tone="pending"] {
  background: #f4efe4;
  color: #8b6d2f;
}

.voice-status[data-tone="live"] {
  background: var(--accent);
  color: #fff;
}

.voice-status[data-tone="success"] {
  background: #edf6ee;
  color: #2b6b39;
}

.voice-status[data-tone="error"] {
  background: #f8ecea;
  color: #ab4c40;
}

.voice-route-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(25, 25, 20, 0.04);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.voice-route-badge[data-route="realtime"] {
  background: rgba(22, 22, 22, 0.08);
  color: var(--text);
}

.voice-route-badge[data-route="fallback"] {
  background: #f4efe4;
  color: #8b6d2f;
}

.voice-route-badge[data-route="upload"] {
  background: #edf6ee;
  color: #2b6b39;
}

.voice-live-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 18px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 180ms ease, max-height 180ms ease;
}

.voice-live-meta[data-visible="true"] {
  opacity: 1;
  max-height: 24px;
}

.voice-level-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(25, 25, 20, 0.05);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.voice-level-badge[data-level="weak"] {
  background: #f8ecea;
  color: #ab4c40;
}

.voice-level-badge[data-level="ok"] {
  background: #edf6ee;
  color: #2b6b39;
}

.voice-level-badge[data-level="strong"] {
  background: #ebeef8;
  color: #3f5da8;
}

.voice-timing-text {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-hint {
  min-height: 20px;
  padding: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.42;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
}

.composer-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 7px;
  align-items: center;
}

.composer-input-shell {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  padding: 0 6px;
  border-radius: 25px;
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.98), rgba(244, 235, 220, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(48, 42, 31, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transition: box-shadow 180ms ease, background 180ms ease;
}

.composer-input-shell:focus-within {
  background: rgba(255, 252, 245, 0.99);
  box-shadow:
    inset 0 0 0 1px rgba(155, 106, 50, 0.18),
    0 0 0 4px rgba(155, 106, 50, 0.08);
}

.tool-button,
.send-button {
  appearance: none;
  -webkit-appearance: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform 140ms ease, background 160ms ease, color 160ms ease, opacity 160ms ease;
}

.tool-button:hover {
  background: rgba(155, 106, 50, 0.1);
  color: var(--text);
}

.tool-button:focus-visible,
.send-button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(22, 22, 22, 0.1);
}

.tool-button[data-active="true"] {
  background: var(--accent);
  color: #fff;
  animation: voice-breathe 1.2s ease-in-out infinite;
}

.voice-button {
  min-width: 48px;
  touch-action: manipulation;
}

.voice-button[data-active="true"] {
  background: var(--accent);
  color: #fff;
  animation: voice-breathe 1.2s ease-in-out infinite;
}

.tool-button[data-busy="true"] {
  opacity: 0.78;
}

.tool-button:disabled,
.send-button:disabled {
  cursor: default;
}

textarea {
  width: 100%;
  min-height: 48px;
  max-height: 168px;
  padding: 12px 12px;
  border: 0;
  border-radius: 18px;
  resize: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.62;
  outline: none;
}

textarea::placeholder {
  color: #8f8a7a;
}

.send-button {
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 255, 255, 0.18), transparent 1.8rem),
    var(--accent);
  border-color: rgba(37, 32, 24, 0.08);
  color: #fff;
  min-width: 48px;
  font-weight: 700;
  opacity: 0.42;
  transform: scale(0.98);
  transition: opacity 160ms ease, transform 160ms ease;
}

.send-button:hover {
  opacity: 0.92;
}

.send-button:disabled {
  opacity: 0.72;
  transform: scale(1);
}

.send-button[data-ready="true"] {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 10px 24px rgba(37, 32, 24, 0.18);
}

@keyframes page-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.send-button[data-ready="true"]:active,
.tool-button:active {
  transform: scale(0.96);
}

@keyframes voice-breathe {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 22, 22, 0.18);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(22, 22, 22, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(22, 22, 22, 0);
  }
}

@keyframes pending-dots {
  from {
    clip-path: inset(0 72% 0 0);
  }

  50% {
    clip-path: inset(0 35% 0 0);
  }

  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes auth-transition-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes composer-ready-pulse {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px);
  }
}

@keyframes auth-form-nudge {
  0%,
  100% {
    transform: translateX(0);
  }

  35% {
    transform: translateX(-4px);
  }

  70% {
    transform: translateX(4px);
  }
}

@media (max-width: 720px) {
  body::after {
    background: linear-gradient(90deg, transparent 8px, rgba(255, 255, 255, 0.28) 8px, rgba(255, 255, 255, 0.28) calc(100% - 8px), transparent calc(100% - 8px));
  }

  .app-shell {
    padding-left: 8px;
    padding-right: 8px;
  }

  .chat-frame {
    min-height: calc(100vh - 18px);
    min-height: calc(100dvh - 18px);
  }

  .chat-frame::before {
    inset: 72px -2px 80px;
    border-radius: 30px;
  }

  .messages {
    gap: 16px;
    padding: 20px 5px 12px;
  }

  .conversation-rail {
    padding: 0 4px 8px;
  }

  .messages[data-empty="true"] {
    padding-top: 12vh;
  }

  .hero-line-wrap {
    min-height: clamp(108px, 16vh, 150px);
    padding: 0 0 0 0;
  }

  .hero-logout {
    right: 0;
  }

  .top-line {
    min-height: 66px;
    padding: 0 6px 8px;
  }

  .daily-line {
    max-width: 22rem;
    font-size: 0.94rem;
    line-height: 1.72;
  }

  .top-reminder {
    max-width: 100%;
    padding: 6px 12px;
    border-radius: 16px;
    flex-direction: column;
    gap: 2px;
  }

  .message-card {
    width: 100%;
    padding: 2px 0 0;
  }

  .message-row.user .message-card {
    max-width: calc(100% - 36px);
    padding: 12px 15px;
    border-radius: 21px 21px 6px 21px;
  }

  .message-row.assistant .message-card {
    padding-left: 14px;
  }

  .message-stamp {
    font-size: 0.72rem;
  }

  .composer-row {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 4px;
  }

  .composer-box {
    border-radius: 30px;
    padding: 8px;
  }

  body[data-keyboard-focus="true"] .top-line {
    min-height: 42px;
  }

  body[data-keyboard-focus="true"] .hero-line-wrap {
    min-height: 54px;
  }

  body[data-keyboard-focus="true"] .daily-line {
    display: none;
  }

  body[data-keyboard-focus="true"] .messages {
    padding-top: 4px;
  }

  body[data-keyboard-focus="true"] .chat-frame::before {
    top: 46px;
  }

  .composer-live {
    gap: 8px;
    padding: 7px 9px;
    border-radius: 16px;
  }

  .voice-live-main {
    gap: 6px;
    flex-wrap: wrap;
  }

  .voice-status {
    min-height: 22px;
    padding: 0 9px;
    font-size: 0.7rem;
  }

  .tool-button,
  .send-button {
    min-width: 40px;
    min-height: 42px;
    padding: 0 8px;
    font-size: 0.76rem;
  }

  .voice-button {
    min-width: 40px;
  }

  textarea {
    min-height: 44px;
    padding: 10px 8px;
    font-size: 0.98rem;
  }

  .send-button {
    min-width: 40px;
  }

  .case-row {
    grid-template-columns: 1fr;
  }

  .feedback-sheet {
    padding: 10px;
  }

  .feedback-panel {
    padding: 20px;
    border-radius: 24px;
  }

  .ops-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .ops-diagnostic-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .composer-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .composer-row .tool-button:first-child {
    display: none;
  }

  .voice-button,
  .send-button {
    min-width: 40px;
  }
}
