/* MyJournal - CSS Styles
   Themeable colour scheme with 10 named themes
*/

/* ============================================
   CSS Custom Properties (Variables)
   ============================================ */

:root {
  /* Primary Theme Colours - These are overridden by JS theme system */
  --color-primary: #F97316;
  --color-primary-hover: #EA580C;
  --color-primary-light: #FED7AA;
  
  /* Legacy aliases for compatibility */
  --color-orange: var(--color-primary);
  --color-orange-hover: var(--color-primary-hover);
  --color-orange-light: var(--color-primary-light);
  
  /* Secondary Colours */
  --color-mustard: #FBBF24;
  --color-mustard-light: #FEF3C7;
  --color-teal: #14B8A6;
  --color-teal-hover: #0D9488;
  --color-teal-light: #CCFBF1;

  /* Light Mode (Default - Classic Day) */
  --bg-primary: #FFFBF5;
  --bg-secondary: #FEF7ED;
  --bg-card: #FFFFFF;
  --bg-input: #FFFFFF;
  --text-primary: #1C1917;
  --text-secondary: #78716C;
  --text-muted: #A8A29E;
  --border-color: #E7E5E4;
  --border-focus: var(--color-primary);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);

  /* Semantic Colours - Consistent across all themes */
  --color-success: #22C55E;
  --color-success-hover: #16A34A;
  --color-success-light: #DCFCE7;
  --color-warning: #F59E0B;
  --color-warning-hover: #D97706;
  --color-warning-light: #FEF3C7;
  --color-error: #EF4444;
  --color-error-hover: #DC2626;
  --color-error-light: #FEE2E2;
  --color-info: #14B8A6;

  /* Typography */
  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
  --font-content: 'Crimson Text', Georgia, serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Dark Mode - Only shadows; colors are set by JS theme system */
[data-theme="dark"] {
  --bg-input: var(--bg-secondary);
  --text-muted: var(--text-secondary);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* ============================================
   Color Theme Definitions (CSS Backup)
   ============================================ */

/* Blaze Theme - Day */
[data-color-theme="blaze"] {
  --color-primary: #FF8C00;
  --color-primary-hover: #E07400;
  --color-primary-light: #FFECD2;
  --color-orange: #FF8C00;
  --color-orange-hover: #E07400;
  --color-orange-light: #FFECD2;
}

[data-color-theme="blaze"]:not([data-theme="dark"]) {
  --bg-primary: #FFFDF7;
  --bg-secondary: #FFF5E6;
  --bg-card: #FFF5E6;
  --bg-input: #FFF5E6;
  --text-primary: #2D1B30;
  --text-secondary: #A0522D;
  --text-muted: #A0522D;
  --border-color: #F0C8A0;
}

/* Blaze Theme - Night */
[data-color-theme="blaze"][data-theme="dark"] {
  --color-primary: #FF9F1C;
  --color-primary-hover: #FFB347;
  --color-primary-light: #5C1A00;
  --color-orange: #FF9F1C;
  --color-orange-hover: #FFB347;
  --color-orange-light: #5C1A00;
  --bg-primary: #1A0E08;
  --bg-secondary: #2A1810;
  --bg-card: #2A1810;
  --bg-input: #2A1810;
  --text-primary: #FFF0DB;
  --text-secondary: #D4956A;
  --text-muted: #D4956A;
  --border-color: #4A2C1A;
}

/* Monochrome Theme - Day */
[data-color-theme="monochrome"] {
  --color-primary: #4A4A4A;
  --color-primary-hover: #333333;
  --color-primary-light: #E0E0E0;
  --color-orange: #4A4A4A;
  --color-orange-hover: #333333;
  --color-orange-light: #E0E0E0;
}

[data-color-theme="monochrome"]:not([data-theme="dark"]) {
  --bg-primary: #FAFAFA;
  --bg-secondary: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-input: #FFFFFF;
  --text-primary: #0A0A0A;
  --text-secondary: #6B6B6B;
  --text-muted: #6B6B6B;
  --border-color: #D5D5D5;
}

/* Monochrome Theme - Night */
[data-color-theme="monochrome"][data-theme="dark"] {
  --color-primary: #B0B0B0;
  --color-primary-hover: #CCCCCC;
  --color-primary-light: #2A2A2A;
  --color-orange: #B0B0B0;
  --color-orange-hover: #CCCCCC;
  --color-orange-light: #2A2A2A;
  --bg-primary: #0D0D0D;
  --bg-secondary: #1A1A1A;
  --bg-card: #1A1A1A;
  --bg-input: #1A1A1A;
  --text-primary: #EBEBEB;
  --text-secondary: #888888;
  --text-muted: #888888;
  --border-color: #2E2E2E;
}

/* ============================================
   Base Styles
   ============================================ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
  color: var(--text-secondary);
}

.logo {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-orange);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.btn-primary {
  background-color: var(--color-orange);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-orange-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-secondary);
  border-color: var(--color-orange);
}

.btn-danger {
  background-color: var(--color-error);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background-color: #DC2626;
}

.btn-large {
  padding: var(--space-md) var(--space-xl);
  font-size: 1rem;
}

.btn-small {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.875rem;
}

.btn-icon-only {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  font-size: 1.25rem;
}

.btn-icon-only:hover {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
}

#btn-logout {
  position: relative;
  color: #000000;
}

[data-theme="dark"] #btn-logout {
  color: #FFFFFF;
}

#btn-logout:hover {
  background-color: var(--color-error);
  border-color: var(--color-error);
  color: #FFFFFF;
}

#btn-logout.entry-status-green {
  background-color: #22c55e;
  border-color: #22c55e;
  color: #FFFFFF;
}

#btn-logout.entry-status-green:hover {
  background-color: #16a34a;
  border-color: #16a34a;
}

#btn-logout.entry-status-amber {
  background-color: #f59e0b;
  border-color: #f59e0b;
  color: #FFFFFF;
}

#btn-logout.entry-status-amber:hover {
  background-color: #d97706;
  border-color: #d97706;
}

#btn-logout.entry-status-red {
  background-color: #ef4444;
  border-color: #ef4444;
  color: #FFFFFF;
}

#btn-logout.entry-status-red:hover {
  background-color: #dc2626;
  border-color: #dc2626;
}

.entry-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: #000000;
  background-color: #FFFFFF;
  border: 1px solid #333;
  pointer-events: none;
  box-sizing: border-box;
}

.btn-back {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  padding: var(--space-sm);
  margin-bottom: var(--space-md);
}

.btn-back:hover {
  color: var(--color-orange);
}

/* ============================================
   Forms
   ============================================ */

.form-group {
  margin-bottom: var(--space-lg);
}

.login-lockout-msg {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-warning);
  margin-top: var(--space-xs);
  font-weight: 500;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.optional {
  font-weight: 400;
  color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--text-primary);
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-orange);
  box-shadow: 0 0 0 3px var(--color-orange-light);
}

textarea {
  font-family: var(--font-content);
  font-size: 1.125rem;
  line-height: 1.7;
  resize: vertical;
  min-height: 200px;
}

select {
  cursor: pointer;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-weight: 400;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin-top: 0.2rem;
  accent-color: var(--color-orange);
}

/* Password Strength */
.password-strength {
  margin-top: var(--space-sm);
}

.strength-bar {
  height: 4px;
  background-color: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--space-xs);
}

.strength-fill {
  height: 100%;
  width: 0%;
  background-color: var(--color-error);
  transition: width var(--transition-normal), background-color var(--transition-normal);
}

.strength-fill[data-level="1"] { width: 20%; background-color: var(--color-error); }
.strength-fill[data-level="2"] { width: 40%; background-color: var(--color-warning); }
.strength-fill[data-level="3"] { width: 60%; background-color: var(--color-mustard); }
.strength-fill[data-level="4"] { width: 80%; background-color: var(--color-teal); }
.strength-fill[data-level="5"] { width: 100%; background-color: var(--color-success); }

.strength-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.password-requirements {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.match-indicator {
  font-size: 0.8125rem;
  margin-top: var(--space-xs);
  display: block;
}

/* ============================================
   Screens
   ============================================ */

.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: block;
}

/* Welcome Screen */
.welcome-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-xl);
  text-align: center;
}

.welcome-header {
  margin-bottom: var(--space-2xl);
}

.welcome-header .logo {
  font-size: 2.5rem;
  margin-bottom: var(--space-sm);
}

.tagline {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
  max-width: 300px;
}

.browser-notice {
  margin-top: var(--space-2xl);
  padding: var(--space-md);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Auth Screens */
.auth-container {
  max-width: 420px;
  margin: 0 auto;
  padding: var(--space-xl);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-form {
  background-color: var(--bg-card);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.warning-box {
  background-color: var(--color-mustard-light);
  border: 1px solid var(--color-mustard);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
}

[data-theme="dark"] .warning-box {
  background-color: rgba(251, 191, 36, 0.1);
}

.warning-box p {
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.warning-box p:last-of-type {
  margin-bottom: var(--space-md);
}

.welcome-back {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.last-access {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

/* ============================================
   Dashboard
   ============================================ */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo {
  font-size: 1.25rem;
  color: var(--color-orange);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.header-logo .db-name {
  font-weight: 400;
  color: var(--text-secondary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.dashboard-main {
  padding: var(--space-md) var(--space-lg);
  max-width: 1200px;
  margin: 0 auto;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.entry-count {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted);
}

.readonly-badge {
  display: inline-block;
  margin-left: var(--space-sm);
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  vertical-align: middle;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sort-controls label {
  margin-bottom: 0;
  color: var(--text-secondary);
}

.sort-controls select {
  width: auto;
  padding: var(--space-xs) var(--space-sm);
}

/* ============================================
   Entry Grid
   ============================================ */

.entries-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(180px, auto);
  grid-auto-flow: dense;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .entries-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }
}

@media (min-width: 1024px) {
  .entries-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
  }
}

/* Entry Card */
.entry-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.entry-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-orange);
}

.entry-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.entry-card-template-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.entry-card-template-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-card-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-left: auto;
  flex-shrink: 0;
}

/* Entry card title + mood row */
.entry-card-title-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.entry-card-title-row .entry-title {
  flex: 0 1 auto;
  min-width: 0;
  margin-bottom: 0;
}

.entry-card-title-row .entry-mood {
  flex-shrink: 0;
}

.entry-mood {
  font-size: 1.25rem;
}

/* Entry card link icon button */
.entry-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity var(--transition-fast);
}

.entry-card-link.link-external {
  background-color: var(--color-teal);
}

.entry-card-link.link-internal {
  background-color: var(--color-orange);
}

.entry-card-link:hover {
  opacity: 0.85;
}

.entry-card-link .link-icon-external,
.entry-card-link .link-icon-internal {
  display: block;
  width: 14px;
  height: 14px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.entry-card-link .link-icon-external {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'%3E%3C/path%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'%3E%3C/path%3E%3C/svg%3E");
}

.entry-card-link .link-icon-internal {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48'%3E%3C/path%3E%3C/svg%3E");
}

/* Entry card divider (consistent separator above tags/date footer) */
.entry-card-divider {
  border-top: 1px solid var(--border-color);
  margin-top: var(--space-sm);
}

.entry-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Reference ID Copy Button - All Card Types */
.card-ref-id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  margin-left: auto;
  background-color: var(--color-info);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.card-ref-id:hover {
  background-color: var(--color-teal-hover);
  transform: scale(1.1);
}

.card-ref-id:active {
  transform: scale(0.95);
}

.card-ref-id .ref-id-icon {
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.card-ref-id.copied {
  background-color: var(--color-success);
}

.card-ref-id.copied .ref-id-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  animation: checkBounce 0.3s ease;
}

@keyframes checkBounce {
  0% { transform: scale(0.5); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Card Favourite Button */
.card-favourite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.card-favourite:hover {
  transform: scale(1.15);
  color: var(--color-mustard);
}

.card-favourite:active {
  transform: scale(0.95);
}

.card-favourite.is-favourite {
  color: var(--color-mustard);
}

.card-favourite.is-favourite:hover {
  color: var(--color-orange);
}

@keyframes starPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Card Footer with Creation Date - All Card Types */
.card-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-sm);
  padding-top: var(--space-xs);
}

.card-creation-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
  text-align: right;
}

.card-favourite.animating {
  animation: starPulse 0.3s ease;
}

/* Card Follow Up Flag (read-only indicator) */
.card-follow-up-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
  cursor: default;
  user-select: none;
}

.entry-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entry-preview {
  font-family: var(--font-content);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: var(--space-md);
}

.empty-state h3 {
  margin-bottom: var(--space-sm);
}

.empty-state p {
  margin-bottom: var(--space-lg);
}

/* ============================================
   Modals
   ============================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background-color: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  width: 100%;
}

.entry-modal-content {
  max-width: 700px;
}

.settings-modal-content {
  max-width: 500px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background-color: var(--bg-card);
  z-index: 10;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.save-status {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.save-status.saving {
  color: var(--color-mustard);
}

.save-status.saved {
  color: var(--color-success);
}

/* Entry Form */
.entry-form {
  padding: var(--space-lg);
}

/* Form Label Row (label + inline control on same line) */
.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xs);
}

