/* ============================================================
   AskSock — stylesheet
   Mobile-first, no external dependencies.
   ============================================================ */

:root {
  --color-bg:         #fafaf8;
  --color-surface:    #ffffff;
  --color-border:     #e8e6e1;
  --color-primary:    #5b4fcf;
  --color-primary-dk: #4a3fb8;
  --color-text:       #1a1a2e;
  --color-text-soft:  #6b7280;
  --color-user-bg:    #5b4fcf;
  --color-user-text:  #ffffff;
  --color-sock-bg:    #ffffff;
  --color-sock-text:  #1a1a2e;
  --color-error:      #dc2626;
  --radius:           12px;
  --radius-sm:        8px;
  --font:             'OpenDyslexic', system-ui, -apple-system, sans-serif;
  --nav-height:       56px;
  --letter-spacing:   normal;
  --line-height:      1.6;
}

/* ── Reading preference overrides ────────────────────────────── */

/* Font */
body.system-font { --font: system-ui, -apple-system, sans-serif; }

/* Colour overlays — tint the background to reduce visual stress */
body.overlay-cream    { --color-bg: #fefef0; --color-surface: #fffff8; }
body.overlay-rose     { --color-bg: #fff0f0; --color-surface: #fffafa; }
body.overlay-peach    { --color-bg: #fff5f0; --color-surface: #fffaf8; }
body.overlay-sand     { --color-bg: #faf8f0; --color-surface: #fefcf5; }
body.overlay-mint     { --color-bg: #f0fff6; --color-surface: #f8fffb; }
body.overlay-sky      { --color-bg: #f0f8ff; --color-surface: #f8fbff; }
body.overlay-lavender { --color-bg: #f5f0ff; --color-surface: #fbf8ff; }

/* Dark theme */
body.theme-dark {
  --color-bg:        #0f0f1a;
  --color-surface:   #1a1a2e;
  --color-border:    #2d2d52;
  --color-text:      #e8e6f0;
  --color-text-soft: #9ca3af;
  --color-sock-bg:   #1a1a2e;
  --color-sock-text: #e8e6f0;
  --color-user-bg:   #6d5fd8;
}

/* High contrast */
body.theme-hc {
  --color-bg:        #000000;
  --color-surface:   #0a0a0a;
  --color-border:    #ffffff;
  --color-text:      #ffffff;
  --color-text-soft: #dddddd;
  --color-primary:   #a090f0;
  --color-sock-bg:   #0a0a0a;
  --color-sock-text: #ffffff;
  --color-user-bg:   #5b4fcf;
  --color-user-text: #ffffff;
}

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

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  line-height: var(--line-height);
  letter-spacing: var(--letter-spacing);
}

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

/* ── Navigation ──────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.nav-logo-img {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.nav-link:hover { color: var(--color-text); }

/* Preferences select (voice picker) */
.prefs-select {
  width: 100%;
  padding: 0.3rem 0.5rem;
  font-size: 0.82rem;
  font-family: system-ui, -apple-system, sans-serif;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  appearance: auto;
}

.prefs-select:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

/* Pause button */
.pause-btn.paused {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ── Settings page ───────────────────────────────────────────────────────────── */

.settings-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.settings-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  color: var(--color-text);
}

.settings-section {
  margin-bottom: 2.5rem;
}

.settings-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-soft);
  font-family: system-ui, -apple-system, sans-serif;
  margin-bottom: 0.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--color-border);
}

.settings-group {
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.settings-group:last-child { border-bottom: none; }

.settings-group-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  font-family: system-ui, -apple-system, sans-serif;
}

.settings-group-desc {
  font-size: 0.82rem;
  color: var(--color-text-soft);
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  margin-bottom: 0.25rem;
}

.settings-voice-select { max-width: 320px; }

.settings-group-note {
  font-size: 0.8rem;
  color: var(--color-text-soft);
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  margin-top: 0.6rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 180, 0, 0.08);
  border-left: 3px solid rgba(255, 180, 0, 0.5);
  border-radius: 0 6px 6px 0;
}

/* Colour overlay swatches */
.overlay-swatches { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.25rem; }

.overlay-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  padding: 0;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  flex-shrink: 0;
}

.overlay-swatch:hover { border-color: var(--color-primary); transform: scale(1.1); }

.overlay-swatch.active {
  border-color: var(--color-primary);
  border-width: 3px;
  box-shadow: 0 0 0 2px rgba(91, 79, 207, 0.25);
  transform: scale(1.12);
}

.swatch-none     { background: #ffffff; background-image: repeating-linear-gradient(45deg, #ddd 0, #ddd 1px, transparent 0, transparent 50%); background-size: 6px 6px; }
.swatch-cream    { background: #fefef0; }
.swatch-rose     { background: #fff0f0; }
.swatch-peach    { background: #fff5f0; }
.swatch-sand     { background: #faf8f0; }
.swatch-mint     { background: #f0fff6; }
.swatch-sky      { background: #f0f8ff; }
.swatch-lavender { background: #f5f0ff; }

.settings-footer {
  font-size: 0.8rem;
  color: var(--color-text-soft);
  font-family: system-ui, -apple-system, sans-serif;
  margin-top: 1rem;
}

/* Reading preferences panel */
.reading-prefs-wrap { position: relative; }

.prefs-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.prefs-panel[hidden] { display: none; }

.prefs-panel-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-soft);
  font-family: system-ui, -apple-system, sans-serif;
}

.prefs-group { display: flex; flex-direction: column; gap: 0.3rem; }

.prefs-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-soft);
  font-family: system-ui, -apple-system, sans-serif;
}

.prefs-options { display: flex; gap: 0.3rem; flex-wrap: wrap; }

.prefs-btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  font-family: system-ui, -apple-system, sans-serif;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text-soft);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}

.prefs-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.prefs-btn.active {
  border-color: var(--color-primary);
  background: rgba(91, 79, 207, 0.1);
  color: var(--color-primary);
  font-weight: 600;
}

/* ── Main wrapper ────────────────────────────────────────── */

.main {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, background 0.15s;
  white-space: nowrap;
}

.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary  { background: var(--color-primary);  color: #fff; }
.btn-secondary { background: var(--color-bg); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-ghost    { background: transparent; color: var(--color-text-soft); }
.btn-sm       { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-full     { width: 100%; }

/* ── Forms ───────────────────────────────────────────────── */

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.form-input {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font);
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus { border-color: var(--color-primary); }

/* ── Alerts ──────────────────────────────────────────────── */

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: #fef2f2;
  color: var(--color-error);
  border: 1px solid #fecaca;
}

/* ── Auth pages ──────────────────────────────────────────── */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.auth-logo { margin-bottom: 0.5rem; }

.auth-logo-img {
  width: 180px;
  height: auto;
}

.auth-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.auth-subtitle {
  color: var(--color-text-soft);
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
}

.auth-note {
  margin-top: 1.25rem;
  font-size: 0.82rem;
  color: var(--color-text-soft);
}

/* ── Dashboard ───────────────────────────────────────────── */

.dashboard {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.dashboard-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.search-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.search-input { flex: 1; }

.search-results-note {
  font-size: 0.9rem;
  color: var(--color-text-soft);
  margin-bottom: 1rem;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.session-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.session-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(91, 79, 207, 0.1);
}

.session-card-icon { font-size: 1.5rem; flex-shrink: 0; }

.session-card-body { flex: 1; min-width: 0; }

.session-card-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-card-subject {
  font-size: 0.85rem;
  color: var(--color-primary);
  margin-bottom: 0.2rem;
}

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

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--color-text-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* ── Chat layout ─────────────────────────────────────────── */

.chat-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--nav-height));
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}

/* Sock intro card */
.sock-intro {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
}

.sock-intro-icon { font-size: 1.75rem; flex-shrink: 0; }
.sock-intro-text { font-size: 0.95rem; line-height: 1.6; }

/* Message bubbles */
.message {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.message-user {
  flex-direction: row-reverse;
}

.message-avatar { font-size: 1.4rem; flex-shrink: 0; }
.avatar-img { height: 36px; width: auto; }

.message-bubble {
  max-width: 75%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message-user .message-bubble {
  background: var(--color-user-bg);
  color: var(--color-user-text);
  border-radius: var(--radius) var(--radius-sm) var(--radius) var(--radius);
}

.message-assistant .message-bubble {
  background: var(--color-sock-bg);
  color: var(--color-sock-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm) var(--radius) var(--radius) var(--radius);
}

/* Typing dots animation */
.typing-dots span {
  animation: blink 1.2s infinite;
  font-size: 1.4rem;
  line-height: 1;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0; }
  40%           { opacity: 1; }
}

/* Input bar */
.chat-input-bar {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 0.75rem 1.25rem 1rem;
}

.chat-form {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
  max-width: 760px;
  margin: 0 auto;
}

.chat-input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  resize: none;
  max-height: 160px;
  overflow-y: auto;
  line-height: 1.5;
  transition: border-color 0.15s;
}

.chat-input:focus { border-color: var(--color-primary); }

.send-btn { flex-shrink: 0; align-self: flex-end; }

/* Icon-only buttons (mic + TTS toggle) */
.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--color-border);
  color: var(--color-text-soft);
  flex-shrink: 0;
  align-self: flex-end;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.btn-icon svg { width: 16px; height: 16px; }

.btn-icon:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-icon.active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(91, 79, 207, 0.07);
}

/* Mic button — dimmed when browser blocks the API */
.mic-btn.unavailable { opacity: 0.4; cursor: help; }

/* Mic button — spinner while transcribing */
.mic-btn.processing {
  border-color: var(--color-primary);
  color: var(--color-primary);
  animation: mic-spin 1s linear infinite;
}

@keyframes mic-spin {
  to { transform: rotate(360deg); }
}

/* Mic button — pulsing ring when listening */
.mic-btn.listening {
  border-color: #dc2626;
  color: #dc2626;
  animation: mic-pulse 1.2s ease-in-out infinite;
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

.chat-hint-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.4rem;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.chat-hint {
  font-size: 0.78rem;
  color: var(--color-text-soft);
  flex: 1;
  text-align: center;
}

.btn-summary {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-soft);
  font-size: 0.75rem;
  font-family: system-ui, -apple-system, sans-serif;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}

.btn-summary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-summary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Session summary message — rendered as a distinct assistant card */
.message-summary .message-bubble {
  background: rgba(91, 79, 207, 0.06);
  border: 1px solid rgba(91, 79, 207, 0.25);
  font-size: 0.9rem;
}

/* Assistant message body wrapper */
.message-assistant .message-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.message-actions {
  display: flex;
  gap: 0.4rem;
}

.msg-speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  background: transparent;
  color: var(--color-text-soft);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}

