/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Match old site color palette */
  --bg: hsl(40 20% 99%); /* cream/paper */
  --fg: hsl(215 35% 15%); /* dark navy text */
  --card: hsl(40 20% 98%);
  --muted: hsl(215 20% 40%);
  --border: hsl(215 20% 85%);
  --primary: hsl(215 40% 20%); /* deep navy */
  --accent: hsl(210 50% 80%); /* light blue */
  
  /* Shadows from old site */
  --shadow-sm: 0 1px 0 rgba(17, 24, 39, 0.04), 0 10px 24px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 1px 0 rgba(17, 24, 39, 0.05), 0 14px 36px rgba(17, 24, 39, 0.10);
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --header-height: 60px;
  
  /* Typography */
  --font-serif: "Source Serif 4", ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --font-heading: "Playfair Display", ui-serif, Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Legacy aliases for compatibility */
  --color-text: var(--fg);
  --color-text-light: var(--muted);
  --color-text-lighter: hsl(215 20% 60%);
  --color-border: var(--border);
  --color-bg: var(--bg);
  --color-bg-light: var(--card);
  
  --radius: 0px;
  --container: 1200px;
}

body {
  font-family: var(--font-serif);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

@media (min-width: 768px) {
  body {
    background: color-mix(in srgb, var(--border) 22%, white);
  }
}

* {
  box-sizing: border-box;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 1.00);
  border-bottom: 1px solid rgba(15, 23, 42, 0.10);
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0;
  box-sizing: border-box;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

@media (min-width: 768px) {
  header {
    backdrop-filter: blur(12px);
  }
}

.header-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  justify-content: space-between;
  padding: 0 var(--spacing-lg);
  box-sizing: border-box;
}

@media (max-width: 767px) {
  .header-inner {
    padding: 0 var(--spacing-sm);
  }
}

.search-wrapper {
  flex: 1;
  max-width: 400px;
  display: flex;
  align-items: center;
  position: relative;
}

.search-wrapper .filter-panel {
  left: 0;
}

.search-input {
  flex: 1;
  padding: 8px 0 8px 40px;
  border: none;
  border-radius: 0;
  font-size: 16px;
  font-family: inherit;
  background: transparent;
  color: var(--fg);
  outline: none;
  width: 200px;
  transition: width 0.2s ease;
}

.search-input:focus {
  outline: none;
  width: 300px;
}

.filter-button {
  position: absolute;
  left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.2s ease, background-color 0.2s ease;
  flex-shrink: 0;
  z-index: 1;
}

.filter-button:hover {
  color: var(--primary);
  background: rgba(0, 0, 0, 0.04);
}

.filter-button.active {
  color: var(--primary);
  background: rgba(15, 23, 42, 0.08);
}

.filter-icon {
  width: 18px;
  height: 18px;
}

.search-input::placeholder {
  color: var(--muted);
}

.header-tabs-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.tabs-burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--spacing-xs);
  flex-shrink: 0;
}

.tabs-burger-bars {
  width: 20px;
  height: 2px;
  background: var(--color-text);
  transition: all 0.3s;
  display: block;
}

.detail-panel-tabs {
  display: flex;
  gap: var(--spacing-sm);
}

@media (min-width: 768px) {
  .detail-panel-tabs {
    gap: var(--spacing-md);
  }
}

@media (max-width: 767px) {
  .header-inner {
    gap: var(--spacing-sm);
  }
  
  .search-input {
    max-width: none;
    flex: 1;
    font-size: 16px; /* Prevents zoom on iOS */
    min-width: 0;
  }
  
  /* Burger menu for mobile */
  .tabs-burger {
    display: flex;
  }
  
  .detail-panel-tabs {
    display: none;
  }
  
  .header-tabs-wrapper[data-open="true"] .detail-panel-tabs {
    display: flex !important;
    position: fixed;
    top: calc(var(--header-height) + 8px);
    right: var(--spacing-sm);
    left: auto;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    padding: var(--spacing-sm);
    min-width: 180px;
    z-index: 10001;
  }
  
  .detail-panel-tabs .tab-button {
    width: 100%;
    justify-content: flex-start;
    padding: var(--spacing-sm) var(--spacing-md);
  }
  
  /* Remove active state styling from burger menu buttons */
  .detail-panel-tabs .tab-button.active {
    color: var(--fg);
    font-weight: 500;
    border-bottom: none;
    padding-bottom: var(--spacing-sm);
  }
  
  .login-button {
    padding: var(--spacing-xs);
  }
}

