/* =========================================================
   InnerEcho — Premium Dark UI
   ========================================================= */

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

:root {
  --bg: #09090b;
  --bg-soft: #0f1014;
  --surface: rgba(19, 21, 27, 0.82);
  --surface-2: rgba(24, 27, 34, 0.9);
  --surface-3: rgba(31, 35, 43, 0.95);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text: #f4f2ee;
  --text-soft: #c8c2b8;
  --text-muted: #918a80;
  --text-faint: #6f6a62;

  --accent: #d6b58a;
  --accent-strong: #e1c39b;
  --accent-soft: rgba(214, 181, 138, 0.12);
  --accent-ring: rgba(214, 181, 138, 0.28);

  --success: #71c78c;
  --error: #e27979;
  --info: #7ba9f6;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.34);

  --container: 1240px;
  --container-narrow: 860px;
  --nav-h: 74px;

  --font-body: 'Inter', system-ui, sans-serif;
  --font-display: 'Cormorant Garamond', serif;

  --transition: 180ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(214, 181, 138, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(123, 169, 246, 0.05), transparent 24%),
    linear-gradient(180deg, #0a0b0f 0%, #09090b 100%);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

img {
  max-width: 100%;
  display: block;
}

/* =========================================================
   Global helpers
   ========================================================= */

.page {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 88px;
}

.page-header {
  margin-bottom: 28px;
}

.page-header-spacious {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 34px;
}

.page-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 0.98;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.page-subtitle {
  margin: 14px 0 0;
  max-width: 720px;
  color: var(--text-soft);
  font-size: 1.02rem;
  line-height: 1.75;
}

.page-header-meta {
  flex-shrink: 0;
}

.page-meta-card {
  min-width: 220px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(17, 19, 25, 0.94) 100%);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}

.page-meta-label {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-meta-value {
  margin-top: 8px;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.45;
}

.section-label,
.section-title {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.section-title {
  margin: 0 0 16px;
}

.side-card-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.1;
}

.side-card-text,
.profile-section-text {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.96rem;
  line-height: 1.8;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.emotion-tag {
  background: rgba(214, 181, 138, 0.12);
  color: var(--accent-strong);
}

.theme-tag {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
}

/* =========================================================
   Navigation
   ========================================================= */

.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
  padding: 0 4px;
  backdrop-filter: blur(18px);
}

.app-nav::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: -1;
  background: rgba(9, 9, 11, 0.76);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}

.nav-logo {
  color: var(--accent-strong);
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all var(--transition);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.nav-link.active {
  background: rgba(214, 181, 138, 0.12);
  color: var(--text);
  border: 1px solid rgba(214, 181, 138, 0.16);
}

.nav-icon {
  font-size: 0.95rem;
  opacity: 0.9;
}

/* =========================================================
   Buttons
   ========================================================= */

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-auth,
.btn-start-session {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 14px;
  transition: all var(--transition);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.btn-primary,
.btn-auth,
.btn-start-session {
  background: linear-gradient(180deg, var(--accent-strong) 0%, var(--accent) 100%);
  color: #171310;
  box-shadow: 0 10px 24px rgba(214, 181, 138, 0.22);
}

.btn-primary:hover,
.btn-auth:hover,
.btn-start-session:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(214, 181, 138, 0.28);
}

.btn-primary:disabled,
.btn-auth:disabled,
.btn-start-session:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-soft);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-danger {
  background: rgba(226, 121, 121, 0.08);
  color: var(--error);
  border: 1px solid rgba(226, 121, 121, 0.22);
}

.btn-danger:hover {
  background: rgba(226, 121, 121, 0.12);
}

/* =========================================================
   Auth
   ========================================================= */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
}

.auth-hero {
  position: relative;
  padding: 54px clamp(28px, 4vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border);
  background:
    radial-gradient(circle at 18% 18%, rgba(214, 181, 138, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(17, 19, 24, 0.94), rgba(11, 12, 16, 0.98));
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.brand-mark,
.auth-mobile-brand {
  color: var(--accent-strong);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
}

.hero-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.78rem;
}

.hero-content {
  max-width: 620px;
  padding: 48px 0;
}

.hero-kicker {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 7vw, 6rem);
  line-height: 0.95;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.hero-title span {
  display: block;
  color: var(--accent-strong);
  font-style: italic;
}

.hero-text {
  max-width: 540px;
  margin: 24px 0 0;
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.9;
}

.hero-points {
  margin-top: 34px;
  display: grid;
  gap: 14px;
}

.hero-point {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-soft);
  font-size: 0.96rem;
}

.hero-point-icon {
  color: var(--accent);
  font-size: 1.2rem;
}

