@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/assets/fonts/Poppins-Light.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/Poppins-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/Poppins-Medium.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/Poppins-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/Poppins-Bold.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/Poppins-ExtraBold.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("/assets/fonts/Poppins-Black.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --ink: #17302f;
  --muted: #607371;
  --paper: #f6f5ef;
  --card: #ffffff;
  --line: #d9dfda;
  --deep: #153c3b;
  --deep-2: #225552;
  --mint: #dceae4;
  --warm: #e8b877;
  --danger: #a23832;
  --danger-soft: #f6e4e1;
  --shadow: 0 14px 40px rgba(18, 52, 50, 0.09);
  font-family: "Poppins", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  font-size: calc(1rem + 3px);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(232, 184, 119, 0.16), transparent 30rem),
    var(--paper);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, h4, h5, h6 { font-weight: 500; }
h1 { margin-bottom: 0.35rem; font-size: calc(clamp(1.55rem, 5vw, 2.15rem) + 3px); letter-spacing: -0.035em; }
h2 { margin-bottom: 0.4rem; font-size: calc(clamp(1.35rem, 4vw, 1.8rem) + 3px); letter-spacing: -0.025em; }
h3 { margin-bottom: 0; font-size: calc(1rem + 3px); }

.centered-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.login-card {
  width: min(100%, 28rem);
  padding: clamp(1.5rem, 6vw, 2.5rem);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 3.2rem;
  height: 3.2rem;
  display: grid;
  place-items: center;
  margin-bottom: 1.2rem;
  border-radius: 1rem;
  color: white;
  background: var(--deep);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: calc(1.65rem + 3px);
  font-weight: 500;
}

.eyebrow {
  margin-bottom: 0.25rem;
  color: var(--deep-2);
  font-size: calc(0.72rem + 3px);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.muted { color: var(--muted); line-height: 1.55; }
.compact { margin: 0.45rem 0 0; font-size: calc(0.8rem + 3px); }
.stack { display: grid; gap: 1rem; }
.attribution-note, .attribution {
  color: var(--deep-2);
  font-size: calc(0.78rem + 3px);
  font-weight: 800;
  line-height: 1.45;
}
.attribution-note {
  display: inline-flex;
  margin: 0 0 1rem;
  padding: 0.45rem 0.7rem;
  background: var(--mint);
  border-radius: 999px;
}
.attribution { margin: 0.25rem 0; }

label {
  display: grid;
  gap: 0.42rem;
  color: var(--ink);
  font-size: calc(0.86rem + 3px);
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.72rem 0.82rem;
  color: var(--ink);
  background: white;
  border: 1px solid #bdc9c5;
  border-radius: 0.72rem;
  outline: none;
}

textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus, button:focus-visible {
  border-color: var(--deep-2);
  box-shadow: 0 0 0 3px rgba(34, 85, 82, 0.17);
}

button {
  min-height: 2.85rem;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 0.72rem;
  font-weight: 800;
}

.primary { color: white; background: var(--deep); }
.primary:hover { background: var(--deep-2); }
.quiet { color: var(--deep); background: var(--mint); }
a.quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: 0.72rem;
  font-weight: 800;
  text-decoration: none;
}
.danger { color: white; background: var(--danger); }
.wide { width: 100%; }
.small { min-height: 2.25rem; padding: 0.35rem 0.75rem; font-size: calc(0.78rem + 3px); }

.privacy-note {
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: calc(0.76rem + 3px);
  line-height: 1.5;
}

.connection-banner, .warning-strip {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: calc(0.83rem + 3px);
  font-weight: 750;
}
.connection-banner { color: white; background: var(--danger); }
.warning-strip { color: #51330f; background: #f4d8aa; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 78rem;
  margin: 0 auto;
  padding: 1.1rem max(1rem, env(safe-area-inset-right)) 0.8rem max(1rem, env(safe-area-inset-left));
}

.app-identity h1 { margin-bottom: 0.15rem; }
.app-identity p {
  margin: 0;
  color: var(--muted);
  font-size: calc(0.78rem + 3px);
  font-weight: 750;
}
.header-actions { display: grid; justify-items: end; gap: 0.35rem; }
.user-name { font-size: calc(0.82rem + 3px); font-weight: 800; }