.tab-button {
  padding: 10px 2px;
  border: none;
  background: transparent;
  color: var(--fg);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.tab-button:hover {
  color: var(--primary);
  text-decoration: none;
}

.tab-button.active {
  color: var(--primary);
  font-weight: 700;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 8px;
}

.tab-button-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.tab-button-text {
  display: inline;
}

/* Filters Bar - Shows below header when filters are active */
.filters-bar {
  position: sticky;
  top: var(--header-height);
  z-index: 999;
  background: white;
  border-bottom: 1px solid var(--color-border);
  padding: var(--spacing-sm) 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.filters-bar-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
}

@media (max-width: 767px) {
  .filters-bar-inner {
    padding: 0 var(--spacing-sm);
  }
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  flex: 1;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 4px 10px;
  background: var(--accent);
  border: 1px solid var(--primary);
  border-radius: 16px;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  color: var(--primary);
  font-weight: 500;
}

.filter-chip-remove {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: var(--primary);
  display: flex;
  align-items: center;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.filter-chip-remove:hover {
  opacity: 1;
}

.filter-chip-remove svg {
  width: 14px;
  height: 14px;
}

.clear-filters {
  padding: 4px 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}

.clear-filters:hover {
  color: var(--primary);
  background: rgba(0, 0, 0, 0.04);
}

/* Filter Panel - Standardized overlay card */
.filter-panel {
  position: fixed;
  background: white;
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 1002;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

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

/* Desktop: Dropdown below search */
@media (min-width: 768px) {
  .filter-panel {
    top: calc(var(--header-height) + 8px);
    left: auto;
    right: auto;
    width: auto;
    min-width: 320px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - var(--header-height) - 100px);
    border-radius: 12px;
  }
  
  .filter-panel-content {
    overflow-y: auto;
    flex: 1;
  }
}

/* Mobile: Bottom card (standardized pattern) */
@media (max-width: 767px) {
  .filter-panel {
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    max-height: 75vh;
    height: 75vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    border-left: none;
    border-right: none;
    border-bottom: none;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  }
  
  .filter-panel.open {
    transform: translateY(0);
  }
  
  .filter-panel-content {
    overflow-y: auto;
    flex: 1;
  }
}

.filter-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  gap: var(--spacing-md);
}

.filter-panel-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0;
  letter-spacing: -0.01em;
  flex: 1;
}

.filter-panel-content {
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.filter-section {
  margin-bottom: var(--spacing-lg);
}

.filter-section:last-of-type {
  margin-bottom: var(--spacing-md);
}

.filter-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: var(--spacing-sm);
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  max-height: 200px;
  overflow-y: auto;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) 0;
  cursor: pointer;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  color: var(--color-text);
}

.filter-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary);
}

.filter-option label {
  cursor: pointer;
  flex: 1;
  user-select: none;
}

.filter-panel-actions {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
  flex-shrink: 0;
}

.filter-apply,
.filter-reset {
  padding: var(--spacing-sm) var(--spacing-lg);
  border: 1px solid var(--primary);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-apply {
  background: var(--primary);
  color: white;
}

.filter-apply:hover {
  opacity: 0.9;
}

.filter-reset {
  background: transparent;
  color: var(--primary);
}

.filter-reset:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* Main Layout */
main {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--spacing-lg);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  position: relative;
  align-items: start;
  box-sizing: border-box;
}

@media (max-width: 767px) {
  main {
    padding: var(--spacing-md) var(--spacing-sm);
    gap: var(--spacing-md);
  }
}

@media (min-width: 768px) {
  body {
    background: color-mix(in srgb, var(--border) 22%, white);
  }
}

@media (min-width: 768px) {
  main {
    grid-template-columns: 55% 45%;
    align-items: start;
    grid-auto-flow: row;
  }
  
  .job-list {
    grid-column: 1;
    grid-row: 1;
  }
  
  .detail-panel {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: calc(var(--header-height) + var(--spacing-lg));
    align-self: start;
  }
}

