/* Shared finish, using existing theme tokens throughout. */
:root {
  --radius: 14px;
  --radius-sm: 8px;
  --polish-shadow: 0 4px 18px rgb(0 0 0 / 7%);
}

@media screen {
  .sidebar-logo {
    letter-spacing: -.5px;
  }

  .sidebar-nav {
    gap: 6px;
  }

  .nav-link {
    position: relative;
    transition: background .2s, color .2s;
  }

  .nav-link.active::before {
    content: "";
    position: absolute;
    inset: 12px auto 12px 0;
    width: 3px;
    border-radius: 3px;
    background: var(--accent);
  }

  .topbar-title {
    font-weight: 650;
    letter-spacing: -.5px;
  }

  .view-hero {
    background: linear-gradient(115deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface) 75%);
    border-top-width: 1px;
    box-shadow: var(--polish-shadow);
  }

  .view-hero--dashboard {
    padding: 30px;
    margin-bottom: 20px;
  }

  .workspace-eyebrow {
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.8px;
    margin-bottom: 8px;
  }

  .view-hero--dashboard .view-hero-title {
    font-size: clamp(22px, 2.6vw, 32px);
    line-height: 1.2;
    letter-spacing: -.9px;
    margin-bottom: 8px;
  }

  .view-hero-sub {
    max-width: 660px;
    line-height: 1.7;
  }

  .stat-card,
  .dash-card,
  .kpi-card {
    background: var(--surface);
    box-shadow: var(--polish-shadow);
    transition: border-color .2s, box-shadow .2s, transform .2s;
  }

  .stat-card {
    position: relative;
    overflow: hidden;
  }

  .stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--accent);
    opacity: .55;
  }

  .stat-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .6px;
    text-transform: uppercase;
  }

  .stat-value {
    font-size: 32px;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
  }

  .dash-card-header {
    padding-top: 18px;
    padding-bottom: 18px;
    font-weight: 600;
  }

  .empty-msg {
    line-height: 1.7;
  }

  .btn-primary {
    box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 18%, transparent);
  }

  :where(button, a, input, select, textarea):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }
}

@media screen and (hover: hover) {

  .stat-card:hover,
  .dash-card:hover,
  .kpi-card:hover {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
    box-shadow: 0 8px 24px rgb(0 0 0 / 10%);
  }
}

@keyframes workspaceReveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media screen and (prefers-reduced-motion: no-preference) {

  html:not(.theme-motion-off) .view.active .view-hero,
  html:not(.theme-motion-off) .view.active .stat-card,
  html:not(.theme-motion-off) .view.active .dash-card {
    animation: workspaceReveal .45s cubic-bezier(.22, 1, .36, 1) backwards;
  }

  .stat-card:nth-child(2) {
    animation-delay: 40ms !important;
  }

  .stat-card:nth-child(3) {
    animation-delay: 80ms !important;
  }

  .stat-card:nth-child(4) {
    animation-delay: 120ms !important;
  }

  .stat-card:nth-child(5) {
    animation-delay: 160ms !important;
  }

  .stat-card:nth-child(6) {
    animation-delay: 200ms !important;
  }

  .dash-grid .dash-card:nth-child(2) {
    animation-delay: 80ms;
  }

  .dash-grid .dash-card:nth-child(3) {
    animation-delay: 120ms;
  }
}

