/* --- CSS Variables & Themes --- */
:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
}

/* Dark Theme (Default) */
body.dark-theme {
  --bg-primary: #0a0f1d;
  --bg-secondary: #0f172a;
  --bg-card: rgba(19, 29, 51, 0.75);
  --bg-card-hover: rgba(26, 39, 68, 0.85);
  --bg-input: #080d19;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.25);

  --success-color: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --warning-color: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --danger-color: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.18);
}

/* Light Theme */
body.light-theme {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-input: #ffffff;
  --border-color: rgba(0, 0, 0, 0.09);
  --border-focus: #2563eb;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent-primary: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.2);

  --success-color: #059669;
  --success-bg: rgba(5, 150, 105, 0.1);
  --warning-color: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.1);
  --danger-color: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.1);

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 25px rgba(37, 99, 235, 0.12);
}

/* --- Base Resets & Layout --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(at 10% 10%, rgba(59, 130, 246, 0.07) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(139, 92, 246, 0.06) 0px, transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-wrapper {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.logo-icon {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
}

.logo-pulse {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background-color: #10b981;
  border: 2px solid var(--bg-primary);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-theme .brand-title {
  background: linear-gradient(to right, #2563eb, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Community Live Badge */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.community-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--success-color);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--success-color);
  box-shadow: 0 0 6px var(--success-color);
  animation: pulse 2s infinite;
}

.live-text {
  letter-spacing: -0.01em;
}

/* Theme Toggle Button */
.icon-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  transform: translateY(-1px);
}

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

body.dark-theme .sun-icon { display: block; }
body.dark-theme .moon-icon { display: none; }
body.light-theme .sun-icon { display: none; }
body.light-theme .moon-icon { display: block; }

/* --- Main Layout --- */
.main-content {
  flex: 1;
  padding: 2rem 1.5rem 3rem;
}

.content-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* --- Cards Common --- */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  transition: border-color var(--transition-normal);
}

/* --- Input Card --- */
.input-card {
  position: relative;
  box-shadow: var(--shadow-glow), var(--shadow-md);
}

.input-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.label-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 8px #3b82f6;
}

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

.textarea-wrapper {
  margin-bottom: 1rem;
}

textarea#textInput {
  width: 100%;
  padding: 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 120px;
  transition: all var(--transition-fast);
  outline: none;
}

textarea#textInput:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea#textInput::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.input-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.keyboard-tip {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

