@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

/* Reset & Base */
:root {
  --primary-color: #000000;
  --secondary-color: #ffffff;
  --accent-color: #f59e0b; /* Amber 500 */
  --bg-color: #f3f4f6;
  --card-bg: #ffffff;
  --fact-color: #0f172a;
  --vibe-color: #8b5cf6;
  --success-color: #10b981;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--primary-color);
  height: 100vh;
  overflow: hidden; /* Prevent body scroll, we use internal scrolling */
}

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

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  z-index: 100;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-brand {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

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

.brand-shone {
  color: #374151;
}

/* Main Container (Bento Grid) */
.bento-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto auto auto;
  gap: 15px;
  padding: 80px 20px 20px 20px; /* Top padding for header */
  height: 100vh;
  overflow-y: auto;
  max-width: 1200px;
  margin: 0 auto;
}

/* Common Widget Styles */
.bento-widget {
  background: var(--card-bg);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bento-widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

/* New: Shine Channel Top Widget */
.widget-shine-top {
  grid-column: 1 / 3;
  grid-row: 1 / 2;
  min-height: 100px;
  background: transparent;
  box-shadow: none; /* Let the inner card handle shadow */
  overflow: visible; /* Allow hover effects to pop out */
}

.widget-shine-top:hover {
  transform: none; /* Disable transform on container */
  box-shadow: none;
}

/* 1. The Anchor (Shine) - Large Widget */
.widget-anchor {
  grid-column: 1 / 3;
  grid-row: 2 / 3;
  min-height: 240px; /* Increased height */
  background: linear-gradient(135deg, #fff7ed 0%, #fff 100%);
  display: flex;
  flex-direction: column;
}

/* Anchor Slider Logic */
.anchor-slider-container {
  flex: 1;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.anchor-slider {
  display: flex;
  width: 200%; /* 2 Slides */
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.anchor-slide {
  width: 50%;
  height: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
}

/* Slide 1: Default (Shine Channel) */
.slide-default {
  /* Using Shine Antenna Card styles below */
}

/* Slide 2: Present */
.slide-present .anchor-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #d97706;
  margin-bottom: 5px;
}

.slide-present .anchor-title {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: #1f2937;
  margin-bottom: 10px;
}

.slide-present .anchor-message {
  font-size: 1rem;
  color: #6b7280;
  margin-bottom: 15px;
}

/* Slide 3: Future */
.slide-future {
  background: #f8fafc;
}

.slide-future .anchor-label {
  color: #3b82f6;
}

/* Plan Circles (Future) */
.plan-circles-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.plan-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
  transition: transform 0.2s;
  border: 2px solid transparent;
}

.plan-circle:hover {
  transform: scale(1.1);
  border-color: #3b82f6;
}

.plan-circle.add-new {
  border: 2px dashed #cbd5e1;
  color: #cbd5e1;
  background: transparent;
}

/* Pagination Dots */
.anchor-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 15px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e5e7eb;
  cursor: pointer;
  transition: all 0.3s;
}

.dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--accent-color);
}

/* 2. Shineworld (Market Window) - Rational & Modular */
.widget-shineworld {
  grid-column: 1 / 2;
  grid-row: 3 / 4;
  min-height: 300px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 0; /* Remove padding to let list stretch */
  color: #1f2937;
  border: 1px solid #e5e7eb;
}

/* Override old styles if any remain */
.widget-shineworld .shineworld-overlay,
.widget-shineworld .shineworld-content {
  display: none;
}

/* Rational Dashboard Header */
.market-dashboard-header {
  padding: 16px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  z-index: 10;
}

.energy-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #64748b;
  background: #f8fafc;
  padding: 4px 8px;
  border-radius: 4px;
}

.energy-icon {
  color: var(--accent-color);
}

.market-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 1px;
  color: #0f172a;
}

.market-ping-btn {
  background: #0f172a;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.market-ping-btn:hover {
  background: #334155;
}

/* Inline Create Form */
.market-inline-create {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    background: #fdfdfd;
}

.inline-input {
    width: 100%;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    min-height: 50px;
    color: #1e293b;
    margin-bottom: 8px;
}

.inline-input::placeholder {
    color: #cbd5e1;
}

.inline-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.type-toggles {
    display: flex;
    gap: 8px;
}

