:root {
  --primary: #e5322d;
  --primary-hover: #c92520;
  --primary-light: #fff1f0;
  --accent: #2563eb;
  --secondary: #1e293b;
  --bg-body: #f6f8fc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --info: #3b82f6;
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.12);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --max-width: 1280px;
}

[data-theme="dark"] {
  --bg-body: #090e1a;
  --bg-card: #131c31;
  --bg-subtle: #0f172a;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #26334d;
  --primary-light: rgba(229, 50, 45, 0.16);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.6);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Noto Sans KR", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-body);
  background-image:
    radial-gradient(at 15% 5%, rgba(229, 50, 45, 0.07) 0px, transparent 42%),
    radial-gradient(at 85% 12%, rgba(59, 130, 246, 0.07) 0px, transparent 42%);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .site-header {
  background: rgba(19, 28, 49, 0.88);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  font-size: 1.35rem;
  letter-spacing: -0.5px;
  color: var(--text-main);
  flex-shrink: 0;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #e5322d 0%, #ff6b6b 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(229, 50, 45, 0.35);
}

.brand span.accent {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-btn {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 0.15s ease;
}

.nav-btn:hover,
.nav-btn.active {
  color: var(--primary);
  background: var(--primary-light);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lang-select {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.15s ease;
}

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

/* Privacy Trust Banner */
.trust-bar {
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  color: #f8fafc;
  font-size: 0.81rem;
  padding: 7px 20px;
  text-align: center;
}

.trust-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #38bdf8;
  font-weight: 650;
}

/* Ad Slots Styling */
.ad-container {
  max-width: var(--max-width);
  margin: 16px auto 0;
  padding: 0 20px;
  display: flex;
  justify-content: center;
}

.ad-slot {
  width: 100%;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.ad-slot-leaderboard {
  min-height: 92px;
  max-width: 970px;
}

.ad-slot-rectangle {
  min-height: 250px;
  max-width: 336px;
  margin: 0 auto;
  position: sticky;
  top: 86px;
}

.ad-slot-infeed {
  min-height: 112px;
  max-width: 820px;
  margin: 22px auto;
}

.ad-label {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
}

.ad-placeholder-content {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.ad-placeholder-content strong {
  color: var(--text-main);
  display: block;
  margin-bottom: 3px;
}

/* Main Content Layout */
.main-container {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 64px;
  flex: 1;
}

/* Hero Section + Live Tool Search */
.hero-section {
  text-align: center;
  max-width: 860px;
  margin: 8px auto 30px;
}

.hero-title {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 12px;
  line-height: 1.22;
  background: linear-gradient(135deg, var(--text-main) 0%, #e5322d 135%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.04rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 22px;
}

.search-box-wrap {
  max-width: 580px;
  margin: 0 auto 22px;
  position: relative;
}

.tool-search-input {
  width: 100%;
  padding: 15px 46px 15px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.96rem;
  box-shadow: var(--shadow-md);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tool-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(229, 50, 45, 0.14);
}

.search-clear-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.82rem;
  display: none;
  align-items: center;
  justify-content: center;
}

.search-clear-btn.visible {
  display: flex;
}

/* Category Filter Tabs */
.category-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.cat-tab {
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 650;
  font-size: 0.9rem;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-sm);
}

.cat-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cat-tab.active {
  background: linear-gradient(135deg, #e5322d 0%, #f43f5e 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(229, 50, 45, 0.28);
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 18px;
  margin-bottom: 40px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.tool-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--primary));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--card-accent, var(--primary));
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  box-shadow: 0 8px 16px -4px rgba(15, 23, 42, 0.22);
}

.tool-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.tool-badge.hot {
  background: #fee2e2;
  color: #dc2626;
}

.tool-badge.new {
  background: #dbeafe;
  color: #1d4ed8;
}

.tool-card h3 {
  font-size: 1.13rem;
  font-weight: 780;
  color: var(--text-main);
}

.tool-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.52;
  flex: 1;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.83rem;
  font-weight: 750;
  color: var(--primary);
  margin-top: 4px;
}