.msg-speak-btn svg { width: 13px; height: 13px; }

.msg-speak-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Markdown rendered inside assistant bubbles */
.message-assistant .message-bubble p { margin-bottom: 0.6em; }
.message-assistant .message-bubble p:last-child { margin-bottom: 0; }
.message-assistant .message-bubble ul,
.message-assistant .message-bubble ol { padding-left: 1.4em; margin-bottom: 0.6em; }
.message-assistant .message-bubble li { margin-bottom: 0.25em; }
.message-assistant .message-bubble strong { font-weight: 700; }
.message-assistant .message-bubble em { font-style: italic; }
.message-assistant .message-bubble code {
  background: rgba(0,0,0,0.06);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-family: monospace;
  font-size: 0.9em;
}
.message-assistant .message-bubble pre {
  background: rgba(0,0,0,0.06);
  border-radius: var(--radius-sm);
  padding: 0.75em 1em;
  overflow-x: auto;
  margin-bottom: 0.6em;
}
.message-assistant .message-bubble pre code { background: none; padding: 0; }
.message-assistant .message-bubble h1,
.message-assistant .message-bubble h2,
.message-assistant .message-bubble h3 {
  font-weight: 700;
  margin-bottom: 0.4em;
  line-height: 1.3;
}

/* ── Audio mode overlay ──────────────────────────────────────────────────────── */

