* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #1a1512; --card: rgba(42,37,32,0.9); --text: #d4c8b8;
  --muted: rgba(196,167,125,0.5); --accent: #c4a77d;
  --red: rgba(205,120,100,0.8); --green: rgba(140,180,130,0.7);
}

body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  background: linear-gradient(170deg, var(--bg) 0%, #221e19 50%, var(--bg) 100%);
  min-height: 100vh; color: var(--text);
}

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

.shell { max-width: 480px; margin: 0 auto; padding: 0 20px 40px; }

/* HEADER */
.header { text-align: center; padding: 32px 0 20px; position: relative; }
.header h1 { font-size: 28px; font-weight: 300; letter-spacing: 0.2em; color: var(--accent); }
.subtitle { font-size: 13px; color: var(--muted); margin-top: 6px; font-style: italic; letter-spacing: 0.04em; }

/* USER STATUS (header pill) */
.user-status {
  position: absolute; top: 14px; right: 4px;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: rgba(196,167,125,0.5);
}
.user-initial {
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(196,167,125,0.12); border: 1px solid rgba(196,167,125,0.2);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 12px; font-weight: 500;
}
.link-btn {
  background: none; border: none; color: rgba(196,167,125,0.5);
  font-family: inherit; font-size: 12px; cursor: pointer;
  letter-spacing: 0.02em; padding: 4px 2px;
}
.link-btn:hover, .link-btn:active { color: var(--accent); }

/* HOME */
.lead { font-size: 15px; color: var(--muted); text-align: center; line-height: 1.7; margin-bottom: 24px; }

.mode-card {
  width: 100%; background: var(--card); border: 1px solid rgba(196,167,125,0.08);
  border-radius: 14px; padding: 20px; margin-bottom: 10px; cursor: pointer;
  text-align: left; display: flex; gap: 16px; align-items: center; font-family: inherit;
  transition: border-color 0.2s;
}
.mode-card:active { border-color: rgba(196,167,125,0.25); }
.mode-icon { font-size: 28px; color: var(--accent); opacity: 0.7; font-weight: 300; flex-shrink: 0; }
.mode-name { font-size: 17px; color: var(--text); margin-bottom: 4px; }
.mode-sub { font-size: 13px; color: var(--muted); }

.breathe-btn {
  width: 100%; margin-top: 16px; padding: 14px; background: none;
  border: 1px solid rgba(196,167,125,0.12); border-radius: 12px;
  color: var(--muted); font-size: 14px; font-family: inherit; cursor: pointer;
}

/* MIRROR PHASES */
.center-col { text-align: center; padding-top: 20px; display: flex; flex-direction: column; align-items: center; }

.desc-card {
  background: var(--card); border-radius: 14px; border: 1px solid rgba(196,167,125,0.08);
  padding: 20px; margin-bottom: 24px; text-align: left; width: 100%;
}
.desc-card p { font-size: 14px; color: rgba(196,167,125,0.6); line-height: 1.7; }

.rec-btn {
  width: 110px; height: 110px; border-radius: 50%; background: rgba(196,167,125,0.08);
  border: 2px solid rgba(196,167,125,0.3); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.rec-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--red); }

.hint { font-size: 13px; color: rgba(196,167,125,0.3); margin-top: 14px; }
.hint-dim { font-size: 13px; color: rgba(196,167,125,0.2); margin-top: 4px; }
.consent { font-size: 12px; color: rgba(196,167,125,0.25); margin-top: 20px; line-height: 1.6; max-width: 300px; }

.back-btn { margin-top: 24px; background: none; border: none; color: var(--muted); font-size: 13px; font-family: inherit; cursor: pointer; }

/* RECORDING */
.timer-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.pulse-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
.timer { font-size: 32px; font-weight: 300; letter-spacing: 0.05em; font-variant-numeric: tabular-nums; }
.listening { font-size: 15px; color: var(--muted); font-style: italic; margin-top: 20px; }
.live-tx { font-size: 13px; color: rgba(196,167,125,0.25); margin: 16px 0; line-height: 1.6; text-align: left; width: 100%; max-height: 80px; overflow: hidden; }