kbd {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* --- Buttons --- */
.btn-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

/* Direct Copy Button (For cards) */
.btn-copy {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  transition: all var(--transition-fast);
}

.btn-copy:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.btn-copy.copied {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-card-action {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-card-action:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.btn-card-danger {
  color: var(--danger-color);
}

.btn-card-danger:hover {
  background: var(--danger-bg);
  border-color: var(--danger-color);
  color: var(--danger-color);
}

/* --- Texts Section --- */
.texts-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.badge {
  background: var(--accent-glow);
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.search-box input {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.85rem 0.45rem 2.2rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  width: 180px;
  transition: all var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--border-focus);
  width: 230px;
}

.btn-text-danger {
  background: none;
  border: none;
  color: var(--danger-color);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.btn-text-danger:hover {
  background: var(--danger-bg);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.empty-icon-wrap {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.empty-icon-wrap svg {
  width: 28px;
  height: 28px;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 440px;
  line-height: 1.5;
}

/* Text Grid & Cards */
.text-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.text-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.text-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: var(--shadow-md);
  background: var(--bg-card-hover);
}

.text-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.card-time {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.card-time svg {
  width: 14px;
  height: 14px;
}

.card-expiry-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
}

.expiry-safe {
  background: var(--success-bg);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.expiry-warning {
  background: var(--warning-bg);
  color: var(--warning-color);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.expiry-danger {
  background: var(--danger-bg);
  color: var(--danger-color);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.text-card-body {
  position: relative;
}

.card-text {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
  color: var(--text-primary);
  max-height: 350px;
  overflow-y: auto;
  padding: 0.75rem;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.card-text a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card-text a:hover {
  color: var(--accent-hover);
}

.text-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.card-meta-info {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- QR Code Modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  width: 90%;
  max-width: 380px;
  box-shadow: var(--shadow-md);
  text-align: center;
  transform: scale(0.95);
  transition: transform var(--transition-fast);
}

.modal-backdrop.show .modal-card {
  transform: scale(1);
}

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

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
}

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

.qr-box {
  background: #ffffff;
  padding: 1rem;
  border-radius: var(--radius-md);
  display: inline-block;
  margin: 0 auto 1rem;
  max-width: 100%;
}

.qr-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* --- Toast Notification --- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  pointer-events: auto;
  animation: toastIn 0.25s ease-out;
}

.toast-success {
  border-left: 4px solid var(--success-color);
}

.toast-danger {
  border-left: 4px solid var(--danger-color);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Footer --- */
.app-footer {
  border-top: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  text-align: center;
  background: var(--bg-card);
  margin-top: auto;
}

.footer-container {
  max-width: 900px;
  margin: 0 auto;
}

.footer-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
}

.inline-clock {
  width: 14px;
  height: 14px;
}

/* --- Responsive Adjustments --- */
@media (max-width: 640px) {
  .header-container {
    padding: 0.75rem 1rem;
  }

  .main-content {
    padding: 1.25rem 1rem 2rem;
  }

  .card {
    padding: 1.15rem;
  }

  .btn-group {
    width: 100%;
    justify-content: space-between;
  }

  .btn-group .btn {
    flex: 1;
  }

  .mobile-hide {
    display: none !important;
  }

  .section-actions {
    width: 100%;
    justify-content: space-between;
  }

  .search-box {
    flex: 1;
  }

  .search-box input {
    width: 100%;
  }

  .search-box input:focus {
    width: 100%;
  }

  .card-actions {
    width: 100%;
    justify-content: space-between;
  }

  .btn-copy {
    flex: 1;
  }
}

.sharing-notice { color: var(--text-secondary); font-size: .85rem; line-height: 1.5; margin: 0 0 1rem; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Shared feed: readable full-width rows and a comfortable composer. */
.main-content { padding: 26px 20px 32px; }
.content-container { max-width: 1080px; gap: 24px; }
.header-container { max-width: 1120px; padding: 16px 20px; }
.brand-title { font-size: 1.4rem; }
.brand-subtitle { font-size: .85rem; }
.card.input-card { padding: 22px; }
.input-card-header { margin-bottom: 8px; }
.input-label { font-size: 1.05rem; }
.sharing-notice { font-size: .82rem; margin: 0 0 12px; }
textarea#textInput { min-height: 144px; height: 144px; padding: 14px; font-size: .95rem; line-height: 1.5; }
.file-upload-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.file-upload-row span { color: var(--text-secondary); font-size: .8rem; }
.file-upload-row [hidden] { display: none; }
.input-card-footer { margin-top: 12px; gap: 14px; }
.btn { padding: 9px 14px; font-size: .85rem; min-height: 39px; }
.input-card-footer .btn-group { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.keyboard-tip { font-size: .78rem; }
.file-picker { position: relative; cursor: pointer; white-space: nowrap; }
.file-picker input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.file-picker:focus-within { outline: 2px solid var(--accent-primary); outline-offset: 3px; }
#dropZone { border-radius: 12px; }
#dropZone.drag-over { outline: 2px dashed var(--accent-primary); outline-offset: 3px; background: var(--accent-glow); }
#dropZone.has-attachment textarea { border-color: var(--accent-primary); }
.texts-section { gap: 14px; }
.section-header { gap: 14px; }
.section-title { font-size: 1.1rem; }
.section-actions { gap: 10px; }
.search-box input { width: 280px; font-size: .85rem; }
.search-box input:focus { width: 280px; }
.text-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; }
.text-card.compact-card { padding: 14px 16px; gap: 10px; min-width: 0; border-radius: 14px; }
.compact-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; color: var(--text-secondary); font-size: .8rem; }
.share-heading-left, .share-heading-right { display: flex; align-items: center; gap: 10px; }
.share-heading-left { flex-shrink: 0; }
.share-heading-right { margin-left: auto; }
.share-id { font: 700 1.05rem var(--font-mono); color: var(--accent-primary); }
.share-heading-right button { flex: none; min-height: 32px; padding: 5px 11px; font-size: .8rem; }
.share-heading-right .symbol-button { width: 32px; padding: 6px; display: inline-flex; align-items: center; justify-content: center; }
.symbol-button svg { width: 17px; height: 17px; }
.share-heading-right .card-expiry-badge { margin: 0; padding: 3px 8px; font-size: .75rem; white-space: nowrap; }
.compact-content { min-width: 0; }
.compact-content .card-text { padding: 10px 12px; max-height: 100px; font-size: .9rem; line-height: 1.5; overflow: auto; }
.attachment { display: flex; align-items: center; gap: 14px; min-width: 0; }
.attachment-image { width: 86px; height: 62px; object-fit: cover; border-radius: 8px; }
.attachment-link { color: var(--accent-primary); font-size: .9rem; overflow-wrap: anywhere; }
.file-icon { flex-shrink: 0; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; font-size: .85rem; }
.file-caption { margin-top: 8px; font-size: .85rem; max-height: 60px; overflow: auto; }
.empty-state { padding: 30px; }
.app-footer { padding: 16px 20px; font-size: .78rem; }
@media (max-width:640px) {
  .main-content { padding: 16px 12px 24px; }
  .content-container { gap: 18px; }
  .card.input-card { padding: 16px; }
  textarea#textInput { height: 128px; min-height: 128px; }
  .input-card-footer { flex-wrap: wrap; }
  .keyboard-tip { display: none; }
  .input-card-footer .btn-group { width: 100%; gap: 7px; }
  .input-card-footer .btn-group .btn { flex: 1; justify-content: center; padding: 8px 9px; font-size: .8rem; }
  .section-actions { width: 100%; }
  .search-box { flex: 1; min-width: 0; }
  .search-box input, .search-box input:focus { width: 100%; }
  .text-card.compact-card { padding: 12px; }
  .share-heading-left, .share-heading-right { gap: 7px; }
  .compact-heading { gap: 8px; }
  .share-heading-right button { min-height: 30px; padding: 4px 8px; }
  .share-heading-right .symbol-button { width: 30px; }
}
@media (max-width:400px) {
  .share-heading-left, .share-heading-right { gap: 5px; }
  .share-id { font-size: .95rem; }
  .card-time-text { font-size: .7rem; }
  .share-heading-right .card-expiry-badge { padding: 2px 5px; font-size: .65rem; }
  .share-heading-right .symbol-button { width: 26px; padding: 4px; }
  .share-heading-right button { padding: 4px 7px; font-size: .7rem; }
  .input-card-footer .btn-group { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1000px) {
  .text-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}

#statsDialog { width: min(520px, calc(100% - 32px)); padding: 24px; background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: 18px; } #statsDialog::backdrop { background: rgba(0,0,0,.65); } .stats-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; } .stats-heading h2 { font-size: 1.2rem; } #statsContent dl { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; font-size: .85rem; } #statsContent dd { margin: 0; overflow-wrap: anywhere; } #statsContent dt, #statsContent p { color: var(--text-secondary); } #statsContent p { margin-top: 20px; font-size: .8rem; line-height: 1.6; }

#statsDialog { margin: auto; background: #101a2c; max-height: calc(100vh - 40px); overflow: auto; } body.light-theme #statsDialog { background: #fff; }