.hero-footer {
  max-width: 440px;
}

.hero-quote {
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.8;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.auth-card {
  width: min(100%, 480px);
  padding: 34px;
  border-radius: 30px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(20, 22, 28, 0.96), rgba(14, 16, 21, 0.98));
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.auth-mobile-brand {
  display: none;
  margin-bottom: 18px;
  text-align: center;
}

.auth-card-header {
  margin-bottom: 22px;
}

.auth-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 500;
  line-height: 1;
}

.auth-subtitle {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 0.96rem;
  line-height: 1.75;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.auth-tab {
  min-height: 48px;
  border-radius: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

.auth-tab.active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.auth-form.active {
  display: flex;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.form-input,
.profile-input {
  min-height: 52px;
  width: 100%;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  transition: all var(--transition);
}

.form-input::placeholder,
.profile-input::placeholder,
#answer-input::placeholder {
  color: var(--text-faint);
}

.form-input:focus,
.profile-input:focus,
#answer-input:focus {
  border-color: var(--accent-ring);
  box-shadow: 0 0 0 4px rgba(214, 181, 138, 0.08);
}

.auth-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.auth-hint,
.auth-note,
.auth-legal {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.7;
}

.auth-link-btn,
.auth-legal-link {
  color: var(--accent-strong);
}

.auth-link-btn {
  padding: 0;
  font-size: 0.84rem;
}

.auth-message {
  display: none;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.auth-message.error {
  background: rgba(226, 121, 121, 0.1);
  color: var(--error);
  border: 1px solid rgba(226, 121, 121, 0.22);
}

.auth-message.success {
  background: rgba(113, 199, 140, 0.1);
  color: var(--success);
  border: 1px solid rgba(113, 199, 140, 0.22);
}

/* =========================================================
   Dashboard
   ========================================================= */

.dashboard-page {
  padding-top: 34px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 22px;
  margin-bottom: 28px;
}

.dashboard-hero-copy,
.hero-mini-card,
.dashboard-side-card,
.history-side-card,
.profile-side-card,
.insight-intro-card {
  border-radius: 28px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(16, 18, 24, 0.98) 100%);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}

.dashboard-hero-copy {
  padding: 34px 34px 30px;
}

.dashboard-hero-side {
  display: flex;
}

.hero-mini-card {
  width: 100%;
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-mini-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-mini-title {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
}

.hero-mini-text {
  margin: 12px 0 0;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.75;
}

.greeting-time {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.greeting-main {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.3rem);
  line-height: 0.96;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.greeting-main span {
  color: var(--accent-strong);
  font-style: italic;
}

.greeting-sub {
  max-width: 620px;
  margin: 16px 0 0;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.8;
}

.dashboard-main-cta {
  margin-bottom: 26px;
}

.session-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 32px;
  border-radius: 28px;
  border: 1px solid rgba(214, 181, 138, 0.14);
  background:
    radial-gradient(circle at left top, rgba(214, 181, 138, 0.1), transparent 40%),
    linear-gradient(180deg, rgba(23, 19, 15, 0.72), rgba(20, 16, 14, 0.9));
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition), border var(--transition);
}

.session-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(214, 181, 138, 0.24);
}

.session-cta-large {
  min-height: 154px;
}

.cta-label {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cta-title {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 0.98;
  font-weight: 500;
}

.cta-desc {
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 0.98rem;
  line-height: 1.8;
}

.cta-arrow {
  color: var(--accent-strong);
  font-size: 2.2rem;
  flex-shrink: 0;
}

.dashboard-stats-section {
  margin-bottom: 24px;
}

.stats-row,
.insights-stats {
  display: grid;
  gap: 16px;
}

.stats-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.insights-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 28px;
}

.stat-card {
  padding: 24px 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(16, 18, 24, 0.98) 100%);
  text-align: left;
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 0.95;
}

.stat-label {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dashboard-content-grid,
.history-layout,
.profile-layout {
  display: grid;
  gap: 22px;
}

.dashboard-content-grid {
  grid-template-columns: minmax(0, 1.2fr) 320px;
  align-items: start;
}

.dashboard-column,
.history-list-wrap,
.profile-main-column {
  min-width: 0;
}

.dashboard-side-panel,
.history-side-info,
.profile-side-column {
  display: grid;
  gap: 18px;
}

.dashboard-side-card,
.history-side-card,
.profile-side-card,
.insight-intro-card {
  padding: 24px;
}

.side-card-btn {
  margin-top: 18px;
}

.answer-card {
  padding: 20px 22px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(16, 18, 24, 0.98) 100%);
  margin-bottom: 14px;
  transition: transform var(--transition), border var(--transition), background var(--transition);
}

