/* Pi Explorer Specific Styles — Aligned with Obsidian & Warm Amber Gold Design System */
:root {
  --bg: #090b10;
  --surface: rgba(18, 21, 30, 0.85);
  --surface-solid: #12151e;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(245, 158, 11, 0.35);
  --border-focus: #f59e0b;
  --ink: #f8fafc;
  --muted: #94a3b8;
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --accent-soft: rgba(245, 158, 11, 0.12);
  --good: #10b981;
  --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
}

main {
  flex: 1;
  width: min(1080px, 100% - 32px);
  margin: 0 auto;
  padding: 24px 0 48px;
  position: relative;
  perspective: 1200px;
}
h1 {
  font-size: clamp(1.2rem, 3.2vw, 1.9rem);
  margin: .15em 0 .6em;
  text-align: center;
  font-weight: 900;
  letter-spacing: -0.02em;
  will-change: transform, opacity;
  transition: opacity 0.15s linear;
}

/* Animated Mode Switcher Tabs with Liquid Glass & Fluid Drag */
.mode-tabs-container {
  display: flex;
  justify-content: center;
  margin: 0 auto 18px;
  will-change: transform;
}
.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  background: rgba(22, 27, 38, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px;
  border-radius: var(--radius-full);
  max-width: 480px;
  width: 100%;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35), inset 0 1px 1.5px rgba(255, 255, 255, 0.08);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}
.mode-tabs.is-dragging {
  cursor: grabbing;
}
.mode-tab {
  border: none;
  background: none;
  color: var(--muted);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: inherit;
  transition: color var(--duration-fast) var(--ease-smooth-out);
  text-align: center;
  position: relative;
  z-index: 2;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.mode-tab:hover { color: var(--ink); }
.mode-tab.active {
  color: #fff;
  text-shadow: 0 0 14px rgba(245, 158, 11, 0.65);
}
.tab-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: calc(50% - 4px);
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(245, 158, 11, 0.22) 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.35),
    0 0 20px rgba(245, 158, 11, 0.35),
    inset 0 1px 2px rgba(255, 255, 255, 0.65),
    inset 0 -1px 2px rgba(245, 158, 11, 0.3);
  transition: transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  will-change: transform;
}
/* Dynamic Specular Sheen Reflection */
.tab-indicator::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    90px circle at var(--gx, 40%) var(--gy, 30%),
    rgba(255, 255, 255, 0.55),
    rgba(255, 255, 255, 0.08) 50%,
    transparent 80%
  );
  pointer-events: none;
}
.mode-tabs.is-dragging .tab-indicator {
  transition: none !important;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(245, 158, 11, 0.5),
    inset 0 1px 2px rgba(255, 255, 255, 0.8),
    inset 0 -1px 2px rgba(245, 158, 11, 0.5);
}

/* LTR layout (default & English) */
html[dir="ltr"] .tab-indicator,
:root:not([dir="rtl"]) .tab-indicator {
  left: 4px;
  right: auto;
  transform: translateX(0%);
}
html[dir="ltr"] .mode-tabs[data-tab="bday"] .tab-indicator,
html[dir="ltr"] .mode-tabs[data-tab="bday"]:not(.is-custom-drag) .tab-indicator,
:root:not([dir="rtl"]) .mode-tabs[data-tab="bday"] .tab-indicator,
:root:not([dir="rtl"]) .mode-tabs[data-tab="bday"]:not(.is-custom-drag) .tab-indicator {
  transform: translateX(100%);
}
html[dir="ltr"] .mode-tabs[data-tab="search"] .tab-indicator,
html[dir="ltr"] .mode-tabs[data-tab="search"]:not(.is-custom-drag) .tab-indicator,
:root:not([dir="rtl"]) .mode-tabs[data-tab="search"] .tab-indicator,
:root:not([dir="rtl"]) .mode-tabs[data-tab="search"]:not(.is-custom-drag) .tab-indicator {
  transform: translateX(0%);
}

/* RTL layout (Persian) */
html[dir="rtl"] .tab-indicator {
  right: 4px;
  left: auto;
  transform: translateX(0%);
}
html[dir="rtl"] .mode-tabs[data-tab="bday"] .tab-indicator,
html[dir="rtl"] .mode-tabs[data-tab="bday"]:not(.is-custom-drag) .tab-indicator {
  transform: translateX(-100%);
}
html[dir="rtl"] .mode-tabs[data-tab="search"] .tab-indicator,
html[dir="rtl"] .mode-tabs[data-tab="search"]:not(.is-custom-drag) .tab-indicator {
  transform: translateX(0%);
}

