:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
  --background: #121314;
  --surface: #1c1e20;
  --surface-raised: #24272a;
  --divider: #353a3d;
  --text: #f4f5f2;
  --muted: #b2b9b4;
  --mint: #c7f877;
  --mint-dark: #19220d;
  --spotify: #26db78;
  --yandex: #fed449;
  --warning: #ffd396;
  background: var(--background);
  color: var(--text);
  line-height: 1.55;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
a { color: var(--mint); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--text); line-height: 1.12; }
p { color: var(--muted); }
button, input, select, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }

.shell {
  width: min(67rem, calc(100% - 3rem));
  margin-inline: auto;
}

.topbar {
  border-bottom: 1px solid var(--divider);
}

.topbar-inner {
  min-height: 4.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  gap: .7rem;
  align-items: center;
  font-weight: 730;
  letter-spacing: -.035em;
  white-space: nowrap;
}

.brand-icon {
  background: var(--mint);
  width: 2rem;
  height: 2rem;
  border-radius: .53rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .13rem;
  flex: none;
}

.brand-icon i {
  width: .13rem;
  height: .39rem;
  border-radius: 1rem;
  background: var(--mint-dark);
}

.brand-icon i:nth-child(2), .brand-icon i:nth-child(4) { height: .65rem; }
.brand-icon i:nth-child(3) { height: 1rem; }

.session-actions, .action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .7rem;
}

.profile-name {
  font-size: .875rem;
  color: var(--muted);
  max-width: 14rem;
  overflow-wrap: anywhere;
}

main.shell { padding-bottom: 4rem; }
main > .notice { margin-top: 1.4rem; }

.login-layout {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  align-items: center;
  column-gap: clamp(2rem, 8vw, 7.3rem);
  min-height: min(38rem, 79vh);
  padding-block: 4rem;
}

.login-intro h1 {
  margin-top: 1.45rem;
  font-size: clamp(2.7rem, 7vw, 5.6rem);
  line-height: .96;
  letter-spacing: -.08em;
  font-weight: 790;
}

.login-intro p {
  margin-top: 1.6rem;
  max-width: 23rem;
  font-size: 1.0625rem;
}

.route {
  display: flex;
  align-items: center;
  gap: .67rem;
  flex-wrap: wrap;
  font-size: .875rem;
  font-weight: 630;
  color: var(--muted);
}

.route > span { display: flex; align-items: center; gap: .47rem; }
.route-line { width: 1.5rem; height: 1px; flex: 0 0 1.5rem; background: #626b66; }
.service-dot { width: .54rem; height: .54rem; border-radius: 50%; }
.yandex-dot { background: var(--yandex); }
.spotify-dot { background: var(--spotify); }

.card {
  border: 1px solid var(--divider);
  background: var(--surface);
  border-radius: 1rem;
  padding: clamp(1rem, 3vw, 1.75rem);
  min-width: 0;
}

.login-card {
  display: grid;
  align-content: start;
  gap: .8rem;
  padding: clamp(1.4rem, 4vw, 2.35rem);
  box-shadow: 0 1.25rem 5rem #080a0b45;
}

.login-card h2 {
  margin-bottom: .55rem;
  font-size: 1.65rem;
}

.login-card .button { margin-top: .5rem; }

.workspace-heading {
  padding-top: clamp(2.8rem, 7vw, 4.8rem);
  padding-bottom: 1.9rem;
}

.workspace-heading h1 {
  margin-top: .72rem;
  font-size: clamp(2.2rem, 5.8vw, 4.25rem);
  font-weight: 790;
  letter-spacing: -.075em;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(16rem, .8fr) minmax(0, 1.2fr);
  align-items: start;
  gap: 1rem;
}

.card-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem 1rem;
  margin-bottom: .8rem;
}

.card-heading h2 {
  font-size: 1.32rem;
  font-weight: 720;
  letter-spacing: -.035em;
}

.card > p { margin-block: .6rem 1.05rem; }

.pill {
  border-radius: 5rem;
  padding: .26rem .56rem;
  background: #303537;
  color: #e0e5df;
  font-size: .875rem;
  font-weight: 590;
  white-space: nowrap;
}

