:root {
  color-scheme: light;
  --bg: #f4f7fa;
  --bg-top: #eaf2f8;
  --surface: #ffffff;
  --surface-soft: #f8fbfd;
  --surface-tint: #eef6fa;
  --ink: #142033;
  --ink-soft: #324054;
  --muted: #667589;
  --line: #d9e4ee;
  --line-strong: #c7d6e4;
  --blue: #2368b8;
  --blue-strong: #184d8d;
  --cyan: #0d8aa4;
  --green: #287a5b;
  --amber: #9a6414;
  --rose: #b83252;
  --violet: #5b5aa8;
  --shadow: 0 18px 42px rgba(20, 32, 51, 0.1);
  --shadow-soft: 0 10px 28px rgba(20, 32, 51, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg-top) 0, var(--bg) 340px);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 3.4rem;
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.08rem;
  line-height: 1.2;
}

h3 {
  margin: 18px 0 8px;
  font-size: 0.96rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  padding: 12px 32px;
  background: rgba(248, 251, 253, 0.92);
  border-bottom: 1px solid rgba(217, 228, 238, 0.9);
  backdrop-filter: blur(16px);
}

.brand,
.nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
}

.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-size: 0.78rem;
  box-shadow: inset 0 -10px 0 rgba(35, 104, 184, 0.22);
}

.nav {
  justify-content: flex-end;
  gap: 10px;
}

.nav-link,
.link-button {
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
}

.nav-link:hover,
.link-button:hover {
  color: var(--ink);
}

.user-chip,
.ready-chip,
.section-tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: #ffffff;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.ready-chip {
  border-color: #b9ddce;
  background: #e9f7f0;
  color: var(--green);
}

.muted-chip,
.section-tag-soft {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

.nav-pill,
.primary-button,
.secondary-button,
.danger-button,
.social-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.nav-pill,
.primary-button {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(35, 104, 184, 0.2);
}

.primary-button:hover,
.nav-pill:hover {
  background: var(--blue-strong);
  transform: translateY(-1px);
}

.secondary-button {
  background: #ffffff;
  color: var(--blue);
  border-color: var(--line-strong);
}

.secondary-button:hover,
.social-button:hover {
  border-color: #adc3d6;
  box-shadow: var(--shadow-soft);
}

.danger-button {
  background: #fff2f5;
  color: var(--rose);
  border-color: #f1bdca;
}

.danger-button:hover {
  background: #ffe7ed;
}

.link-button,
.inline-form {
  padding: 0;
  border: 0;
  background: transparent;
}

.messages {
  max-width: 1220px;
  margin: 16px auto 0;
  padding: 0 22px;
}

.message {
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid #cbe8d8;
  border-radius: 8px;
  background: #e9f7f0;
  color: var(--green);
  font-weight: 800;
}

.message-error {
  background: #fff2f5;
  color: var(--rose);
  border-color: #f1bdca;
}

.auth-shell {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px);
  gap: 40px;
  align-items: center;
  padding: 54px 6vw 64px;
}

.product-intro {
  max-width: 820px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy {
  max-width: 650px;
  margin-bottom: 26px;
  color: var(--ink-soft);
  font-size: 1.08rem;
  font-weight: 650;
}

.panel-copy {
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 650;
}

.preview-panel {
  max-width: 720px;
  border: 1px solid rgba(199, 214, 228, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.preview-toolbar strong {
  color: var(--ink);
}

.preview-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.preview-board article {
  min-height: 132px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.preview-board strong,
.preview-board small {
  display: block;
}

.preview-board small {
  color: var(--muted);
  font-weight: 700;
}

.auth-panel,
.auth-card,
.panel {
  border: 1px solid rgba(199, 214, 228, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.auth-panel {
  padding: 24px;
}

.auth-page {
  min-height: calc(100vh - 68px);
  display: grid;
  place-items: center;
  padding: 34px 18px;
}

.auth-card {
  width: min(100%, 460px);
  padding: 24px;
}

.auth-card h1 {
  font-size: 2.25rem;
}

.social-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.social-stack form,
.social-button {
  width: 100%;
}

.social-button {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line-strong);
}

.social-button-dark {
  background: #151923;
  color: #ffffff;
  border-color: #151923;
}

.social-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.auth-actions,
.button-row,
.status-form,
.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.auth-switch {
  margin: 16px 0 0;
  color: var(--muted);
}

.auth-switch a {
  color: var(--blue);
  font-weight: 850;
}

.form-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 16px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.form-divider::before,
.form-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.workspace {
  max-width: 1220px;
  margin: 0 auto;
  padding: 34px 22px 58px;
}

.workspace.narrow {
  max-width: 820px;
}

.profile-workspace {
  max-width: 1060px;
}

.workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.workspace-header h1 {
  margin-bottom: 6px;
  font-size: 2.55rem;
  line-height: 1.06;
}

.subline {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 750;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(20, 32, 51, 0.05);
}

.stat span {
  display: block;
  color: var(--ink);
  font-size: 2rem;
  font-weight: 950;
  line-height: 1;
}

.stat small,
.muted {
  color: var(--muted);
  font-weight: 800;
}

.stat-cyan {
  border-left-color: var(--cyan);
}

.stat-green {
  border-left-color: var(--green);
}

.stat-amber {
  border-left-color: var(--amber);
}

.dashboard-grid,
.detail-grid,
.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.86fr);
  gap: 18px;
  align-items: start;
}

.profile-grid {
  grid-template-columns: minmax(260px, 0.52fr) minmax(0, 1fr);
}

.panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header h2,
.panel-header p {
  margin: 0;
}

.panel-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.search-form,
.stacked-form {
  display: grid;
  gap: 13px;
}

.search-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.search-form .field:first-child,
.search-form .primary-button {
  grid-column: 1 / -1;
}

.search-form .primary-button {
  justify-self: start;
}

.stacked-form.compact {
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field-label {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 850;
}

.field-control,
.field-select,
.field input:not([type="checkbox"]),
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 12px;
  box-shadow: 0 1px 0 rgba(20, 32, 51, 0.03);
}

.field-control:hover,
.field-select:hover,
.field input:not([type="checkbox"]):hover,
.field select:hover,
.field textarea:hover {
  border-color: #b7cadb;
}

.field-control:focus,
.field-select:focus,
.field input:not([type="checkbox"]):focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--cyan);
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 138, 164, 0.14);
}