/* Job List */
.job-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.job-card {
  padding: 20px;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
  background: white;
  display: flex;
  gap: var(--spacing-md);
  align-items: start;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.job-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.job-card.active {
  border-color: var(--primary);
  border-width: 2px;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08), var(--shadow-md);
  background: var(--bg);
  box-sizing: border-box;
  padding: 20px;
}

.job-card.expired {
  opacity: 0.6;
  filter: grayscale(0.1);
}

.job-card.max-urgent {
  border-left: 5px solid #dc2626;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.2), 0 0 0 1px rgba(220, 38, 38, 0.1);
  background: linear-gradient(to right, rgba(220, 38, 38, 0.02), white);
}

/* Countdown wrapper uses same positioning as deadline field, but shifted left to align icon */
.job-countdown-wrapper {
  display: inline-flex;
  align-items: center;
  /* Shift left by badge padding (12px) so icon aligns with other metadata icons */
  margin-left: -12px;
}

.job-card.max-urgent .job-countdown {
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  background: #dc2626;
  padding: 6px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.02em;
  line-height: 1.3;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
  white-space: nowrap;
}

.job-countdown-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  filter: brightness(0) invert(1); /* Make icon white */
  opacity: 1;
}

/* Less urgent cards - no left border, red deadline styling applied via classes */

.job-meta-item.job-meta-urgent {
  color: #dc2626;
  font-weight: 600;
}

.job-meta-item.job-meta-urgent .meta-icon.meta-icon-urgent {
  opacity: 1;
  filter: brightness(0) saturate(100%) invert(27%) sepia(95%) saturate(7151%) hue-rotate(346deg) brightness(92%) contrast(89%);
}

.job-expired-timer {
  color: var(--color-text-lighter);
  font-weight: 600;
  font-size: 13px;
  margin: var(--spacing-xs) 0;
  letter-spacing: 0.05em;
}

.expired-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  transform-origin: center center;
  user-select: none;
  opacity: 1 !important;
  filter: grayscale(0) brightness(1.4) contrast(1.5) saturate(1.4) !important;
  width: clamp(180px, 35vw, 300px);
  height: auto;
  object-fit: contain;
  isolation: isolate;
}

@media (max-width: 767px) {
  .expired-stamp {
    width: clamp(280px, 70vw, 380px);
  }
}

.meta-icon {
  width: 12px;
  height: 12px;
  opacity: 0.6;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(40%);
  flex-shrink: 0;
}

.job-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  object-fit: contain;
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.job-icon[src]:not([src=""]) {
  opacity: 1;
}

@media (min-width: 768px) {
  .job-icon {
    width: 64px;
    height: 64px;
  }
}

@media (max-width: 767px) {
  .job-card .job-icon {
    display: none;
  }
  
  .job-icon-bg {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: 120px;
    max-height: calc(100% - 8px);
    object-fit: contain;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.2s ease;
  }
  
  .job-icon-bg[src]:not([src=""]) {
    opacity: 0.2;
  }
}

.job-content {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.job-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--primary);
  line-height: 1.3;
}

.job-org {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: var(--spacing-sm);
  line-height: 1.4;
}

.job-meta {
  display: flex;
  align-items: center;
  position: relative;
  min-height: 20px;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.job-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
  white-space: nowrap;
  position: absolute;
}

/* Fixed x positions for each metadata field - more generous spacing */
.job-meta-item:nth-child(1) {
  left: 0;
}

.job-meta-item:nth-child(2) {
  left: 160px; /* More generous spacing for second field */
}

.job-meta-item:nth-child(3) {
  left: 320px; /* More generous spacing for third field */
}

.job-meta-item:nth-child(4) {
  left: 480px; /* Fourth field if needed */
}

@media (max-width: 767px) {
  .job-meta-item:nth-child(2) {
    left: 130px; /* Mobile: adjusted position for second field */
  }

  .job-meta-item:nth-child(3) {
    left: 240px; /* Mobile: adjusted position for third field */
  }

  .job-meta-item:nth-child(4) {
    left: 350px; /* Mobile: fourth field */
  }
}

/* Detail Panel */
.detail-panel {
  position: sticky;
  top: calc(var(--header-height) + var(--spacing-lg));
  max-height: calc(100vh - var(--header-height) - var(--spacing-lg) * 2);
  overflow-y: auto;
  padding: var(--spacing-lg);
  background: transparent;
  border-radius: 0;
  border: none;
  display: block;
  align-self: start;
  min-height: 200px;
  height: fit-content;
}