.form-label-row > label:first-child {
  margin-bottom: 0;
}

/* Follow Up Toggle in Entry Form */
.follow-up-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-primary);
  user-select: none;
  margin-bottom: 0;
}

.follow-up-toggle input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.follow-up-toggle input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

.follow-up-toggle input[type="checkbox"]:disabled ~ .follow-up-toggle-label,
.follow-up-toggle input[type="checkbox"]:disabled ~ .follow-up-toggle-flag {
  cursor: not-allowed;
  opacity: 0.6;
}

.follow-up-toggle-label {
  font-weight: 500;
}

.follow-up-toggle-flag {
  font-size: 0.875rem;
}

.mood-selector {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.mood-btn {
  width: 3rem;
  height: 3rem;
  font-size: 1.5rem;
  background-color: var(--bg-secondary);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mood-btn:hover {
  transform: scale(1.1);
  border-color: var(--color-orange);
}

.mood-btn.selected {
  background-color: var(--color-orange-light);
  border-color: var(--color-orange);
}

[data-theme="dark"] .mood-btn.selected {
  background-color: rgba(249, 115, 22, 0.2);
}

/* Template Select */
.template-select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-size: 1rem;
  font-family: inherit;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-md) center;
  padding-right: calc(var(--space-md) * 2 + 12px);
}

.template-select:hover {
  border-color: var(--color-orange);
}

.template-select:focus {
  outline: none;
  border-color: var(--color-orange);
  box-shadow: 0 0 0 3px var(--color-orange-light);
}

[data-theme="dark"] .template-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23aaa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

/* Personal Template Actions */
.personal-template-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-sm);
}

.personal-template-actions.hidden {
  display: none;
}

/* Personal Template Edit Modal */
.personal-template-modal-content {
  max-width: 600px;
}

.personal-template-body {
  padding: var(--space-md) var(--space-lg);
}

.personal-template-hint {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
  line-height: 1.4;
}

.personal-template-body textarea {
  width: 100%;
  min-height: 250px;
  padding: var(--space-sm) var(--space-md);
  font-size: 1rem;
  font-family: inherit;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  resize: vertical;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.personal-template-body textarea:focus {
  outline: none;
  border-color: var(--color-orange);
  box-shadow: 0 0 0 3px var(--color-orange-light);
}

.personal-template-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-color);
}

/* Entry Link Section */
.entry-link-group {
  margin-top: var(--space-sm);
}

.entry-link-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.entry-link-input-wrapper input {
  flex: 1;
  padding-right: 36px;
}

.entry-link-icon {
  position: absolute;
  right: 10px;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.link-icon-external-indicator {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314B8A6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'%3E%3C/path%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.link-icon-internal-indicator {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F97316' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.entry-link-preview {
  margin-top: var(--space-sm);
}

.entry-link-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.entry-link-btn.entry-link-external {
  background-color: var(--color-teal-light);
  color: var(--color-teal-hover);
}

.entry-link-btn.entry-link-external:hover {
  background-color: var(--color-teal);
  color: white;
}

.entry-link-btn.entry-link-internal {
  background-color: var(--color-orange-light);
  color: var(--color-orange-hover);
}

.entry-link-btn.entry-link-internal:hover {
  background-color: var(--color-orange);
  color: white;
}

.entry-link-btn .link-preview-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.entry-link-btn .link-preview-icon .link-icon-external,
.entry-link-btn .link-preview-icon .link-icon-internal {
  width: 16px;
  height: 16px;
}

.entry-link-btn.entry-link-external .link-icon-external {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230D9488' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'%3E%3C/path%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.entry-link-btn.entry-link-external:hover .link-icon-external {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'%3E%3C/path%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'%3E%3C/path%3E%3C/svg%3E");
}

.entry-link-btn.entry-link-internal .link-icon-internal {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23EA580C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.entry-link-btn.entry-link-internal:hover .link-icon-internal {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48'%3E%3C/path%3E%3C/svg%3E");
}

.entry-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
}

.entry-stats {
  display: flex;
  gap: var(--space-md);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.entry-actions {
  display: flex;
  gap: var(--space-sm);
}

.entry-button-group {
  display: flex;
  gap: var(--space-sm);
}

.entry-button-group.hidden {
  display: none;
}

/* Settings */
.settings-content {
  padding: var(--space-lg);
}

.settings-section {
  margin-bottom: var(--space-xl);
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h3 {
  margin-bottom: var(--space-md);
  color: var(--color-orange);
}

.setting-item {
  margin-bottom: var(--space-md);
}

.setting-item-row {
  display: flex;
  gap: var(--space-lg);
}

.setting-item-row .setting-item {
  flex: 1;
}

.setting-item label:not(.checkbox-label) {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.setting-item .checkbox-label {
  justify-content: flex-start;
}

.setting-item select {
  width: auto;
  min-width: 150px;
}

.about-text {
  font-size: 0.875rem;
  margin-bottom: var(--space-xs);
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
  position: fixed;
  bottom: 80px;
  right: var(--space-lg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background-color: var(--bg-card);
  color: var(--text-primary);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--color-teal);
  animation: slideIn 0.3s ease;
  max-width: 350px;
}

.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-error); }
.toast.warning { border-left-color: var(--color-warning); }

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================
   Loading Overlay
   ============================================ */

.loading-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(255, 251, 245, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

[data-theme="dark"] .loading-overlay {
  background-color: rgba(28, 25, 23, 0.9);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--color-orange);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: var(--space-md);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   Utilities
   ============================================ */

.hidden {
  display: none !important;
}

.error-message {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--color-error);
  color: var(--color-error);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

/* ============================================
   Media Attachments
   ============================================ */

.media-controls {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.media-count {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.media-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.media-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.media-item:hover {
  transform: scale(1.05);
  border-color: var(--color-orange);
}

.media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-item-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  padding: 0;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.media-item:hover .media-item-delete {
  opacity: 1;
}

.media-item-delete:hover {
  background-color: var(--color-error);
}

.media-uploading {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: var(--space-sm) 0;
}

.loading-spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-top-color: var(--color-orange);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Entry card media thumbnails */
.entry-card-media {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.entry-card-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

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

.entry-card-media-more {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================
   Media Viewer Modal
   ============================================ */

.media-viewer-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.viewer-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 10;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  width: 2.5rem;
  height: 2.5rem;
}

.viewer-close:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

#viewer-image,
#viewer-video {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

#viewer-video {
  background-color: #000;
}

/* Audio viewer */
.viewer-audio-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-xl);
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: var(--radius-lg);
  min-width: 320px;
  max-width: 500px;
}

.audio-waveform-display {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.audio-waveform-display img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#viewer-audio {
  width: 100%;
  max-width: 400px;
  height: 48px;
  border-radius: var(--radius-md);
}

/* Style audio controls for webkit browsers */
#viewer-audio::-webkit-media-controls-panel {
  background: linear-gradient(to right, var(--color-orange), var(--color-teal));
}

.viewer-info {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.875rem;
  display: flex;
  gap: var(--space-md);
}

/* Video indicator on thumbnails */
.media-item-video-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.625rem;
  font-weight: 600;
}

/* Audio indicator on thumbnails */
.media-item-audio-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background-color: var(--color-orange);
  color: white;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.625rem;
  font-weight: 600;
}

.entry-card-thumb-video {
  position: relative;
}

.entry-card-video-badge {
  position: absolute;
  bottom: 2px;
  left: 2px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 0.5rem;
}

/* ============================================
   Storage & Stats
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.stat-item {
  background-color: var(--bg-secondary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-xs);
}

.stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-orange);
}

.storage-bars {
  margin-bottom: var(--space-md);
}

.storage-item {
  margin-bottom: var(--space-sm);
}

.storage-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.storage-bar {
  height: 8px;
  background-color: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.storage-fill {
  height: 100%;
  background-color: var(--color-teal);
  border-radius: 4px;
  transition: width var(--transition-normal);
}

.storage-fill-media {
  background-color: var(--color-mustard);
}

.memory-stats {
  margin-bottom: var(--space-md);
}

.stat-detail {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.stat-detail span:last-child {
  color: var(--text-primary);
  font-weight: 500;
}

.stat-detail.highlight {
  background-color: var(--bg-secondary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  margin-top: var(--space-xs);
}

.stat-detail.highlight span:last-child {
  color: var(--color-success);
  font-weight: 600;
}

.compression-stats,
.memory-stats {
  margin-bottom: var(--space-md);
}

.compression-stats h4,
.memory-stats h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.stat-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
  font-style: italic;
}

/* Memory state indicators */
.memory-indicator {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.memory-indicator.state-normal {
  color: var(--color-success);
}

.memory-indicator.state-warning {
  background-color: rgba(251, 191, 36, 0.2);
  color: var(--color-warning);
}

.memory-indicator.state-critical {
  background-color: rgba(239, 68, 68, 0.2);
  color: var(--color-error);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

#memory-status-row.state-warning {
  background-color: rgba(251, 191, 36, 0.1);
  border-left: 3px solid var(--color-warning);
}

#memory-status-row.state-critical {
  background-color: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--color-error);
}

/* ============================================
   Confirm Modal
   ============================================ */

.confirm-modal-content {
  max-width: 400px;
}

.confirm-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.confirm-header h3 {
  margin: 0;
  color: var(--color-error);
}

.confirm-body {
  padding: var(--space-lg);
}

.confirm-body p {
  margin: 0;
  color: var(--text-primary);
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.readonly-modal-content {
  max-width: 440px;
}

.readonly-modal-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.readonly-modal-header h3 {
  margin: 0;
  color: var(--color-error);
}

.readonly-modal-body {
  padding: var(--space-lg);
}

.readonly-modal-body p {
  margin: 0 0 var(--space-sm) 0;
  color: var(--text-primary);
}

.readonly-checkbox-label {
  margin-top: var(--space-md);
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  cursor: pointer;
}

.readonly-checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
}

.readonly-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-color);
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 639px) {
  .app-header {
    padding: var(--space-sm) var(--space-md);
  }

  .header-logo {
    font-size: 1rem;
    max-width: calc(100vw - 160px);
  }

  .dashboard-main {
    padding: var(--space-md);
  }

  .modal-content {
    border-radius: var(--radius-lg);
    max-height: 95vh;
  }

  .entry-form {
    padding: var(--space-md);
  }

  .toast-container {
    left: var(--space-md);
    right: var(--space-md);
    bottom: 80px;
  }

  .toast {
    max-width: 100%;
  }
  
  .fab-container {
    bottom: 16px;
    left: 16px;
  }
}

/* ============================================
   Ko-fi Widget Position Override
   ============================================ */

.floatingchat-container-wrap {
  left: auto !important;
  right: 24px !important;
}

.floatingchat-container-wrap.kofi-hidden,
.floatingchat-container.kofi-hidden {
  display: none !important;
}

/* ============================================
   Floating Action Button (FAB)
   ============================================ */

.fab-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 100;
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  background: var(--color-orange);
  border-radius: 28px;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.fab-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

.fab-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: white;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.fab-btn:active {
  transform: scale(0.95);
}

.fab-icon {
  font-size: 1.25rem;
}

/* ============================================
   Counter Card
   ============================================ */

.counter-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.counter-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-teal);
}

/* Urgent counter (less than 7 days) */
.counter-card.urgent {
  border-left: 3px solid var(--color-warning);
}

.counter-card.urgent .countdown-value {
  color: var(--color-warning);
}

/* Shake animation on hover for urgent counters */
@keyframes urgentShake {
  0%, 100% { transform: translateX(0) translateY(-2px) scale(1.01); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-2px) translateY(-2px) scale(1.01); }
  20%, 40%, 60%, 80% { transform: translateX(2px) translateY(-2px) scale(1.01); }
}

.counter-card.urgent:hover {
  animation: urgentShake 0.5s ease-in-out;
}

/* Ended counter */
.counter-card[data-status="ended"] {
  opacity: 0.85;
  background: var(--bg-secondary);
}

.counter-card[data-status="ended"]:hover {
  border-color: var(--color-teal);
}

/* Card header */
.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.card-icon {
  font-size: 1.25rem;
}

.card-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
  flex: 1;
}

.counter-status {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 10px;
}

.counter-status.active {
  background-color: var(--color-teal-light);
  color: var(--color-teal);
}

[data-theme="dark"] .counter-status.active {
  background-color: rgba(20, 184, 166, 0.2);
}