.type-chip {
    border: 1px solid #e2e8f0;
    background: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.type-chip.active {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.type-chip[data-value="HARD_FACT"].active {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
}

.type-chip[data-value="SOFT_VIBE"].active {
    background: #f3e8ff;
    color: #7c3aed;
    border-color: #d8b4fe;
}

.inline-submit-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s;
}

.inline-submit-btn:hover {
    filter: brightness(1.1);
}

/* Market List (High Density) */
.market-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.market-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  padding: 40px 20px;
  text-align: center;
}

.empty-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  opacity: 0.5;
}

.empty-text {
  font-size: 0.9rem;
}

.market-list-item {
  padding: 16px;
  border-bottom: 1px solid #f1f5f9;
  cursor: default; /* Changed from pointer since actions are inline */
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
}

.item-type {
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 2px;
}

.type-fact {
  background: #e0f2fe;
  color: #0369a1;
}

.type-vibe {
  background: #f3e8ff;
  color: #7c3aed;
}

.item-content {
  font-size: 1rem;
  line-height: 1.5;
  color: #334155;
  /* Removed line clamping for full feed experience */
  word-break: break-word;
}

.item-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 5px;
}

.confidence-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.confidence-track {
  flex: 1;
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
}

.confidence-bar {
  height: 100%;
  background: #94a3b8;
  transition: width 0.3s ease;
}

.confidence-bar.high { background: #10b981; }
.confidence-bar.med { background: #f59e0b; }
.confidence-bar.low { background: #ef4444; }

.confidence-text {
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  color: #64748b;
  min-width: 35px;
  text-align: right;
}

/* Inline Actions */
.item-actions {
    display: flex;
    gap: 10px;
}

.action-btn-inline {
    flex: 1;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.action-btn-inline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.action-btn-inline.confirm {
    color: #059669;
}
.action-btn-inline.confirm:hover {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.action-btn-inline.challenge {
    color: #dc2626;
}
.action-btn-inline.challenge:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

.vote-status-inline {
    font-size: 0.8rem;
    color: #64748b;
    padding: 6px;
    background: #f1f5f9;
    border-radius: 4px;
    text-align: center;
    width: 100%;
}

/* 3. ShineMap - Mid Right */
.widget-field {
  grid-column: 2 / 3;
  grid-row: 3 / 4;
  min-height: 200px;
  background: #1e293b;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  cursor: pointer;
  position: relative;
}

.field-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(#334155 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    z-index: 0;
}

.field-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.field-icon {
    margin-bottom: auto;
    color: var(--accent-color);
}

.field-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.field-desc {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 15px;
}

.field-status {
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.1);
    padding: 4px 8px;
    border-radius: 12px;
    width: fit-content;
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 4px #22c55e;
}

/* Scope Switch in ShineMap Card */
.scope-switch-container {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 4px;
    width: fit-content;
    margin-bottom: 10px;
    pointer-events: auto; /* Ensure clicks are captured */
}

.scope-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scope-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.scope-btn:hover:not(.active) {
    color: white;
}


/* 4. The Spark (Prism) - Bottom Left */
.widget-spark {
  grid-column: 1 / 2;
  grid-row: 4 / 5;
  min-height: 160px;
  perspective: 1000px;
}

.spark-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

/* Removed hover flip for mobile consistency, handled by JS click */
/* .widget-spark:hover .spark-inner {
  transform: rotateY(180deg);
} */

.spark-front, .spark-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 24px;
}

.spark-front {
  background: linear-gradient(135deg, #e0f2fe 0%, #fff 100%);
}

.spark-back {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  transform: rotateY(180deg);
}

.spark-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.spark-text {
  font-weight: 600;
  color: #0f172a;
}

/* 5. The Echo (Shone) - Bottom Right */
.widget-echo {
  grid-column: 2 / 3;
  grid-row: 4 / 5;
  min-height: 160px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
}

.echo-stat {
  margin-bottom: 10px;
}

.echo-number {
  font-family: 'Syne', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1;
}

.echo-label {
  font-size: 0.9rem;
  color: #64748b;
}

/* Shine Antenna Card (Reused in Top Widget) */
.shine-antenna-card {
  background: white;
  border-radius: 24px;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

.shine-antenna-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

.pulse-ring {
  position: absolute;
  top: 50%;
  left: 40px; /* Centered on icon */
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.2);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { width: 10px; height: 10px; opacity: 1; }
  100% { width: 60px; height: 60px; opacity: 0; }
}

.antenna-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff7ed;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d97706;
  position: relative;
  z-index: 1;
}

.antenna-info {
  flex: 1;
  z-index: 1;
}

.antenna-title {
  font-weight: 700;
  color: #1f2937;
  font-size: 1rem;
}

.antenna-status {
  font-size: 0.8rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Drawers & Overlays */
.shine-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.shine-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.shine-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80vh;
  background: white;
  border-radius: 24px 24px 0 0;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.shine-drawer-overlay.active .shine-drawer {
  transform: translateY(0);
}

.drawer-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f3f4f6;
}

.drawer-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
}

.drawer-close {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
}

.channel-list-container {
  flex: 1;
  background: #f9fafb;
  position: relative;
  overflow-y: auto;
  padding: 20px;
}

/* Signal Bubble */
.signal-bubble {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #1f2937;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  white-space: nowrap;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  z-index: 10;
}

.signal-bubble:hover {
  z-index: 20;
  transform: translate(-50%, -50%) scale(1.1);
}

@keyframes popIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.shine-btn {
  display: inline-block;
  padding: 8px 20px;
  background: #000;
  color: #fff;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.2s;
}

.shine-btn:hover {
  opacity: 0.8;
}

/* Quick View Panel (Morphing) */
.plan-quick-view-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(2px);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.plan-quick-view-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.plan-quick-view-panel {
    position: absolute;
    background: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 910;
    overflow: hidden;
    display: none;
    /* Transition is handled in JS */
}

.plan-quick-view-panel.expanded {
    /* Final state styles if needed, mainly handled by JS inline styles */
}

/* Ensure widget containing the panel is above others */
.widget-elevated {
    z-index: 100 !important;
}

.plan-quick-view-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s;
}

.quick-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
}