@media (max-width: 600px) {
  .view-hero--dashboard {
    padding: 20px;
    gap: 14px;
  }

  .view-hero--dashboard .view-hero-icon {
    display: none;
  }

  .stat-value {
    font-size: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Board layouts: readable priority groups and responsive stage panels. */
@media screen {
  #view-calendar>.view-hero {
    margin-bottom: 24px;
  }

  #view-calendar .cal-view-controls {
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    gap: 14px;
  }

  #view-calendar .cal-event-filters {
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }

  .cal-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: start;
  }

  .cal-calendar-panel {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
  }

  #view-calendar .cal-full-month-grid {
    border-radius: 10px;
    overflow: hidden;
  }

  #view-calendar .cal-full-cell {
    min-width: 0;
    min-height: 110px;
  }

  #view-calendar .cal-full-event {
    border-radius: 5px;
    font-size: 10px;
    padding: 4px 6px;
    line-height: 1.5;
  }

  #view-calendar .cal-compact-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: 100%;
    min-width: 0;
    padding: 7px 8px;
    margin-bottom: 5px;
    border: 0;
    border-left: 3px solid currentColor;
    border-radius: 7px;
    text-align: left;
    font-family: inherit;
  }

  .cal-card-title,
  .cal-card-role,
  .cal-card-meta {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cal-card-title {
    font-weight: 700;
    color: var(--text);
  }

  .cal-card-role {
    font-weight: 400;
    color: var(--text-muted);
  }

  .cal-card-meta {
    font-size: 9px;
    font-weight: 500;
  }

  .cal-status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 4px;
  }

  #view-calendar button.cal-more-events {
    background: none;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
  }

  #view-calendar button.cal-more-events:hover {
    color: var(--accent);
  }

  #view-calendar .cal-compact-card:focus-visible,
  #view-calendar .cal-more-events:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
  }

  .cal-agenda {
    display: grid;
    gap: 20px;
  }

  .cal-agenda-day h3 {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--text);
    font-size: 13px;
  }

  .cal-agenda-day h3 span {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 400;
  }

  .cal-agenda-events {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 8px;
  }

  #view-calendar .cal-agenda .cal-compact-card {
    padding: 12px 14px;
    font-size: 12px;
  }

  .cal-agenda .cal-card-meta {
    font-size: 10px;
  }

  .cal-full-event.ev-interview {
    color: #a78bfa;
    background: rgb(167 139 250 / 12%);
  }

  .ev-interview .cal-ev-dot,
  .cal-legend-interview {
    background: #a78bfa;
  }

  .cal-workspace .cal-upcoming-strip {
    margin: 0;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .cal-upcoming-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
  }

  .cal-next-heading {
    color: var(--accent);
    font-size: 10px;
    letter-spacing: 1.2px;
    font-weight: 700;
    margin-bottom: 8px;
  }

  .cal-workspace .cal-upcoming-item {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
  }

  .cal-workspace .cal-upcoming-next {
    border-color: var(--accent);
  }

  .cal-workspace .cal-upcoming-label {
    flex: 1 1 100%;
    font-size: 12px;
    line-height: 1.6;
    overflow-wrap: anywhere;
  }

  .cal-upcoming-time {
    font-size: 11px;
    color: var(--text-muted);
  }

  #view-calendar .cal-activity-section {
    padding: 24px;
    margin-top: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
  }

  #view-calendar .act-counts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
  }

  #view-calendar .act-count-card {
    background: var(--card);
    border-radius: 10px;
    padding: 16px;
  }

  #view-calendar .act-count-value {
    font-size: 28px;
    font-variant-numeric: tabular-nums;
  }

  .cal-activity-feed {
    display: grid;
    gap: 20px;
  }

  .cal-activity-feed h3 {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
  }

  .cal-activity-record {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    text-align: left;
    color: var(--text);
  }

  .cal-activity-record>span:nth-child(2) {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .cal-activity-record strong {
    font-size: 13px;
    font-weight: 600;
  }

  .cal-activity-record>span:nth-child(2)>span {
    color: var(--text-muted);
    font-size: 11px;
  }

  .cal-activity-record:hover strong {
    color: var(--accent);
  }

  .cal-activity-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
  }
}

@media screen and (max-width: 1200px) {
  .cal-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media screen and (max-width: 600px) {
  .cal-calendar-panel {
    padding: 8px;
  }

  #view-calendar .cal-full-cell {
    min-height: 76px;
    padding: 3px;
  }

  #view-calendar .cal-full-event {
    font-size: 9px;
    padding: 2px;
  }

  #view-calendar .cal-compact-card {
    padding: 4px 3px;
    gap: 1px;
    border-left-width: 2px;
  }

  #view-calendar .cal-compact-card .cal-card-meta {
    font-size: 8px;
  }

  #view-calendar .cal-week-strip {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  #view-calendar .cal-week-day-cell {
    min-height: 80px;
  }

  #view-calendar .cal-activity-section {
    padding: 16px;
  }
}