.counter-status.ended {
  background-color: var(--bg-secondary);
  color: var(--text-muted);
}

/* Card title */
.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Countdown display */
.countdown-display {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
  padding: var(--space-sm);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.countdown-unit {
  text-align: center;
  min-width: 36px;
  padding: 2px 4px;
}

/* Adjust unit size based on count */
.countdown-display[data-unit-count="7"] .countdown-unit {
  min-width: 32px;
}

.countdown-display[data-unit-count="6"] .countdown-unit,
.countdown-display[data-unit-count="5"] .countdown-unit {
  min-width: 36px;
}

.countdown-display[data-unit-count="4"] .countdown-unit,
.countdown-display[data-unit-count="3"] .countdown-unit {
  min-width: 44px;
}

.countdown-display[data-unit-count="2"] .countdown-unit,
.countdown-display[data-unit-count="1"] .countdown-unit {
  min-width: 60px;
}

.countdown-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-teal);
  line-height: 1.2;
}

/* Larger values for fewer units */
.countdown-display[data-unit-count="4"] .countdown-value,
.countdown-display[data-unit-count="3"] .countdown-value,
.countdown-display[data-unit-count="2"] .countdown-value,
.countdown-display[data-unit-count="1"] .countdown-value {
  font-size: 1.5rem;
}

.countdown-label {
  display: block;
  font-size: 0.5rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.countdown-display[data-unit-count="4"] .countdown-label,
.countdown-display[data-unit-count="3"] .countdown-label,
.countdown-display[data-unit-count="2"] .countdown-label,
.countdown-display[data-unit-count="1"] .countdown-label {
  font-size: 0.625rem;
}

/* Counter target date */
.counter-target {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

/* Counter notes */
.counter-notes {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: var(--space-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Ended display */
.counter-ended-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-md);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
}

.ended-checkmark {
  font-size: 2rem;
  color: var(--color-success);
  margin-bottom: var(--space-xs);
}

.ended-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.ended-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ============================================
   Counter Modal
   ============================================ */

.counter-modal-content {
  max-width: 480px;
}

.counter-form {
  padding: var(--space-lg);
}

.counter-actions {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
}

.counter-button-group {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

.counter-button-group.hidden {
  display: none;
}

/* Form validation */
.required {
  color: var(--color-error);
}

input.error,
textarea.error {
  border-color: var(--color-error);
}

input.error:focus,
textarea.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.error-message {
  font-size: 0.8125rem;
  color: var(--color-error);
  margin-top: var(--space-xs);
  background: transparent;
  border: none;
  padding: 0;
}

/* Counter notes - shorter textarea for 200 char limit */
#counter-notes {
  min-height: 80px;
  font-family: var(--font-ui);
  font-size: 0.9375rem;
}

/* Character count */
.char-count {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.char-count.warning {
  color: var(--color-warning);
}

.char-count.error {
  color: var(--color-error);
}

/* Time selects */
.time-selects {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.time-select {
  width: 80px;
  text-align: center;
}

.time-separator {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ============================================
   Calendar Component
   ============================================ */

.calendar-container {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.calendar-title {
  font-weight: 600;
  color: var(--text-primary);
}

.calendar-nav {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.calendar-nav:hover:not(:disabled) {
  border-color: var(--color-orange);
  color: var(--color-orange);
}

.calendar-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: var(--space-xs);
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: var(--space-xs);
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  background-color: var(--bg-card);
  color: var(--text-primary);
}

.calendar-day:hover:not(.disabled):not(.selected) {
  background-color: var(--color-orange-light);
  color: var(--color-orange);
}

.calendar-day.other-month {
  color: var(--text-muted);
  background-color: transparent;
}

.calendar-day.today {
  font-weight: 700;
  border: 2px solid var(--color-teal);
}

.calendar-day.selected {
  background-color: var(--color-orange);
  color: white;
  font-weight: 600;
}

.calendar-day.disabled {
  color: var(--text-muted);
  opacity: 0.4;
  cursor: not-allowed;
  background-color: transparent;
}

/* ============================================
   Ended Counters Notification Modal
   ============================================ */

.ended-counters-modal-content {
  max-width: 400px;
}

.ended-counters-body {
  padding: var(--space-lg);
}

.ended-counters-body > p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

.ended-counters-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ended-counters-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
}

.ended-counters-list li:last-child {
  margin-bottom: 0;
}

.ended-counter-check {
  color: var(--color-success);
  font-size: 1rem;
}

.ended-counter-info {
  flex: 1;
}

.ended-counter-title {
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

.ended-counter-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.ended-counters-actions {
  display: flex;
  justify-content: center;
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-color);
}

/* ============================================
   Top 10 Card
   ============================================ */

.top10-card {
  grid-row: span 2;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.top10-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-mustard);
}

/* Top 10 card header */
.top10-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-color);
}

.top10-card-icon {
  font-size: 1.25rem;
}

.top10-card-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

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

/* Top 10 entries list on card */
.top10-card-list {
  flex: 1;
  list-style: none;
  padding: 0;
  margin: 0;
}

.top10-card-list li {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.top10-card-list li:last-child {
  border-bottom: none;
}

.top10-rank {
  font-weight: 600;
  color: var(--color-mustard);
  min-width: 1.75rem;
  text-align: right;
}

.top10-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top10-link-icon {
  color: var(--color-teal);
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* Top 10 Link Buttons - External (teal chain) and Internal (orange paperclip) */
.top10-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  margin-left: var(--space-xs);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.top10-link-btn:hover {
  transform: scale(1.1);
}

.top10-link-btn:active {
  transform: scale(0.95);
}

/* External link button - Teal with chain link icon */
.top10-link-external {
  background-color: var(--color-teal);
}

.top10-link-external:hover {
  background-color: var(--color-teal-hover);
}

.top10-link-external .link-icon-external {
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'%3E%3C/path%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Internal link button - Orange with paperclip icon */
.top10-link-internal {
  background-color: var(--color-orange);
}

.top10-link-internal:hover {
  background-color: var(--color-orange-hover);
}

.top10-link-internal .link-icon-internal {
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Internal reference display text */
.top10-entry-ref {
  color: var(--color-orange);
  font-family: var(--font-ui);
  font-size: 0.75rem;
}

/* ============================================
   Top 10 Modal
   ============================================ */

.top10-modal-content {
  max-width: 550px;
}

.top10-form {
  padding: var(--space-lg);
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.top10-entries-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.top10-entry-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.top10-entry-item:hover {
  border-color: var(--border-color);
}

.top10-entry-item.dragging {
  opacity: 0.5;
  background-color: var(--color-orange-light);
}

.top10-entry-item.drop-target {
  border-color: var(--color-orange);
  background-color: var(--color-orange-light);
}

[data-theme="dark"] .top10-entry-item.dragging,
[data-theme="dark"] .top10-entry-item.drop-target {
  background-color: rgba(249, 115, 22, 0.2);
}

.top10-entry-rank {
  font-weight: 700;
  color: var(--color-mustard);
  min-width: 1.25rem;
  text-align: center;
  font-size: 0.875rem;
}

.top10-entry-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.top10-entry-input {
  width: 100%;
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-input);
  color: var(--text-primary);
}

.top10-entry-input:focus {
  outline: none;
  border-color: var(--color-orange);
  box-shadow: 0 0 0 2px var(--color-orange-light);
}

/* URL toggle wrapper */
.top10-url-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.2s ease;
}

.top10-url-wrapper.expanded {
  grid-template-rows: 1fr;
}

.top10-url-inner {
  overflow: hidden;
}

.top10-url-row {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding-top: var(--space-xs);
}

.top10-url-input {
  flex: 1;
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.8125rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-input);
  color: var(--text-secondary);
}

.top10-url-input:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 2px var(--color-teal-light);
}

.top10-url-input::placeholder {
  color: var(--text-muted);
}

.top10-url-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.top10-url-close:hover {
  color: var(--color-error);
  background-color: rgba(239, 68, 68, 0.1);
}

.top10-entry-text {
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.top10-entry-url {
  font-size: 0.8125rem;
  margin-top: var(--space-xs);
}

.top10-entry-url a {
  color: var(--color-teal);
  text-decoration: none;
}

.top10-entry-url a:hover {
  text-decoration: underline;
}

.top10-entry-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

/* Link toggle button */
.top10-link-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.top10-link-toggle:hover {
  background-color: var(--bg-card);
  color: var(--color-teal);
}

.top10-link-toggle.has-url {
  color: var(--color-teal);
}

.top10-entry-link-icon {
  font-size: 0.875rem;
  color: var(--color-teal);
}

.top10-drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 4px;
  user-select: none;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.top10-drag-handle:hover {
  color: var(--text-secondary);
  background-color: var(--bg-card);
}

.top10-drag-handle:active {
  cursor: grabbing;
}

.top10-actions {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
}

.top10-button-group {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

.top10-button-group.hidden {
  display: none;
}

/* Text muted helper */
.text-muted {
  color: var(--text-muted);
}

/* ============================================
   Moment Cards
   ============================================ */

.moment-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  position: relative;
  overflow: hidden;
}

/* Image moments span 2 rows (like Top 10 cards) */
.moment-card[data-moment-type="image"] {
  grid-row: span 2;
  display: flex;
  flex-direction: column;
}

.moment-card[data-moment-type="image"] .moment-card-image {
  flex: 1;
  min-height: 200px;
}

/* Gradient accent on top */
.moment-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ec4899, #8b5cf6);
}

.moment-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: #ec4899;
}

/* Moment card header */
.moment-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
  margin-top: var(--space-xs);
}

.moment-card-icon {
  font-size: 1.25rem;
}

.moment-card-date {
  flex: 1;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}

/* Quote moment styling */
.moment-card-quote {
  text-align: center;
  padding: var(--space-md) var(--space-sm);
}

.moment-quote-text {
  font-family: var(--font-content);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0 0 var(--space-sm) 0;
}

.moment-quote-attribution {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Image moment styling */
.moment-card-image {
  width: 100%;
  min-height: 120px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.moment-card-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.moment-image-loading {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.moment-image-error {
  color: var(--color-error);
  font-size: 0.875rem;
}

/* Image moment subtitle */
.moment-card-subtitle {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm) 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Note moment styling */
.moment-card-note {
  padding: var(--space-sm);
}

.moment-note-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0 0 var(--space-xs) 0;
  line-height: 1.3;
}

.moment-note-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Slideshow card elements */
.moment-card-slideshow {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--bg-secondary);
}

.moment-slideshow-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.moment-slideshow-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: var(--bg-secondary);
  /* Simple fade transition */
  transition: opacity 0.6s ease-in-out;
  opacity: 1;
}

/* Hidden state for slideshow images - simple fade */
.moment-slideshow-image.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Lock icon in header - grey outline SVG when unlocked, emoji when locked */
.moment-card-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform var(--transition-fast);
}

.moment-card-lock:hover {
  transform: scale(1.1);
}

/* Unlocked state - grey outline SVG */
.moment-card-lock .lock-icon {
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Locked state - hide SVG icon */
.moment-card-lock.locked .lock-icon {
  display: none;
}

/* Locked state - show emoji */
.moment-card-lock .lock-emoji {
  display: none;
  font-size: 14px;
}

.moment-card-lock.locked .lock-emoji {
  display: block;
}


/* Position dots */
.moment-slideshow-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: var(--space-sm) 0;
}

.moment-slideshow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--border-color);
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  border: none;
  padding: 0;
}

.moment-slideshow-dot:hover:not(.disabled) {
  transform: scale(1.2);
}

.moment-slideshow-dot.active {
  background-color: var(--color-orange);
}

.moment-slideshow-dot.disabled {
  opacity: 0.4;
  cursor: default;
}

/* Lock icon in header */
.moment-card-lock {
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  transition: transform var(--transition-fast);
}

.moment-card-lock:hover {
  transform: scale(1.1);
}

/* Link icons on card */
.moment-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.moment-card-link.link-external {
  background-color: var(--color-teal);
}

.moment-card-link.link-internal {
  background-color: var(--color-orange);
}

.moment-card-link:hover {
  opacity: 0.9;
}

