/* ========================================
   Semantic Prompt Compiler — Dark Theme
   ======================================== */

/* --- CSS Variables --- */
:root {
  --bg-body: #0f1117;
  --bg-card: rgba(22, 25, 37, 0.85);
  --bg-card-border: rgba(255, 255, 255, 0.06);
  --bg-input: rgba(15, 17, 23, 0.7);
  --bg-input-focus: rgba(20, 22, 32, 0.9);
  --border-input: rgba(255, 255, 255, 0.1);
  --border-focus: #7c3aed;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-glow: rgba(124, 58, 237, 0.25);
  --accent-2: #06b6d4;
  --accent-2-glow: rgba(6, 182, 212, 0.2);
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--bg-card-border);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Subtle grid background */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    radial-gradient(ellipse 600px 400px at 15% 10%, rgba(124, 58, 237, 0.06), transparent),
    radial-gradient(ellipse 500px 350px at 85% 80%, rgba(6, 182, 212, 0.05), transparent);
  pointer-events: none;
  z-index: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* --- Header --- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: rgba(15, 17, 23, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bg-card-border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo h1 {
  font-size: 1.1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #c4b5fd, #7c3aed, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.session-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  border: 1px solid var(--bg-card-border);
}

/* --- Main Grid --- */
.app-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem 2rem;
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  margin-bottom: 1rem;
  transition: border-color var(--transition);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge.optional {
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  background: rgba(124, 58, 237, 0.12);
  color: #a78bfa;
  border: 1px solid rgba(124, 58, 237, 0.2);
}

/* --- Form Fields --- */
.field {
  margin-bottom: 0.85rem;
}

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

select, textarea, input[type="text"] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.88rem;
  transition: all var(--transition);
  outline: none;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

select:focus, textarea:focus, input[type="text"]:focus {
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea {
  resize: vertical;
  min-height: 60px;
}

.custom-input {
  margin-top: 0.4rem;
  border-color: var(--accent);
  background: rgba(124, 58, 237, 0.06);
}

.field-hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.7;
}

.input-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

/* --- Toggle --- */
.toggle-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: var(--transition);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: #fff;
}

.toggle input:disabled + .toggle-slider {
  opacity: 0.35;
  cursor: not-allowed;
}

/* --- Repeater Items --- */
.repeater-item {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  align-items: start;
  padding: 0.6rem;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  animation: fadeSlideIn 0.25s ease;
}

.repeater-item input {
  font-size: 0.82rem;
  padding: 0.5rem 0.6rem;
}

.repeater-actions {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  margin-top: 2px;
}

.btn-save-lib {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  transition: all var(--transition);
  opacity: 0.6;
}

.btn-save-lib:hover {
  opacity: 1;
  color: var(--accent-2);
  background: rgba(6, 182, 212, 0.1);
}

.btn-save-lib.saved {
  opacity: 1;
  color: var(--success);
}

.btn-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  transition: var(--transition);
  opacity: 0.6;
  margin-top: 2px;
}

.btn-remove:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.1);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #9333ea);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-2);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(6, 182, 212, 0.25);
}

.btn-accent {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.25);
}

.btn-accent:hover:not(:disabled) {
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px dashed rgba(255, 255, 255, 0.15);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(124, 58, 237, 0.06);
}

.btn-sm { padding: 0.45rem 0.8rem; font-size: 0.78rem; }

/* --- Chat --- */
.card-chat {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 64px;
}

.chatbox {
  flex: 1;
  min-height: 300px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 250px;
  color: var(--text-muted);
  text-align: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.chat-msg {
  margin-bottom: 0.75rem;
  animation: fadeSlideIn 0.3s ease;
}

.chat-msg .chat-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.chat-msg.agent .chat-label { color: var(--accent); }
.chat-msg.user .chat-label { color: var(--accent-2); }

.chat-msg .chat-bubble {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg.agent .chat-bubble {
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-left: 3px solid var(--accent);
}

.chat-msg.user .chat-bubble {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.15);
  border-left: 3px solid var(--accent-2);
}

.chat-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#replySection {
  margin-bottom: 0.75rem;
}

#replySection textarea {
  width: 100%;
}

/* --- Result --- */
.card-result {
  margin-top: 0;
}