@media screen {
  .board-view-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 22px;
  }

  .board-view-heading h2 {
    font-size: clamp(20px, 2vw, 27px);
    line-height: 1.3;
    letter-spacing: -.6px;
    margin: 8px 0;
  }

  .board-view-heading p,
  .board-view-heading>span {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.7;
  }

  .kanban--table {
    overflow: visible;
  }

  .board-table-scroll {
    max-height: 70vh;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .board-table {
    min-width: 900px;
  }

  .board-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface);
  }

  .board-table .table-th {
    padding: 16px 12px;
    border-bottom-width: 1px;
  }

  .table-sort-btn {
    color: inherit;
    font: inherit;
    text-align: left;
    padding: 3px 0;
  }

  .table-sort-btn:hover {
    color: var(--accent);
  }

  .table-sort-btn[data-sort="company-asc"] {
    text-transform: none;
    font-size: 10px;
    font-weight: 500;
  }

  .board-table .table-td {
    padding: 18px 12px;
  }

  .board-table .table-td-role {
    white-space: normal;
    min-width: 210px;
    max-width: 300px;
  }

  .table-open-btn {
    color: var(--text);
    text-align: left;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .table-open-btn:hover {
    color: var(--accent);
  }

  .table-company {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
  }

  .board-table .table-location {
    display: block;
    margin-top: 4px;
    font-weight: 400;
    line-height: 1.5;
  }

  .table-deadline {
    font-size: 11px;
    color: var(--text-muted);
  }

  .table-deadline.is-overdue,
  .table-deadline.is-today {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--hover);
    font-weight: 600;
  }

  .table-deadline.is-overdue {
    color: var(--red);
  }

  .table-deadline.is-today {
    color: var(--yellow);
  }

  .table-row-pinned {
    background: color-mix(in srgb, var(--accent) 4%, var(--surface));
  }

  .table-pin-btn {
    color: var(--text-muted);
    font-size: 20px;
    padding: 4px;
  }

  .table-pin-btn[aria-pressed="true"] {
    color: var(--accent);
  }

  .board-table .table-delete-btn {
    opacity: .75;
    font-size: 18px;
  }

  .board-table .table-actions {
    white-space: nowrap;
    width: 80px;
  }

  .table-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    overflow: hidden;
  }

  .kanban--timeline {
    overflow: visible;
  }

  .agenda-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }

  .agenda-filters .active {
    color: var(--accent);
    background: var(--accent-dim);
    border-color: var(--accent);
  }

  .agenda-next {
    padding: 20px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--accent) 6%, var(--surface));
    margin-bottom: 24px;
  }

  .agenda-next .agenda-next-button {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    border: none;
    padding: 8px 0 0;
    min-height: 0;
    gap: 6px;
    width: 100%;
    text-align: left;
    color: var(--text);
    background: transparent;
  }

  .agenda-next-button span {
    color: var(--text-muted);
    font-size: 12px;
  }

  .agenda-notice {
    padding: 22px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 12px;
  }

  .agenda-groups {
    display: grid;
    gap: 24px;
  }

  .agenda-group h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    margin-bottom: 12px;
  }

  .agenda-group h3 span {
    font-size: 10px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 2px 8px;
  }

  .agenda-overdue h3 {
    color: var(--red);
  }

  .agenda-today h3 {
    color: var(--accent);
  }

  .agenda-group>div {
    display: grid;
    gap: 10px;
  }

  .agenda-group .agenda-entry {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    text-align: left;
    color: var(--text);
  }

  .agenda-group .agenda-entry:hover {
    border-color: var(--accent);
    background: var(--card);
  }

  .agenda-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    min-width: 66px;
    padding: 8px;
    border-radius: 8px;
    background: var(--hover);
  }

  .agenda-date strong {
    font-size: 23px;
    font-variant-numeric: tabular-nums;
  }

  .agenda-date>span {
    font-size: 10px;
    color: var(--text-muted);
  }

  .agenda-entry-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .agenda-entry-content>strong {
    font-size: 14px;
  }

  .agenda-entry-content>span {
    color: var(--text-muted);
    font-size: 12px;
  }

  .agenda-entry-content .agenda-type {
    color: var(--accent);
    font-size: 10px;
    font-weight: 600;
  }

  .agenda-arrow {
    color: var(--text-muted);
  }
}