.audio-overlay {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 2rem;
  padding: 3rem 2rem;
  text-align: center;
}

.audio-status {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-text);
  min-height: 2em;
}

.audio-big-btn {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid var(--color-primary);
  background: transparent;
  color: var(--color-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.audio-big-btn svg { width: 40px; height: 40px; }

.audio-big-btn:hover {
  background: rgba(91, 79, 207, 0.08);
}

.audio-big-btn:active { transform: scale(0.96); }

.audio-big-btn.listening {
  border-color: #e53e3e;
  color: #e53e3e;
  animation: pulse-ring 1.5s ease-out infinite;
}

.audio-big-btn.thinking {
  border-color: var(--color-text-soft);
  color: var(--color-text-soft);
  cursor: default;
}

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.4); }
  70%  { box-shadow: 0 0 0 16px rgba(229, 62, 62, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 62, 62, 0); }
}

.audio-transcript-btn {
  background: none;
  border: none;
  color: var(--color-text-soft);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.audio-transcript-btn:hover { color: var(--color-text); }

/* ── File attachment preview (above input form) ───────────────────────────── */

.file-preview {
  display: none;
  max-width: 760px;
  margin: 0 auto 0.5rem;
}

.file-preview-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-bg);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
  font-size: 0.82rem;
  color: var(--color-text);
  font-family: system-ui, -apple-system, sans-serif;
  max-width: 100%;
}

.file-preview-thumb {
  height: 36px;
  width: auto;
  max-width: 56px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.file-preview-name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-clear {
  background: none;
  border: none;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-soft);
  padding: 0 0.1rem;
  flex-shrink: 0;
}

.file-preview-clear:hover { color: var(--color-error); }

/* Attachment inside user message bubble */
.message-attachment {
  margin-bottom: 0.4rem;
}

.message-attachment img {
  max-width: 220px;
  max-height: 160px;
  border-radius: var(--radius-sm);
  display: block;
}

.message-attachment-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-family: system-ui, -apple-system, sans-serif;
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
}

/* YouTube video embed */
.video-embed {
  margin-top: 0.75rem;
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.video-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 480px) {
  .auth-card { padding: 2rem 1.25rem; }
  .message-bubble { max-width: 88%; }
  .dashboard-header h1 { font-size: 1.25rem; }
}
