:root {
  --bg: #f4f6fb;
  --bg-card: #ffffff;
  --bg-hover: #f0f3fa;
  --text: #1a1d26;
  --text-secondary: #5c6370;
  --text-muted: #8b93a1;
  --border: #e2e6ef;
  --primary: #4f6ef7;
  --primary-hover: #3d5ce5;
  --primary-light: rgba(79, 110, 247, 0.1);
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --status-pending: #94a3b8;
  --status-pending-early: #64748b;
  --status-applied: #3b82f6;
  --status-written: #8b5cf6;
  --status-interview1: #f59e0b;
  --status-interview2: #f97316;
  --status-interview3: #ef6f5e;
  --status-hr: #ec4899;
  --status-offer: #10b981;
  --status-rejected: #ef4444;
  --status-giveup: #6b7280;
  --status-giveup-unapplied: #9ca3af;
}

[hidden] {
  display: none !important;
}

[data-theme="dark"] {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-hover: #252936;
  --text: #e8eaed;
  --text-secondary: #a0a8b8;
  --text-muted: #6b7280;
  --border: #2d3344;
  --primary: #6b8aff;
  --primary-hover: #5a79ee;
  --primary-light: rgba(107, 138, 255, 0.15);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

.app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 20px 24px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
  min-height: 100dvh;
}

/* PWA install banner */
.install-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
}

.install-banner__content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.install-banner__text {
  font-size: 0.875rem;
  flex: 1;
  min-width: 200px;
}

.install-banner__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.install-banner .btn--primary {
  background: #fff;
  color: var(--primary);
}

.install-banner .btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.update-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  background: rgba(79, 110, 247, 0.12);
  border-bottom: 1px solid rgba(79, 110, 247, 0.2);
  font-size: 0.875rem;
  color: var(--primary);
}

.update-banner[hidden] {
  display: none !important;
}

@media (display-mode: standalone) {
  .page-hint {
    display: none;
  }
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  min-height: 40px;
}

.header__page-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Pages */
.page {
  display: none;
  animation: page-in 0.2s ease;
}

.page--active {
  display: block;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-hint {
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

/* Bottom tab bar */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .tab-bar {
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
}

.tab-bar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px 10px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 500;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.tab-bar__item--active {
  color: var(--primary);
}

.tab-bar__icon {
  font-size: 1.25rem;
  line-height: 1;
}

.tab-bar__label {
  line-height: 1.2;
}

/* Settings */
.settings-group {
  margin-bottom: 20px;
}

.settings-group__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-left: 4px;
}

.settings-note {
  margin: 0 4px 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.12);
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.resume-version-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 4px 8px;
}

.resume-version-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.resume-version-item__main {
  flex: 1;
  min-width: 0;
}

.resume-version-item__main strong {
  display: block;
  font-size: 0.9375rem;
  margin-bottom: 4px;
}

.resume-version-item__tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
}

.resume-version-item__meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.resume-version-item__actions {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
}

.resume-version-default {
  display: flex;
  align-items: center;
  gap: 8px;
}

.resume-version-default input {
  width: auto;
}

