/* =====================================================
   Together — Full Stylesheet
   ===================================================== */

/* ----- CSS Custom Properties ----- */
:root {
  --primary: #EC1F77;
  --primary-dark: #C4145D;
  --primary-light: #F0427E;
  --primary-pale: #FDEAF4;
  --accent: #1966E8;
  --accent-light: #4D8FFF;
  --accent-pale: #EEF3FF;
  --bg: #F7F7F9;
  --bg-dark: #1A1A22;
  --surface: #FFFFFF;
  --surface-alt: #F0F0F2;
  --text: #111111;
  --text-light: #555555;
  --text-muted: #AAAAAA;
  --text-inverse: #FFFFFF;
  --border: #E4E4E8;
  --border-light: #F0F0F4;
  --success: #00B894;
  --warning: #FDCB6E;
  --danger: #D63031;
  --danger-light: #FFF0F0;
  --user-bubble: #EC1F77;
  --user-bubble-text: #FFFFFF;
  --ai-bubble: #F0F0F2;
  --ai-bubble-text: #111111;
  --partner-bubble: #1966E8;
  --partner-bubble-text: #FFFFFF;
  --system-bubble: #F5F5F7;
  --system-bubble-text: #555555;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --header-h: 56px;
  --nav-h: 64px;
  --input-h: 56px;
}

/* ----- Reset ----- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--accent); text-decoration: none; }

/* ----- Utilities ----- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  border: 0;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover:not(:disabled) {
  background: var(--primary-pale);
}
.btn-ghost {
  background: transparent;
  color: var(--text-light);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-alt);
}
.btn-danger {
  background: var(--danger);
  color: var(--text-inverse);
}
.btn-danger:hover:not(:disabled) {
  background: #c0392b;
}
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* ----- Forms ----- */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}
.form-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--danger-light);
  color: var(--danger);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
}

/* =====================================================
   LANDING PAGE
   ===================================================== */

.landing-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}
.landing-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.hero {
  padding: 120px 0 80px;
  background: linear-gradient(150deg, #FFFFFF 0%, #FEF0F6 55%, #EEF3FF 100%);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  background: var(--primary-pale);
  color: var(--primary-dark);
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: 3.25rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 20px;
}
.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 520px;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-note {
  margin-top: 16px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.hero-visual {
  display: flex;
  justify-content: center;
}
.phone-mockup {
  width: 280px;
  background: var(--bg-dark);
  border-radius: 36px;
  padding: 16px 12px;
  box-shadow: var(--shadow-lg);
}
.phone-screen {
  background: var(--surface);
  border-radius: 24px;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 320px;
}
.mock-msg {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.8125rem;
  line-height: 1.5;
  max-width: 85%;
  animation: fadeInUp 0.5s ease both;
}
.mock-msg:nth-child(2) { animation-delay: 0.3s; }
.mock-msg:nth-child(3) { animation-delay: 0.6s; }
.mock-ai {
  background: var(--ai-bubble);
  color: var(--ai-bubble-text);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.mock-user {
  background: var(--user-bubble);
  color: var(--user-bubble-text);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.section {
  padding: 80px 0;
}
.section-alt {
  background: var(--surface);
}
.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
}
.section-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 1.0625rem;
  margin-bottom: 48px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.step {
  text-align: center;
  padding: 32px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}
.step.visible {
  opacity: 1;
  transform: translateY(0);
}
.step-number {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: var(--text-inverse);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.step h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.step p {
  font-size: 0.9375rem;
  color: var(--text-light);
  line-height: 1.6;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.feature-card {
  padding: 32px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}
.feature-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.feature-icon--private  { background: var(--primary-pale); color: var(--primary); }
.feature-icon--softener { background: var(--accent-pale); color: var(--accent); }
.feature-icon--mediation{ background: #FFF8E1; color: #F9A825; }

.feature-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.feature-card p {
  font-size: 0.9375rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 16px;
}
.feature-list {
  list-style: none;
  font-size: 0.875rem;
  color: var(--text-light);
}
.feature-list li {
  padding: 4px 0;
  padding-left: 20px;
  position: relative;
}
.feature-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

.privacy-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 60px;
  align-items: center;
}
.privacy-list {
  list-style: none;
}
.privacy-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.5s ease;
}
.privacy-list li.visible {
  opacity: 1;
  transform: translateX(0);
}
.privacy-list li:last-child { border-bottom: none; }
.privacy-list strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}
.privacy-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}
.shield-icon {
  opacity: 0.15;
}

.cta-section {
  background: linear-gradient(150deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--text-inverse);
  text-align: center;
}
.cta-inner h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.cta-inner p {
  font-size: 1.0625rem;
  opacity: 0.9;
  margin-bottom: 28px;
}
.cta-install-guide {
  margin-top: 24px;
  font-size: 0.8125rem;
  opacity: 0.7;
}
.cta-install-guide p { margin: 4px 0; }

.landing-footer {
  padding: 24px 0;
  border-top: 1px solid var(--border-light);
  background: var(--surface);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.install-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(16, 22, 24, 0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(8px);
}
.install-overlay-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.install-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 0;
}
.install-overlay-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--text-light);
  font-size: 1rem;
}
.install-overlay-body {
  padding: 20px 22px 24px;
}
.install-overlay-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--primary-pale);
  color: var(--primary-dark);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.install-overlay-body h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.install-overlay-body p {
  color: var(--text-light);
  margin-bottom: 18px;
}
.install-steps {
  margin-left: 18px;
  margin-bottom: 22px;
  color: var(--text);
}
.install-steps li {
  margin-bottom: 10px;
}
.install-overlay-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero h1 { font-size: 2.5rem; }
  .hero-visual { order: -1; }
  .steps, .features { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .privacy-grid { grid-template-columns: 1fr; }
  .privacy-visual { display: none; }
}
@media (max-width: 600px) {
  .hero { padding: 100px 0 60px; }
  .hero h1 { font-size: 2rem; }
  .section { padding: 60px 0; }
  .section-title { font-size: 1.5rem; }
  .landing-header-inner { padding: 0 16px; }
  .container { padding: 0 16px; }
  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}