@media (min-width: 768px) {
  .detail-panel {
    min-height: 400px;
    height: auto;
    background: transparent;
  }
}

@media (max-width: 767px) {
  .detail-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    max-height: 75vh;
    height: 75vh;
    background: var(--color-bg-light);
    border-radius: 16px 16px 0 0;
    border: 1px solid var(--color-border);
    border-left: none;
    border-right: none;
    border-bottom: none;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0; /* Remove padding on mobile - content handles it */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .detail-panel.open {
    transform: translateY(0);
  }
  
  .detail-content {
    overflow-y: auto;
    flex: 1;
    padding: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .detail-content > * {
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .detail-content .section-title,
  .detail-content h3.section-title,
  .detail-content h3 {
    margin-left: 0 !important;
    padding-left: 0 !important;
    width: 100%;
  }
  
  .detail-content p {
    margin-left: 0;
    padding-left: 0;
  }
  
  .detail-content ul {
    margin-left: 0 !important;
    padding-left: var(--spacing-lg);
  }
  
  .detail-content-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
  }
  
  .detail-header {
    padding: var(--spacing-md);
    padding-bottom: var(--spacing-xs);
    padding-top: var(--spacing-lg);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .detail-content {
    padding: 0 var(--spacing-md) var(--spacing-md) var(--spacing-md);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Standardized Backdrop - Used by all overlay panels */
.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  display: none;
}

.backdrop.open {
  opacity: 1;
  pointer-events: auto;
  display: block;
}

@media (min-width: 768px) {
  .backdrop {
    display: block;
  }
}

.detail-header {
  margin-bottom: var(--spacing-lg);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.detail-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--primary);
  letter-spacing: -0.01em;
}

.detail-org {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: var(--spacing-md);
  line-height: 1.4;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  font-size: 14px;
  color: #2a4a62;
  margin-bottom: var(--spacing-md);
}

.detail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.detail-content {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #2a4a62;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.detail-content p {
  margin-bottom: var(--spacing-md);
  color: rgba(2, 6, 23, 0.74);
}

.detail-content h3 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  margin: var(--spacing-lg) 0 var(--spacing-sm);
  color: hsl(215 14% 42%);
  letter-spacing: -0.01em;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 0.74rem;
  font-weight: 500;
  color: hsl(215 14% 42%);
  margin: 0 0 6px;
  letter-spacing: 0.04em;
  text-transform: none;
  line-height: 1.35;
}

.detail-content ul {
  margin-left: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}

.detail-content li {
  margin-bottom: var(--spacing-xs);
}

.detail-actions {
  margin-bottom: var(--spacing-lg);
}

.detail-link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-text);
  color: var(--color-bg);
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.2s;
}

.detail-link:hover {
  opacity: 0.9;
}

.detail-link svg {
  width: 16px;
  height: 16px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  margin: var(--spacing-lg) 0 var(--spacing-md);
  color: hsl(215 14% 42%);
}

/* StoryBrand About Section Styles */
.storybrand-section {
  margin-bottom: var(--spacing-xl);
}

.storybrand-line {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--fg);
  margin-bottom: var(--spacing-sm);
  padding-left: 0;
  font-weight: 400;
}

.storybrand-section > .storybrand-line:first-child {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: var(--spacing-sm);
}

.storybrand-line.emphasis {
  font-weight: 500;
  color: var(--primary);
  font-size: 1.05rem;
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
}

.storybrand-divider {
  display: none;
}

.storybrand-cta {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-lg);
}

.storybrand-cta-line {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--fg);
  margin-bottom: var(--spacing-sm);
}

.storybrand-cta-line.cta-primary {
  font-weight: 500;
  color: var(--primary);
  font-size: 1.05rem;
  margin-top: var(--spacing-xs);
}

.section-title:first-child {
  margin-top: 0;
}

.requirements-list,
.responsibilities-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.requirement-item,
.responsibility-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #2a4a62;
}

.requirement-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.requirement-item > div {
  display: flex;
  gap: 6px;
  flex: 1;
}