.pill.success { background: #263e2b; color: #d2f7b0; }
.pill.active { background: #2f3d25; color: var(--mint); }
.pill.warning { background: #403528; color: var(--warning); }

.button {
  appearance: none;
  display: inline-flex;
  max-width: 100%;
  justify-content: center;
  align-items: center;
  border: 1px solid transparent;
  border-radius: .63rem;
  padding: .59rem .98rem;
  line-height: 1.45;
  min-height: 2.8rem;
  cursor: pointer;
  color: var(--text);
  font-weight: 675;
  text-decoration: none;
}

.button-primary { background: var(--mint); color: var(--mint-dark); }
.button-primary:hover:not(:disabled) { background: #d6ff98; }
.button-secondary { background: var(--surface-raised); border-color: #4d5551; }
.button-secondary:hover:not(:disabled) { background: #343b37; }
.button-quiet { background: transparent; color: var(--muted); }
.button-quiet:hover:not(:disabled) { background: var(--surface-raised); color: var(--text); }
.button-small { font-size: .875rem; min-height: 2.3rem; padding: .35rem .7rem; }
.button:disabled { cursor: default; opacity: .48; }

label, legend { color: var(--text); font-size: .9rem; font-weight: 660; }

input[type=password], input[type=file], select {
  width: 100%;
  min-width: 0;
  border: 1px solid #464e49;
  background: #151817;
  border-radius: .57rem;
  color: var(--text);
}

input[type=password], select {
  min-height: 2.9rem;
  padding: .55rem .7rem;
}

input[type=file] {
  font-size: .875rem;
  padding: .32rem;
  color: var(--muted);
}

input[type=file]::file-selector-button {
  font: inherit;
  font-weight: 650;
  margin-right: .62rem;
  padding: .32rem .51rem;
  border: 0;
  border-radius: .32rem;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
}

input[type=radio], input[type=checkbox] { accent-color: var(--mint); }

.source-form { display: grid; gap: .9rem; }
.source-form > .button { justify-self: start; }
.source-fields { display: grid; gap: .7rem; }
.input-group { min-width: 0; display: grid; gap: .33rem; }
.hint { font-size: .875rem; }

.mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: .26rem;
  margin: 0;
  padding: .22rem;
  min-width: 0;
  width: fit-content;
  border: 1px solid var(--divider);
  background: #151817;
  border-radius: .63rem;
}

.mode-option {
  position: relative;
  cursor: pointer;
  color: var(--muted);
}

.mode-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.mode-option span {
  display: block;
  padding: .33rem .65rem;
  border-radius: .4rem;
}

.mode-option input:checked + span {
  background: var(--surface-raised);
  color: var(--text);
}

.mode-option input:focus-visible + span { outline: 2px solid var(--mint); }

.task-card { margin-top: 1rem; }
.task-card .action-row { margin-top: .85rem; }
.progress-box { display: grid; gap: .35rem; margin-block: .7rem 1rem; }
.progress-box label { font-size: .9rem; }
progress { width: 100%; height: .7rem; accent-color: var(--mint); }
progress::-webkit-progress-bar { background: #333b36; border-radius: 2rem; }
progress::-webkit-progress-value { background: var(--mint); border-radius: 2rem; }
progress::-moz-progress-bar { background: var(--mint); border-radius: 2rem; }

.report {
  display: grid;
  gap: .85rem;
  margin-top: 1rem;
  border-top: 1px solid var(--divider);
  padding-top: 1rem;
}

.report > p { color: var(--text); font-weight: 650; }
.report h3 { font-size: 1rem; }
.report p { margin-block: .3rem; }

#unmatched { display: grid; gap: .52rem; margin-top: .7rem; }

.candidate {
  display: grid;
  grid-template-columns: 1fr minmax(12rem, 1fr);
  align-items: center;
  gap: .5rem 1.1rem;
  border: 1px solid var(--divider);
  background: #171a19;
  border-radius: .55rem;
  padding: .63rem .75rem;
}

.candidate small { display: block; margin-top: .15rem; font-size: .875rem; color: var(--muted); }
.candidate label { overflow-wrap: anywhere; }
.candidate select { font-size: .9rem; }
.candidate-matched { grid-template-columns: minmax(0, 1fr); }
.candidate-matched label { min-width: 0; }

.confirmation {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem 1rem;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--divider);
  padding-top: 1rem;
}

.confirm-label { display: flex; align-items: flex-start; gap: .45rem; cursor: pointer; }
.confirm-label input { flex: none; margin-top: .24rem; }
.track-count { font-variant-numeric: tabular-nums; }

.notice {
  border: 1px solid var(--divider);
  border-radius: .62rem;
  padding: .65rem .79rem;
  background: var(--surface-raised);
  overflow-wrap: anywhere;
}

.notice-warning { color: #ffe2b8; border-color: #69563d; background: #30291f; }
.notice-success { color: #dcffb6; border-color: #405136; background: #263121; }

.visually-hidden {
  position: absolute;
  padding: 0;
  margin: -1px;
  border: 0;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

@media (max-width: 46rem) {
  .shell { width: calc(100% - 2rem); }
  .login-layout, .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .login-layout { gap: 2rem; padding-block: 2.4rem; min-height: 0; }
  .login-intro h1 { max-width: 13ch; }
  .login-intro br { display: none; }
  .login-intro p { margin-top: 1rem; }
  .login-card { width: min(100%, 26rem); }
}

@media (max-width: 33rem) {
  .profile-name { display: none; }
  .candidate { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 24rem) {
  .brand { font-size: .88rem; gap: .48rem; }
  .topbar-inner { gap: .3rem; }
}

.job-list { display: grid; gap: .45rem; }

.job-row {
  display: grid;
  grid-template-columns: 1fr auto minmax(7rem, auto);
  align-items: center;
  text-align: start;
  gap: .65rem;
  padding: .63rem .75rem;
  border: 1px solid var(--divider);
  border-radius: .56rem;
  background: #171a19;
  color: var(--text);
  cursor: pointer;
}

.job-row[aria-pressed=true], .job-row:hover:not(:disabled) {
  border-color: #627253;
  background: #22291f;
}

.job-row small { color: var(--muted); font-size: .875rem; }
.job-row .pill { justify-self: end; }
#resume-token-group { max-width: 30rem; margin-top: .75rem; }
#source-warnings summary { cursor: pointer; color: var(--warning); }
#source-warning-list { color: var(--muted); padding-left: 1.2rem; }

@media (max-width: 33rem) {
  .job-row { grid-template-columns: 1fr auto; }
  .job-row small { grid-column: 1; grid-row: 2; }
  .job-row .pill { grid-column: 2; grid-row: 1 / 3; }
}