.quick-view-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-view-actions {
    display: flex;
    gap: 10px;
}

.quick-view-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.quick-view-btn:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.quick-view-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.quick-view-days {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 10px;
    scrollbar-width: none; /* Firefox */
}
.quick-view-days::-webkit-scrollbar {
    display: none;
}

.quick-view-day-chip {
    padding: 6px 12px;
    background: #f3f4f6;
    border-radius: 16px;
    font-size: 0.8rem;
    color: #4b5563;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.quick-view-day-chip.active {
    background: var(--accent-color);
    color: white;
    font-weight: 600;
    transform: scale(1.05);
}

.quick-view-items {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-view-item {
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 3px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.quick-view-item-content {
    width: 100%;
}

.quick-view-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 2px;
}

.quick-view-item-meta {
    font-size: 0.75rem;
    color: #9ca3af;
}

.quick-view-empty {
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
    margin-top: 20px;
}

/* Map Overlay */
.map-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
}

.map-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.map-header {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 2001;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none; /* Let clicks pass through to map where empty */
}

.map-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    padding: 8px 16px;
    border-radius: 20px;
    pointer-events: auto;
}

.map-close-btn {
    background: rgba(255,255,255,0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.map-close-btn:hover {
    transform: scale(1.1);
}

/* Detail Panel (Detail View) */
.detail-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 30;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.detail-panel.active {
    transform: translateX(0);
}

.detail-header {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-back-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #334155;
    padding: 0;
    line-height: 1;
}

.detail-title {
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
}

.detail-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.detail-info {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 12px;
}

.detail-body {
    font-size: 1rem;
    line-height: 1.6;
    color: #334155;
    margin-bottom: 24px;
}

.detail-meta {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
}

.detail-meta-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.8rem;
}

.detail-meta-label { color: #94a3b8; }
.detail-meta-value { color: #334155; font-weight: 500; }

.detail-footer {
    padding: 16px;
    border-top: 1px solid #f3f4f6;
}

.detail-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-verify {
    background: #0f172a;
    color: white;
}

.btn-dismiss {
    background: #f1f5f9;
    color: #475569;
}

/* Modal (Create Spark) */
.create-spark-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.create-spark-modal.active {
    display: flex;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

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

.modal-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #0f172a;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #1e293b;
    transition: border-color 0.2s;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: #0f172a;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-footer {
    padding: 16px 20px;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
}

.btn-cancel {
    background: transparent;
    color: #64748b;
}

.btn-submit {
    background: #0f172a;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
  .bento-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  
  .widget-shine-top,
  .widget-anchor,
  .widget-shineworld,
  .widget-field,
  .widget-spark,
  .widget-echo {
    grid-column: 1 / 2;
    grid-row: auto;
  }
}