.answer-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.answer-card-question {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.6;
  font-style: italic;
}

.answer-card-preview {
  margin-top: 10px;
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.8;
}

.answer-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* =========================================================
   History
   ========================================================= */

.history-toolbar {
  margin-bottom: 20px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.88rem;
  transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  color: var(--text);
  border-color: rgba(214, 181, 138, 0.24);
  background: rgba(214, 181, 138, 0.08);
}

.history-layout {
  grid-template-columns: minmax(0, 1.1fr) 300px;
}

.session-card {
  padding: 22px 24px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(16, 18, 24, 0.98) 100%);
  margin-bottom: 14px;
  transition: transform var(--transition), border var(--transition);
  cursor: pointer;
}

.session-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

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

.session-date {
  font-size: 0.98rem;
  color: var(--text);
}

.session-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-completed {
  color: var(--success);
  background: rgba(113, 199, 140, 0.12);
}

.status-in_progress {
  color: var(--info);
  background: rgba(123, 169, 246, 0.12);
}

.status-abandoned {
  color: var(--error);
  background: rgba(226, 121, 121, 0.12);
}

.session-info {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--text-muted);
  font-size: 0.84rem;
  margin-bottom: 8px;
}

.session-mood {
  color: var(--text-soft);
  font-size: 0.9rem;
}

/* Modal */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  padding: 24px;
  background: rgba(5, 6, 8, 0.76);
  backdrop-filter: blur(14px);
  align-items: center;
  justify-content: center;
}

.modal-box {
  width: min(760px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 28px;
  border-radius: 28px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(20, 22, 28, 0.98), rgba(13, 15, 19, 0.98));
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
}

.modal-close {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
}

.modal-close:hover {
  color: var(--text);
}

.modal-session-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.84rem;
}

.modal-answer-item {
  padding: 0 0 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.modal-answer-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.modal-question-label {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.modal-question {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--text-soft);
  font-style: italic;
}

.modal-answer {
  margin-top: 14px;
  color: var(--text);
  font-size: 0.97rem;
  line-height: 1.9;
  white-space: pre-wrap;
}

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

/* =========================================================
   Insights
   ========================================================= */

.insights-intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 22px;
}

.insights-main-wrap {
  min-width: 0;
}

.insights-section {
  margin-bottom: 28px;
}

.commentary-list {
  display: grid;
  gap: 12px;
}

.commentary-item {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surface) 0%, rgba(16, 18, 24, 0.98) 100%);
  border: 1px solid var(--border);
}

.commentary-dot {
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1.2;
}

.commentary-item p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.94rem;
  line-height: 1.8;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.theme-chip,
.emotion-chip {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(16, 18, 24, 0.98) 100%);
}

.theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
}

.theme-chip-label {
  color: var(--text);
  font-size: 0.9rem;
}

.theme-chip-count {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.emotion-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
  padding: 12px 14px;
  border-radius: 16px;
  color: var(--text);
  font-size: 0.9rem;
}

.emotion-bar {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.emotion-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.week-chart {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 120px;
  padding: 12px 6px 0;
}

.week-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.week-bar {
  width: 100%;
  max-width: 34px;
  min-height: 6px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, var(--accent-strong) 0%, var(--accent) 100%);
}

.week-label {
  color: var(--text-muted);
  font-size: 0.74rem;
}

/* =========================================================
   Profile
   ========================================================= */

.profile-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
}

.profile-section {
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(16, 18, 24, 0.98) 100%);
  margin-bottom: 18px;
}

.profile-section-title {
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.profile-section-title-danger {
  color: var(--error);
}

.profile-field {
  margin-bottom: 16px;
}

.profile-field:last-child {
  margin-bottom: 0;
}

.profile-field-label {
  color: var(--text-muted);
  font-size: 0.76rem;
  margin-bottom: 6px;
}

.profile-field-value {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
}

.profile-input-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.profile-message {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
}

.profile-message.success {
  background: rgba(113, 199, 140, 0.1);
  color: var(--success);
}

.profile-message.error {
  background: rgba(226, 121, 121, 0.1);
  color: var(--error);
}

.profile-message.info {
  background: rgba(123, 169, 246, 0.1);
  color: var(--info);
}

.danger-zone {
  border-color: rgba(226, 121, 121, 0.18);
}

/* =========================================================
   Session
   ========================================================= */

.session-page {
  width: min(var(--container-narrow), calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 88px;
}

.session-frame {
  border-radius: 30px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(18, 20, 26, 0.98), rgba(12, 14, 19, 0.98));
  box-shadow: var(--shadow-lg);
  padding: 28px;
}

.session-frame-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}