.moment-card-link .link-icon-external,
.moment-card-link .link-icon-internal {
  width: 14px;
  height: 14px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.moment-card-link .link-icon-external {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'%3E%3C/path%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'%3E%3C/path%3E%3C/svg%3E");
}

.moment-card-link .link-icon-internal {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48'%3E%3C/path%3E%3C/svg%3E");
}

/* Slideshow animation styles are defined earlier in the file */

/* ============================================
   Moment Modal
   ============================================ */

.moment-modal-content {
  max-width: 500px;
  padding: var(--space-lg);
  padding-top: 0;
}

.moment-modal-content .modal-header {
  margin-left: calc(-1 * var(--space-lg));
  margin-right: calc(-1 * var(--space-lg));
  margin-bottom: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.moment-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Type selector */
.moment-type-selector {
  display: flex;
  gap: var(--space-md);
}

.moment-type-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.moment-type-option:hover {
  border-color: var(--color-orange);
}

.moment-type-option:has(input:checked) {
  border-color: var(--color-orange);
  background-color: var(--color-orange-light);
}

[data-theme="dark"] .moment-type-option:has(input:checked) {
  background-color: rgba(249, 115, 22, 0.2);
}

.moment-type-option input[type="radio"] {
  accent-color: var(--color-orange);
}

.moment-type-label {
  font-size: 0.9375rem;
  font-weight: 500;
}

/* Image upload section */
.moment-image-section,
.moment-quote-section,
.moment-note-section {
  animation: fadeIn var(--transition-fast);
}

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

.moment-image-count {
  font-weight: normal;
  color: var(--text-muted);
}

.moment-images-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Thumbnail grid for multi-image (2 rows of 5 max) */
.moment-images-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-sm);
  padding: var(--space-sm);
  min-height: 70px;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.moment-images-strip:empty {
  display: none;
}

.moment-image-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--bg-tertiary);
  border: 2px solid transparent;
  cursor: grab;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.moment-image-thumb:hover {
  border-color: var(--color-orange);
}

.moment-image-thumb.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.moment-image-thumb.drag-over {
  border-color: var(--color-orange);
  transform: scale(1.05);
}

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

.moment-image-thumb-handle {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
  cursor: grab;
}

.moment-image-thumb-remove {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast), background-color var(--transition-fast);
}

.moment-image-thumb:hover .moment-image-thumb-remove {
  opacity: 1;
}

.moment-image-thumb-remove:hover {
  background-color: var(--color-error);
}

/* Add images button */
.moment-image-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.moment-image-add:hover {
  border-color: var(--color-orange);
  background-color: var(--bg-secondary);
}

.moment-image-add-icon {
  font-size: 2rem;
  color: var(--text-muted);
}

.moment-image-add-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.moment-image-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Upload progress */
.moment-upload-progress {
  padding: var(--space-md);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.moment-upload-status {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.moment-upload-bar {
  height: 6px;
  background-color: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}

.moment-upload-fill {
  height: 100%;
  background-color: var(--color-orange);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

/* Slideshow settings */
.moment-slideshow-settings {
  padding: var(--space-md);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.moment-slideshow-settings h4 {
  margin: 0 0 var(--space-md) 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.moment-setting-row {
  margin-bottom: var(--space-md);
}

.moment-setting-row:last-child {
  margin-bottom: 0;
}

.moment-setting-row > label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}


.moment-speed-slider {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.moment-speed-slider input[type="range"] {
  flex: 1;
  accent-color: var(--color-orange);
}

.moment-speed-slider .speed-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.moment-speed-slider .speed-value {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-orange);
  min-width: 30px;
  text-align: right;
}

/* Legacy single image upload (hidden but kept for compatibility) */
.moment-image-upload {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
  text-align: center;
}

.moment-image-upload:hover {
  border-color: var(--color-orange);
  background-color: var(--bg-secondary);
}

.moment-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
}

.moment-image-icon {
  font-size: 2.5rem;
}

.moment-image-text {
  font-weight: 500;
  color: var(--text-secondary);
}

.moment-image-preview {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.moment-image-preview img {
  max-width: 100%;
  max-height: 400px;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  display: block;
  object-fit: contain;
}

.moment-image-remove {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast);
}

.moment-image-remove:hover {
  background-color: var(--color-error);
}

/* Note section */
.moment-note-section input[type="text"] {
  font-weight: 500;
}

.moment-note-section textarea {
  resize: vertical;
  min-height: 80px;
}

/* Link section */
.moment-link-section {
  animation: fadeIn var(--transition-fast);
}

.moment-link-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.moment-link-input-wrapper input {
  flex: 1;
  padding-right: 36px;
}

.moment-link-icon {
  position: absolute;
  right: 10px;
  width: 20px;
  height: 20px;
}

.moment-link-icon.link-icon-external-indicator {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314B8A6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'%3E%3C/path%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.moment-link-icon.link-icon-internal-indicator {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F97316' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Quote section */
.moment-quote-section textarea {
  font-family: var(--font-content);
  font-size: 1.125rem;
  resize: vertical;
  min-height: 100px;
}

/* Actions */
.moment-actions {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
}

.moment-button-group {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.moment-button-group.hidden {
  display: none;
}

/* ---- Media moment sub-type selector ---- */
.moment-media-subtype-selector {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.moment-subtype-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
  font-size: 0.875rem;
}

.moment-subtype-option:hover {
  border-color: var(--color-orange);
}

.moment-subtype-option:has(input:checked) {
  border-color: var(--color-orange);
  background-color: var(--color-orange-light);
}

[data-theme="dark"] .moment-subtype-option:has(input:checked) {
  background-color: rgba(249, 115, 22, 0.2);
}

.moment-subtype-option input[type="radio"] {
  accent-color: var(--color-orange);
}

.moment-subtype-label {
  font-weight: 500;
}

/* ---- Media file drop area ---- */
.moment-media-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-lg);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.moment-media-drop:hover {
  border-color: var(--color-orange);
  background-color: var(--bg-secondary);
}

.moment-media-drop.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.moment-media-drop-icon {
  font-size: 2rem;
}

.moment-media-drop-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.moment-media-drop-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---- Selected file indicator ---- */
.moment-media-selected {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.moment-media-filename {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.moment-media-filesize {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 2px 8px;
  background-color: var(--bg-tertiary, var(--bg-secondary));
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.moment-media-remove {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 2px 6px;
}

/* ---- Media moment card ---- */
.moment-card[data-moment-type="media"] {
  grid-row: span 2;
  display: flex;
  flex-direction: column;
}

.moment-card-media {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.moment-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Play overlay ---- */
.moment-media-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.85);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  z-index: 2;
}

.moment-media-play-overlay:hover {
  background-color: rgba(0, 0, 0, 0.75);
  transform: translate(-50%, -50%) scale(1.08);
}

.moment-media-play-overlay::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 18px;
  border-color: transparent transparent transparent #fff;
  margin-left: 3px;
}

/* ---- Duration badge ---- */
.moment-media-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 8px;
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  z-index: 2;
}

/* ---- Media card loading ---- */
.moment-media-loading {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 480px) {
  .moment-type-selector {
    flex-direction: column;
  }
  
  .moment-button-group {
    flex-direction: column-reverse;
  }
  
  .moment-button-group .btn {
    width: 100%;
  }
}

/* ============================================
   Plan Cards
   ============================================ */

.plan-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--color-teal);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.plan-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.plan-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.plan-card-icon {
  font-size: 1.25rem;
}

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

.plan-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

.plan-progress-container {
  height: 10px;
  background-color: var(--bg-secondary);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.plan-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-teal), var(--color-success));
  border-radius: 5px;
  transition: width 0.3s ease;
}

.plan-card-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.plan-tasks-count {
  color: var(--text-muted);
}

.plan-status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 500;
}

.plan-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.plan-status-on-track .plan-status-dot {
  background-color: var(--color-success);
}

.plan-status-behind .plan-status-dot {
  background-color: var(--color-warning);
}

.plan-status-complete .plan-status-dot {
  background-color: var(--color-teal);
}

.plan-status-on-track {
  color: var(--color-success);
}

.plan-status-behind {
  color: var(--color-warning);
}

.plan-status-complete {
  color: var(--color-teal);
}

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

/* ============================================
   Place Card
   ============================================ */

.place-card {
  grid-row: span 2;
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.place-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

.place-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.place-card-icon {
  font-size: 1.25rem;
}

.place-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.place-card-link.link-external {
  background-color: var(--color-teal);
}

.place-card-link.link-internal {
  background-color: var(--color-orange);
}

.place-card-link:hover {
  opacity: 0.85;
}

.place-card-link .link-icon-external,
.place-card-link .link-icon-internal {
  display: block;
  width: 14px;
  height: 14px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.place-card-link .link-icon-external {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'%3E%3C/path%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'%3E%3C/path%3E%3C/svg%3E");
}

.place-card-link .link-icon-internal {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48'%3E%3C/path%3E%3C/svg%3E");
}

.place-card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex: 1;
}

.place-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.place-card-image {
  width: 100%;
  flex: 1;
  min-height: 150px;
  overflow: hidden;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.place-card-map {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.place-card-map-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.place-card-map-placeholder span {
  font-size: 2rem;
}

/* ============================================
   Place Modal
   ============================================ */

.place-modal-content {
  max-width: 600px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}

.place-form {
  padding: var(--space-lg);
}

.place-map-container {
  position: relative;
  width: 100%;
  height: 250px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.place-map {
  width: 100%;
  height: 100%;
}

.place-map-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background-color: var(--bg-secondary);
}

.place-map-placeholder span {
  font-size: 3rem;
  margin-bottom: var(--space-sm);
}

.place-map-placeholder p {
  font-size: 0.875rem;
}

.place-name-input-wrapper {
  display: flex;
  gap: var(--space-sm);
}

.place-name-input-wrapper input {
  flex: 1;
}

.place-geocode-notice {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
  font-style: italic;
}

.place-refresh-btn {
  flex-shrink: 0;
  font-size: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  background-color: #C0C0C0;
  border: 1px solid #A0A0A0;
  color: #333333;
  border-radius: var(--radius-md);
}

.place-refresh-btn:hover {
  background-color: #D0D0D0;
  border-color: #909090;
}

.place-refresh-btn.refreshing {
  animation: spin 1s linear infinite;
}

.place-actions {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
}

.place-button-group {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
}

.place-button-group.hidden {
  display: none;
}

/* ============================================
   Plan Modal
   ============================================ */

.plan-modal-content {
  max-width: 1100px;
  width: 95%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
}

.plan-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--space-lg) var(--space-lg);
}

.plan-modal-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(90vh - 350px);
  overflow: hidden;
  gap: var(--space-lg);
  padding-top: var(--space-lg);
}

.plan-left-panel {
  width: 35%;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  overflow-y: auto;
  padding-right: var(--space-sm);
}

.plan-right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.plan-details-section {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
}

.plan-details-section .form-group {
  margin-bottom: var(--space-sm);
}

.plan-details-section .form-group:last-child {
  margin-bottom: 0;
}

.plan-details-section .form-group-row {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.plan-details-section .form-group-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.plan-details-section label {
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

#plan-notes {
  resize: vertical;
  min-height: 72px;
  max-height: 200px;
}

.plan-summary-section {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
}

.plan-summary-header {
  font-size: 0.9rem;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.plan-summary-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.plan-stat-card {
  background-color: var(--bg-card);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  text-align: center;
}

.plan-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-teal);
}

.plan-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.plan-tasks-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.plan-tasks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.plan-tasks-header h3 {
  font-size: 1rem;
  margin: 0;
}

.plan-task-counter {
  font-size: 0.8125rem;
  color: var(--text-muted);
  background-color: var(--bg-secondary);
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
}

.plan-task-counter.warning {
  background-color: var(--color-mustard-light);
  color: #92400E;
}

.plan-legend {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.plan-legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.plan-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.plan-legend-independent {
  background-color: var(--color-teal);
}

.plan-legend-dependent {
  background-color: #9B59B6;
}

.plan-legend-action {
  background-color: var(--color-mustard);
}

.plan-task-tree {
  flex: 1;
  overflow-y: auto;
  padding-right: var(--space-xs);
}

.plan-tasks-empty {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-muted);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
}

.plan-add-task-btn {
  margin-top: var(--space-md);
  width: 100%;
}

/* Plan Task Node */
.plan-task-node {
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-sm);
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-teal);
  transition: all var(--transition-fast);
}

.plan-task-node:hover {
  box-shadow: var(--shadow-sm);
}

.plan-task-independent {
  background-color: #FFF9DB;
  border-left-color: var(--color-teal);
}

.plan-task-dependent {
  background-color: #FCE4EC;
  border-left-color: #9B59B6;
}

.plan-task-action {
  background-color: var(--bg-card);
  border-left-color: var(--color-mustard);
}

[data-theme="dark"] .plan-task-independent {
  background-color: rgba(20, 184, 166, 0.1);
}

[data-theme="dark"] .plan-task-dependent {
  background-color: rgba(155, 89, 182, 0.1);
}

[data-theme="dark"] .plan-task-action {
  background-color: rgba(251, 191, 36, 0.1);
}

.plan-task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.plan-task-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  min-width: 0;
}