/* Input Shake & Error States */
@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
input.shake, .shake {
  animation: inputShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.5) !important;
}

/* Panel Transition Animation */
.panel-animated {
  animation: panelSlideIn var(--duration-medium) var(--ease-smooth-out) both;
}
@keyframes panelSlideIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Quick Bookmarks Bar */
.quick-bookmarks {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 auto 14px;
  max-width: 780px;
}
.bm-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  font-family: inherit;
}
.bm-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

/* Search Bar */
.searchbar {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 0 auto 12px;
  max-width: 780px;
}
.search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}
.searchbar input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: var(--radius-md);
  padding: 13px 18px;
  font-family: 'JetBrains Mono', 'Space Grotesk', inherit;
  font-size: 15px;
  min-width: 0;
  direction: ltr;
  text-align: center;
  outline: none;
  transition: var(--transition);
}
/* Padding so input text does not collide with the live digit count badge */
html[dir="rtl"] .searchbar input {
  padding-left: 95px;
}
html[dir="ltr"] .searchbar input,
:root:not([dir="rtl"]) .searchbar input {
  padding-right: 95px;
}
.searchbar input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface-hover);
}

/* Liquid Glass Live Digit Counter Badge */
.q-digit-count {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(245, 158, 11, 0.24) 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35),
              0 0 16px rgba(245, 158, 11, 0.25),
              inset 0 1px 1.5px rgba(255, 255, 255, 0.65),
              inset 0 -1px 2px rgba(245, 158, 11, 0.25);
  backdrop-filter: blur(10px) saturate(1.5);
  -webkit-backdrop-filter: blur(10px) saturate(1.5);
  color: var(--accent);
  z-index: 5;
  white-space: nowrap;
  animation: badgePop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  user-select: none;
}
html[dir="rtl"] .q-digit-count {
  left: 10px;
  right: auto;
  direction: rtl;
}
html[dir="ltr"] .q-digit-count,
:root:not([dir="rtl"]) .q-digit-count {
  right: 10px;
  left: auto;
  direction: ltr;
}
.q-digit-count.maxed {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.24) 0%, rgba(245, 158, 11, 0.2) 100%);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.45);
}
@keyframes badgePop {
  from {
    opacity: 0;
    transform: translateY(-50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}
.searchbar button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.searchbar button:hover {
  border-color: var(--border-hover);
  color: var(--accent);
  transform: translateY(-1px);
}
.searchbar button.primary {
  background: var(--accent);
  color: #000;
  border: none;
}
.searchbar button.primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
}

/* ==========================================================================
   Godly-Inspired Liquid Glass Share Card & Drawer
   Inspired by: https://godly.design (floating capsule, tactile copy, glowing beacon)
   ========================================================================== */
.godly-share-wrap {
  margin: 10px auto 16px;
  max-width: 760px;
  width: 100%;
  animation: godlyShareEntrance 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.godly-share-wrap[hidden] {
  display: none !important;
}

@keyframes godlyShareEntrance {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.godly-share-card {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(18, 22, 32, 0.88) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5),
              0 0 30px rgba(245, 158, 11, 0.07),
              inset 0 1px 1.5px rgba(255, 255, 255, 0.4),
              inset 0 -1px 2px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px) saturate(1.7);
  -webkit-backdrop-filter: blur(20px) saturate(1.7);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.share-ambient-glow {
  position: absolute;
  top: -40px;
  left: 30%;
  width: 220px;
  height: 90px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.22), transparent 70%);
  pointer-events: none;
  filter: blur(24px);
}

/* Header */
.share-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.share-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.share-beacon {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: beaconPulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes beaconPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.share-meta-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
}

.share-query-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  direction: ltr;
}

.share-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--ink-tertiary);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-spring);
}
.share-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  transform: rotate(90deg) scale(1.08);
}

/* URL Input & Godly Tactile Copy */
.share-main-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.share-input-capsule {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  transition: border-color var(--duration-quick) ease, box-shadow var(--duration-quick) ease;
}
.share-input-capsule:focus-within, .share-input-capsule:hover {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}