@media screen and (prefers-reduced-motion: no-preference) {
  html:not(.theme-motion-off) .agenda-entry {
    animation: workspaceReveal .3s ease backwards;
    animation-delay: var(--agenda-delay, 0ms);
  }
}

@media screen and (max-width: 700px) {
  .board-view-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .board-table-scroll {
    max-height: none;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .board-table,
  .board-table tbody {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .board-table thead {
    display: none;
  }

  .board-table .table-row-clickable {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
  }

  .board-table .table-td {
    display: block;
    min-width: 0;
    max-width: none;
    padding: 10px;
    border: none;
    overflow-wrap: anywhere;
  }

  .board-table .table-td::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 7px;
  }

  .board-table .table-td-role {
    grid-column: 1 / -1;
  }

  .board-table .table-actions {
    width: auto;
  }

  .table-stage-select {
    max-width: 100%;
  }

  .agenda-group .agenda-entry {
    gap: 12px;
    padding: 14px;
    flex-wrap: wrap;
  }

  .agenda-entry .stage-badge {
    margin-left: 78px;
  }

  .agenda-arrow {
    display: none;
  }
}

@media screen {
  #view-analytics>.view-hero {
    margin-bottom: 0;
  }

  #view-analytics .analytics-controls {
    justify-content: space-between;
    margin-bottom: 0;
  }

  #view-analytics .an-period-tabs {
    flex-wrap: wrap;
    padding: 5px;
    background: var(--surface);
  }

  #view-analytics .an-tab {
    padding: 9px 16px;
  }

  #view-analytics .an-kpi-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 0;
  }

  #view-analytics .an-kpi-card {
    flex: 1 1 130px;
    min-width: 0;
    padding: 20px;
    background: var(--surface);
    box-shadow: var(--polish-shadow);
  }

  #view-analytics .an-kpi-value {
    font-size: 32px;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
  }

  .an-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    margin-bottom: 0;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  }

  .an-summary h2 {
    font-size: 19px;
    letter-spacing: -.4px;
    line-height: 1.4;
    margin: 6px 0;
  }

  .an-summary p {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.7;
  }

  .an-summary-tag {
    color: var(--text-muted);
    font-size: 11px;
    max-width: 150px;
    line-height: 1.7;
  }

  #view-analytics .an-row-two,
  #view-analytics .an-row-three {
    gap: 16px;
    margin-bottom: 0;
  }

  #view-analytics .dash-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
  }

  #view-analytics .dash-card-header {
    padding: 18px 20px;
    font-size: 13px;
  }

  #view-analytics .dash-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
    padding: 20px;
    min-height: 0;
  }

  #view-analytics .an-bar-row {
    flex: 1;
    min-height: 36px;
    margin-bottom: 0;
    padding: 8px 0;
  }

  #view-analytics .an-bar-track {
    height: clamp(24px, 3vw, 36px);
    min-width: 0;
  }

  #view-analytics .an-funnel-row {
    flex: 1;
    min-height: 48px;
    margin-bottom: 0;
  }

  #view-analytics .an-funnel-bar-wrap {
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  #view-analytics .an-funnel-bar {
    flex-shrink: 0;
    height: 36px;
  }

  #view-analytics #an-over-time {
    min-height: 260px;
  }

  #view-analytics .an-timechart {
    flex: 1;
    height: auto;
    min-height: 220px;
    align-items: stretch;
  }

  #view-analytics .an-timechart-col {
    justify-content: flex-end;
  }

  #view-analytics .an-timechart-bar {
    max-width: none;
    width: 85%;
    flex-shrink: 0;
  }

  #view-analytics .an-timechart-count,
  #view-analytics .an-timechart-label {
    font-size: 11px;
    line-height: 16px;
  }

  #view-analytics .an-bar-label {
    width: 110px;
    font-size: 12px;
  }

  #view-analytics .an-bar-count {
    font-variant-numeric: tabular-nums;
  }

  #view-analytics .empty-msg {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 16px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
  }
}