.plan-task-name {
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-collapse-icon {
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  user-select: none;
}

.plan-collapse-icon.collapsed {
  transform: rotate(-90deg);
}

/* Task drag handle */
.plan-task-drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 0.875rem;
  letter-spacing: -2px;
  user-select: none;
  padding: 0 var(--space-xs);
  opacity: 0.6;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.plan-task-drag-handle:hover {
  opacity: 1;
  color: var(--text-primary);
}

.plan-task-drag-handle:active {
  cursor: grabbing;
}

/* Task dragging states */
.plan-task-node.dragging {
  opacity: 0.5;
  background-color: var(--bg-tertiary);
}

.plan-task-node.drop-target {
  outline: 2px dashed var(--color-teal);
  outline-offset: -2px;
  background-color: color-mix(in srgb, var(--color-teal) 10%, transparent);
}

.plan-task-node.drop-invalid {
  outline: 2px dashed var(--color-coral);
  outline-offset: -2px;
  opacity: 0.7;
}

.plan-task-badge {
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  color: white;
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
}

.plan-badge-independent {
  background-color: var(--color-teal);
}

.plan-badge-dependent {
  background-color: #9B59B6;
}

.plan-badge-action {
  background-color: var(--color-mustard);
  color: #1C1917;
}

.plan-task-controls {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.plan-task-status {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-input);
  color: var(--text-primary);
}

.plan-task-status-display {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: default;
  min-width: 42px;
  text-align: center;
}

/* Task link button */
.plan-task-link-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  padding: 4px;
}

.plan-task-link-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.plan-task-link-btn .link-icon-external,
.plan-task-link-btn .link-icon-internal {
  width: 16px;
  height: 16px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.plan-task-link-external .link-icon-external {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314B8A6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'%3E%3C/path%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'%3E%3C/path%3E%3C/svg%3E");
}

.plan-task-link-external:not(:disabled):hover {
  background-color: var(--color-teal);
}

.plan-task-link-external:not(:disabled):hover .link-icon-external {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'%3E%3C/path%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'%3E%3C/path%3E%3C/svg%3E");
}

.plan-task-link-internal .link-icon-internal {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F97316' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48'%3E%3C/path%3E%3C/svg%3E");
}

.plan-task-link-internal:not(:disabled):hover {
  background-color: var(--color-orange);
}

.plan-task-link-internal:not(:disabled):hover .link-icon-internal {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48'%3E%3C/path%3E%3C/svg%3E");
}

.plan-task-add-subtask-btn,
.plan-task-edit-btn,
.plan-task-delete-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.plan-task-add-subtask-btn:hover {
  color: var(--color-success);
  background-color: var(--bg-secondary);
}

.plan-task-edit-btn:hover {
  color: var(--color-teal);
  background-color: var(--bg-secondary);
}

.plan-task-delete-btn:hover {
  color: var(--color-error);
  background-color: var(--bg-secondary);
}

.plan-task-details {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
  display: flex;
  gap: var(--space-md);
}

.plan-subtask-count {
  color: var(--color-teal);
  font-weight: 500;
}

.plan-task-notes {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: var(--space-sm);
  padding: var(--space-sm);
  background-color: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--border-color);
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

[data-theme="dark"] .plan-task-notes {
  background-color: rgba(255, 255, 255, 0.03);
}

.plan-task-children {
  margin-top: var(--space-sm);
  margin-left: var(--space-md);
  padding-left: var(--space-md);
  border-left: 2px dashed var(--border-color);
}

.plan-task-children.collapsed {
  display: none;
}

/* Plan Attachments Accordion */
.plan-attachments-accordion {
  margin-top: var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--space-sm);
  overflow: hidden;
}

.accordion-header {
  display: flex;
  align-items: center;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: background-color 0.2s ease;
}

.accordion-header:hover {
  background: var(--border-color);
}

.accordion-icon {
  font-size: 0.7rem;
  margin-right: var(--space-sm);
  transition: transform 0.2s ease;
}

.accordion-title {
  font-weight: 600;
}

.accordion-summary {
  margin-left: var(--space-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.accordion-add-btn {
  margin-left: auto;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-teal);
  color: white;
  border-radius: 4px;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1;
  transition: all 0.2s ease;
}

.accordion-add-btn:hover {
  background: var(--color-teal-hover);
  transform: scale(1.1);
}

.accordion-content {
  padding: var(--space-md);
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}

.attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-sm);
  min-height: 60px;
}

.attachments-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: var(--space-md);
  font-size: 0.9rem;
}