.share-link-icon {
  color: var(--ink-tertiary);
  margin-right: 8px;
  flex-shrink: 0;
}
html[dir="rtl"] .share-link-icon {
  margin-right: 0;
  margin-left: 8px;
}

.share-url-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fbbf24;
  font-family: 'JetBrains Mono', 'Space Grotesk', monospace;
  font-size: 12.5px;
  font-weight: 600;
  direction: ltr;
  text-align: left;
  padding: 9px 0;
  width: 100%;
}

.godly-copy-btn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.9)) !important;
  color: #0b0d13 !important;
  font-weight: 800 !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  border-radius: var(--radius-sm) !important;
  padding: 9px 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  font-size: 12.5px;
  transition: all var(--duration-fast) var(--ease-spring);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35),
              inset 0 1px 1px rgba(255, 255, 255, 0.65);
}
.godly-copy-btn:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}
.godly-copy-btn:active {
  transform: scale(0.95);
}
.godly-copy-btn.copied {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.9)) !important;
  color: #fff !important;
  border-color: rgba(16, 185, 129, 0.6) !important;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.4);
}

/* Channels Tray */
.share-channels-tray {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.godly-tray-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ink-secondary);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--duration-fast) var(--ease-spring);
}
.godly-tray-btn:hover {
  transform: translateY(-1px);
  color: var(--ink);
}
.godly-tray-btn:active {
  transform: scale(0.95);
}

.tray-tg:hover {
  background: rgba(36, 161, 222, 0.16);
  border-color: rgba(36, 161, 222, 0.4);
  color: #38bdf8;
}
.tray-x:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}
.tray-wa:hover {
  background: rgba(37, 211, 102, 0.16);
  border-color: rgba(37, 211, 102, 0.4);
  color: #4ade80;
}
.tray-native:hover {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--accent);
}
.tray-open:hover {
  background: rgba(147, 51, 234, 0.16);
  border-color: rgba(168, 85, 247, 0.4);
  color: #c084fc;
}

.status {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  min-height: 1.4em;
  margin: 10px 0;
  padding: 0 8px;
}

/* Result Box */
.result-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 3vw, 26px);
  margin: 0 auto;
  max-width: 960px;
  width: 100%;
  box-shadow: var(--shadow-md);
  position: relative;
  will-change: transform, box-shadow;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.digits-view, .chunk {
  direction: ltr;
  unicode-bidi: embed;
  font-family: 'JetBrains Mono', 'Space Grotesk', ui-monospace, monospace;
  font-size: clamp(.95rem, 2vw, 1.25rem);
  line-height: 1.95;
  letter-spacing: .06em;
  word-break: break-all;
  overflow-wrap: anywhere;
}
.chunk { min-height: 7.6em; }
.pos-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  transition: all var(--duration-fast) ease;
}
.pos-label.is-floating {
  position: sticky;
  top: 14px;
  z-index: 15;
  background: rgba(18, 21, 30, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-full);
  padding: 8px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55),
              0 0 20px rgba(245, 158, 11, 0.12),
              inset 0 1px 1.5px rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(18px) saturate(1.7);
  -webkit-backdrop-filter: blur(18px) saturate(1.7);
}