@media screen and (max-width: 700px) {
  .an-summary {
    padding: 18px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .an-summary-tag {
    max-width: none;
  }

  #view-analytics .an-row-three {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media screen {
  .main {
    min-width: 0;
  }

  #view-board {
    min-width: 0;
  }

  .kanban--columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
    align-items: start;
    width: 100%;
    min-width: 0;
    gap: 18px;
    padding: 4px 4px 22px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }

  .kanban--columns .kanban-col:not(.kanban-col--collapsed) {
    min-width: 0;
    max-width: none;
    width: 100%;
    border-left-width: 1px;
    border-top: 3px solid var(--lane-accent, var(--text-muted));
    background: color-mix(in srgb, var(--surface) 65%, var(--bg));
    box-shadow: var(--polish-shadow);
  }

  .kanban-col[data-stage="applied"] {
    --lane-accent: var(--accent);
  }

  .kanban-col[data-stage="screening"] {
    --lane-accent: #a78bfa;
  }

  .kanban-col[data-stage="interview"] {
    --lane-accent: var(--yellow);
  }

  .kanban-col[data-stage="offer"] {
    --lane-accent: var(--green);
  }

  .kanban-col[data-stage="declined"] {
    --lane-accent: var(--red);
  }

  .kanban-col[data-stage="ghosted"] {
    --lane-accent: #f97316;
  }

  .kanban-col:not(.kanban-col--collapsed) .kanban-col-header {
    padding: 18px 14px;
    background: var(--surface);
    font-size: 13px;
    text-transform: none;
    letter-spacing: -.2px;
    align-items: flex-start;
    min-height: 94px;
  }

  .kanban-col-title-group {
    gap: 10px;
  }

  .kanban-col-collapse-icon {
    opacity: .7;
  }

  .kanban-col--collapsed .kanban-col-stats {
    display: none;
  }

  .kanban-col-add {
    width: 28px;
    height: 28px;
  }

  .kanban-col-body {
    min-height: 320px;
    max-height: 62vh;
    padding: 14px;
    gap: 12px;
  }

  .kanban--columns .job-card {
    min-width: 0;
    flex-shrink: 0;
    background: var(--surface);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgb(0 0 0 / 5%);
  }

  .kanban--columns .job-card-role {
    line-height: 1.5;
    font-size: 14px;
    overflow-wrap: anywhere;
  }

  .kanban--columns .job-card-company {
    line-height: 1.6;
    overflow-wrap: anywhere;
  }

  .kanban--columns .kanban-col--collapsed {
    min-width: 0;
    max-width: none;
    width: 100%;
    border-left-width: 1px;
    border-top: 3px solid var(--lane-accent, var(--text-muted));
    box-shadow: var(--polish-shadow);
  }

  .kanban--columns .kanban-col--collapsed .kanban-col-header {
    flex-direction: row;
    min-height: 74px;
    height: auto;
    padding: 18px 14px;
    align-items: center;
    font-size: 13px;
    text-transform: none;
    letter-spacing: -.2px;
  }

  .kanban--columns .kanban-col--collapsed .kanban-col-title-group {
    align-items: flex-start;
  }

  .kanban--columns .kanban-col--collapsed .kanban-col-header-label {
    writing-mode: horizontal-tb;
    transform: none;
    max-height: none;
  }

  .kanban-col-body.drag-over {
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    border-radius: 8px;
  }

  .pm-wrapper {
    gap: 18px;
  }

  .pm-workspace-intro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 8px 0;
  }

  .pm-workspace-intro h2 {
    font-size: clamp(20px, 2vw, 27px);
    line-height: 1.3;
    letter-spacing: -.7px;
    margin: 8px 0;
  }

  .pm-workspace-intro p,
  .pm-method-note {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.7;
  }

  .pm-workspace-total {
    display: flex;
    flex-direction: column;
    text-align: right;
    color: var(--text-muted);
    font-size: 11px;
  }

  .pm-workspace-total strong {
    color: var(--accent);
    font-size: 32px;
    font-variant-numeric: tabular-nums;
  }

  .pm-controls {
    padding: 16px 20px;
    gap: 24px;
  }

  .pm-method-note {
    margin-top: -10px;
  }

  .pm-matrix-area {
    height: auto;
    min-height: 0;
  }

  .pm-y-label,
  .pm-axis-top {
    display: none;
  }

  .pm-grid {
    gap: 20px;
    grid-template-rows: auto auto;
  }

  .pm-quadrant {
    background: var(--surface);
    box-shadow: var(--polish-shadow);
  }

  .pm-q-tr {
    order: -2;
  }

  .pm-q-tl {
    order: -1;
  }

  .pm-q-br {
    order: 0;
  }

  .pm-q-bl {
    order: 1;
  }

  .pm-quadrant-header {
    padding: 20px 18px 12px;
    border-bottom: none;
  }

  .pm-q-title {
    font-size: 16px;
    letter-spacing: -.3px;
    white-space: normal;
  }

  .pm-q-desc {
    font-size: 11px;
    white-space: normal;
    margin-top: 5px;
  }

  .pm-q-icon-wrap {
    width: 40px;
    height: 40px;
  }

  .pm-q-guidance {
    color: var(--text-muted);
    padding: 0 18px 14px;
    font-size: 12px;
    line-height: 1.6;
  }

  .pm-q-summary {
    padding: 10px 18px;
    background: var(--hover);
  }

  .pm-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    padding: 16px;
    gap: 12px;
    max-height: 440px;
    min-height: 150px;
    align-content: start;
  }

  .pm-cards .pm-card {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 16px;
    background: var(--card);
  }

  .pm-card-role {
    white-space: normal;
    line-height: 1.5;
    font-size: 14px;
    padding-right: 12px;
  }

  .pm-card-stage {
    margin-bottom: 10px;
  }

  .pm-card .job-card-company {
    line-height: 1.6;
    overflow-wrap: anywhere;
  }

  .pm-card .job-card-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .pm-empty-q {
    grid-column: 1 / -1;
    opacity: 1;
    padding: 26px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .pm-empty-q strong {
    color: var(--text);
    font-weight: 500;
  }

  .pm-empty-q span {
    font-size: 11px;
    line-height: 1.6;
  }

  .pm-unscored {
    padding: 20px;
  }

  .pm-unscored-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
    gap: 12px;
  }

  .pm-unscored-cards .pm-card {
    width: 100%;
  }
}