.attachment-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--space-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.attachment-card:hover {
  border-color: var(--color-teal);
  background: var(--bg-card);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.attachment-icon {
  font-size: 2rem;
  margin-bottom: var(--space-xs);
}

.attachment-name {
  font-size: 0.75rem;
  color: var(--text-primary);
  text-align: center;
  word-break: break-word;
  line-height: 1.2;
}

.attachment-size {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.attachment-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-error);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.attachment-card:hover .attachment-remove {
  opacity: 1;
}

.attachment-remove:hover {
  background: #dc2626;
}

.attachments-status {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-color);
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Plan Actions */
.plan-actions {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
}

.plan-button-group {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.plan-button-group.hidden {
  display: none;
}

/* Plan Task Modal */
.plan-task-modal-content {
  max-width: 500px;
  border: 1px solid var(--border-color);
}

.plan-task-form {
  padding: var(--space-md);
}

.plan-task-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

/* Task link input wrapper */
.plan-task-link-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  position: relative;
}

.plan-task-link-wrapper input {
  flex: 1;
  padding-left: 32px;
}

.plan-task-link-icon {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* ============================================
   Plan Timeline
   ============================================ */

.plan-timeline {
  position: relative;
  width: 100%;
  height: 115px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

/* Timeline content area (draggable) */
.plan-timeline-content {
  position: relative;
  flex: 1;
  cursor: grab;
}

.plan-timeline-content:active {
  cursor: grabbing;
}

/* Timeline controls row - below month labels */
.plan-timeline-controls-row {
  position: relative;
  height: 28px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 10px;
  background-color: rgb(207, 159, 212);
  border-top: 1px solid rgba(150, 100, 160, 0.3);
}

/* Diamonds wrapper - clips overflow, aligned with timeline container origin */
.plan-timeline-diamonds-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Diamonds container - pans/zooms with timeline */
.plan-timeline-diamonds {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  pointer-events: auto;
}

.plan-timeline-controls-group {
  display: flex;
  flex-direction: row;
  gap: 4px;
  z-index: 20;
  position: relative;
}

.plan-timeline-controls {
  display: flex;
  flex-direction: row;
  gap: 4px;
}

.plan-timeline-zoom-controls {
  display: flex;
  flex-direction: row;
  gap: 4px;
}

.plan-timeline-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  font-size: 0.75rem;
}

.plan-timeline-btn svg {
  display: block;
  flex-shrink: 0;
}

.plan-timeline-reset {
  background-color: var(--text-muted);
  color: white;
}

.plan-timeline-reset:hover {
  background-color: var(--text-secondary);
}

/* Markers Toggle Button */
.plan-timeline-markers-toggle {
  background-color: var(--color-mustard);
  color: white;
}

.plan-timeline-markers-toggle:hover {
  background-color: var(--color-orange);
}

.plan-timeline-markers-toggle.markers-hidden {
  background-color: var(--text-muted);
  opacity: 0.5;
}

.plan-timeline-markers-toggle.markers-hidden:hover {
  opacity: 0.7;
}

/* Hide markers when toggle is off */
.plan-timeline.markers-hidden .plan-timeline-today,
.plan-timeline.markers-hidden .plan-timeline-start,
.plan-timeline.markers-hidden .plan-timeline-finish {
  display: none;
}

.plan-timeline-zoom {
  background-color: var(--color-teal);
  color: white;
}

.plan-timeline-zoom:hover {
  background-color: #0d9488;
}

.plan-timeline-zoom:disabled {
  background-color: var(--border-color);
  cursor: not-allowed;
  opacity: 0.6;
}

.plan-timeline-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  padding: 0 25px;
}

.plan-timeline-container {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  transition: transform 0.1s ease-out;
}

.plan-timeline-tasks {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 10px 0;
}

.plan-timeline-empty {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.plan-timeline.empty .plan-timeline-empty {
  display: block;
}

.plan-timeline.empty .plan-timeline-content,
.plan-timeline.empty .plan-timeline-controls-row {
  display: none;
}

/* Timeline Date Markers */
.plan-timeline-months {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 18px;
  pointer-events: none;
  background-color: var(--bg-secondary);
}

.plan-timeline-month {
  position: absolute;
  bottom: 2px;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  background-color: var(--bg-secondary);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  z-index: 5;
}

.plan-timeline-month::before {
  content: '';
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 50px;
  background-color: var(--border-color);
  opacity: 0.3;
}

/* Today Marker */
/* Today Marker - displays at mid-height so Start/Finish flags can appear above */
.plan-timeline-today {
  position: absolute;
  top: 45%;
  bottom: 20px;
  width: 2px;
  background-color: var(--color-error);
  z-index: 11;
  transform: translateX(-50%);
}

.plan-timeline-today::before {
  content: 'Today';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  font-size: 0.6rem;
  font-weight: 600;
  color: white;
  background-color: var(--color-error);
  padding: 1px 4px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* Start Marker (Plan Start Date) - full height, appears above Today */
.plan-timeline-start {
  position: absolute;
  top: 0;
  bottom: 20px;
  width: 2px;
  background-color: var(--color-teal);
  z-index: 13;
  transform: translateX(-50%);
}

.plan-timeline-start::before {
  content: 'Start';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 600;
  color: white;
  background-color: var(--color-teal);
  padding: 1px 4px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* Finish Marker (Plan End Date) - full height, appears above Today */
.plan-timeline-finish {
  position: absolute;
  top: 0;
  bottom: 20px;
  width: 2px;
  background-color: var(--color-teal);
  z-index: 12;
  transform: translateX(-50%);
}

.plan-timeline-finish::before {
  content: 'Finish';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 600;
  color: white;
  background-color: var(--color-teal);
  padding: 1px 4px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* Timeline Task Boxes */
.plan-timeline-task {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  height: 55px;
  top: 8px;
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 6px 10px;
  min-width: 90px;
  max-width: 140px;
  text-align: center;
  font-size: 0.75rem;
  border: 2px solid var(--border-color);
  transition: all var(--transition-fast);
  transform: translateX(-50%);
}

/* Spike line from task bubble to timeline axis */
.plan-timeline-task::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 20px;
  background-color: var(--border-color);
}

.plan-timeline-task:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: var(--shadow-md);
  z-index: 15;
}

.plan-timeline-task:hover::after {
  background-color: var(--color-teal);
}

/* Status border colors */
.plan-timeline-task.status-complete {
  border-color: #7B2B9D;  /* Purple for complete tasks */
}

.plan-timeline-task.status-in-progress {
  border-color: var(--color-warning);
}

.plan-timeline-task.status-overdue {
  border-color: var(--color-error);
}

.plan-timeline-task.status-future {
  border-color: var(--color-teal);
}

.plan-timeline-task-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.plan-timeline-task-date {
  color: var(--text-muted);
  font-size: 0.7rem;
}

/* Timeline Stack Badge - Diamond shape in control bar for overlapping tasks */
.timeline-stack-badge {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  background-color: #4B5563;
  transform: translate(-50%, -50%) rotate(45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}

.timeline-stack-badge:hover {
  background-color: #374151;
}

.timeline-stack-badge-number {
  transform: rotate(-45deg);
  color: white;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  user-select: none;
}


/* Task highlight animation - triggered when clicking timeline bubble */
.plan-task-node.timeline-highlight {
  animation: timeline-highlight-pulse 2s ease-in-out;
  position: relative;
  z-index: 5;
}

@keyframes timeline-highlight-pulse {
  0% { 
    box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.8);
    background-color: rgba(20, 184, 166, 0.15);
  }
  25% {
    box-shadow: 0 0 0 8px rgba(20, 184, 166, 0.4);
    background-color: rgba(20, 184, 166, 0.2);
  }
  50% { 
    box-shadow: 0 0 0 12px rgba(20, 184, 166, 0.2);
    background-color: rgba(20, 184, 166, 0.15);
  }
  100% { 
    box-shadow: 0 0 0 0 rgba(20, 184, 166, 0);
    background-color: transparent;
  }
}

/* Plan Modal Responsive */
@media (max-width: 768px) {
  .plan-modal-body {
    flex-direction: column;
    max-height: none;
    flex: 0 0 auto;
  }
  
  .plan-left-panel {
    width: 100%;
    min-width: 100%;
    overflow-y: visible;
    padding-right: 0;
  }
  
  .plan-right-panel {
    width: 100%;
  }
  
  .plan-modal-content {
    max-height: 95vh;
  }
  
  .plan-form {
    overflow-y: auto;
  }
  
  .plan-summary-stats {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .plan-button-group {
    flex-direction: column-reverse;
  }
  
  /* Tasks section gets more vertical room on mobile */
  .plan-tasks-section {
    min-height: 400px;
  }
  
  .plan-task-tree {
    min-height: 300px;
    max-height: 350px;
    overflow-y: auto;
  }
  
  /* Timeline responsive */
  .plan-timeline {
    height: 105px;
  }
  
  .plan-timeline-wrapper {
    padding: 0 15px;
  }
  
  .plan-timeline-task {
    min-width: 70px;
    max-width: 110px;
    height: 45px;
    padding: 4px 6px;
  }
  
  .plan-timeline-task::after {
    height: 15px;
    bottom: -15px;
  }
  
  .plan-timeline-task-title {
    font-size: 0.65rem;
  }
  
  .plan-timeline-task-date {
    font-size: 0.55rem;
  }
  
  .plan-timeline-btn {
    width: 22px;
    height: 22px;
    font-size: 0.6rem;
  }
  
  .plan-timeline-controls-row {
    height: 24px;
    padding: 0 5px;
  }
  
  .plan-button-group .btn {
    width: 100%;
  }
}

/* ============================================
   Search Modal
   ============================================ */

.search-modal-content {
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.search-input-container {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.search-input-container input {
  width: 100%;
  padding: var(--space-md);
  font-size: 1.1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-input);
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}

.search-input-container input:focus {
  outline: none;
  border-color: var(--color-orange);
}

.search-input-container input::placeholder {
  color: var(--text-muted);
}

.search-hint {
  display: block;
  margin-top: var(--space-xs);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.search-results-container {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
}

/* Search States */
.search-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  text-align: center;
  color: var(--text-secondary);
}

.search-state.hidden {
  display: none;
}

.search-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.search-state p {
  margin: 0;
  font-size: 1rem;
}

.search-state-hint {
  margin-top: var(--space-xs) !important;
  font-size: 0.875rem !important;
  color: var(--text-muted);
}

.search-empty-message {
  font-size: 1.125rem !important;
  font-weight: 500;
  color: var(--text-primary);
}

/* Loading spinner for search */
.loading-spinner-small {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--color-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: var(--space-md);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Search Results */
#search-results.hidden {
  display: none;
}

.search-results-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  font-weight: 500;
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Search Result Card */
.search-result {
  padding: var(--space-md);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.search-result:hover {
  border-color: var(--color-orange);
  background-color: var(--bg-card);
  transform: translateX(4px);
}

.search-result:focus {
  outline: none;
  border-color: var(--color-orange);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.search-result.selected {
  border-left: 3px solid var(--color-orange);
  background-color: var(--bg-card);
}

.search-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
}

.search-result-type {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.search-result-icon {
  font-size: 0.875rem;
}

.search-result-label {
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.search-result-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.search-result-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  line-height: 1.4;
}

.search-result-snippet {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  font-family: var(--font-content);
}

/* Search Highlight */
.search-highlight {
  background-color: var(--color-mustard-light);
  color: var(--text-primary);
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 500;
}

[data-theme="dark"] .search-highlight {
  background-color: rgba(251, 191, 36, 0.3);
}

/* Show More Button */
.btn-search-more {
  width: 100%;
  margin-top: var(--space-md);
  justify-content: center;
}

.btn-search-more.hidden {
  display: none;
}

/* Search Input Container with Button */
.search-input-container {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.search-input-container input {
  flex: 1;
}

#btn-execute-search {
  flex-shrink: 0;
  padding: var(--space-sm) var(--space-md);
}

/* Search Tag Selector */
.search-tag-selector-container {
  padding: var(--space-sm) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.search-tag-selector {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.search-tag-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.search-tag-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.search-tag-summary {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.search-tag-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-xs);
}

/* Enhanced Search Results */
.search-result-content {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.search-result-thumbnail {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--bg-tertiary);
}

.search-result-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-result-body {
  flex: 1;
  min-width: 0;
}

.search-result-preview {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: var(--space-xs);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.search-result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: var(--space-sm);
}

.search-result-tags .tag-pill {
  font-size: 0.6875rem;
  padding: 2px 6px;
}

/* Text Required State */
.search-text-required-message {
  font-size: 1.125rem !important;
  font-weight: 500;
  color: var(--color-orange);
}

/* Search Tag Grid Responsive - 2 column screens */
@media (max-width: 900px) {
  .search-tag-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Search Modal Responsive */
@media (max-width: 640px) {
  .search-modal-content {
    max-height: 90vh;
    margin: var(--space-sm);
  }
  
  .search-input-container {
    padding: var(--space-sm) var(--space-md);
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .search-input-container input {
    font-size: 1rem;
    padding: var(--space-sm) var(--space-md);
    width: 100%;
  }
  
  #btn-execute-search {
    width: 100%;
  }
  
  .search-tag-selector-container {
    padding: var(--space-sm) var(--space-md);
  }
  
  .search-tag-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .search-results-container {
    padding: var(--space-md);
  }
  
  .search-result {
    padding: var(--space-sm) var(--space-md);
  }
  
  .search-state {
    padding: var(--space-xl);
  }
  
  .search-state-icon {
    font-size: 2.5rem;
  }
  
  .search-result-thumbnail {
    width: 32px;
    height: 32px;
  }
}

/* ============================================
   Opal Timer (Countdown Graphic as Card Background)
   ============================================ */

/* Counter card needs relative positioning for absolute timer background */
.counter-card {
  position: relative;
  overflow: hidden;
}

/* Timer wrapper - absolutely positioned to cover entire card */
.opal-timer-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
}

.opal-timer-bg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Center dot subtle glow effect */
.opal-center-dot {
  filter: drop-shadow(0 0 3px rgba(239, 68, 68, 0.6));
}

/* Sweep edge - clean hard cut */
.opal-sweep {
  /* No transitions for hard edge */
}

/* Counter card content needs to be above the timer background */
.counter-card-content {
  position: relative;
  z-index: 1;
}

/* Ensure buttons remain clickable above timer */
.counter-card .card-ref-id,
.counter-card .card-favourite {
  position: relative;
  z-index: 2;
}

/* Dark grey text for target date and notes over opal background */
.counter-card .counter-target,
.counter-card .counter-notes {
  color: #4B5563;
}

/* ============================================
   Tag Selector (Entry Form)
   ============================================ */

/* Tag Accordion - Collapsible tag selector */
.tag-accordion {
  margin-top: var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--space-sm);
  overflow: hidden;
}

.tag-accordion-header {
  display: flex;
  align-items: center;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: background-color 0.2s ease;
}

.tag-accordion-header:hover {
  background: var(--border-color);
}

.tag-accordion-icon {
  font-size: 0.7rem;
  margin-right: var(--space-sm);
  transition: transform 0.2s ease;
}

.tag-accordion.expanded .tag-accordion-icon {
  transform: rotate(90deg);
}

.tag-accordion-title {
  font-weight: 600;
}

.tag-accordion-summary {
  margin-left: var(--space-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 400;
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-accordion-content {
  padding: var(--space-md);
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}

.tag-accordion-content.hidden {
  display: none;
}

.tag-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
}

/* Medium screens (tablet) - 4 columns */
@media (min-width: 640px) {
  .tag-selector {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Large screens (desktop) - 6 columns */
@media (min-width: 1024px) {
  .tag-selector {
    grid-template-columns: repeat(6, 1fr);
  }
}

.tag-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font-ui);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
}

.tag-btn:hover {
  transform: scale(1.02);
}

.tag-btn.selected {
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tag-btn.tag-btn-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tag-btn.tag-btn-disabled:hover {
  transform: none;
}

/* Dark mode tag adjustments */
[data-theme="dark"] .tag-btn {
  background-color: var(--bg-secondary);
}

[data-theme="dark"] .tag-btn.selected {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* ============================================
   Tag Pills (Card Display)
   ============================================ */

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: var(--space-sm);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 600;
  font-family: var(--font-ui);
  border-radius: 9999px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.tag-pill-more {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================================
   Entry Card Tag Section
   ============================================ */

.entry-card .card-tags {
  padding-top: var(--space-sm);
}

/* ============================================
   Data Map Screen
   ============================================ */

#screen-map.active {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-primary);
}

.map-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.map-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.map-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

/* Map List (Unified for all screen sizes) */
.map-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 800px;
  margin: 0 auto;
}

.map-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  animation: fadeInSlide 0.3s ease backwards;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.map-row:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

/* Staggered animation delays for rows */
.map-row:nth-child(1) { animation-delay: 0.02s; }
.map-row:nth-child(2) { animation-delay: 0.04s; }
.map-row:nth-child(3) { animation-delay: 0.06s; }
.map-row:nth-child(4) { animation-delay: 0.08s; }
.map-row:nth-child(5) { animation-delay: 0.1s; }
.map-row:nth-child(6) { animation-delay: 0.12s; }
.map-row:nth-child(7) { animation-delay: 0.14s; }
.map-row:nth-child(8) { animation-delay: 0.16s; }
.map-row:nth-child(9) { animation-delay: 0.18s; }
.map-row:nth-child(10) { animation-delay: 0.2s; }

.map-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  background-color: var(--color-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-ui);
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.map-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.map-bubble:active {
  transform: scale(0.95);
}

.map-bubble:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Map Results Panel */
.map-results {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 50vh;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 200;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.map-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}

.map-results-header span {
  font-weight: 600;
  color: var(--text-primary);
}

.map-results-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm);
}

.map-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.map-result-item:hover {
  background-color: var(--bg-secondary);
}

.map-result-title {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.map-result-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-left: var(--space-sm);
}

/* Map Empty State */
.map-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
  padding: var(--space-xl);
}

.map-empty .empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.map-empty h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm);
}

.map-empty p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 300px;
}

/* Map Tabs */
.map-tabs {
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.map-tab {
  flex: 1;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.map-tab.active {
  background-color: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* Word Cloud Content */
.wordcloud-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-md);
  overflow-y: auto;
}

.wordcloud-container {
  position: relative;
  width: min(90vw, 550px);
  height: min(90vw, 550px);
  /* No border-radius. No overflow: hidden. No mask. Words define the shape. */
}

.wordcloud-word {
  position: absolute;
  font-family: var(--font-ui);
  line-height: 1.1;
  white-space: nowrap;
  cursor: default;
  user-select: none;
  opacity: 1;
  transform-origin: center center;
  /* No :hover rule — the composition never changes visually */
}

.wordcloud-word:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.wordcloud-stats {
  margin-top: var(--space-md);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-align: center;
}

/* Word Cloud Empty State */
.wordcloud-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  text-align: center;
}

.wordcloud-empty .empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.wordcloud-empty h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm);
}

.wordcloud-empty p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 300px;
}

/* Responsive adjustments */
@media (max-width: 639px) {
  .map-header {
    padding: var(--space-sm) var(--space-md);
  }
  
  .map-header h1 {
    font-size: 1.125rem;
  }
  
  .map-content {
    padding: var(--space-sm);
  }
}

@media (min-width: 640px) {
  .wordcloud-container {
    width: min(70vw, 600px);
    height: min(70vw, 600px);
  }
}

@media (min-width: 1024px) {
  .wordcloud-container {
    width: min(50vw, 650px);
    height: min(50vw, 650px);
  }
}

/* ============================================
   Sales Content Styles
   ============================================ */

/* Welcome Screen now allows scrolling */
#screen-welcome {
  overflow-y: auto;
  overflow-x: hidden;
}

/* ============================================
   Hero Section
   ============================================ */

.sales-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  position: relative;
  background: var(--bg-primary);
}

.sales-hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 400px;
}

.sales-hero__logo {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.sales-hero__tagline {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
}

.sales-hero__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
  max-width: 300px;
  margin-bottom: var(--space-lg);
}

.sales-hero__scroll-indicator {
  position: absolute;
  bottom: var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.sales-hero__scroll-indicator:hover {
  opacity: 1;
}

.sales-hero__scroll-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.sales-hero__scroll-arrow {
  font-size: 1.5rem;
  color: var(--color-primary);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(8px);
  }
  60% {
    transform: translateY(4px);
  }
}

/* ============================================
   Sales Content Container
   ============================================ */

.sales-content {
  width: 100%;
}

.sales-section {
  padding: var(--space-2xl) var(--space-lg);
}

.sales-section:nth-child(even) {
  background: var(--bg-secondary);
}

.sales-section__container {
  max-width: 1000px;
  margin: 0 auto;
}

.sales-section__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: var(--space-md);
}

.sales-section__subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--space-xl);
}

/* ============================================
   Carousel Section
   ============================================ */

.sales-carousel-section {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--bg-secondary) 100%);
  padding: var(--space-2xl) var(--space-lg);
}