/* =====================================================
   APP STYLES
   ===================================================== */

.install-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--primary);
  color: var(--text-inverse);
  padding: 10px 16px;
  font-size: 0.875rem;
}
.install-banner-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
}
.install-banner span { flex: 1; }

.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--danger);
  color: var(--text-inverse);
  padding: 10px 16px;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.screen {
  min-height: 100vh;
  min-height: 100dvh;
}
.auth-container {
  max-width: 420px;
  margin: 0 auto;
  padding: 60px 24px;
}
.auth-header {
  text-align: center;
  margin-bottom: 40px;
}
.auth-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 12px;
}
.auth-step h2 {
  font-size: 1.375rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.auth-step p {
  color: var(--text-light);
  margin-bottom: 24px;
  font-size: 0.9375rem;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.role-badge {
  display: inline-block;
  padding: 6px 14px;
  background: var(--primary-pale);
  color: var(--primary-dark);
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.profile-preview {
  padding: 14px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-light);
  white-space: pre-wrap;
}

#app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 16px;
}
#view-title {
  flex: 1;
  font-size: 1.125rem;
  font-weight: 600;
  text-align: center;
}
.header-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.header-btn:hover { background: var(--surface-alt); }

#app-content {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: var(--nav-h);
  overflow: hidden;
}
.view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#mediation-chat {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#mediation-messages {
  min-height: 0;
}

.mode-subnav {
  display: flex;
  gap: 8px;
  padding: 12px 16px 0;
  background: var(--bg);
}
.mode-subnav-btn {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-light);
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
}
.mode-subnav-btn.active {
  background: var(--primary);
  color: var(--text-inverse);
  border-color: var(--primary);
}
.readonly-banner {
  margin: 12px 16px 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--system-bubble);
  color: var(--system-bubble-text);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 500;
}

.message-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.9375rem;
  line-height: 1.55;
  word-wrap: break-word;
  position: relative;
}
.msg-user {
  align-self: flex-end;
  background: var(--user-bubble);
  color: var(--user-bubble-text);
  border-bottom-right-radius: 4px;
}
.msg-ai {
  align-self: flex-start;
  background: var(--ai-bubble);
  color: var(--ai-bubble-text);
  border-bottom-left-radius: 4px;
}
.msg-partner {
  align-self: flex-start;
  background: var(--partner-bubble);
  color: var(--partner-bubble-text);
  border-bottom-left-radius: 4px;
}
.msg-system {
  align-self: center;
  max-width: 90%;
  background: var(--system-bubble);
  color: var(--system-bubble-text);
  border: 1px solid var(--border);
}
.msg-sender {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.7;
  margin-bottom: 4px;
}
.msg-time {
  font-size: 0.6875rem;
  opacity: 0.5;
  margin-top: 4px;
}
.msg-original {
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.08);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-style: italic;
  opacity: 0.8;
}
.msg-original-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 2px;
  font-style: normal;
}

