/**
 * Utility Seva — Unit Converter Styles
 * File: css/unit-converter.css
 * 
 * Compact 1366x768 Desktop Viewport Optimized
 * Supports Light & Dark Themes, Responsive Layouts & Print Styles
 */

/* ==========================================================================
   1. BREADCRUMBS & PAGE HEADER
   ========================================================================== */
.breadcrumb-nav-compact {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-secondary, #64748b);
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.breadcrumb-nav-compact a {
  color: var(--text-secondary, #64748b);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
}

.breadcrumb-nav-compact a:hover {
  color: #8b5cf6;
}

.breadcrumb-nav-compact .breadcrumb-sep {
  color: var(--text-tertiary, #94a3b8);
  font-size: 0.72rem;
  user-select: none;
  opacity: 0.7;
}

.breadcrumb-nav-compact .breadcrumb-current {
  color: var(--text-primary, #0f172a);
  font-weight: 600;
}

[data-theme="dark"] .breadcrumb-nav-compact .breadcrumb-current {
  color: #f8fafc;
}

.unit-page-wrapper {
  padding: 0.2rem 0 1.25rem;
  max-width: 1140px;
  margin: 0 auto;
}

.unit-header-section {
  text-align: center;
  margin-bottom: 0.45rem;
}

.unit-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.45rem;
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}

[data-theme="dark"] .unit-badge-pill {
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
  border-color: rgba(167, 139, 250, 0.3);
}

.unit-badge-pill svg {
  width: 11px;
  height: 11px;
}

.unit-page-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.05rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

[data-theme="dark"] .unit-page-title {
  color: #f8fafc;
}

.unit-page-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary, #64748b);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.25;
}

[data-theme="dark"] .unit-page-subtitle {
  color: #94a3b8;
}

/* ==========================================================================
   2. TWO-COLUMN STAGE CONTAINER (1366x768 OPTIMIZED)
   ========================================================================== */
.unit-stage-container {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0.75rem;
  align-items: stretch;
  margin-bottom: 0.75rem;
}

@media (max-width: 900px) {
  .unit-stage-container {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* Card Base */
.unit-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 0.6rem;
  padding: 0.7rem 0.85rem;
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .unit-card {
  background: var(--card-bg, #1e293b);
  border-color: var(--border-color, #334155);
  box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.35);
}

.unit-card-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

[data-theme="dark"] .unit-card-header {
  border-bottom-color: var(--border-color, #334155);
}

.unit-card-header-icon {
  width: 28px;
  height: 28px;
  border-radius: 0.45rem;
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .unit-card-header-icon {
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
}

.unit-card-header-icon.highlight {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

[data-theme="dark"] .unit-card-header-icon.highlight {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.unit-card-header-icon svg {
  width: 15px;
  height: 15px;
}

.unit-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  line-height: 1.2;
}

[data-theme="dark"] .unit-card-title {
  color: #f8fafc;
}

.unit-card-desc {
  font-size: 0.72rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.2;
}

[data-theme="dark"] .unit-card-desc {
  color: #94a3b8;
}

/* ==========================================================================
   3. LEFT INPUT CARD & FORM
   ========================================================================== */
.unit-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.unit-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.unit-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

[data-theme="dark"] .unit-label {
  color: #e2e8f0;
}

.unit-label .required-star {
  color: #ef4444;
  margin-left: 2px;
}

.unit-select,
.unit-number-input {
  width: 100%;
  padding: 0.35rem 0.6rem;
  border: 1.5px solid var(--border-color, #cbd5e1);
  border-radius: 0.4rem;
  background: var(--bg-primary, #ffffff);
  color: var(--text-primary, #0f172a);
  font-size: 0.78rem;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

[data-theme="dark"] .unit-select,
[data-theme="dark"] .unit-number-input {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

.unit-select:focus,
.unit-number-input:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
}

.unit-number-input {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Unit Swap Row */
.unit-swap-row {
  display: grid;
  grid-template-columns: 1fr 34px 1fr;
  align-items: flex-end;
  gap: 0.3rem;
}

.unit-swap-btn {
  height: 31px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-secondary, #f1f5f9);
  color: var(--text-primary, #334155);
  border-radius: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 1px;
}

[data-theme="dark"] .unit-swap-btn {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

.unit-swap-btn:hover {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
  border-color: #8b5cf6;
}

[data-theme="dark"] .unit-swap-btn:hover {
  background: rgba(167, 139, 250, 0.2);
  color: #c4b5fd;
  border-color: #c4b5fd;
}

.unit-swap-btn svg {
  width: 14px;
  height: 14px;
}

/* Precision Row */
.unit-precision-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.unit-precision-row .unit-select {
  width: auto;
  flex: 1;
}

/* Action Button Row */
.unit-btn-row {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.2rem;
}

.unit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.4rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

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

.unit-btn-primary {
  background: #8b5cf6;
  color: #ffffff;
  flex: 1;
}

.unit-btn-primary:hover {
  background: #7c3aed;
}

[data-theme="dark"] .unit-btn-primary {
  background: #8b5cf6;
}

[data-theme="dark"] .unit-btn-primary:hover {
  background: #a78bfa;
}

.unit-btn-secondary {
  background: var(--bg-secondary, #f1f5f9);
  color: var(--text-primary, #334155);
  border: 1px solid var(--border-color, #cbd5e1);
}

[data-theme="dark"] .unit-btn-secondary {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

.unit-btn-secondary:hover {
  background: var(--border-color, #e2e8f0);
}

[data-theme="dark"] .unit-btn-secondary:hover {
  background: #1e293b;
}

/* Shortcuts Section */
.unit-shortcuts-section {
  margin-top: 0.4rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border-color, #e2e8f0);
}

[data-theme="dark"] .unit-shortcuts-section {
  border-top-color: #334155;
}

.unit-shortcuts-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary, #64748b);
  margin-bottom: 0.25rem;
}

[data-theme="dark"] .unit-shortcuts-title {
  color: #94a3b8;
}

.unit-shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
}

@media (max-width: 500px) {
  .unit-shortcuts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.unit-shortcut-btn {
  padding: 0.2rem 0.3rem;
  font-size: 0.66rem;
  font-weight: 600;
  border-radius: 0.3rem;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-secondary, #f8fafc);
  color: var(--text-primary, #0f172a);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .unit-shortcut-btn {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

.unit-shortcut-btn:hover {
  border-color: #8b5cf6;
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.08);
}

[data-theme="dark"] .unit-shortcut-btn:hover {
  border-color: #a78bfa;
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.15);
}

/* ==========================================================================
   4. RIGHT RESULT CARD (ULTRA-COMPACT)
   ========================================================================== */
.unit-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 0.35rem;
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

[data-theme="dark"] .unit-category-badge {
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
  border-color: rgba(167, 139, 250, 0.3);
}

/* Empty State */
.unit-result-empty {
  text-align: center;
  padding: 2.2rem 1rem;
  background: var(--bg-secondary, #f8fafc);
  border: 1px dashed var(--border-color, #cbd5e1);
  border-radius: 0.55rem;
  margin: auto 0;
}

[data-theme="dark"] .unit-result-empty {
  background: #0f172a;
  border-color: #334155;
}

.empty-icon-wrap {
  width: 36px;
  height: 36px;
  color: var(--text-secondary, #94a3b8);
  margin: 0 auto 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.empty-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.2rem;
}

[data-theme="dark"] .empty-title {
  color: #f8fafc;
}

.empty-text {
  font-size: 0.78rem;
  color: var(--text-secondary, #64748b);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.35;
}

[data-theme="dark"] .empty-text {
  color: #94a3b8;
}

/* Result Section Container */
.unit-result-section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.unit-result-section.hidden {
  display: none !important;
}

/* Prominent Main Banner */
.unit-main-banner {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(124, 58, 237, 0.03) 100%);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 0.55rem;
  padding: 0.45rem 0.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

[data-theme="dark"] .unit-main-banner {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.16) 0%, rgba(124, 58, 237, 0.05) 100%);
  border-color: rgba(167, 139, 250, 0.25);
}

.banner-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #64748b);
  margin-bottom: 0.1rem;
}

[data-theme="dark"] .banner-lbl {
  color: #94a3b8;
}

.banner-val {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: #8b5cf6;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

[data-theme="dark"] .banner-val {
  color: #c4b5fd;
}

/* From & To Details Grid */
.unit-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.detail-card {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 0.45rem;
  padding: 0.35rem 0.5rem;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .detail-card {
  background: #0f172a;
  border-color: #334155;
}

.detail-lbl {
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  margin-bottom: 0.1rem;
}

[data-theme="dark"] .detail-lbl {
  color: #94a3b8;
}

.detail-val {
  font-size: 0.8rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .detail-val {
  color: #f8fafc;
}

/* Formula & Reciprocal Boxes */
.unit-formula-box,
.unit-reciprocal-box {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 0.45rem;
  padding: 0.35rem 0.55rem;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .unit-formula-box,
[data-theme="dark"] .unit-reciprocal-box {
  background: #0f172a;
  border-color: #334155;
}

.formula-lbl,
.reciprocal-lbl {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary, #64748b);
  margin-bottom: 0.1rem;
}

[data-theme="dark"] .formula-lbl,
[data-theme="dark"] .reciprocal-lbl {
  color: #94a3b8;
}

.formula-val,
.reciprocal-val {
  font-size: 0.78rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: #0891b2;
  line-height: 1.25;
}

[data-theme="dark"] .formula-val,
[data-theme="dark"] .reciprocal-val {
  color: #22d3ee;
}

/* Actions Toolbar */
.unit-actions-toolbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
  margin-top: 0.1rem;
}

@media (max-width: 500px) {
  .unit-actions-toolbar {
    grid-template-columns: repeat(2, 1fr);
  }
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 0.35rem;
  cursor: pointer;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-primary, #ffffff);
  color: var(--text-primary, #334155);
  transition: all 0.15s ease;
}

[data-theme="dark"] .action-btn {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

.action-btn:hover {
  background: var(--bg-secondary, #f1f5f9);
  color: #8b5cf6;
  border-color: #8b5cf6;
}

[data-theme="dark"] .action-btn:hover {
  background: #0f172a;
  color: #c4b5fd;
  border-color: #c4b5fd;
}

.action-btn svg {
  width: 12px;
  height: 12px;
}

/* ==========================================================================
   5. COLLAPSIBLE CALCULATION HISTORY
   ========================================================================== */
.unit-history-section {
  margin-bottom: 1.25rem;
}

.unit-history-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 9999px;
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

[data-theme="dark"] .unit-history-count-badge {
  background: rgba(167, 139, 250, 0.2);
  color: #c4b5fd;
}

.unit-h-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.35rem;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-secondary, #f8fafc);
  color: var(--text-primary, #0f172a);
  cursor: pointer;
  transition: all 0.15s ease;
}

[data-theme="dark"] .unit-h-toggle-btn {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

.unit-h-toggle-btn:hover {
  border-color: #8b5cf6;
  color: #8b5cf6;
}

.toggle-chevron {
  width: 13px;
  height: 13px;
  transition: transform 0.2s ease;
}

/* History Wrapper */
.unit-history-wrapper {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color, #e2e8f0);
}

[data-theme="dark"] .unit-history-wrapper {
  border-top-color: #334155;
}

.unit-history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.unit-history-search-box {
  position: relative;
  flex: 1 1 180px;
}

.unit-history-search-box svg {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  color: var(--text-secondary, #64748b);
  pointer-events: none;
}

.unit-h-search-input {
  width: 100%;
  padding: 0.35rem 0.65rem 0.35rem 2rem;
  font-size: 0.76rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-primary, #ffffff);
  color: var(--text-primary, #0f172a);
}

[data-theme="dark"] .unit-h-search-input {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

.unit-history-select {
  padding: 0.35rem 0.55rem;
  font-size: 0.76rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-primary, #ffffff);
  color: var(--text-primary, #0f172a);
}

[data-theme="dark"] .unit-history-select {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

.unit-history-btn-group {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.unit-h-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 0.4rem;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-primary, #ffffff);
  color: var(--text-primary, #334155);
  cursor: pointer;
  transition: all 0.15s ease;
}

[data-theme="dark"] .unit-h-tool-btn {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

.unit-h-tool-btn:hover:not(:disabled) {
  border-color: #8b5cf6;
  color: #8b5cf6;
}

.unit-h-tool-btn.danger:hover:not(:disabled) {
  border-color: #dc2626;
  color: #dc2626;
}

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

.unit-h-tool-btn svg {
  width: 12px;
  height: 12px;
}

/* History List Items */
.unit-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.unit-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 0.45rem;
  gap: 0.65rem;
  transition: border-color 0.15s ease;
}

[data-theme="dark"] .unit-history-item {
  background: #0f172a;
  border-color: #334155;
}

.unit-history-item:hover {
  border-color: #8b5cf6;
}

@media (max-width: 768px) {
  .unit-history-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

.unit-h-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.unit-h-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.unit-h-cat-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.08rem 0.4rem;
  border-radius: 0.25rem;
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

[data-theme="dark"] .unit-h-cat-badge {
  color: #c4b5fd;
}

.unit-h-time {
  font-size: 0.68rem;
  color: var(--text-tertiary, #94a3b8);
  margin-left: auto;
}

.unit-h-calc-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.unit-h-from {
  color: var(--text-primary, #0f172a);
}

[data-theme="dark"] .unit-h-from {
  color: #f8fafc;
}

.unit-h-arrow {
  width: 13px;
  height: 13px;
  color: #8b5cf6;
}

.unit-h-to {
  color: #8b5cf6;
}

[data-theme="dark"] .unit-h-to {
  color: #c4b5fd;
}

.unit-h-formula {
  font-size: 0.68rem;
  color: var(--text-secondary, #64748b);
  font-family: 'JetBrains Mono', monospace;
}

[data-theme="dark"] .unit-h-formula {
  color: #94a3b8;
}

.unit-h-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.unit-h-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 0.3rem;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-primary, #ffffff);
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
}

[data-theme="dark"] .unit-h-btn {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

.unit-h-btn svg {
  width: 11px;
  height: 11px;
}

.unit-h-btn.reuse-btn:hover {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
  border-color: #8b5cf6;
}

.unit-h-btn.copy-btn:hover {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border-color: #2563eb;
}

.unit-h-btn.delete-btn:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border-color: #dc2626;
}

/* Empty State inside History */
.unit-history-empty {
  text-align: center;
  padding: 1.25rem 1rem;
}

.unit-history-empty svg {
  width: 28px;
  height: 28px;
  color: var(--text-secondary, #94a3b8);
  margin-bottom: 0.35rem;
}

/* ==========================================================================
   6. EDUCATIONAL & FAQ SECTION
   ========================================================================== */
.unit-faq-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color, #e2e8f0);
}

[data-theme="dark"] .unit-faq-section {
  border-top-color: #334155;
}

.faq-header {
  text-align: center;
  margin-bottom: 1rem;
}

.faq-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.2rem;
  letter-spacing: -0.01em;
}

[data-theme="dark"] .faq-title {
  color: #f8fafc;
}

.faq-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary, #64748b);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.35;
}

[data-theme="dark"] .faq-subtitle {
  color: #94a3b8;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}

.faq-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 0.55rem;
  padding: 0.85rem 1rem;
}

[data-theme="dark"] .faq-card {
  background: var(--card-bg, #1e293b);
  border-color: #334155;
}

.faq-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

[data-theme="dark"] .faq-card-title {
  color: #f8fafc;
}

.faq-card-title svg {
  width: 14px;
  height: 14px;
  color: #8b5cf6;
  flex-shrink: 0;
}

[data-theme="dark"] .faq-card-title svg {
  color: #a78bfa;
}

.faq-card-text {
  font-size: 0.78rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.45;
  margin: 0;
}

[data-theme="dark"] .faq-card-text {
  color: #94a3b8;
}

/* ==========================================================================
   7. TOAST NOTIFICATION
   ========================================================================== */
.unit-toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: #1e293b;
  color: #ffffff;
  padding: 0.55rem 1rem;
  border-radius: 0.45rem;
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.unit-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.unit-toast.success {
  background: #8b5cf6;
  color: #ffffff;
}

.unit-toast.info {
  background: #0891b2;
  color: #ffffff;
}

/* ==========================================================================
   8. PRINT STYLES
   ========================================================================== */
@media print {
  .site-header,
  .site-footer,
  .breadcrumb-nav-compact,
  .unit-header-section,
  .unit-inputs-card,
  .unit-history-section,
  .unit-faq-section,
  .unit-actions-toolbar,
  .unit-shortcuts-section,
  .unit-toast {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .unit-stage-container {
    display: block !important;
  }

  .unit-results-card {
    border: 1px solid #000000 !important;
    box-shadow: none !important;
  }
}