[data-theme="dark"] .sales-carousel-section {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.sales-carousel {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.sales-carousel__slides {
  position: relative;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sales-carousel__slide {
  position: absolute;
  width: 100%;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

.sales-carousel__slide.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.sales-carousel__quote {
  font-family: var(--font-content);
  font-size: 1.75rem;
  font-weight: 600;
  font-style: italic;
  color: var(--text-primary);
  margin: 0 0 var(--space-md);
  line-height: 1.4;
}

.sales-carousel__subtext {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
}

.sales-carousel__indicators {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.sales-carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.sales-carousel__dot:hover {
  background: var(--text-secondary);
}

.sales-carousel__dot.active {
  background: var(--color-primary);
  transform: scale(1.2);
}

/* ============================================
   Creator's Story Section
   ============================================ */

.sales-creator {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.sales-creator__content {
  max-width: 750px;
  margin: 0 auto;
  text-align: center;
}

.sales-creator__quote {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-primary);
  font-style: italic;
  margin: 0;
  padding: 0;
}

.sales-creator__quote p {
  margin-bottom: var(--space-lg);
}

.sales-creator__quote p:last-child {
  margin-bottom: var(--space-xl);
}

.sales-creator__quote em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
}

.sales-creator__attribution {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-style: normal;
}

@media (max-width: 768px) {
  .sales-creator__quote {
    font-size: 1rem;
    line-height: 1.7;
  }
}

/* ============================================
   Promise Section
   ============================================ */

.sales-promise {
  text-align: center;
}

.sales-promise__text {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ============================================
   Life Stages Section
   ============================================ */

.sales-lifestages__tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.sales-lifestages__tab {
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sales-lifestages__tab:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.sales-lifestages__tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.sales-lifestages__content {
  position: relative;
  min-height: 180px;
}

.sales-lifestages__panel {
  position: absolute;
  width: 100%;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.sales-lifestages__panel.active {
  position: relative;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.sales-lifestages__list {
  list-style: none;
  padding: 0;
  max-width: 500px;
  margin: 0 auto;
}

.sales-lifestages__list li {
  padding: var(--space-sm) 0;
  padding-left: var(--space-lg);
  position: relative;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

.sales-lifestages__list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: 600;
}

/* ============================================
   Features Grid
   ============================================ */

.sales-features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.sales-feature-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  border: 1px solid var(--border-color);
}

.sales-feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.sales-feature-card__icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: var(--space-md);
}

.sales-feature-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.sales-feature-card__desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ============================================
   Feature Journey Section — Encyclopedia of You
   ============================================ */

.sales-journey {
  background: var(--bg-primary);
}

.sales-journey__bands {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 900px;
  margin: 0 auto;
}

/* Each band: two-column grid */
.sales-journey__band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
  padding: var(--space-xl) 0;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.sales-journey__band.journey-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Separator between bands */
.sales-journey__band + .sales-journey__band {
  border-top: 1px solid var(--border-color);
}

/* Alternating direction */
.sales-journey__band--right .sales-journey__visual {
  order: 2;
}

.sales-journey__band--right .sales-journey__text {
  order: 1;
}

/* Visual container */
.sales-journey__visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px;
}

/* Text container */
.sales-journey__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.sales-journey__feature-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-ui);
  margin: 0;
}

.sales-journey__sell {
  font-family: var(--font-content);
  font-size: 1.125rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
}

.sales-journey__detail {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

.journey-visual-caption {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  margin: var(--space-sm) 0 0;
}

/* ----------------------------------------
   Visual 1: Cross-Linking (Chain + Hub)
   ---------------------------------------- */

.journey-visual-chain {
  width: 100%;
  max-width: 260px;
  height: auto;
}

.journey-visual-hub {
  width: 100%;
  max-width: 300px;
  height: auto;
  margin-top: var(--space-xs);
}

.journey-link-arrow {
  stroke: var(--border-color);
  stroke-width: 1.5;
  transition: stroke 0.3s ease, stroke-width 0.3s ease;
}

.journey-link-spoke {
  stroke-width: 1;
}

.journey-node {
  fill: var(--color-primary);
  opacity: 0.15;
  stroke: var(--color-primary);
  stroke-width: 1.5;
  transition: opacity 0.3s ease;
}

.journey-node-hub {
  opacity: 0.22;
  stroke-width: 2;
}

.journey-node-dest {
  opacity: 0.1;
  stroke-width: 1;
}

.journey-node-url {
  opacity: 0.08;
  stroke: var(--text-muted);
  fill: var(--text-muted);
}

.journey-node-label {
  font-size: 14px;
  text-anchor: middle;
  dominant-baseline: central;
}

.journey-node-label-sm {
  font-size: 11px;
}

.journey-ref-label {
  font-size: 7.5px;
  font-family: 'Inter', monospace;
  fill: var(--text-muted);
  text-anchor: middle;
  letter-spacing: 0.5px;
}

.journey-url-label {
  font-size: 7px;
  font-family: 'Inter', monospace;
  fill: var(--text-muted);
  letter-spacing: 0.5px;
  dominant-baseline: central;
}

.sales-journey__band[data-feature="linking"]:hover .journey-link-arrow {
  stroke: var(--color-primary);
}

.sales-journey__band[data-feature="linking"]:hover .journey-link-spoke {
  stroke-width: 1.5;
}

.sales-journey__band[data-feature="linking"]:hover .journey-node {
  opacity: 0.3;
}

.sales-journey__band[data-feature="linking"]:hover .journey-node-hub {
  opacity: 0.35;
}

.sales-journey__band[data-feature="linking"]:hover .journey-node-dest {
  opacity: 0.2;
}

.sales-journey__band[data-feature="linking"]:hover .journey-node-url {
  opacity: 0.15;
}

/* ----------------------------------------
   Visual 2: Theme Dots
   ---------------------------------------- */

.journey-visual-themes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.journey-theme-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2.5px solid var(--bg-primary);
  margin-left: -6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  cursor: default;
}

.journey-theme-dot:first-child {
  margin-left: 0;
}

.journey-theme-dot:hover {
  transform: scale(1.35);
  z-index: 2;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}

/* ----------------------------------------
   Visual 3: Data Map Bars
   ---------------------------------------- */

.journey-visual-datamap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 280px;
}

.journey-bar {
  height: 14px;
  border-radius: var(--radius-sm);
  opacity: 0.75;
  transition: opacity 0.3s ease;
}

.sales-journey__band[data-feature="datamap"]:hover .journey-bar {
  opacity: 1;
}

/* ----------------------------------------
   Visual 4: Word Cloud
   ---------------------------------------- */

.journey-visual-cloud {
  position: relative;
  width: 280px;
  height: 200px;
  font-family: var(--font-content);
}

.cloud-word {
  position: absolute;
  color: var(--text-primary);
  transition: color 0.3s ease;
  white-space: nowrap;
  line-height: 1;
}

.cloud-w1  { font-size: 1.75rem; top: 18%; left: 8%;  font-weight: 600; color: var(--color-primary); }
.cloud-w2  { font-size: 1.4rem;  top: 4%;  left: 42%; opacity: 0.85; }
.cloud-w3  { font-size: 1.5rem;  top: 45%; left: 55%; font-weight: 600; color: var(--color-primary); }
.cloud-w4  { font-size: 1.1rem;  top: 62%; left: 5%;  opacity: 0.7; transform: rotate(-4deg); }
.cloud-w5  { font-size: 1.3rem;  top: 38%; left: 2%;  opacity: 0.75; }
.cloud-w6  { font-size: 1.6rem;  top: 70%; left: 40%; font-weight: 600; opacity: 0.9; }
.cloud-w7  { font-size: 1rem;    top: 8%;  left: 75%; opacity: 0.65; transform: rotate(3deg); }
.cloud-w8  { font-size: 1.15rem; top: 52%; left: 30%; opacity: 0.7; }
.cloud-w9  { font-size: 1.05rem; top: 82%; left: 15%; opacity: 0.6; transform: rotate(-2deg); }
.cloud-w10 { font-size: 0.95rem; top: 28%; left: 62%; opacity: 0.6; }
.cloud-w11 { font-size: 1.45rem; top: 85%; left: 62%; font-weight: 600; color: var(--color-primary); }
.cloud-w12 { font-size: 0.9rem;  top: 55%; left: 75%; opacity: 0.55; transform: rotate(5deg); }
.cloud-w13 { font-size: 1.2rem;  top: 22%; left: 35%; opacity: 0.7; }
.cloud-w14 { font-size: 1rem;    top: 42%; left: 80%; opacity: 0.6; transform: rotate(-3deg); }

/* ----------------------------------------
   Visual 5: Search Preview
   ---------------------------------------- */

.journey-visual-search {
  width: 100%;
  max-width: 300px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.journey-search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
}

.journey-search-icon {
  font-size: 0.875rem;
  flex-shrink: 0;
}

.journey-search-placeholder {
  font-size: 0.8125rem;
  color: var(--text-muted);
  flex: 1;
}

.journey-search-shortcut {
  font-size: 0.6875rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-family: var(--font-ui);
}

.journey-search-results {
  padding: 4px 0;
}

.journey-search-result {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 14px;
  transition: background 0.15s ease;
}

.journey-search-result:first-child {
  background: var(--color-primary-light);
}

.journey-result-icon {
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.journey-result-title {
  font-size: 0.8125rem;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journey-result-date {
  font-size: 0.6875rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ----------------------------------------
   Visual 6: Tag Pills
   ---------------------------------------- */

.journey-visual-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 300px;
}

.journey-tag {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-family: var(--font-ui);
  font-weight: 500;
  transition: transform 0.2s ease;
  cursor: default;
}

.journey-tag:nth-child(odd) {
  transform: rotate(-1.5deg);
}

.journey-tag:nth-child(even) {
  transform: rotate(1deg);
}

.journey-tag:hover {
  transform: scale(1.1) rotate(0deg);
}

/* ----------------------------------------
   Visual 7: Opal Timer
   ---------------------------------------- */

.journey-visual-opal {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.journey-opal-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ----------------------------------------
   Visual 8: Locale Flags
   ---------------------------------------- */

.journey-visual-locale {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.journey-flags {
  display: flex;
  gap: var(--space-sm);
  font-size: 1.75rem;
  line-height: 1;
}

.journey-flag {
  transition: transform 0.2s ease;
  cursor: default;
}

.journey-flag:hover {
  transform: scale(1.25);
}

.journey-locale-examples {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8125rem;
  font-family: var(--font-ui);
}

.journey-locale-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.journey-locale-label {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 52px;
  text-align: right;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.journey-locale-gb {
  color: var(--text-primary);
  font-weight: 500;
}

.journey-locale-sep {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.journey-locale-us {
  color: var(--text-muted);
  font-style: italic;
}

/* ----------------------------------------
   Feature Journey — Responsive
   ---------------------------------------- */

@media (max-width: 1023px) {
  .sales-journey__band {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    text-align: center;
  }

  .sales-journey__band--right .sales-journey__visual,
  .sales-journey__band--right .sales-journey__text {
    order: unset;
  }

  .sales-journey__text {
    align-items: center;
  }

  .sales-journey__detail {
    max-width: 560px;
  }

  .journey-visual-chain {
    max-width: 220px;
  }

  .journey-visual-hub {
    max-width: 260px;
  }

  .journey-visual-cloud {
    width: 240px;
    height: 170px;
  }

  .journey-visual-opal {
    width: 150px;
    height: 150px;
  }
}

@media (max-width: 639px) {
  .sales-journey__bands {
    gap: 0;
  }

  .sales-journey__band {
    padding: var(--space-md) 0;
    gap: var(--space-md);
  }

  .sales-journey__feature-title {
    font-size: 1.125rem;
  }

  .sales-journey__sell {
    font-size: 1rem;
    font-style: normal;
  }

  .sales-journey__detail {
    font-size: 0.875rem;
  }

  .journey-theme-dot {
    width: 24px;
    height: 24px;
    margin-left: -4px;
  }

  .journey-visual-cloud {
    width: 200px;
    height: 150px;
  }

  .cloud-w1  { font-size: 1.35rem; }
  .cloud-w2  { font-size: 1.1rem; }
  .cloud-w3  { font-size: 1.2rem; }
  .cloud-w6  { font-size: 1.25rem; }
  .cloud-w11 { font-size: 1.15rem; }

  .journey-visual-opal {
    width: 120px;
    height: 120px;
  }

  .journey-visual-search {
    max-width: 260px;
  }

  .journey-flags {
    font-size: 1.5rem;
  }
}

/* ============================================
   Gallery Section
   ============================================ */

.sales-gallery {
  background: var(--bg-secondary);
}

.sales-gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.sales-gallery__item {
  margin: 0;
}

.sales-gallery__image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  cursor: pointer;
}

.sales-gallery__image:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-xl);
}

/* ============================================
   Lightbox
   ============================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.lightbox.hidden {
  display: none;
}

.lightbox.fade-out {
  opacity: 0;
}

.lightbox__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.lightbox__close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  background: transparent;
  border: none;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
  line-height: 1;
  padding: var(--space-sm);
}

.lightbox__close:hover {
  opacity: 1;
}

.sales-gallery__caption {
  margin-top: var(--space-md);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  text-align: center;
}

.sales-gallery__trial {
  display: flex;
  justify-content: center;
  margin-top: var(--space-xl);
}

@media (max-width: 768px) {
  .sales-gallery__grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

/* ============================================
   Templates Grid
   ============================================ */

.sales-templates__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-md);
}

.sales-template-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid var(--border-color);
  transition: border-color var(--transition-fast);
}

.sales-template-card:hover {
  border-color: var(--color-primary);
}

.sales-template-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.sales-template-card__prompt {
  font-family: var(--font-content);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* ============================================
   Mini CTA Section
   ============================================ */

.sales-minicta {
  text-align: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%) !important;
  color: white;
}

.sales-minicta .sales-section__title {
  color: white;
}

.sales-minicta__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.sales-minicta__actions .btn-primary {
  background: white;
  color: var(--color-primary);
}

.sales-minicta__actions .btn-primary:hover {
  background: var(--bg-secondary);
}

.sales-minicta__actions .btn-secondary {
  background: transparent;
  border: 2px solid white;
  color: white;
}

.sales-minicta__actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sales-minicta__details {
  max-width: 600px;
  margin: 0 auto;
}

.sales-minicta__line {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-sm);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.sales-minicta__line strong {
  color: white;
}

.sales-minicta__utopia {
  font-size: 1.125rem;
  margin-top: var(--space-lg);
  color: white;
}

/* ============================================
   Access Section
   ============================================ */

.sales-access__methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.sales-access__method {
  text-align: center;
  padding: var(--space-lg);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.sales-access__icon {
  font-size: 2rem;
  display: block;
  margin-bottom: var(--space-sm);
}

.sales-access__method h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.sales-access__method p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.sales-access__requirements {
  text-align: center;
  max-width: 400px;
  margin: 0 auto;
}

.sales-access__req-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.sales-access__req-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-lg);
}

.sales-access__req-list li {
  padding: var(--space-xs) 0;
  color: var(--text-secondary);
}

.sales-access__tagline {
  font-size: 1rem;
  color: var(--text-secondary);
}

.sales-access__tagline strong {
  color: var(--text-primary);
}

/* ============================================
   Ownership Section
   ============================================ */

.sales-ownership__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

.sales-ownership__item {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.sales-ownership__check {
  font-size: 1.25rem;
  color: var(--color-success);
  flex-shrink: 0;
}

.sales-ownership__item strong {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.sales-ownership__item span {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ============================================
   Security Section
   ============================================ */

.sales-security__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.sales-security__item {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border-color);
}

.sales-security__icon {
  font-size: 1.75rem;
  display: block;
  margin-bottom: var(--space-sm);
}

.sales-security__item h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.sales-security__item p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ============================================
   Encrypted Section
   ============================================ */

.sales-encrypted__content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
}

.sales-encrypted__protected,
.sales-encrypted__unprotected {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border-color);
}

.sales-encrypted__protected h3 {
  color: var(--color-success);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.sales-encrypted__unprotected h3 {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.sales-encrypted__protected ul,
.sales-encrypted__unprotected ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sales-encrypted__protected li,
.sales-encrypted__unprotected li {
  padding: var(--space-xs) 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.sales-encrypted__note {
  margin-top: var(--space-md);
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================
   Comparison Table
   ============================================ */

.sales-comparison__table-wrapper {
  overflow-x: auto;
}

.sales-comparison__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.sales-comparison__table th,
.sales-comparison__table td {
  padding: var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.sales-comparison__table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
}

.sales-comparison__table th.highlight {
  background: var(--color-primary);
  color: white;
}

.sales-comparison__table td {
  color: var(--text-secondary);
}

.sales-comparison__table td.highlight {
  background: var(--color-primary-light);
  color: var(--text-primary);
  font-weight: 500;
}

[data-theme="dark"] .sales-comparison__table td.highlight {
  background: rgba(var(--color-primary), 0.2);
}

.sales-comparison__table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================
   Final CTA Section
   ============================================ */

.sales-finalcta {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg) !important;
}

.sales-finalcta__title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.sales-finalcta__subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.sales-finalcta__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.sales-finalcta__notice {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ============================================
   FAQ Section
   ============================================ */

.sales-faq {
  background: var(--bg-secondary);
}

.sales-faq__list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.sales-faq__item {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.sales-faq__item:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.sales-faq__item[open] {
  border-color: var(--color-primary);
}

/* Question Banner - Full width background */
.sales-faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  list-style: none;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-secondary);
  transition: background-color 0.2s ease;
}

.sales-faq__question::-webkit-details-marker {
  display: none;
}

.sales-faq__question::marker {
  display: none;
  content: '';
}

.sales-faq__question:hover {
  background: var(--bg-tertiary);
}

.sales-faq__question-text {
  flex: 1;
  text-align: left;
}

.sales-faq__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  position: relative;
  transition: transform 0.3s ease;
}

.sales-faq__icon::before,
.sales-faq__icon::after {
  content: '';
  position: absolute;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Horizontal line */
.sales-faq__icon::before {
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  transform: translate(-50%, -50%);
}

/* Vertical line */
.sales-faq__icon::after {
  top: 50%;
  left: 50%;
  width: 2px;
  height: 14px;
  transform: translate(-50%, -50%);
}

/* When open, rotate the plus to become minus */
.sales-faq__item[open] .sales-faq__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
  opacity: 0;
}

/* Answer Text Box - Inset with subtle background */
.sales-faq__answer {
  margin: var(--space-md);
  margin-top: var(--space-sm);
  padding: var(--space-lg);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 1rem;
  animation: faq-slide-down 0.3s ease;
}

.sales-faq__answer p {
  margin: 0;
}

.sales-faq__answer a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.sales-faq__answer a:hover {
  text-decoration: underline;
}

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

/* Mobile adjustments */
@media (max-width: 640px) {
  .sales-faq__question {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.9375rem;
  }
  
  .sales-faq__answer {
    margin: var(--space-sm);
    padding: var(--space-md);
    font-size: 0.9375rem;
  }
}

/* ============================================
   Contact Section
   ============================================ */

.sales-contact {
  background: var(--bg-card);
  border-top: 4px solid var(--color-primary);
  padding: var(--space-2xl) var(--space-lg) !important;
}

.sales-contact__title {
  font-family: 'Kalam', cursive;
  font-size: 2.5rem;
  font-weight: 400;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: var(--space-xl);
  transform: rotate(-2deg);
  display: inline-block;
  width: 100%;
}

.sales-contact__form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.sales-contact__honeypot {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
}

.sales-contact__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sales-contact__label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
}

.sales-contact__label .required {
  color: var(--color-error);
}

.sales-contact__input,
.sales-contact__textarea {
  width: 100%;
  padding: var(--space-md);
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.sales-contact__input:focus,
.sales-contact__textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.sales-contact__input::placeholder,
.sales-contact__textarea::placeholder {
  color: var(--text-muted);
}

.sales-contact__textarea {
  resize: vertical;
  min-height: 150px;
  max-height: 300px;
}

.sales-contact__counter {
  text-align: right;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.sales-contact__counter.warning {
  color: var(--color-warning);
  font-weight: 600;
}

.sales-contact__counter.error {
  color: var(--color-error);
  font-weight: 600;
}

.sales-contact__error {
  font-size: 0.875rem;
  color: var(--color-error);
  display: none;
}

.sales-contact__error.visible {
  display: block;
}

.sales-contact__submit {
  align-self: center;
  min-width: 200px;
  margin-top: var(--space-sm);
}

.sales-contact__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sales-contact__submit .loading-spinner-small {
  margin-right: var(--space-sm);
}

.sales-contact__success {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  padding: var(--space-xl);
  background: var(--color-success-light);
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-success);
}

.sales-contact__success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--color-success);
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 50%;
  margin-bottom: var(--space-md);
}

.sales-contact__success p {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* Contact section responsive */
@media (max-width: 640px) {
  .sales-contact__title {
    font-size: 1.75rem;
  }
  
  .sales-contact__form {
    padding: 0 var(--space-sm);
  }
}

/* ============================================
   Footer
   ============================================ */

.sales-footer {
  text-align: center;
  padding: var(--space-xl);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.sales-footer p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.sales-footer__copyright {
  margin-top: var(--space-xs) !important;
  color: var(--text-muted) !important;
  font-size: 0.8125rem !important;
}

/* ============================================
   Responsive Styles for Sales Content
   ============================================ */

@media (min-width: 640px) {
  .sales-hero__actions {
    flex-direction: row;
    max-width: 500px;
  }
  
  .sales-minicta__actions,
  .sales-finalcta__actions {
    flex-direction: row;
    justify-content: center;
  }
  
  .sales-carousel__quote {
    font-size: 2rem;
  }
}

@media (min-width: 1024px) {
  .sales-section {
    padding: var(--space-2xl) var(--space-xl);
  }
  
  .sales-section__title {
    font-size: 2rem;
  }
  
  .sales-carousel__quote {
    font-size: 2.25rem;
  }
  
  .sales-features__grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .sales-templates__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 639px) {
  .sales-hero {
    padding: var(--space-lg);
    min-height: 100svh;
  }
  
  .sales-hero__logo {
    font-size: 2rem;
  }
  
  .sales-hero__scroll-indicator {
    bottom: var(--space-md);
  }
  
  .sales-section {
    padding: var(--space-xl) var(--space-md);
  }
  
  .sales-section__title {
    font-size: 1.5rem;
  }
  
  .sales-carousel__quote {
    font-size: 1.375rem;
  }
  
  .sales-lifestages__tabs {
    gap: var(--space-xs);
  }
  
  .sales-lifestages__tab {
    font-size: 0.75rem;
    padding: var(--space-xs) var(--space-sm);
  }
  
  .sales-comparison__table {
    font-size: 0.8125rem;
  }
  
  .sales-comparison__table th,
  .sales-comparison__table td {
    padding: var(--space-sm);
  }
  
  .sales-finalcta__title {
    font-size: 1.5rem;
  }
}

/* ============================================
   Region Selector — inline two-flag dropdown
   ============================================ */

.sales-hero__notices {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

/* Container — positioned so dropdown anchors below trigger */
.region-selector {
  position: relative;
  display: inline-block;
}

/* Trigger button — shows current flag */
.region-selector__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-xs) var(--space-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1.25rem;
  line-height: 1;
}

.region-selector__trigger:hover {
  border-color: var(--color-primary);
  transform: scale(1.05);
}

.region-selector__flag {
  display: block;
}

/* Dropdown panel — appears directly below trigger */
.region-selector__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 100;
  overflow: hidden;
}

.region-selector__dropdown.hidden {
  display: none;
}

/* Each flag option in the dropdown */
.region-selector__option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xs) var(--space-sm);
  font-size: 1.25rem;
  line-height: 1;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.region-selector__option:hover {
  background: var(--bg-secondary);
}

/* Active / selected flag — left border accent */
.region-selector__option.active {
  border-left-color: var(--color-primary);
}

/* ============================================
   Legacy Section
   ============================================ */

.sales-legacy {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.sales-legacy__content {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.sales-legacy__intro {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
}

.sales-legacy__text {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

.sales-legacy__highlight {
  font-family: var(--font-content);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text-primary);
  margin: var(--space-xl) 0;
  padding: var(--space-lg);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--color-primary);
}

.sales-legacy__highlight em {
  font-style: normal;
  color: var(--color-primary);
  font-weight: 600;
}

.sales-legacy__closing {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: var(--space-lg);
}

@media (max-width: 639px) {
  .sales-legacy__intro {
    font-size: 1.25rem;
  }
  
  .sales-legacy__text {
    font-size: 1rem;
  }
  
  .sales-legacy__highlight {
    font-size: 1.125rem;
    padding: var(--space-md);
  }
}

.sales-legacy__action {
  font-size: 1.0625rem;
  color: var(--text-primary);
  line-height: 1.7;
  margin: var(--space-lg) 0;
  font-weight: 500;
}

/* ============================================
   Technical Specifications Section
   ============================================ */

.sales-techspecs__content {
  max-width: 800px;
  margin: 0 auto;
}

.sales-techspecs__intro {
  text-align: center;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-xl);
}

.sales-techspecs__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.sales-techspecs__item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sales-techspecs__label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sales-techspecs__value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sales-techspecs__note {
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  font-style: italic;
  max-width: 600px;
  margin: 0 auto;
}

@media (max-width: 639px) {
  .sales-techspecs__grid {
    grid-template-columns: 1fr;
  }
}