.msg-mediation-user {
  align-self: flex-end;
  background: var(--user-bubble);
  color: var(--user-bubble-text);
  border-bottom-right-radius: 4px;
}
.msg-mediation-partner {
  align-self: flex-start;
  background: var(--partner-bubble);
  color: var(--partner-bubble-text);
  border-bottom-left-radius: 4px;
}

.admin-message-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.admin-message-card-own {
  border-left: 4px solid var(--primary);
}
.admin-message-card-partner {
  border-left: 4px solid var(--accent);
}
.admin-message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.admin-message-sender {
  font-size: 0.875rem;
  font-weight: 700;
}
.admin-message-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.admin-message-section {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
}
.admin-message-section--original {
  background: var(--accent-pale);
}
.admin-message-section--softened {
  background: var(--primary-pale);
}
.admin-message-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
  color: var(--text-light);
}

.msg-text p {
  margin: 0 0 0.85em 0;
}

.msg-text p:last-child {
  margin-bottom: 0;
}

.msg-text strong {
  font-weight: 600;
}

.msg-text em {
  font-style: italic;
}

.msg-text ul,
.msg-text ol {
  margin: 0.75em 0;
  padding-left: 1.25em;
  list-style-position: outside;
}

.msg-text ul:last-child,
.msg-text ol:last-child {
  margin-bottom: 0;
}

.msg-text li {
  margin: 0.25em 0;
}

.msg-text br + br {
  display: block;
  content: "";
  margin-top: 0.7em;
}
.msg-text p {
  margin: 0 0 0.85em 0;
}

.msg-text p:last-child {
  margin-bottom: 0;
}


.msg-text-streaming::after {
  content: '▎';
  display: inline-block;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

.typing-indicator {
  padding: 8px 16px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.typing-dots {
  display: inline-flex;
  gap: 3px;
}
.typing-dots i {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite;
}
.typing-dots i:nth-child(2) { animation-delay: 0.2s; }
.typing-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

.input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border-light);
}
.input-bar input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 24px;
  background: var(--bg);
  font-size: 0.9375rem;
  color: var(--text);
  transition: border-color 0.2s;
}
.input-bar input:focus {
  outline: none;
  border-color: var(--primary);
}
.send-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--primary);
  color: var(--text-inverse);
  border-radius: 50%;
  transition: background 0.2s;
  flex-shrink: 0;
}
.send-btn:hover { background: var(--primary-dark); }
.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-btn svg { transition: color 0.2s; }
.nav-btn.active {
  color: var(--primary);
}
.nav-btn.active svg {
  stroke: var(--primary);
}

.thread-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}
.thread-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}
.thread-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.thread-item-title {
  font-weight: 600;
  font-size: 0.9375rem;
}
.thread-item-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.thread-empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.thread-empty svg {
  margin: 0 auto 16px;
  opacity: 0.3;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-large { max-width: 540px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
}
.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--surface-alt);
  border-radius: 50%;
  font-size: 1rem;
  color: var(--text-light);
  transition: background 0.2s;
}
.modal-close:hover { background: var(--border); }
.modal-body {
  padding: 20px 24px 24px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}
.setting-info strong {
  display: block;
  font-size: 0.9375rem;
  margin-bottom: 2px;
}
.setting-info span {
  font-size: 0.8125rem;
  color: var(--text-light);
}
.setting-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 8px 0;
}

.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 28px;
  transition: 0.3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: var(--shadow-sm);
}
.toggle input:checked + .toggle-slider {
  background: var(--primary);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state svg {
  margin: 0 auto 16px;
  opacity: 0.3;
}
.empty-state p {
  font-size: 0.9375rem;
}

.boot-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  color: var(--text-light);
}

@media (max-width: 600px) {
  .auth-container { padding: 40px 20px; }
  .msg { max-width: 88%; }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  }
  #app-content {
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  }
}