@media screen and (max-width: 850px) {
  .pm-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pm-workspace-intro {
    align-items: flex-start;
    gap: 12px;
  }

  .pm-controls {
    gap: 16px;
  }
}

@media screen and (max-width: 600px) {
  .kanban--columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .pm-workspace-total {
    display: none;
  }
}

/* Goals: pace, actions, recorded history, and daily activity. */
.goal-pace {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  border-radius: 10px;
  background: var(--accent-dim);
  font-size: 12px;
  line-height: 1.5;
}

.goal-pace span {
  color: var(--text-muted);
}

.goal-card-footer {
  flex-wrap: wrap;
  align-items: center;
}

.goal-action-btn {
  margin-right: auto;
  font-size: 12px;
  padding: 8px 12px;
}

.goals-insights {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.goals-insights .dash-card {
  min-width: 0;
}

.goal-history-row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.goal-history-row:last-child {
  border-bottom: 0;
}

.goal-history-row>div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-right: auto;
}

.goal-history-row>div span,
.goal-history-status {
  color: var(--text-muted);
  font-size: 11px;
}

.goal-history-status.goal-status-done {
  color: var(--green);
}

.goal-activity-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.goal-activity-summary strong {
  font-size: 18px;
}

.goal-activity-summary span {
  font-size: 11px;
  color: var(--text-muted);
}