.session-page-title {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1;
  font-weight: 500;
}

.session-page-subtitle {
  max-width: 580px;
  margin: 12px 0 0;
  color: var(--text-soft);
  font-size: 0.98rem;
  line-height: 1.75;
}

.session-frame-note {
  width: 240px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.session-note-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.session-note-text {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.7;
}

.session-start,
.question-screen,
.session-complete {
  padding: 18px 6px 4px;
}

.session-start {
  text-align: center;
}

.session-start-icon,
.complete-icon {
  color: var(--accent-strong);
  font-size: 3.4rem;
  line-height: 1;
}

.session-start h2,
.session-complete h2 {
  margin: 18px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  font-weight: 500;
}

.session-start p,
.complete-subtitle {
  max-width: 560px;
  margin: 14px auto 0;
  color: var(--text-soft);
  font-size: 0.98rem;
  line-height: 1.8;
}

.mood-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 28px 0 26px;
}

.mood-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
}

.mood-btn:hover,
.mood-btn.selected {
  color: var(--text);
  border-color: rgba(214, 181, 138, 0.24);
  background: rgba(214, 181, 138, 0.08);
}

.question-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}

.question-progress {
  flex: 1;
  display: flex;
  gap: 12px;
  align-items: center;
}

.progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.progress-text {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.question-category {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(214, 181, 138, 0.08);
  color: var(--accent-strong);
  border: 1px solid rgba(214, 181, 138, 0.16);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.question-number {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.question-text {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.question-hint {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.8;
  font-style: italic;
}

.answer-area {
  margin-top: 28px;
  margin-bottom: 20px;
}

#answer-input {
  width: 100%;
  min-height: 260px;
  padding: 20px 20px;
  border-radius: 20px;
  resize: vertical;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.95;
}

.answer-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 4px 0;
}

.word-counter,
.autosave-status {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.question-actions,
.complete-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-error {
  display: none;
  margin-top: 12px;
  color: var(--error);
  font-size: 0.9rem;
}

.complete-actions {
  justify-content: center;
  margin-top: 28px;
}

/* =========================================================
   Loading / empty / error
   ========================================================= */

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 74px 20px;
}

.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  animation: pulse 1.15s ease-in-out infinite;
}

.loading-dot:nth-child(2) {
  animation-delay: 0.16s;
}

.loading-dot:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes pulse {
  0%, 80%, 100% {
    transform: scale(0.85);
    opacity: 0.25;
  }
  40% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.empty-state,
.error-state {
  padding: 70px 24px;
  text-align: center;
}

.empty-icon {
  color: var(--text-faint);
  font-size: 2.6rem;
  margin-bottom: 12px;
}

.empty-state p,
.error-state p {
  margin: 0 0 10px;
  color: var(--text-soft);
  line-height: 1.8;
}

/* =========================================================
   Scrollbar / selection
   ========================================================= */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.14);
}

::selection {
  background: rgba(214, 181, 138, 0.18);
  color: var(--text);
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1100px) {
  .dashboard-content-grid,
  .history-layout,
  .profile-layout,
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .page-header-spacious,
  .session-frame-top {
    flex-direction: column;
  }

  .session-frame-note,
  .page-meta-card {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    display: none;
  }

  .auth-panel {
    min-height: 100vh;
    padding: 24px;
  }

  .auth-mobile-brand {
    display: block;
  }

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

  .insights-intro-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .app-nav {
    width: calc(100% - 24px);
  }

  .nav-links {
    gap: 4px;
  }

  .nav-link {
    padding: 0 10px;
  }

  .nav-link span:not(.nav-icon) {
    display: none;
  }

  .page,
  .session-page {
    width: calc(100% - 24px);
  }

  .auth-card,
  .session-frame,
  .dashboard-hero-copy,
  .hero-mini-card,
  .dashboard-side-card,
  .history-side-card,
  .profile-side-card,
  .insight-intro-card,
  .stat-card,
  .session-card,
  .profile-section,
  .modal-box {
    padding-left: 18px;
    padding-right: 18px;
  }

  .stats-row,
  .insights-stats {
    grid-template-columns: 1fr;
  }

  .profile-input-row,
  .auth-row,
  .question-actions {
    flex-direction: column;
    align-items: stretch;
  }

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

  .modal-overlay {
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .page-title,
  .greeting-main,
  .hero-title,
  .question-text,
  .session-page-title {
    letter-spacing: -0.01em;
  }

  .auth-card {
    padding: 22px 16px;
    border-radius: 24px;
  }

  .session-cta {
    padding: 24px 20px;
  }

  .cta-arrow {
    font-size: 1.8rem;
  }
}