.field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

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

.field-file {
  padding: 9px 10px;
}

.field-help {
  color: var(--muted);
  font-size: 0.82rem;
}

.field-error,
.form-errors {
  color: var(--rose);
  font-size: 0.86rem;
  font-weight: 800;
}

.provider-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.provider-link,
.lead-row {
  display: grid;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-decoration: none;
}

.provider-link {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 96px;
  padding: 13px;
}

.provider-link:hover,
.lead-row:hover {
  border-color: #b7cadb;
  box-shadow: var(--shadow-soft);
}

.provider-link small,
.lead-row p {
  display: block;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.arrow {
  color: var(--blue);
  font-weight: 950;
}

.leads-panel {
  margin-top: 18px;
}

.lead-list {
  display: grid;
  gap: 10px;
}

.lead-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 13px;
}

.lead-title {
  color: var(--ink);
  font-weight: 950;
  text-decoration: none;
}

.lead-title:hover {
  color: var(--blue);
}

.status,
.priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 950;
  white-space: nowrap;
}

.status {
  background: #eaf2ff;
  color: var(--blue);
}

.status-saved {
  background: #eef3f8;
  color: var(--muted);
}

.status-applied,
.status-interview {
  background: #e8f5ee;
  color: var(--green);
}

.status-rejected,
.status-archived {
  background: #f2f4f7;
  color: var(--muted);
}

.status-drafted {
  background: #e5f7fb;
  color: var(--cyan);
}

.priority {
  background: #fff7e6;
  color: var(--amber);
}

.empty-state {
  padding: 28px;
  border: 1px dashed #aec2d4;
  border-radius: 8px;
  background: var(--surface-soft);
  text-align: center;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

.meta-list,
.summary-list {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.meta-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-list div,
.summary-list div {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.meta-list dt,
.summary-list dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.meta-list dd,
.summary-list dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.profile-summary {
  position: sticky;
  top: 88px;
}

.profile-summary h2 {
  margin-bottom: 4px;
  font-size: 1.35rem;
}

.profile-summary p {
  color: var(--muted);
  font-weight: 700;
}

.preline {
  white-space: pre-line;
}

.draft-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.draft-block p {
  color: var(--ink-soft);
}

.status-form {
  margin-top: 18px;
}

.status-form .field-select {
  width: auto;
  min-width: 180px;
}

.danger-zone {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.confirm-panel {
  text-align: center;
}

.confirm-panel .button-row {
  justify-content: center;
}

:focus-visible {
  outline: 3px solid rgba(13, 138, 164, 0.28);
  outline-offset: 2px;
}

@media (max-width: 1000px) {
  .auth-shell,
  .dashboard-grid,
  .detail-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .auth-shell {
    align-items: start;
  }

  .profile-summary {
    position: static;
  }
}

@media (max-width: 760px) {
  .topbar,
  .workspace-header,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    padding: 12px 18px;
  }

  .nav,
  .header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .auth-shell {
    padding: 34px 18px 48px;
  }

  .preview-board,
  .stats-row,
  .provider-list,
  .search-form,
  .meta-list {
    grid-template-columns: 1fr;
  }

  .lead-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  h1 {
    font-size: 2.35rem;
  }

  .workspace-header h1 {
    font-size: 2rem;
  }
}