.tab-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 0.35rem;
  max-width: 78rem;
  margin: 0 auto;
  padding: 0.55rem 1rem;
  overflow-x: auto;
  background: rgba(246, 245, 239, 0.93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.tab {
  flex: 0 0 auto;
  min-height: 2.5rem;
  padding-inline: 0.9rem;
  color: var(--muted);
  background: transparent;
  font-size: calc(0.82rem + 3px);
}
.tab.active { color: white; background: var(--deep); }
.tab:disabled { display: none; }

.content-shell { max-width: 78rem; min-height: 68vh; margin: 0 auto; padding: 1rem; }
.panel { animation: appear 180ms ease-out; }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } }

.section-heading, .card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.toggle-label { display: flex; align-items: center; gap: 0.45rem; white-space: nowrap; }
.toggle-label input { width: 1.2rem; min-height: 1.2rem; accent-color: var(--deep); }

.voice-welcome {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 13rem;
  overflow: hidden;
  padding: clamp(1.25rem, 5vw, 2rem);
  color: white;
  background:
    radial-gradient(circle at 90% 10%, rgba(232, 184, 119, 0.22), transparent 13rem),
    linear-gradient(135deg, var(--deep), #1d4d4b);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.25rem;
  box-shadow: 0 14px 36px rgba(18, 52, 50, 0.16);
}
.voice-welcome-copy {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  max-width: 68%;
  align-self: center;
}
.voice-welcome-aside {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 1;
  width: min(45%, 25rem);
}
.sam-portrait {
  position: absolute;
  inset: -8% -8% -8% -4%;
  width: 112%;
  height: 116%;
  object-fit: cover;
  object-position: 44% 37%;
  opacity: 0.6;
  filter: saturate(0.82) contrast(0.94);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.45) 24%, #000 52%);
  mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.45) 24%, #000 52%);
  pointer-events: none;
  user-select: none;
}
.voice-mode-toggle {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 3;
  padding: 0.42rem 0.66rem;
  background: rgba(16, 53, 51, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.voice-welcome .eyebrow { color: #efc58f; }
.voice-welcome h2 {
  margin-bottom: 0.45rem;
  color: white;
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: calc(clamp(1.75rem, 6vw, 2.65rem) + 3px);
  font-weight: 500;
  letter-spacing: -0.025em;
}
.voice-welcome-question {
  max-width: 32rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: calc(clamp(1rem, 3.5vw, 1.2rem) + 3px);
  line-height: 1.45;
}
.voice-welcome .toggle-label { color: white; }
.voice-welcome .toggle-label input { accent-color: var(--warm); }
.voice-privacy-note { margin: 0.85rem 0 0; font-size: calc(0.86rem + 3px); }

.voice-controls { display: grid; gap: 0.75rem; max-width: 30rem; margin: 1.5rem auto 0.8rem; }
.voice-primary-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 4vw, 1.25rem);
}
.voice-button {
  min-height: 7.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  color: white;
  background: var(--deep);
  border-radius: 50%;
  width: 7.5rem;
  flex: 0 0 7.5rem;
  margin: 0;
  box-shadow: 0 12px 32px rgba(21, 60, 59, 0.25);
}
.voice-button.active-session {
  background: var(--deep-2);
  box-shadow: 0 0 0 4px rgba(34, 85, 82, 0.13), 0 12px 32px rgba(21, 60, 59, 0.2);
}
.voice-button.active-session:disabled { opacity: 1; }
.voice-icon { color: #efc58f; font-size: calc(1.1rem + 3px); }
.mic-button {
  display: flex;
  width: 6.25rem;
  min-height: 6.25rem;
  flex: 0 0 6.25rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: var(--deep);
  background: var(--mint);
  border: 2px solid rgba(21, 60, 59, 0.18);
  border-radius: 50%;
  box-shadow: 0 9px 24px rgba(21, 60, 59, 0.14);
}
.mic-button.is-muted {
  color: white;
  background: var(--danger);
  border-color: transparent;
}
.mic-button:not(:disabled):active { transform: scale(0.98); }
.mic-icon { color: #2f7b61; font-size: calc(1rem + 3px); }
.mic-button.is-muted .mic-icon { color: #ffd5c7; }
.aec-status {
  min-height: 1.35rem;
  margin: 0.25rem auto 0;
  color: var(--muted);
  text-align: center;
  font-size: calc(0.8rem + 3px);
  line-height: 1.45;
}
.status-line { min-height: 1.4rem; text-align: center; color: var(--muted); font-size: calc(0.86rem + 3px); }

.card, .transcript-card {
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 5px 20px rgba(18, 52, 50, 0.04);
}

.transcript-card { margin-top: 1rem; }
.transcript { min-height: 13rem; max-height: 27rem; margin-top: 1rem; overflow-y: auto; }
.empty-state { margin: 1rem 0; color: var(--muted); font-size: calc(0.9rem + 3px); line-height: 1.55; }

.transcript-line, .chat-bubble {
  max-width: 90%;
  margin: 0.55rem 0;
  padding: 0.7rem 0.85rem;
  border-radius: 0.9rem;
  white-space: pre-wrap;
  line-height: 1.5;
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: calc(0.91rem + 3px);
  font-weight: 300;
}
.transcript-line.user, .chat-bubble.user { margin-left: auto; background: var(--mint); }
.transcript-line.assistant, .chat-bubble.assistant { background: #f0eee6; }
.speaker { display: block; margin-bottom: 0.2rem; color: var(--muted); font-size: calc(0.65rem + 3px); font-weight: 500; text-transform: uppercase; }
.partial { opacity: 0.72; }

.chat-messages { min-height: 44vh; max-height: 62vh; padding: 0.4rem; overflow-y: auto; }
.composer { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr auto; gap: 0.6rem; padding: 0.75rem 0; background: var(--paper); }

.capture-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.capture-button {
  min-height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem;
  color: white;
  text-align: center;
  background: var(--deep);
  border-radius: 0.8rem;
}
.capture-button.secondary { color: var(--deep); background: var(--mint); }
.selected-files { margin: 0; color: var(--muted); font-size: calc(0.82rem + 3px); overflow-wrap: anywhere; }
.two-column { display: grid; gap: 0.8rem; }

.master-import-card {
  margin: 1rem 0 1.6rem;
  padding: clamp(1rem, 4vw, 1.35rem);
  background:
    radial-gradient(circle at 96% 0%, rgba(232, 184, 119, 0.2), transparent 12rem),
    white;
  border: 1px solid #c8d9d1;
  border-radius: 1rem;
  box-shadow: 0 8px 28px rgba(18, 52, 50, 0.07);
}
.master-safety-note {
  margin: 0.85rem 0 1rem;
  padding: 0.75rem 0.85rem;
  color: #51330f;
  background: #f7ead4;
  border-left: 4px solid var(--warm);
  border-radius: 0.55rem;
  font-size: calc(0.78rem + 3px);
  line-height: 1.5;
}
.master-import-form { gap: 0.7rem; }
.master-import-form .capture-button { min-height: 3.6rem; }
.master-import-workspace { display: grid; gap: 0.8rem; margin-top: 1rem; }
.ordinary-upload-heading { margin: 1.25rem 0 0.7rem; }
.ordinary-upload-heading .eyebrow { margin-bottom: 0.15rem; }
.master-import-summary {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
  background: #f7f8f4;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}
.master-import-summary h4 { margin: 0; overflow-wrap: anywhere; }
.master-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.master-metric {
  padding: 0.6rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.master-metric strong { display: block; font-size: calc(1rem + 3px); }
.master-metric span { color: var(--muted); font-size: calc(0.7rem + 3px); line-height: 1.35; }
.master-progress {
  width: 100%;
  height: 0.8rem;
  overflow: hidden;
  accent-color: var(--deep-2);
  border-radius: 999px;
}
.master-action-row { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.master-action-row button { flex: 1 1 12rem; }
.master-review-note {
  margin: 0;
  padding: 0.7rem;
  color: var(--deep-2);
  background: var(--mint);
  border-radius: 0.65rem;
  font-size: calc(0.78rem + 3px);
  font-weight: 700;
  line-height: 1.45;
}
.master-segment-list { display: grid; gap: 0.75rem; }
.master-review-controls {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 0.75rem;
  align-items: end;
}
.master-review-controls label { display: grid; gap: 0.35rem; }
@media (max-width: 640px) {
  .master-review-controls { grid-template-columns: 1fr; }
}
.master-segment {
  padding: 0.85rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}
.master-segment.is-flagged { border-color: #d8a455; box-shadow: inset 4px 0 #d8a455; }
.master-segment.is-ready-unflagged { border-color: #9bb9ad; }
.master-segment.is-approved { border-color: #75a890; box-shadow: inset 4px 0 #75a890; }
.master-segment.is-excluded { opacity: 0.78; border-style: dashed; }
.master-segment h4 { margin: 0; font-size: calc(0.9rem + 3px); overflow-wrap: anywhere; }
.master-segment-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  font-size: calc(0.86rem + 3px);
}
.master-segment-summary strong { overflow-wrap: anywhere; }
.master-segment-meta {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: calc(0.74rem + 3px);
  line-height: 1.45;
}
.master-source-link {
  display: inline-block;
  margin-top: 0.45rem;
  color: var(--deep-2);
  font-size: calc(0.76rem + 3px);
  font-weight: 800;
}
.master-field-group { margin-top: 0.65rem; }
.master-field-group > strong {
  display: block;
  font-size: calc(0.75rem + 3px);
}
.master-segment > .master-action-row { margin-top: 0.8rem; }
.master-event-list { display: grid; gap: 0.6rem; margin-top: 0.75rem; }
.master-event {
  padding: 0.7rem;
  background: #f7f6f1;
  border-radius: 0.65rem;
}
.master-event h5 { margin: 0 0 0.4rem; font-size: calc(0.82rem + 3px); }
.master-event p { margin: 0.28rem 0; color: var(--muted); font-size: calc(0.76rem + 3px); line-height: 1.45; }
.master-event strong { color: var(--ink); }
.master-detail-list {
  display: grid;
  gap: 0.3rem;
  margin: 0.45rem 0 0;
  padding-left: 1.1rem;
}
.master-detail-list li {
  color: var(--muted);
  font-size: calc(0.74rem + 3px);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.master-evidence {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
}
.master-evidence summary {
  color: var(--deep-2);
  cursor: pointer;
  font-size: calc(0.74rem + 3px);
  font-weight: 800;
}
.master-event-editor {
  margin-top: 0.7rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}
.master-event-editor summary {
  color: var(--deep-2);
  cursor: pointer;
  font-size: calc(0.76rem + 3px);
  font-weight: 850;
}
.master-event-editor[open] { display: grid; gap: 0.65rem; }
.master-json-editor {
  min-height: 18rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: calc(0.72rem + 3px);
  line-height: 1.45;
  white-space: pre;
}
.master-receipt {
  padding: 0.85rem;
  color: #174f3b;
  background: #e5f2eb;
  border: 1px solid #b9d8c8;
  border-radius: 0.75rem;
  font-size: calc(0.78rem + 3px);
  line-height: 1.5;
}

.section-gap { margin-top: 1.6rem; margin-bottom: 0.65rem; }
.badge { display: inline-block; padding: 0.25rem 0.5rem; color: var(--deep-2); background: var(--mint); border-radius: 999px; font-size: calc(0.68rem + 3px); font-weight: 850; white-space: nowrap; }
.form-message { min-height: 1.25rem; margin: 0; color: var(--muted); font-size: calc(0.82rem + 3px); line-height: 1.45; }
.error { color: var(--danger); }

.upload-confirmation-dialog {
  position: fixed;
  inset: 0;
  width: min(calc(100% - 2rem), 32rem);
  max-height: calc(100dvh - 2rem);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: white;
  border: 0;
  border-radius: 1.25rem;
  box-shadow: 0 24px 70px rgba(8, 32, 31, 0.28);
}
.upload-confirmation-dialog::backdrop {
  background: rgba(10, 35, 34, 0.58);
  backdrop-filter: blur(3px);
}
.upload-confirmation-card { padding: clamp(1.35rem, 6vw, 2rem); }
.upload-success-mark {
  width: 3.4rem;
  height: 3.4rem;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  color: white;
  background: #2f7b61;
  border-radius: 50%;
  font-size: calc(1.65rem + 3px);
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(47, 123, 97, 0.25);
}
.upload-confirmation-dialog h3 {
  margin: 0 0 0.6rem;
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  font-size: calc(clamp(1.45rem, 5vw, 1.9rem) + 3px);
  font-weight: 500;
}
.upload-confirmation-summary {
  margin: 0;
  color: var(--muted);
  font-size: calc(0.9rem + 3px);
  line-height: 1.55;
}
.upload-confirmation-list {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0 1.25rem;
  padding: 0;
  list-style: none;
}
.upload-confirmation-item {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
  background: #f2f7f4;
  border: 1px solid #d4e4dc;
  border-radius: 0.75rem;
}
.upload-confirmation-item strong {
  font-size: calc(0.86rem + 3px);
  overflow-wrap: anywhere;
}
.upload-confirmation-item span {
  color: var(--muted);
  font-size: calc(0.78rem + 3px);
  line-height: 1.45;
}

.item-list { display: grid; gap: 0.7rem; }
.item {
  padding: 0.9rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}
.item h4 { margin: 0 0 0.35rem; font-size: calc(0.95rem + 3px); overflow-wrap: anywhere; }
.item p { margin: 0.25rem 0; color: var(--muted); font-size: calc(0.82rem + 3px); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.item .citation { color: var(--deep-2); font-weight: 750; }
.item-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.65rem; }
.item a { color: var(--deep-2); font-weight: 800; }

.review-text { max-height: 12rem; overflow-y: auto; padding: 0.7rem; background: #f4f3ed; border-radius: 0.55rem; }
.review-editor { margin-top: 0.7rem; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 0.55rem; margin: 1rem 0; }
.living-grid { display: grid; gap: 0.75rem; }
.living-section { padding: 0.9rem; background: white; border: 1px solid var(--line); border-radius: 0.8rem; }
.living-section h4 { margin: 0 0 0.6rem; text-transform: capitalize; }
.living-section pre { margin: 0; color: #415350; white-space: pre-wrap; overflow-wrap: anywhere; font: calc(0.78rem + 3px)/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }

.vault-warning {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  color: #51330f;
  background: #f4e3c6;
  border: 1px solid #e4c995;
  border-radius: 0.8rem;
  font-size: calc(0.82rem + 3px);
  line-height: 1.5;
}
.vault-grid { display: grid; gap: 0.9rem; margin: 1rem 0; }
.compact-button { min-height: 2.85rem; font-size: calc(0.86rem + 3px); font-weight: 800; }
.vault-unlock { display: grid; gap: 0.65rem; margin: 1rem 0; }
.vault-content { display: grid; gap: 0.8rem; margin-top: 1rem; }
.vault-overview p { margin: 0.35rem 0; color: var(--muted); font-size: calc(0.8rem + 3px); line-height: 1.45; }
.vault-section { display: grid; gap: 0.6rem; }
.vault-item { padding: 0.7rem; background: #f7f6f1; border: 1px solid var(--line); border-radius: 0.65rem; }
.vault-item strong { display: block; margin-bottom: 0.35rem; font-size: calc(0.86rem + 3px); overflow-wrap: anywhere; }
.vault-item p { margin: 0.25rem 0; color: var(--muted); font-size: calc(0.78rem + 3px); line-height: 1.45; overflow-wrap: anywhere; }
.vault-item pre { max-height: 16rem; overflow: auto; }

.app-footer { max-width: 78rem; margin: 1rem auto 0; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom)); color: var(--muted); border-top: 1px solid var(--line); font-size: calc(0.72rem + 3px); line-height: 1.45; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (min-width: 720px) {
  .content-shell { padding: 1.8rem; }
  .two-column { grid-template-columns: 1fr 1fr; }
  .master-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .vault-grid { grid-template-columns: 1fr 1fr; }
  .vault-unlock { grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; }
  .panel { max-width: 58rem; margin: auto; }
  .tab-bar { justify-content: center; }
  .voice-button { width: 9rem; height: 9rem; flex-basis: 9rem; }
  .mic-button { width: 7rem; min-height: 7rem; flex-basis: 7rem; }
}

@media (max-width: 520px) {
  .voice-welcome {
    min-height: 15.5rem;
    padding-bottom: 4.35rem;
  }
  .voice-welcome-copy { max-width: 78%; }
  .voice-welcome-aside { width: 58%; }
  .sam-portrait {
    object-position: 42% 36%;
    opacity: 0.48;
  }
  .voice-mode-toggle {
    right: 0.85rem;
    bottom: 0.85rem;
  }
}

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