.goal-activity-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.goal-activity-day {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1.3;
  min-width: 0;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

.goal-activity-day[data-level="1"] {
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
}

.goal-activity-day[data-level="2"] {
  background: color-mix(in srgb, var(--accent) 40%, var(--surface));
  color: var(--text);
}

.goal-activity-day[data-level="3"] {
  background: color-mix(in srgb, var(--accent) 65%, var(--surface));
  color: var(--text);
}

.goal-activity-day[data-level="4"] {
  background: var(--accent);
  color: #10231d;
}

.goal-activity-legend {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  font-size: 10px;
  color: var(--text-muted);
}

.goal-activity-legend .goal-activity-day {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

@media (max-width: 900px) {
  .goals-insights {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Analytics: distinct chart treatments with shared typography and interaction. */
@media screen {
  #view-analytics .dash-card {
    background: var(--surface);
    box-shadow: var(--polish-shadow);
  }

  #view-analytics .dash-card-header {
    font-weight: 650;
    letter-spacing: -.2px;
    background: color-mix(in srgb, var(--text) 2%, var(--surface));
  }

  #view-analytics .an-bar-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    row-gap: 7px;
    padding: 8px;
    border-radius: 10px;
    margin-left: 0;
  }

  #view-analytics .an-bar-label {
    width: auto;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    color: var(--text);
  }

  #view-analytics .an-bar-count {
    width: auto;
    grid-column: 2;
    grid-row: 1;
    font-size: 13px;
  }

  #view-analytics .an-bar-count small {
    display: block;
    font-size: 10px;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 3px;
  }

  #view-analytics .an-bar-track {
    grid-column: 1 / -1;
    height: 9px;
    border: 0;
    background: color-mix(in srgb, var(--text) 6%, transparent);
  }

  #view-analytics .an-bar-fill {
    background: var(--accent);
  }

  #view-analytics .an-bar-fill.fill-purple {
    background: #a78bfa;
  }

  #view-analytics .an-bar-fill.fill-yellow {
    background: var(--yellow);
  }

  #view-analytics .an-bar-fill.fill-green {
    background: var(--green);
  }

  #view-analytics .an-bar-fill.fill-red {
    background: var(--red);
  }

  #view-analytics .an-bar-fill.fill-orange {
    background: #fb923c;
  }

  #view-analytics .an-bar-fill::after,
  #view-analytics .an-funnel-bar::after {
    display: none;
  }

  #view-analytics .an-funnel-row {
    padding: 10px;
    margin-left: 0;
    border-radius: 10px;
    background: color-mix(in srgb, var(--text) 3%, transparent);
  }

  #view-analytics .an-funnel-label {
    text-align: left;
    font-weight: 600;
    color: var(--text);
  }

  #view-analytics .an-funnel-bar {
    border-radius: 6px;
    height: 32px;
    box-sizing: border-box;
  }

  #view-analytics .an-composition {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    flex: 1;
    min-width: 0;
  }

  #view-analytics .an-ring {
    position: relative;
    width: clamp(150px, 15vw, 210px);
    margin: 0 auto;
    flex-shrink: 0;
  }

  #view-analytics .an-ring svg {
    display: block;
    width: 100%;
  }

  #view-analytics .an-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    gap: 4px;
  }

  #view-analytics .an-ring-center strong {
    font-size: 30px;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
  }

  #view-analytics .an-ring-center span {
    font-size: 11px;
    color: var(--text-muted);
  }

  #view-analytics .an-chart-legend {
    display: grid;
    gap: 5px;
    width: 100%;
  }

  #view-analytics .an-legend-item {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto 38px;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    text-align: left;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: background .15s;
  }

  #view-analytics .an-legend-item:hover {
    background: var(--hover);
  }

  #view-analytics .an-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--segment-color);
  }

  #view-analytics .an-legend-label {
    overflow-wrap: anywhere;
  }

  #view-analytics .an-legend-percent {
    color: var(--text-muted);
    font-size: 11px;
    text-align: right;
  }

  #view-analytics .an-trend-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
  }

  #view-analytics .an-trend-summary strong {
    color: var(--text);
    font-size: 24px;
  }

  #view-analytics .an-trend-summary strong span {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
  }

  #view-analytics .an-trend {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  #view-analytics .an-trend svg {
    display: block;
    width: 100%;
    min-height: 160px;
  }

  #view-analytics .an-trend-grid {
    stroke: var(--border);
    stroke-dasharray: 4 5;
  }

  #view-analytics .an-trend-axis {
    fill: var(--text-muted);
    font-size: 10px;
  }

  #view-analytics .an-trend-periods {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    padding: 4px 0;
  }

  #view-analytics .an-trend-periods button {
    flex: 1;
    min-width: 32px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    padding: 8px 2px;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 10px;
  }

  #view-analytics .an-trend-periods button strong {
    color: var(--text);
    font-size: 12px;
  }

  #view-analytics .an-trend-periods button:hover {
    background: var(--hover);
  }

  #view-analytics button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }
}

@media screen and (min-width: 1100px) {
  #view-analytics #an-fit-dist .an-composition {
    flex-direction: row;
    align-items: center;
  }
}