.resume-version-default span {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.sync-hint {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.sync-hint--warn {
  color: #d97706;
}

.sync-key-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sync-key-row input,
.sync-key-row select {
  flex: 1;
  min-width: 0;
}

.sync-key-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.settings-group .settings-item:first-of-type {
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}

.settings-group .settings-item:last-child {
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  border-bottom: none;
}

.settings-item:hover {
  background: var(--bg-hover);
}

.settings-item--static {
  cursor: default;
}

.settings-item--static:hover {
  background: var(--bg-card);
}

.settings-item__icon {
  font-size: 1.125rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.settings-item__label {
  flex: 1;
}

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

.settings-item__arrow {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Header legacy removed */
.header__brand,
.header__logo,
.header__title,
.header__subtitle,
.header__actions {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--primary-hover);
}

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

.btn--ghost:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}

.btn--danger:hover {
  background: var(--danger-hover);
}

.btn--sm {
  padding: 4px 10px;
  font-size: 0.8125rem;
}

.btn--notify-on {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

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

/* Reminders panel */
.reminders-panel {
  background: linear-gradient(135deg, var(--primary-light), transparent);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.reminders-panel__header {
  margin-bottom: 12px;
}

.reminders-panel__section + .reminders-panel__section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(79, 110, 247, 0.25);
}

.reminders-panel__title {
  font-weight: 600;
  font-size: 0.9375rem;
}

.reminders-panel__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reminder-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  flex-wrap: wrap;
}

.reminder-card--today {
  border-color: var(--status-interview1);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2);
}

.reminder-card--deadline .reminder-card__time strong {
  color: var(--status-pending, #8b5cf6);
}

.reminder-card--deadline.reminder-card--today .reminder-card__time strong {
  color: var(--status-interview1);
}

.reminder-card--overdue {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2);
}

.reminder-card--overdue .reminder-card__time strong {
  color: var(--danger);
}

.reminder-card__time {
  display: flex;
  flex-direction: column;
  min-width: 72px;
}

.reminder-card__time strong {
  font-size: 1rem;
  color: var(--status-interview1);
}

.reminder-card__time span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.reminder-card__info {
  flex: 1;
  min-width: 140px;
}

.reminder-card__company {
  font-weight: 600;
  font-size: 0.875rem;
}

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

/* Calendar view */
.calendar-view {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: start;
}

.calendar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.calendar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.calendar__title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar__title h2 {
  font-size: 1.125rem;
  font-weight: 600;
}

.calendar__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.cal-day:hover {
  background: var(--bg-hover);
}

.cal-day--other {
  opacity: 0.35;
}

.cal-day--today .cal-day__num {
  background: var(--primary);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-day--selected {
  background: var(--primary-light);
  outline: 2px solid var(--primary);
}

.cal-day__num {
  font-size: 0.875rem;
  font-weight: 500;
}

.cal-day__dots {
  display: flex;
  gap: 3px;
  position: absolute;
  bottom: 6px;
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.dot--interview {
  background: var(--status-interview1);
}

.dot--apply {
  background: var(--status-applied);
}

.dot--deadline {
  background: var(--status-pending, #8b5cf6);
}

.calendar__legend {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  position: sticky;
  top: 20px;
}

.calendar-sidebar h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.calendar-sidebar__hint {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.calendar-sidebar__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cal-event-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.cal-event-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.cal-event-card__position {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.cal-event-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.cal-event-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
}

.cal-event-tag--interview {
  background: rgba(245, 158, 11, 0.15);
  color: var(--status-interview1);
}

.cal-event-tag--apply {
  background: rgba(59, 130, 246, 0.12);
  color: var(--status-applied);
}

.cal-event-tag--deadline {
  background: rgba(139, 92, 246, 0.15);
  color: var(--status-pending, #8b5cf6);
}

.cal-event-card__notes {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.cell-interview {
  font-size: 0.8125rem;
  white-space: nowrap;
}

.cell-interview--soon {
  color: var(--status-interview1);
  font-weight: 600;
}

.cell-deadline {
  font-size: 0.8125rem;
  white-space: nowrap;
}

.cell-deadline--soon {
  color: var(--status-pending, #8b5cf6);
  font-weight: 600;
}

.cell-deadline--overdue {
  color: var(--danger);
  font-weight: 600;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.stat-card:hover {
  transform: translateY(-1px);
}

.stat-card--active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.stat-card__count {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-card__label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.35;
  word-break: break-word;
}

.stat-card--all .stat-card__count { color: var(--primary); }
.stat-card--pending .stat-card__count { color: var(--status-pending); }
.stat-card--pending-early .stat-card__count { color: var(--status-pending-early); }
.stat-card--applied .stat-card__count { color: var(--status-applied); }
.stat-card--written .stat-card__count { color: var(--status-written); }
.stat-card--interview1 .stat-card__count { color: var(--status-interview1); }
.stat-card--interview2 .stat-card__count { color: var(--status-interview2); }
.stat-card--interview3 .stat-card__count { color: var(--status-interview3); }
.stat-card--hr .stat-card__count { color: var(--status-hr); }
.stat-card--offer .stat-card__count { color: var(--status-offer); }
.stat-card--rejected .stat-card__count { color: var(--status-rejected); }
.stat-card--giveup .stat-card__count { color: var(--status-giveup); }
.stat-card--giveup-unapplied .stat-card__count { color: var(--status-giveup-unapplied); }

.list-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.list-filter-bar__label {
  font-weight: 600;
  font-size: 0.9375rem;
}

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

/* Toolbar */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.view-switcher {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-card) 72%, var(--bg));
}

.view-switcher__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.view-switcher__button:hover {
  color: var(--text);
}

.view-switcher__button--active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.toolbar__search {
  position: relative;
  width: min(400px, 100%);
}

.toolbar__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}

.toolbar__search input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.toolbar__search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-chip--active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Upcoming 7-day schedule */
.upcoming-schedule {
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.upcoming-schedule__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
}

.upcoming-schedule__eyebrow {
  margin-bottom: 1px;
  color: var(--text-muted);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.upcoming-schedule__header h2 {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.upcoming-schedule__toggle {
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.upcoming-schedule__toggle:hover {
  color: var(--text);
}

.upcoming-schedule__body {
  border-top: 1px solid var(--border);
}

.upcoming-day {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  border-bottom: 1px solid var(--border);
}

.upcoming-day:last-child {
  border-bottom: 0;
}

.upcoming-day__date {
  padding: 13px 16px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--bg) 58%, transparent);
}

.upcoming-day__events {
  min-width: 0;
}

.upcoming-schedule__event {
  display: grid;
  grid-template-columns: 64px minmax(100px, 0.72fr) minmax(140px, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 9px 16px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.upcoming-schedule__event:last-child {
  border-bottom: 0;
}

.upcoming-schedule__event:hover {
  background: var(--bg-hover);
}

.upcoming-schedule__time {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.upcoming-schedule__company {
  overflow: hidden;
  font-size: 0.8125rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-schedule__position {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-schedule__empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* Table */
.main {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th {
  text-align: left;
  padding: 14px 16px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tbody tr:hover {
  background: var(--bg-hover);
}

.table-row--clickable {
  cursor: pointer;
}

.table-row--clickable:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table .cell-company {
  font-weight: 600;
}

.table .cell-notes {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.table .cell-actions {
  white-space: nowrap;
}

.table .cell-actions button {
  margin-right: 4px;
}

/* Linear-inspired kanban */
.kanban-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 2px 0 14px;
  overscroll-behavior-x: contain;
  scrollbar-color: color-mix(in srgb, var(--text-muted) 45%, transparent) transparent;
}

.kanban-board {
  display: flex;
  align-items: stretch;
  min-width: max-content;
}

.kanban-column {
  --kanban-accent: var(--text-muted);
  flex: 0 0 252px;
  min-height: 380px;
  padding: 0 10px 18px;
  border-left: 1px solid var(--border);
}

.kanban-column:first-child {
  border-left: 0;
  padding-left: 0;
}

.kanban-column:last-child {
  padding-right: 0;
}

.kanban-column--pending { --kanban-accent: var(--status-pending); }
.kanban-column--pending_early { --kanban-accent: var(--status-pending-early); }
.kanban-column--written { --kanban-accent: var(--status-written); }
.kanban-column--interview1 { --kanban-accent: var(--status-interview1); }
.kanban-column--interview2 { --kanban-accent: var(--status-interview2); }
.kanban-column--interview3 { --kanban-accent: var(--status-interview3); }
.kanban-column--hr { --kanban-accent: var(--status-hr); }
.kanban-column--offer { --kanban-accent: var(--status-offer); }
.kanban-column--applied { --kanban-accent: var(--status-applied); }
.kanban-column--rejected { --kanban-accent: var(--status-rejected); }
.kanban-column--giveup,
.kanban-column--giveup_unapplied { --kanban-accent: var(--status-giveup); }

.kanban-column__header {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 4px 2px 9px;
}

.kanban-column__title-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.kanban-column__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--kanban-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--kanban-accent) 12%, transparent);
}

.kanban-column__header h3 {
  overflow: hidden;
  font-size: 0.8125rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-column__count {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.kanban-column__cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  width: 100%;
  min-height: 86px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.kanban-card:hover {
  border-color: color-mix(in srgb, var(--kanban-accent) 50%, var(--border));
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}

.kanban-card:focus-visible,
.upcoming-schedule__event:focus-visible,
.view-switcher__button:focus-visible,
.upcoming-schedule__toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.kanban-card__avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--kanban-accent) 13%, var(--bg-card));
  color: var(--kanban-accent);
  font-size: 0.75rem;
  font-weight: 700;
}

.kanban-card__body {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.kanban-card__company,
.kanban-card__position,
.kanban-card__meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-card__company {
  font-size: 0.8125rem;
  font-weight: 650;
  line-height: 1.4;
}

.kanban-card__position {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.kanban-card__meta {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 0.6875rem;
}

.kanban-card__arrow {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.25;
}

.kanban-column__empty {
  padding: 12px 3px;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.link-external {
  color: var(--primary);
  text-decoration: none;
}

.link-external:hover {
  text-decoration: underline;
}

/* Status badge */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.badge--pending { background: rgba(148, 163, 184, 0.15); color: var(--status-pending); }
.badge--pending-early { background: rgba(100, 116, 139, 0.15); color: var(--status-pending-early); }
.badge--applied { background: rgba(59, 130, 246, 0.12); color: var(--status-applied); }
.badge--written { background: rgba(139, 92, 246, 0.12); color: var(--status-written); }
.badge--interview1 { background: rgba(245, 158, 11, 0.12); color: var(--status-interview1); }
.badge--interview2 { background: rgba(249, 115, 22, 0.12); color: var(--status-interview2); }
.badge--interview3 { background: rgba(239, 111, 94, 0.12); color: var(--status-interview3); }
.badge--hr { background: rgba(236, 72, 153, 0.12); color: var(--status-hr); }
.badge--offer { background: rgba(16, 185, 129, 0.12); color: var(--status-offer); }
.badge--rejected { background: rgba(239, 68, 68, 0.12); color: var(--status-rejected); }
.badge--giveup { background: rgba(107, 114, 128, 0.12); color: var(--status-giveup); }
.badge--giveup-unapplied { background: rgba(156, 163, 175, 0.15); color: var(--status-giveup-unapplied); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 64px 24px;
}

.empty-state__icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Modal */
dialog.modal {
  display: none;
}

dialog.modal[open] {
  display: flex;
  flex-direction: column;
}

.modal {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  max-width: 640px;
  width: calc(100% - 32px);
  background: var(--bg-card);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

.modal--sm {
  max-width: 420px;
}

.modal__form {
  display: flex;
  flex-direction: column;
  max-height: 100dvh;
}

.modal--detail {
  display: flex;
  flex-direction: column;
  max-height: 100dvh;
  max-width: 760px;
  overflow: hidden;
}

body:has(dialog[open]) .tab-bar {
  display: none;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal__header h2 {
  font-size: 1.125rem;
  font-weight: 600;
}

.modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

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

.modal__body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-card);
}

/* Detail modal */
.modal--detail .modal__body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.detail-hero {
  position: relative;
  padding: 24px 48px 20px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, #6b8aff 100%);
  color: #fff;
  flex-shrink: 0;
}

.detail-hero__close {
  position: absolute;
  top: 12px;
  right: 12px;
  color: rgba(255, 255, 255, 0.85);
  z-index: 1;
}

.detail-hero__close:hover {
  color: #fff;
}

.detail-hero__company-input,
.detail-hero__position-input {
  display: block;
  width: 100%;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  outline: 0;
  background: transparent;
  color: #fff;
  font-family: inherit;
}

.detail-hero__company-input {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
}

.detail-hero__position-input {
  font-size: 0.9375rem;
  opacity: 0.9;
  margin-bottom: 10px;
}

.detail-hero__company-input::placeholder,
.detail-hero__position-input::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

.detail-hero__company-input:hover,
.detail-hero__position-input:hover,
.detail-hero__company-input:focus,
.detail-hero__position-input:focus {
  border-bottom-color: rgba(255, 255, 255, 0.55);
}

.detail-hero__badge {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.detail-body {
  padding: 20px 20px 8px;
}

.detail-editor-section {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.detail-editor-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.status-timeline__new-hint {
  margin: 0;
  padding: 14px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: var(--bg);
  font-size: 0.8125rem;
}

.status-timeline__initial {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(190px, 1.2fr) minmax(130px, 0.8fr);
  gap: 10px;
}

.status-timeline__initial label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-timeline__initial label > span {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
}

.status-timeline__initial select,
.status-timeline__initial input,
.status-timeline__reminder {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8125rem;
}

.status-timeline__initial select:focus,
.status-timeline__initial input:focus,
.status-timeline__reminder:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.status-timeline__reminder {
  flex: 0 1 132px;
}

.detail-quick {
  margin-bottom: 16px;
}

.detail-quick__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.detail-chip__icon {
  font-size: 0.875rem;
  line-height: 1;
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.detail-section__icon {
  font-size: 1rem;
  text-transform: none;
  letter-spacing: 0;
}

.detail-section__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-item {
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.detail-item__label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.detail-item__value {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

.detail-item--highlight {
  border-color: var(--status-interview1);
  background: rgba(245, 158, 11, 0.08);
}

.detail-item--highlight .detail-item__value {
  color: var(--status-interview1);
}

.detail-item--warn {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
}

.detail-item--warn .detail-item__value {
  color: var(--danger);
}

.status-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.status-timeline__empty {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 8px 0;
}

.status-timeline__item {
  display: flex;
  gap: 12px;
  min-height: 56px;
}

.status-timeline__track {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 16px;
  flex-shrink: 0;
  padding-top: 6px;
}

.status-timeline__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 0 2px var(--border);
  flex-shrink: 0;
}

.status-timeline__line {
  flex: 1;
  width: 2px;
  min-height: 12px;
  margin: 4px 0;
  background: var(--border);
}

.status-timeline__body {
  flex: 1;
  padding-bottom: 14px;
}

.status-timeline__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.status-timeline__time {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.status-timeline__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.status-timeline__input {
  flex: 1;
  min-width: 0;
  max-width: 220px;
  padding: 8px 10px;
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.status-timeline__input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.status-timeline__select {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.status-timeline__add {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.status-timeline__add-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.status-timeline__add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status-timeline__add-hint {
  margin-top: 14px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.btn-timeline-delete {
  color: var(--danger);
  flex-shrink: 0;
}

.status-timeline__current-tag {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 999px;
}

.status-timeline__item--current .status-timeline__dot {
  background: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 110, 247, 0.25);
}

.detail-link-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: background 0.15s, transform 0.15s;
}

.detail-link-btn:hover {
  background: rgba(79, 110, 247, 0.18);
  transform: translateY(-1px);
}

.detail-link-btn__arrow {
  font-size: 1.125rem;
  opacity: 0.7;
}

.detail-notes {
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-notes--empty {
  color: var(--text-muted);
  font-style: italic;
}

.detail-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0 4px;
}

.detail-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 10px;
  padding: 16px 20px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}

.detail-footer__btn {
  padding: 12px 10px;
  font-size: 0.875rem;
}

.detail-footer .btn--ghost:first-child {
  color: var(--text-secondary);
  border-color: var(--border);
}

.detail-footer .btn--ghost:first-child:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.detail-footer #btnDetailDelete {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.35);
}

.detail-footer #btnDetailDelete:hover {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  border-color: var(--danger);
}

.reminder-card[data-id] {
  cursor: pointer;
}

.cal-event-card[data-id] {
  cursor: pointer;
}

.cal-event-card[data-id]:hover {
  border-color: var(--primary);
}

/* Form */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-section {
  display: contents;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field--full {
  grid-column: 1 / -1;
}

.form-field span {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-field span em {
  color: var(--danger);
  font-style: normal;
}

.sync-hint--status {
  color: var(--primary);
  font-weight: 500;
}

#syncCodeExportText {
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  line-height: 1.4;
  word-break: break-all;
  min-height: 160px;
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

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

/* Responsive */
@media (max-width: 768px) {
  .app {
    padding: 12px 12px 24px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  .header__page-title {
    font-size: 1.125rem;
  }

  .toolbar__search {
    width: 100%;
    max-width: none;
  }

  .toolbar__top {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .view-switcher {
    width: 100%;
  }

  .view-switcher__button {
    flex: 1;
  }

  .toolbar__filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .filter-chip {
    flex-shrink: 0;
  }

  .upcoming-day {
    grid-template-columns: 1fr;
  }

  .upcoming-day__date {
    padding: 9px 13px;
    border-bottom: 1px solid var(--border);
  }

  .upcoming-schedule__event {
    grid-template-columns: 50px minmax(0, 1fr) auto;
    gap: 7px 10px;
    padding: 10px 13px;
  }

  .upcoming-schedule__position {
    grid-column: 2;
  }

  .upcoming-schedule__event .badge {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .kanban-column {
    flex-basis: min(82vw, 280px);
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-card {
    padding: 12px;
  }

  .stat-card__count {
    font-size: 1.375rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .status-timeline__initial {
    grid-template-columns: 1fr;
  }

  .detail-section__grid {
    grid-template-columns: 1fr;
  }

  .modal--detail {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
    margin: 0;
  }

  .modal {
    max-width: none;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    margin: 0;
  }

  .modal__body {
    max-height: none;
  }

  .table th:nth-child(9),
  .table td:nth-child(9) {
    display: table-cell;
  }

  .table th:nth-child(3),
  .table td:nth-child(3),
  .table th:nth-child(7),
  .table td:nth-child(7),
  .table th:nth-child(8),
  .table td:nth-child(8) {
    display: none;
  }

  .calendar-view {
    grid-template-columns: 1fr;
  }

  .calendar-sidebar {
    position: static;
  }

  .cal-day {
    min-height: 40px;
  }

  .reminder-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }
}

/* Home dashboard */
.home-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 2px 0 18px;
  padding: 0 2px;
}

.home-intro__eyebrow,
.dashboard-card__kicker {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.home-intro__title {
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.home-intro__metrics {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.home-metric {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  background: color-mix(in srgb, var(--bg-card) 88%, transparent);
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.home-metric strong {
  color: var(--text);
  font-size: 0.875rem;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  gap: 14px;
  margin-bottom: 14px;
}

.dashboard-card {
  overflow: hidden;
  background: var(--bg-card);
  background: color-mix(in srgb, var(--bg-card) 96%, var(--primary) 4%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.dashboard-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
}

.dashboard-card__header h2 {
  font-size: 1.05rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.text-button {
  flex-shrink: 0;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.75rem;
  text-decoration: none;
  cursor: pointer;
}

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

.funnel {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 0 20px 20px;
}

.funnel-stage {
  position: relative;
  width: 100%;
  min-height: 50px;
}

.funnel-stage__bar {
  position: absolute;
  inset: 0 auto 0 50%;
  width: var(--funnel-width, 100%);
  overflow: hidden;
  border: 1px solid var(--border);
  border-color: color-mix(in srgb, var(--stage-color) 34%, var(--border));
  border-radius: 9px;
  background: var(--bg-card);
  background: color-mix(in srgb, var(--stage-color) 12%, var(--bg-card));
  transform: translateX(-50%);
}

.funnel-stage__bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--stage-color) 24%, transparent), transparent);
  pointer-events: none;
}

.funnel-stage__content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(92px, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 7px 14px;
}

.funnel-stage__main {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}

.funnel-stage__count {
  color: var(--stage-color);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

.funnel-stage__label {
  overflow: hidden;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funnel-stage__rate {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-align: right;
  white-space: nowrap;
}

.funnel-empty {
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 28px;
  color: var(--text-secondary);
  text-align: center;
}

.funnel-empty p {
  margin-bottom: 12px;
  font-size: 0.875rem;
}

.today-schedule {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 14px 14px;
}

.schedule-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 60px;
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.schedule-item:hover {
  border-color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  transform: translateY(-1px);
}

.schedule-item__time {
  color: var(--primary);
  font-size: 0.9375rem;
  font-weight: 700;
  text-align: center;
}

.schedule-item__body {
  min-width: 0;
}

.schedule-item__company,
.job-item__title {
  overflow: hidden;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-item__position,
.job-item__meta {
  overflow: hidden;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-empty,
.jobs-empty,
.jobs-loading {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-align: center;
}

.jobs-panel__header {
  align-items: center;
}

.jobs-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.jobs-title-row .dashboard-card__kicker {
  margin-bottom: 2px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-offer);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--status-offer) 14%, transparent);
}

.jobs-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  margin-left: 5px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  vertical-align: 1px;
}

.jobs-panel__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.jobs-source-status {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.jobs-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 14px 14px;
}

.job-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg-card);
}

.job-item__avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 700;
}

.job-item__body {
  min-width: 0;
}

.job-item__company {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.job-item__actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.job-item__link {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 1rem;
  text-decoration: none;
}

.job-item__link:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

.jobs-panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.6875rem;
}

.jobs-panel__footer a {
  flex-shrink: 0;
  color: var(--text-secondary);
  text-decoration: none;
}

.jobs-panel__footer a:hover {
  color: var(--primary);
}

/* Open autumn recruitment directory */
.jobs-directory-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 14px;
  padding: 26px 28px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: 16px;
  background:
    radial-gradient(circle at 92% 18%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 34%),
    linear-gradient(135deg, var(--bg-card), color-mix(in srgb, var(--primary-light) 60%, var(--bg-card)));
  box-shadow: var(--shadow);
}

.jobs-directory-hero__content {
  min-width: 0;
}

.jobs-directory-hero__eyebrow {
  margin-bottom: 5px;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.jobs-directory-hero h2 {
  margin-bottom: 6px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.jobs-directory-hero__content > p:last-child {
  max-width: 680px;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.jobs-directory-hero__metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 126px;
}

.jobs-directory-hero__metric strong {
  color: var(--primary);
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.06em;
}

.jobs-directory-hero__metric span {
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
}

.jobs-directory-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.jobs-directory-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.jobs-directory-search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(420px, 100%);
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-muted);
}

.jobs-directory-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.jobs-directory-search input {
  width: 100%;
  height: 38px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
}

.jobs-directory-toolbar__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.jobs-directory-summary {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
}

.jobs-directory-list {
  display: flex;
  flex-direction: column;
}

.open-job-row {
  display: grid;
  grid-template-columns: 42px minmax(180px, 1.2fr) minmax(150px, 0.9fr) auto auto;
  align-items: center;
  gap: 14px;
  min-height: 70px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.open-job-row:last-child {
  border-bottom: 0;
}

.open-job-row:hover {
  background: var(--bg-hover);
}

.open-job-row__avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 700;
}

.open-job-row__company {
  min-width: 0;
}

.open-job-row__company strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 0.9375rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-job-row__company span,
.open-job-row__referral {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.open-job-row__referral {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-job-row__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--status-offer);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.open-job-row__status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: '';
}

.open-job-row__actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.open-job-row__apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

.open-job-row__apply:hover {
  background: var(--primary-light);
}

.jobs-directory-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.jobs-directory-footer a {
  flex-shrink: 0;
  color: var(--text-secondary);
  text-decoration: none;
}

.jobs-directory-footer a:hover {
  color: var(--primary);
}

@media (max-width: 900px) {
  .home-grid {
    grid-template-columns: 1fr;
  }

  .today-schedule {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .open-job-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }

  .open-job-row__referral {
    grid-column: 2;
  }

  .open-job-row__status {
    grid-column: 3;
    grid-row: 1;
  }

  .open-job-row__actions {
    grid-column: 3;
    grid-row: 2;
  }
}

@media (max-width: 640px) {
  .home-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .home-intro__metrics {
    justify-content: flex-start;
  }

  .dashboard-card__header {
    padding: 16px 14px 12px;
  }

  .funnel {
    padding: 0 14px 16px;
  }

  .today-schedule,
  .jobs-list {
    grid-template-columns: 1fr;
  }

  .jobs-panel__header,
  .jobs-panel__footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .jobs-panel__actions {
    width: 100%;
    justify-content: space-between;
  }

  .job-item {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .job-item__actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .jobs-directory-hero {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px 18px;
  }

  .jobs-directory-hero__metric {
    align-items: flex-start;
  }

  .jobs-directory-toolbar,
  .jobs-directory-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .jobs-directory-toolbar__meta {
    justify-content: space-between;
  }

  .open-job-row {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px 11px;
    padding: 13px 14px;
  }

  .open-job-row__avatar {
    width: 38px;
    height: 38px;
  }

  .open-job-row__status {
    grid-column: 2;
    grid-row: auto;
  }

  .open-job-row__referral,
  .open-job-row__actions {
    grid-column: 2;
    grid-row: auto;
  }
}