.result-wrapper {
  position: relative;
}

.result-wrapper textarea {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding-right: 3rem;
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(34, 197, 94, 0.2);
}

.btn-copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.4rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-copy:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-copy.copied {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

/* --- Loading Overlay --- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 23, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 23, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--bg-card-border);
  animation: fadeSlideIn 0.2s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--bg-card-border);
}

.modal-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  transition: all var(--transition);
}

.btn-modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.modal-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
}

.modal-section {
  margin-bottom: 1.25rem;
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-section h4 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.preset-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.preset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  animation: fadeSlideIn 0.2s ease;
}

.preset-item-info {
  flex: 1;
  min-width: 0;
}

.preset-item-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}

.btn-preset-delete {
  flex-shrink: 0;
  background: none;
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: var(--font);
  font-weight: 500;
  transition: all var(--transition);
  opacity: 0.7;
}

.btn-preset-delete:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
}

.preset-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem 0;
}

/* --- Library list (expanded card style) --- */
.modal-library {
  max-width: 600px;
}

.library-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.library-card {
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  animation: fadeSlideIn 0.2s ease;
}

.library-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.library-card-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.library-card-badges {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.library-card-desc,
.library-card-prompt {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.library-card-prompt {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  -webkit-line-clamp: 3;
}

.library-card-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-top: 0.4rem;
  margin-bottom: 0.15rem;
}

.library-card.library-shared {
  border-color: rgba(124, 58, 237, 0.15);
  background: rgba(124, 58, 237, 0.04);
}

.library-card.library-shared .library-card-name {
  color: var(--accent);
}

.btn-library-delete {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  transition: all var(--transition);
  opacity: 0.5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-library-delete:hover {
  opacity: 1;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Add Picker Dropdown --- */
.add-picker-wrapper {
  position: relative;
  display: inline-block;
}

.add-picker-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 50;
  min-width: 220px;
  max-height: 260px;
  overflow-y: auto;
  background: rgba(22, 25, 37, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  animation: fadeSlideIn 0.15s ease;
}

.picker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition);
}

.picker-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.picker-new {
  color: var(--accent);
  font-weight: 500;
}

.picker-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 0.2rem 0;
}

.picker-saved-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background var(--transition);
}

.picker-saved-item:hover {
  background: rgba(124, 58, 237, 0.1);
}

.picker-saved-item .picker-s-name {
  font-size: 0.82rem;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picker-saved-item .picker-s-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picker-empty {
  padding: 0.6rem 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

/* --- Shared Library styles --- */
.picker-section-label,
.preset-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.picker-shared-item .picker-s-name {
  color: var(--accent);
}

.preset-shared {
  border-color: rgba(124, 58, 237, 0.15);
  background: rgba(124, 58, 237, 0.04);
}

/* Shared library element items in form (readonly) */
.repeater-shared input[readonly] {
  background: rgba(124, 58, 237, 0.05);
  border-color: rgba(124, 58, 237, 0.15);
  color: var(--text-secondary);
  cursor: default;
}

.repeater-shared input[readonly]:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.15);
  box-shadow: none;
}

.preset-readonly-badge {
  font-size: 0.6rem;
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: normal;
  color: var(--text-muted);
  opacity: 0.6;
}

.preset-type-badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: capitalize;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(124, 58, 237, 0.12);
  color: var(--accent);
  border: 1px solid rgba(124, 58, 237, 0.2);
}

/* --- Modal actions bar --- */
.modal-actions-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--bg-card-border);
}

.btn-syncing svg {
  animation: spin 0.7s linear infinite;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* --- Utilities --- */
.hidden { display: none !important; }

/* --- Animations --- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .app-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .card-chat {
    position: static;
  }

  .chatbox {
    max-height: 40vh;
  }
}

@media (max-width: 640px) {
  html { font-size: 14px; }

  .app-header {
    padding: 0.6rem 1rem;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .logo h1 { font-size: 0.95rem; }

  .session-badge { display: none; }

  .app-grid {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .card { padding: 1rem; }

  .repeater-item {
    grid-template-columns: 1fr;
  }

  .chat-actions {
    flex-direction: column;
  }

  .chat-actions .btn {
    width: 100%;
    justify-content: center;
  }
}