.empty-search-box {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
}

/* Active Converter Workspace View */
.workspace-wrapper {
  display: none;
  margin-bottom: 48px;
}

.workspace-wrapper.active {
  display: block;
}

.workspace-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.back-btn,
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 650;
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}

.back-btn:hover,
.share-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* 3-Step Flow Tracker */
.step-tracker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.step-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.step-pill.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.step-pill.done {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border-color: var(--success);
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.workspace-grid.no-sidebar-ad {
  grid-template-columns: minmax(0, 880px);
  justify-content: center;
}

.workspace-grid.no-sidebar-ad aside {
  display: none;
}

@media (max-width: 980px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

.converter-stage {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

@media (max-width: 600px) {
  .converter-stage {
    padding: 20px 16px;
  }
}

.tool-header-info {
  text-align: center;
  margin-bottom: 20px;
}

.tool-header-info h1 {
  font-size: clamp(1.5rem, 2.8vw, 1.95rem);
  font-weight: 850;
  margin-bottom: 6px;
}

.tool-header-info p {
  color: var(--text-muted);
  font-size: 0.96rem;
  max-width: 620px;
  margin: 0 auto;
}

/* Dropzone */
.dropzone {
  border: 2.5px dashed #cbd5e1;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  padding: 44px 24px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.dropzone-icon {
  font-size: 3.1rem;
  margin-bottom: 12px;
  display: block;
  transition: transform 0.2s ease;
}

.dropzone:hover .dropzone-icon {
  transform: translateY(-4px) scale(1.05);
}

.select-files-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #e5322d 0%, #f43f5e 100%);
  color: #fff;
  font-size: 1.12rem;
  font-weight: 780;
  padding: 15px 36px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 24px rgba(229, 50, 45, 0.32);
  transition: transform 0.15s, box-shadow 0.15s;
  margin-bottom: 12px;
}

.select-files-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(229, 50, 45, 0.4);
}

.sample-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 650;
  transition: all 0.15s;
}

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

.dropzone-hint {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Visual PDF Page Organizer Grid */
.organizer-section {
  margin-top: 24px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
}

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

.organizer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.org-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.18s;
  position: relative;
}

.org-card.deleted {
  opacity: 0.45;
  border-style: dashed;
  border-color: var(--primary);
}