.stop-btn {
  width: 90px; height: 90px; border-radius: 50%; background: rgba(196,167,125,0.08);
  border: 2px solid rgba(196,167,125,0.3); cursor: pointer;
  display: flex; align-items: center; justify-content: center; margin-top: 40px;
}
.stop-sq { width: 24px; height: 24px; border-radius: 4px; background: var(--accent); }

/* PROCESSING */
.spinner {
  width: 50px; height: 50px; border-radius: 50%;
  border: 2px solid rgba(196,167,125,0.15); border-top-color: var(--accent);
  animation: spin 1s linear infinite; margin: 0 auto 28px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.processing-text { font-size: 17px; color: var(--accent); font-style: italic; }

/* RESULTS */
.count { font-size: 14px; color: var(--muted); text-align: center; font-style: italic; margin-bottom: 20px; }

.moment-card {
  background: var(--card); border-radius: 14px; border: 1px solid rgba(196,167,125,0.1);
  padding: 20px; margin-bottom: 12px;
}
.fade-in { animation: fadeIn 0.5s ease both; }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.moment-label { font-size: 11px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px; }
.moment-quote { font-size: 17px; line-height: 1.7; font-style: italic; margin-bottom: 12px; }

.reflect-btn {
  background: none; border: 1px solid rgba(196,167,125,0.15); color: var(--muted);
  padding: 8px 16px; border-radius: 20px; font-size: 12px; font-family: inherit; cursor: pointer;
}
.reflect-area { margin-top: 8px; }
.reflect-area textarea {
  width: 100%; background: rgba(0,0,0,0.3); border: 1px solid rgba(196,167,125,0.12);
  border-radius: 10px; padding: 12px 14px; color: var(--text); font-size: 14px;
  font-family: inherit; resize: vertical; min-height: 60px; outline: none; line-height: 1.6;
}
.reflect-row { display: flex; gap: 8px; margin-top: 8px; }
.hold-btn { flex: 1; padding: 10px; background: var(--accent); color: var(--bg); border: none; border-radius: 10px; font-size: 13px; font-family: inherit; cursor: pointer; font-weight: 600; }
.cancel-refl { padding: 10px 16px; background: none; border: 1px solid rgba(196,167,125,0.15); color: var(--muted); border-radius: 10px; font-size: 13px; font-family: inherit; cursor: pointer; }
.saved-refl { font-size: 14px; color: rgba(196,167,125,0.6); font-style: italic; margin-top: 8px; }

/* INSIGHTS */
.insight {
  background: rgba(196,167,125,0.06); border-left: 3px solid rgba(196,167,125,0.25);
  border-radius: 0 12px 12px 0; padding: 16px 16px 16px 20px; margin-bottom: 12px;
}
.insight-label { font-size: 11px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 6px; }
.insight-text { font-size: 16px; line-height: 1.7; font-style: italic; }

.door-card {
  background: rgba(196,167,125,0.1); border-radius: 14px; padding: 20px;
  margin-bottom: 16px; border: 1px solid rgba(196,167,125,0.15);
}
.door-label { font-size: 11px; color: var(--accent); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px; }
.door-quote { font-size: 18px; line-height: 1.7; font-style: italic; }

.strength-card {
  background: rgba(140,180,130,0.08); border-radius: 14px; padding: 20px;
  margin-bottom: 16px; border: 1px solid rgba(140,180,130,0.15);
}
.strength-label { font-size: 11px; color: var(--green); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px; }
.strength-quote { font-size: 18px; line-height: 1.7; font-style: italic; }

/* ACTIONS */
.action-col { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.primary-btn { width: 100%; padding: 14px; background: var(--accent); color: var(--bg); border: none; border-radius: 12px; font-size: 15px; font-family: inherit; cursor: pointer; font-weight: 600; }
.secondary-btn { width: 100%; padding: 14px; background: none; border: 1px solid rgba(196,167,125,0.15); color: var(--muted); border-radius: 12px; font-size: 14px; font-family: inherit; cursor: pointer; }
.outline-btn { padding: 12px 32px; background: none; border: 1px solid rgba(196,167,125,0.2); color: var(--accent); border-radius: 12px; font-size: 14px; font-family: inherit; cursor: pointer; }

/* ERROR */
.error-text { font-size: 15px; color: var(--red); line-height: 1.7; margin-bottom: 24px; max-width: 320px; }

/* BREATHE */
.breathe-shell {
  position: fixed; inset: 0; z-index: 100;
  background: linear-gradient(160deg, var(--bg) 0%, #2a2520 40%, var(--bg) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', Georgia, serif;
}
.breathe-circle {
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(196,167,125,0.15) 0%, rgba(196,167,125,0.03) 70%);
  border: 1px solid rgba(196,167,125,0.2);
  display: flex; align-items: center; justify-content: center;
  transform: scale(1); transition: transform 1s ease-in-out; cursor: pointer;
}
.breathe-circle span { color: var(--muted); font-size: 14px; }
.breathe-label { color: var(--accent); font-size: 20px; margin-top: 40px; font-style: italic; }
.breathe-x { position: absolute; top: 20px; right: 20px; background: none; border: none; color: rgba(196,167,125,0.3); font-size: 28px; cursor: pointer; opacity: 1; }

/* SUMMARY (F01) */
.summary-card {
  background: rgba(196,167,125,0.06); border-radius: 14px; padding: 20px;
  margin-bottom: 20px; border: 1px solid rgba(196,167,125,0.1);
}
.summary-text { font-size: 15px; line-height: 1.8; color: var(--text); font-style: italic; }

/* MOMENT CONTEXT */
.moment-context { font-size: 13px; color: rgba(196,167,125,0.35); margin-bottom: 12px; line-height: 1.6; }

/* NOTES FIELD (U01, F04) */
.notes-during { margin-top: 32px; width: 100%; }
.notes-prompt { font-size: 13px; color: var(--muted); margin-bottom: 10px; font-style: italic; }
.notes-field {
  width: 100%; background: rgba(0,0,0,0.25); border: 1px solid rgba(196,167,125,0.1);
  border-radius: 12px; padding: 14px 16px; color: var(--text); font-size: 14px;
  font-family: inherit; resize: vertical; min-height: 80px; outline: none; line-height: 1.6;
}
.notes-field:focus { border-color: rgba(196,167,125,0.25); }
.results-notes { margin-top: 20px; margin-bottom: 8px; }

/* LANGUAGE SELECT (B03, F03) */
.lang-select { margin-top: 16px; }
.lang-select select {
  background: rgba(0,0,0,0.3); border: 1px solid rgba(196,167,125,0.12);
  border-radius: 8px; padding: 8px 12px; color: var(--muted); font-size: 12px;
  font-family: inherit; outline: none; appearance: none; cursor: pointer;
}

/* INPUT TOGGLE (U04: voice/type for self mode) */
.input-toggle { display: flex; gap: 0; margin-bottom: 20px; border-radius: 10px; overflow: hidden; border: 1px solid rgba(196,167,125,0.15); }
.toggle-btn {
  flex: 1; padding: 10px 20px; background: none; border: none;
  color: var(--muted); font-size: 14px; font-family: inherit; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.toggle-btn.active { background: rgba(196,167,125,0.15); color: var(--text); }
.text-input {
  width: 100%; background: rgba(0,0,0,0.25); border: 1px solid rgba(196,167,125,0.12);
  border-radius: 12px; padding: 16px; color: var(--text); font-size: 15px;
  font-family: inherit; resize: vertical; min-height: 180px; outline: none; line-height: 1.7;
}
.text-input:focus { border-color: rgba(196,167,125,0.25); }

/* UPLOAD (F08) */
.upload-card {
  width: 100%; background: none; border: 1px dashed rgba(196,167,125,0.2);
  border-radius: 14px; padding: 18px 20px; margin-bottom: 10px; cursor: pointer;
  text-align: left; display: flex; gap: 16px; align-items: center; font-family: inherit;
  transition: border-color 0.2s;
}
.upload-card:active { border-color: rgba(196,167,125,0.35); }
.upload-mode-select { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; justify-content: center; }
.upload-mode-chip {
  padding: 8px 14px; border-radius: 20px; border: 1px solid rgba(196,167,125,0.15);
  background: none; color: var(--muted); font-size: 13px; font-family: inherit; cursor: pointer;
}
.upload-mode-chip.active { background: rgba(196,167,125,0.15); color: var(--text); border-color: rgba(196,167,125,0.3); }

/* DIVIDER */
.divider { width: 60px; height: 1px; background: rgba(196,167,125,0.1); margin: 16px auto; }

/* HISTORY (F02) */
.history-btn {
  width: 100%; margin-top: 8px; padding: 12px; background: none;
  border: 1px solid rgba(196,167,125,0.08); border-radius: 12px;
  color: rgba(196,167,125,0.35); font-size: 13px; font-family: inherit; cursor: pointer;
}
.history-card {
  width: 100%; background: var(--card); border: 1px solid rgba(196,167,125,0.08);
  border-radius: 14px; padding: 16px 20px; margin-bottom: 8px; cursor: pointer;
  text-align: left; display: flex; gap: 14px; align-items: center; font-family: inherit;
}
.history-card:active { border-color: rgba(196,167,125,0.2); }
.history-summary { font-size: 12px; color: rgba(196,167,125,0.3); margin-top: 4px; font-style: italic; }

/* DELAYED NEW SESSION (U02, U03) */
.delayed-btn { animation: fadeInDelayed 3s ease both; }
@keyframes fadeInDelayed { 0%,60%{opacity:0;pointer-events:none} 100%{opacity:1;pointer-events:auto} }

/* SIGN-IN VIEW */
.signin-blurb {
  font-size: 14px; color: var(--muted); line-height: 1.7;
  text-align: center; max-width: 320px; margin-top: -12px; margin-bottom: 22px;
}
.email-input {
  width: 100%; max-width: 360px;
  background: rgba(0,0,0,0.25); border: 1px solid rgba(196,167,125,0.15);
  border-radius: 12px; padding: 14px 16px;
  color: var(--text); font-size: 16px; font-family: inherit;
  outline: none; line-height: 1.5; transition: border-color 0.2s;
}
.email-input:focus { border-color: rgba(196,167,125,0.35); }
.email-input::placeholder { color: rgba(196,167,125,0.3); }

.signin-submit-btn { max-width: 360px; margin-top: 14px; }
.signin-submit-btn:disabled { opacity: 0.5; cursor: default; }

.signin-error {
  font-size: 13px; color: var(--red); margin-top: 14px;
  text-align: center; max-width: 320px; line-height: 1.6;
}

.signin-sent-card {
  background: rgba(196,167,125,0.06); border: 1px solid rgba(196,167,125,0.15);
  border-radius: 14px; padding: 22px;
  max-width: 360px; margin-top: 8px;
  text-align: center;
}
.signin-sent-card p:first-child {
  font-size: 18px; color: var(--text); font-style: italic;
  margin-bottom: 12px;
}
.signin-sent-detail {
  font-size: 13px; color: var(--muted); line-height: 1.7;
}
.signin-sent-detail em {
  color: var(--accent); font-style: normal;
}

/* FOOTER */
.footer { text-align: center; margin-top: 40px; font-size: 11px; color: rgba(196,167,125,0.12); letter-spacing: 0.1em; }