.hits {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hit {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 13px;
  border-top: 1px dashed var(--border);
  padding: 9px 12px;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 8px;
  animation: hitSlideIn var(--duration-fast) var(--ease-smooth-out) both;
}
@keyframes hitSlideIn {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.hit:hover {
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateX(-4px);
}
.hit:first-child { border-top: none; }
.hit b { color: var(--accent); }
.hit span.snip { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

#sentinel { height: 1px; }

/* Dedicated Birthday Panel */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 0 auto 20px;
  max-width: 780px;
  box-shadow: var(--shadow-md);
}
.panel[hidden] { display: none; }
.prow {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.panel label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.panel select, .panel input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  width: 130px;
  outline: none;
  transition: var(--transition);
}
.panel select:focus, .panel input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.formats { gap: 8px !important; }
.chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 6px 15px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.chip.on {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.bd-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.bd-res {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  cursor: pointer;
  flex-wrap: wrap;
  transition: var(--transition);
  animation: hitSlideIn var(--duration-fast) var(--ease-smooth-out) both;
}
.bd-res:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateX(-4px);
}
.bd-res b { color: var(--accent); font-weight: 700; }
.bd-res .miss { color: var(--muted); }
.bd-res .fmt { color: var(--accent-light); font-weight: 700; min-width: 130px; }

.age-line {
  background: var(--accent-soft);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
}
.age-line b { color: #fff; font-size: 15px; }

/* Integrated Cosmic Fallback & Deep Probe Box */
.cosmic-fallback-box {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.07), rgba(18, 21, 30, 0.98));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 3.5vw, 26px);
  margin-bottom: 20px;
  text-align: start;
  box-shadow: var(--shadow-lg), 0 0 24px rgba(245, 158, 11, 0.12);
  animation: panelSlideIn var(--duration-fast) var(--ease-smooth-out) both;
}
.cosmic-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.cosmic-probe-title {
  color: var(--accent);
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cosmic-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}
.cosmic-probe-desc {
  font-size: 13.5px;
  color: var(--ink-secondary);
  line-height: 1.85;
  margin-bottom: 18px;
}
.cosmic-probe-desc b {
  color: var(--accent);
}
.cosmic-probe-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
}
.cosmic-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cosmic-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--site-font) !important;
  font-size: 14px;
  padding: 9px 14px;
  direction: ltr;
  text-align: start;
  transition: var(--transition);
}
.cosmic-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.cosmic-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--site-font) !important;
  font-size: 13px;
  padding: 9px 12px;
  cursor: pointer;
}
.cosmic-milestones {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.cosmic-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.cosmic-result-card {
  background: rgba(9, 11, 16, 0.9);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-top: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
}
.cosmic-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.cosmic-stream-content {
  font-family: 'JetBrains Mono', 'Space Grotesk', monospace;
  font-size: clamp(0.92rem, 2vw, 1.15rem);
  line-height: 2.2;
  letter-spacing: 0.05em;
  word-break: break-all;
  direction: ltr;
  color: #f8fafc;
  user-select: text;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px 4px;
}
.cosmic-search-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cosmic-mark {
  background: rgba(245, 158, 11, 0.45);
  color: #fff;
  border: 1px solid #fbbf24;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.85);
  font-weight: 900;
  border-radius: 4px;
  padding: 1px 6px;
  animation: cosmicMarkPulse 1.8s infinite alternate;
}
@keyframes cosmicMarkPulse {
  0% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.5); }
  100% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.95), 0 0 35px rgba(251, 191, 36, 0.6); }
}
.cosmic-found-banner {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cosmic-info-banner {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.cosmic-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-weight: 700;
  font-size: 13.5px;
  padding: 12px 0;
}
.cosmic-error {
  color: #f87171;
  font-size: 13.5px;
  font-weight: 700;
  padding: 8px 0;
}
.cosmic-footer-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

/* Autonomous Cloud Search Box & Telemetry */
.cosmic-auto-box {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(15, 23, 42, 0.7));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cosmic-auto-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.cosmic-auto-title {
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cosmic-radar-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}
.cosmic-radar-beam {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--accent), #fff, var(--accent), transparent);
  border-radius: 3px;
  animation: cosmicRadarSweep 1.3s infinite ease-in-out;
}
@keyframes cosmicRadarSweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
.cosmic-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12.5px;
}
.cosmic-telemetry-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cosmic-telemetry-label {
  color: var(--ink-tertiary);
  font-size: 11px;
}
.cosmic-telemetry-val {
  color: var(--ink);
  font-weight: 700;
  font-family: var(--site-font) !important;
}
.cosmic-stop-btn {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.5) !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 700 !important;
  padding: 8px 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.cosmic-stop-btn:hover {
  background: rgba(239, 68, 68, 0.35) !important;
  color: #fff !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3) !important;
}

@media(max-width: 640px) {
  main { width: calc(100% - 20px); padding: 18px 0 40px; }
  .searchbar { flex-wrap: wrap; }
  .searchbar input { flex: 1 1 100%; }
  .searchbar button { flex: 1; padding: 11px 10px; font-size: 13px; }
  .panel select, .panel input { width: 100%; }
  .bd-res .fmt { min-width: 0; }
  .sharebar input { flex-basis: 100%; order: -1; }
  .mode-tab { padding: 8px 12px; font-size: 12px; }
}