.org-thumb-box {
  height: 155px;
  background: var(--bg-subtle);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.org-thumb-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.org-page-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.org-deleted-pill {
  position: absolute;
  inset: 0;
  background: rgba(229, 50, 45, 0.16);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.org-controls {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.org-btn {
  flex: 1;
  padding: 5px 0;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 700;
}

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

.org-btn.del-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Options & File List Panel */
.options-panel {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.options-title {
  font-size: 0.96rem;
  font-weight: 750;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.option-group label {
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--text-muted);
}

.option-group select,
.option-group input[type="text"],
.option-group input[type="number"] {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.92rem;
}

.option-group input[type="range"] {
  accent-color: var(--primary);
  cursor: pointer;
}

/* Selected Files List */
.file-list-section {
  margin-top: 24px;
}

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

.file-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  gap: 12px;
}

.file-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.file-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.74rem;
  color: var(--primary);
  flex-shrink: 0;
  overflow: hidden;
}

.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-meta {
  min-width: 0;
}

.file-name {
  font-weight: 650;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-btn {
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 650;
  transition: all 0.15s;
}

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

/* Convert Action Button */
.convert-action-bar {
  margin-top: 24px;
  text-align: center;
}

.convert-submit-btn {
  width: 100%;
  max-width: 440px;
  padding: 16px 28px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #e5322d 0%, #f43f5e 100%);
  color: #fff;
  font-size: 1.14rem;
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(229, 50, 45, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.18s;
}

.convert-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(229, 50, 45, 0.45);
}

.convert-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Progress & Result View */
.progress-box {
  display: none;
  margin-top: 24px;
  padding: 24px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  text-align: center;
}

.progress-box.active {
  display: block;
}

.progress-bar-track {
  width: 100%;
  height: 12px;
  background: var(--border-color);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #e5322d, #ff7b54);
  transition: width 0.25s ease;
}

.results-box {
  display: none;
  margin-top: 28px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: rgba(16, 185, 129, 0.06);
  border: 2px solid var(--success);
}

.results-box.active {
  display: block;
}

.results-header {
  text-align: center;
  margin-bottom: 22px;
}

.results-header h2 {
  color: var(--success);
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.download-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-size: 1.08rem;
  font-weight: 800;
  padding: 15px 34px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.32);
  margin: 10px 0 18px;
  transition: transform 0.15s;
}

.download-all-btn:hover {
  transform: translateY(-2px);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-preview {
  height: 140px;
  background: var(--bg-subtle);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.result-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.result-dl-btn {
  padding: 8px 12px;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

/* Related Tools Showcase (Internal Linking SEO + High-CTR Multi-Tool Flow) */
.related-tools-box {
  margin-top: 32px;
  padding: 24px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(229, 50, 45, 0.05) 0%, rgba(37, 99, 235, 0.05) 100%);
  border: 1.5px solid var(--border-color);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.related-tools-box.post-convert {
  border-color: rgba(229, 50, 45, 0.45);
  box-shadow: 0 10px 28px rgba(229, 50, 45, 0.1);
}

.related-tools-header h3 {
  font-size: 1.24rem;
  font-weight: 850;
  color: var(--text-main);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.related-tools-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.related-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

@media (max-width: 680px) {
  .related-pills {
    grid-template-columns: 1fr;
  }
}

.related-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  text-align: left;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.related-card:hover {
  transform: translateY(-3px);
  border-color: var(--card-accent, var(--primary));
  box-shadow: var(--shadow-md);
}

.related-card-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  color: #fff;
  box-shadow: 0 8px 16px -4px rgba(15, 23, 42, 0.24);
}

.related-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.related-card-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.related-card-title {
  font-size: 1.04rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.related-card-badge {
  font-size: 0.66rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  text-transform: uppercase;
  flex-shrink: 0;
}

.related-card-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-card-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.related-card:hover .related-card-arrow {
  background: var(--primary);
  color: #fff;
  transform: translateX(3px);
}

/* SEO Content & FAQ Section */
.seo-section {
  margin-top: 44px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}

@media (max-width: 820px) {
  .seo-section {
    grid-template-columns: 1fr;
  }
}

.seo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.seo-card h2 {
  font-size: 1.25rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.step-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 0.94rem;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e5322d 0%, #f43f5e 100%);
  color: #fff;
  font-weight: 800;
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.faq-q {
  font-weight: 750;
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--text-main);
}

.faq-a {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 36px 20px;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links button {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-links button:hover {
  color: var(--primary);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

/* Toast Notification */
.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 650;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 300;
}

.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Accessibility Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header Quick Feedback Button */
.feedback-nav-btn {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(229, 50, 45, 0.28);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 750;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.feedback-nav-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

@media (max-width: 520px) {
  .feedback-nav-btn {
    padding: 6px 10px;
    font-size: 0.76rem;
  }
}

/* ================= Community Comments & Developer Request Hub ================= */
.community-section {
  margin-top: 40px;
}

.fb-shell {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.fb-header {
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(229, 50, 45, 0.06) 0%, rgba(37, 99, 235, 0.06) 100%);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.fb-header h2 {
  font-size: 1.3rem;
  font-weight: 850;
  margin-bottom: 4px;
  color: var(--text-main);
}

.fb-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.fb-tabs {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  gap: 4px;
}

.fb-tab-btn {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 750;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.16s ease;
}

.fb-tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.fb-tab-count {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 800;
}

.fb-mode-banner {
  padding: 11px 28px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
}

.fb-mode-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 750;
  color: var(--text-main);
  flex-shrink: 0;
}

.fb-mode-text {
  color: var(--text-muted);
  flex: 1;
  min-width: 220px;
}

.fb-setup-btn {
  padding: 5px 11px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 750;
}

.fb-setup-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.fb-panel-body {
  padding: 26px 28px;
}

@media (max-width: 680px) {
  .fb-header,
  .fb-mode-banner,
  .fb-panel-body {
    padding-left: 16px;
    padding-right: 16px;
  }
}

.fb-composer {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fb-composer-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.fb-composer-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 740px) {
  .fb-composer-row,
  .fb-composer-3 {
    grid-template-columns: 1fr;
  }
}

.fb-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fb-field label {
  font-size: 0.8rem;
  font-weight: 750;
  color: var(--text-muted);
}

.fb-input,
.fb-select,
.fb-textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fb-input:focus,
.fb-select:focus,
.fb-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(229, 50, 45, 0.14);
}

.fb-textarea {
  resize: vertical;
  min-height: 82px;
}

.fb-type-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fb-type-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

.fb-type-pill.active,
.fb-type-pill:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.fb-composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fb-char-counter {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.fb-primary-btn {
  background: linear-gradient(135deg, #e5322d 0%, #f43f5e 100%);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 16px rgba(229, 50, 45, 0.25);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.fb-primary-btn:hover {
  transform: translateY(-1px);
}

.fb-primary-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.fb-mini-primary {
  background: var(--primary);
  color: #fff;
  font-weight: 750;
  font-size: 0.82rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.fb-feed-toolbar {
  margin-top: 22px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.fb-filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fb-filter-btn {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.fb-filter-btn.active {
  background: var(--text-main);
  color: var(--bg-card);
  border-color: var(--text-main);
}

.fb-sort-select {
  width: auto;
  min-width: 120px;
  padding: 6px 12px;
  font-size: 0.82rem;
}

.fb-comments-feed,
.fb-req-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fb-empty-state,
.fb-req-empty {
  text-align: center;
  padding: 32px 18px;
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
}

.fb-empty-icon {
  font-size: 2rem;
  margin-bottom: 6px;
}

.fb-empty-state h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.fb-empty-state p,
.fb-req-empty {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.fb-starter-chips {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.fb-starter-chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

.fb-starter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.fb-comment-card,
.fb-req-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fb-comment-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.fb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fb-comment-meta {
  flex: 1;
  min-width: 0;
}

.fb-comment-author-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.fb-author-name {
  font-size: 0.94rem;
}

.fb-type-badge {
  font-size: 0.72rem;
  font-weight: 750;
  padding: 2px 8px;
  border-radius: 999px;
}

.fb-type-badge.tag-praise {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

.fb-type-badge.tag-feature {
  background: rgba(37, 99, 235, 0.14);
  color: #2563eb;
}

.fb-type-badge.tag-bug {
  background: rgba(229, 50, 45, 0.14);
  color: #e5322d;
}

.fb-type-badge.tag-question {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.fb-scope-link {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--accent);
}

.fb-scope-link:hover {
  text-decoration: underline;
}

.fb-scope-tag {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.fb-time {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.fb-icon-del {
  font-size: 0.88rem;
  opacity: 0.65;
  padding: 4px;
}

.fb-icon-del:hover {
  opacity: 1;
}

.fb-comment-body,
.fb-req-desc {
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
}

.fb-comment-actions,
.fb-req-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.fb-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  transition: all 0.14s ease;
}

.fb-act-btn:hover,
.fb-act-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.fb-reply-composer {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.fb-reply-list {
  margin-top: 4px;
  padding-left: 14px;
  border-left: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fb-reply-item {
  background: var(--bg-subtle);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.fb-reply-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.fb-reply-meta strong {
  color: var(--text-main);
}

.fb-text-danger {
  color: var(--primary);
  font-size: 0.74rem;
  margin-left: auto;
}

.fb-reply-text {
  font-size: 0.87rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.fb-req-intro {
  margin-bottom: 14px;
}

.fb-req-intro strong {
  font-size: 1.02rem;
  display: block;
  margin-bottom: 2px;
}

.fb-req-intro p {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.fb-checkbox-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fb-check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--text-muted);
  cursor: pointer;
}

.fb-req-history {
  margin-top: 24px;
}

.fb-req-history-title {
  font-size: 0.98rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.fb-req-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.fb-req-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.fb-ticket-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--text-main);
}

.fb-pri-badge,
.fb-status-pill {
  font-size: 0.72rem;
  font-weight: 750;
  padding: 2px 8px;
  border-radius: 999px;
}

.fb-pri-badge.pri-normal {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.fb-pri-badge.pri-high {
  background: rgba(245, 158, 11, 0.16);
  color: #d97706;
}

.fb-pri-badge.pri-urgent {
  background: rgba(229, 50, 45, 0.16);
  color: #e5322d;
}

.fb-status-pill.status-sent {
  background: rgba(16, 185, 129, 0.16);
  color: #059669;
}

.fb-status-pill.status-local {
  background: rgba(59, 130, 246, 0.14);
  color: #2563eb;
}

.fb-req-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.fb-req-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.fb-giscus-mount {
  min-height: 160px;
}

/* ================= Floating Quick Scroll-to-Top Button ================= */
.scroll-top-btn {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 140;
  width: 50px;
  padding: 10px 6px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: var(--shadow-md);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.scroll-top-btn.scrolled {
  opacity: 1;
  border-color: rgba(229, 50, 45, 0.35);
}

.scroll-top-btn:hover {
  opacity: 1;
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(calc(-50% - 2px));
  box-shadow: var(--shadow-lg);
}

.scroll-top-arrow {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
}

.scroll-top-label {
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* ================= Floating Chat Assistant & Request Drawer ================= */
.chat-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 185;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e5322d 0%, #f43f5e 100%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(229, 50, 45, 0.38);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.chat-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(229, 50, 45, 0.48);
}

.chat-fab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.28);
}

.chat-panel {
  position: fixed;
  right: 20px;
  bottom: 80px;
  z-index: 190;
  width: min(390px, calc(100vw - 24px));
  height: min(550px, calc(100vh - 104px));
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.chat-panel.open {
  display: flex;
}

.chat-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}

.chat-header-info strong {
  display: block;
  font-size: 0.94rem;
  line-height: 1.2;
}

.chat-header-info span {
  display: block;
  font-size: 0.72rem;
  color: #94a3b8;
}

.chat-header-btns {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.chat-hdr-btn {
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-size: 0.76rem;
  font-weight: 700;
}

.chat-hdr-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  display: flex;
}

.chat-msg.user {
  justify-content: flex-end;
}

.chat-msg.bot {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 0.86rem;
  line-height: 1.48;
  word-break: break-word;
}

.chat-bubble p {
  margin: 0;
  white-space: pre-wrap;
}

.chat-msg.user .chat-bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg.bot .chat-bubble {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
}

.chat-msg-actions {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chat-action-pill {
  text-align: left;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 700;
}

.chat-action-pill.primary {
  background: var(--primary-light);
  border-color: rgba(229, 50, 45, 0.35);
  color: var(--primary);
}

.chat-action-pill:hover {
  border-color: var(--primary);
}

.chat-quick-chips {
  padding: 8px 12px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chat-quick-chips::-webkit-scrollbar {
  display: none;
}

.chat-chip {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 700;
}

.chat-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.chat-input-bar {
  padding: 10px 12px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  min-width: 0;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  padding: 9px 14px;
  font-family: inherit;
  font-size: 0.86rem;
}

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

.chat-send-btn {
  padding: 0 16px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.84rem;
}

.chat-inline-req {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-inline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
}

@media (max-width: 640px) {
  .scroll-top-btn {
    right: 10px;
    width: 40px;
    padding: 8px 4px;
    border-radius: 12px;
    opacity: 0.8;
  }

  .scroll-top-label {
    font-size: 0.62rem;
  }

  .toast-msg {
    bottom: 80px;
  }

  .chat-fab {
    right: 14px;
    bottom: 14px;
    padding: 10px 14px;
    font-size: 0.84rem;
  }

  .chat-panel {
    right: 12px;
    bottom: 70px;
  }
}