.requirement-label {
  font-weight: 500;
  color: hsl(215 14% 42%);
  white-space: nowrap;
  min-width: 85px;
}

.requirement-value {
  color: #2a4a62;
}

.requirement-icon,
.responsibility-icon {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  padding-top: 3px;
}

.requirement-icon img,
.responsibility-icon img {
  width: 14px;
  height: 14px;
  opacity: 0.4;
  object-fit: contain;
}

.benefits-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.benefit-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.28rem 0.6rem;
  background: #f9fbfd;
  border: 1px solid #e4e9ef;
  border-radius: 999px;
  font-size: 0.74rem;
  color: #2a4a62;
  font-weight: 500;
  cursor: default;
  overflow: hidden;
  white-space: nowrap;
  height: 26px;
  line-height: 1;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  box-shadow: none;
}

.benefit-tag:hover {
  background: #f5f8fb;
  border-color: #d8e0ea;
  color: #2a4a62;
}

.benefit-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #2a4a62;
}

.benefit-row:last-child {
  border-bottom: none;
}

.benefit-row-label {
  font-weight: 500;
  color: hsl(215 14% 42%);
  flex-shrink: 0;
}

.benefit-row-value {
  font-weight: 400;
  text-align: right;
  color: #2a4a62;
}

/* Loading & Empty States */
.loading, .empty {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--color-text-light);
}

/* Section Headers */
.section-header {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  margin: var(--spacing-lg) 0 var(--spacing-sm);
  color: var(--color-text);
}

.section-header:first-child {
  margin-top: 0;
}

.urgency-section-header {
  margin: var(--spacing-lg) 0 var(--spacing-sm);
}

.urgency-section-header:first-child {
  margin-top: 0;
}

.urgency-title {
  font-family: var(--font-heading);
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 600;
  color: var(--primary);
  margin: 0;
  letter-spacing: -0.01em;
}

/* Expired Section */
.expired-section-header {
  margin-top: var(--spacing-lg) !important;
  margin-bottom: var(--spacing-sm);
  padding: 0;
  position: relative;
  z-index: 1;
}

.expired-section-header:first-child {
  margin-top: 0 !important;
}

.expired-title {
  font-family: var(--font-heading);
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 600;
  color: var(--primary);
  margin: 0;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  letter-spacing: -0.01em;
}

.expired-toggle {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--color-text);
  display: flex;
  align-items: center;
  transition: transform 0.2s;
}

.expired-toggle-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
}

.expired-section-header[data-expanded="true"] .expired-toggle-icon {
  transform: rotate(180deg);
}

.expired-section-content {
  margin-bottom: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

/* Other Positions Card - Gray card with dotted border */
.other-positions-card {
  padding: 20px;
  border: 2px dashed var(--color-border);
  border-radius: 12px;
  background: linear-gradient(135deg, hsl(40 20% 98%) 0%, hsl(40 15% 96%) 100%);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0;
  box-sizing: border-box;
}

.other-positions-content {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.other-positions-count {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 var(--spacing-sm);
  color: var(--color-text);
  font-family: var(--font-sans);
}

.other-positions-count strong {
  font-weight: 700;
}

.other-positions-text {
  font-size: 0.9375rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
  font-family: var(--font-serif);
}

.other-positions-text em {
  font-style: italic;
  color: var(--color-text);
}

/* Detail Panel Expired */
.detail-content-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.detail-content-wrapper.expired-detail {
  opacity: 0.7;
  filter: grayscale(0.3);
}

.expired-stamp-large {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1000;
  transform-origin: center center;
  width: clamp(220px, 40vw, 350px);
  height: auto;
  object-fit: contain;
  max-width: calc(100% - 40px);
  filter: grayscale(0) brightness(1.4) contrast(1.5) saturate(1.4) !important;
  opacity: 1 !important;
  isolation: isolate;
}

@media (max-width: 767px) {
  .expired-stamp-large {
    width: clamp(280px, 70vw, 380px);
  }
}

@media (min-width: 768px) {
  .expired-stamp-large {
    width: clamp(250px, 45vw, 400px);
  }
}

.detail-header,
.detail-content {
  position: relative;
  z-index: 1;
}

/* Save Button */
.save-button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--spacing-xs);
  color: var(--color-text-lighter);
  transition: color 0.2s;
}

.save-button:hover {
  color: var(--color-text);
}

.save-button.saved {
  color: var(--color-text);
}

.save-button svg {
  width: 20px;
  height: 20px;
}

/* Login button is now styled as tab-button, no separate styles needed */

/* Login Panel */
.login-panel {
  position: fixed;
  background: white;
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 1002;
  display: none;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}

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

/* Desktop: Centered popup */
@media (min-width: 768px) {
  .login-panel {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 480px;
    border-radius: 12px;
    min-height: auto;
  }
  
  .login-panel.open {
    display: flex;
  }
  
  /* Wider panel for pricing page */
  .login-panel[data-tab="pricing"] {
    max-width: 900px;
  }
}

/* Mobile: Bottom card (standardized pattern) */
@media (max-width: 767px) {
  .login-panel {
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    max-height: 75vh;
    height: 75vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    border-left: none;
    border-right: none;
    border-bottom: none;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  
  .login-panel.open {
    transform: translateY(0);
  }
  
  .login-panel-content {
    overflow-y: auto;
    flex: 1;
  }
}

.login-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.login-panel-header-left {
  flex: 1;
}

.login-panel-tabs {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
}

.login-panel-tab {
  padding: var(--spacing-xs) 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 0;
  transition: color 0.2s ease;
  position: relative;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.login-panel-tab:hover {
  color: var(--primary);
}

.login-panel-tab.active {
  color: var(--primary);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.login-panel-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.login-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.login-panel-close:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--primary);
}

.login-panel-close svg {
  width: 20px;
  height: 20px;
}

.login-panel-content {
  padding: var(--spacing-lg);
  overflow-y: auto;
  flex: 1;
}

/* Login form styles */
.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.login-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.login-form-label {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.login-form-input {
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--color-text);
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.login-form-button {
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  background: var(--primary);
  color: white;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s ease, background-color 0.2s ease;
  margin-top: var(--spacing-sm);
}

.login-form-button:hover {
  opacity: 0.9;
}

.login-form-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-panel-section {
  padding: var(--spacing-md) 0;
  border-top: 1px solid var(--color-border);
}

.login-panel-section:first-child {
  border-top: none;
  padding-top: 0;
}

.login-panel-link {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  padding: var(--spacing-xs) 0;
  transition: opacity 0.2s ease;
}

.login-panel-link:hover {
  opacity: 0.8;
}

.login-panel-text {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.5;
  margin: 0;
}

/* Login backdrop */
#login-backdrop {
  z-index: 1001;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  display: none;
}

#login-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 768px) {
  #login-backdrop {
    display: block;
  }
  
  .login-panel[data-tab="pricing"] {
    max-width: 900px;
  }
}

@media (max-width: 767px) {
  #login-backdrop {
    display: block;
  }
}

/* Pricing Page Styles */
.pricing-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  padding: var(--spacing-md) 0;
}

@media (min-width: 768px) {
  .pricing-container {
    flex-direction: row;
    align-items: stretch;
  }
}

.pricing-card {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: var(--spacing-lg);
  background: white;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
  min-height: 380px;
}

.pricing-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pricing-card.popular {
  border-color: var(--primary);
  border-width: 2px;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08), var(--shadow-md);
}

.pricing-card.popular::before {
  content: 'Most Popular';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pricing-card-header {
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
}

.pricing-card-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 var(--spacing-sm) 0;
  letter-spacing: -0.02em;
}

.pricing-card-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: var(--spacing-sm);
}

.pricing-card-amount {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1;
}

.pricing-card-period {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 400;
}

.pricing-card-description {
  font-family: var(--font-serif);
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: var(--spacing-lg);
  font-weight: 400;
}

.pricing-card-features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--spacing-lg) 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pricing-card-feature {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  padding: var(--spacing-xs) 0;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--color-text);
  line-height: 1.4;
}

.pricing-card-feature span {
  flex: 1;
}

.pricing-card-feature-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--primary);
}

.pricing-card-button {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--primary);
  background: var(--primary);
  color: white;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
  margin-top: auto;
}

.pricing-card-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.pricing-card.popular .pricing-card-button {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.pricing-card-button.secondary {
  background: transparent;
  color: var(--primary);
}

.pricing-card-button.secondary:hover {
  background: rgba(15, 23, 42, 0.04);
}