body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  padding: 16px 16px 76px 16px;
  background: var(--tg-theme-bg-color, #ffffff);
  color: var(--tg-theme-text-color, #000000);
}
/* Persistent bottom tab bar: Home / Search / Analyze / Profile - the
   app's primary navigation, matching the reference screenshot's bottom
   menu pattern. */
#tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--tg-theme-bg-color, #ffffff);
  border-top: 1px solid var(--tg-theme-hint-color, #dddddd);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom, 0px));
  z-index: 100;
}
.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: auto;
  background: none;
  border: none;
  color: var(--tg-theme-hint-color, #999999);
  font-size: 11px;
  padding: 4px 0;
  margin-top: 0;
  cursor: pointer;
}
.tab-btn .tab-icon { line-height: 1; }
.tab-btn .tab-icon svg { width: 22px; height: 22px; display: block; }
.tab-btn.active { color: var(--tg-theme-button-color, #2481cc); font-weight: 600; }
h2 { font-size: 21px; margin-bottom: 4px; }
.hint { color: var(--tg-theme-hint-color, #999999); font-size: 15px; margin-bottom: 16px; }
label { display: block; font-size: 14px; margin: 12px 0 4px; }
input, select, textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--tg-theme-hint-color, #cccccc);
  background: var(--tg-theme-secondary-bg-color, #f5f5f5);
  color: var(--tg-theme-text-color, #000000);
  font-size: 16px;
}
textarea { font-family: inherit; resize: vertical; min-height: 120px; }
.menu-option {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--tg-theme-secondary-bg-color, #f5f5f5);
  color: var(--tg-theme-text-color, #000000);
  border: 1px solid var(--tg-theme-hint-color, #dddddd);
  border-radius: 10px;
  padding: 14px;
  margin-top: 12px;
  font-size: 16px;
  font-weight: 600;
}
.menu-option .hint { margin: 4px 0 0; font-weight: 400; }
/* A label introducing the option button right below it (e.g. Home
   screen's "Search for a vacancy" / "Or analyze your CV") - real user
   feedback: with plain .hint's symmetric-looking spacing, it read as
   ambiguous which button a label belonged to. Bolder/darker than .hint
   (a real lead-in, not fine print) and, more importantly, pulled tight
   to the button that follows it while staying separated from whatever
   came before - proximity, not just wording, is what makes "this label
   belongs to this button" obvious at a glance. */
.option-label { font-size: 14px; font-weight: 600; color: var(--tg-theme-hint-color, #999999); margin: 8px 0 6px; }
.menu-option + .option-label { margin-top: 28px; }
.option-label + .menu-option { margin-top: 6px; }
.score-bar {
  background: var(--tg-theme-hint-color, #dddddd);
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
  margin: 6px 0 10px;
}
.score-bar-fill { background: var(--tg-theme-button-color, #2481cc); height: 100%; }
.tool-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--tg-theme-hint-color, #eeeeee); }
.roadmap-body { white-space: pre-wrap; }
button {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--tg-theme-button-color, #2481cc);
  color: var(--tg-theme-button-text-color, #ffffff);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
button:disabled { opacity: 0.5; cursor: default; }
button.secondary {
  background: var(--tg-theme-secondary-bg-color, #f0f0f0);
  color: var(--tg-theme-text-color, #000000);
}
button.danger { background: #d33; color: #ffffff; }
button.link {
  width: auto;
  background: none;
  color: var(--tg-theme-link-color, #2481cc);
  padding: 4px 0;
  margin-top: 4px;
  font-weight: 400;
  text-align: left;
}
/* A real, noticeable back/close affordance - not a small text link */
button.back-btn {
  width: auto;
  background: var(--tg-theme-secondary-bg-color, #ececec);
  color: var(--tg-theme-text-color, #000000);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  margin-top: 0;
}
/* Header nav buttons (Profile/checks, Applications) - a visible pill,
   not a bare text link that reads as a stat rather than a tappable
   navigation target. */
button.nav-chip {
  width: auto;
  background: var(--tg-theme-secondary-bg-color, #ececec);
  color: var(--tg-theme-text-color, #000000);
  border: 1px solid var(--tg-theme-hint-color, #cccccc);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 0;
}
.row { display: flex; gap: 8px; margin-top: 16px; }
/* flex:1 + width:auto on BOTH buttons and the Open-link anchor - button's
   own base rule sets width:100%, which (left unset here) fights flexbox's
   sizing and was making buttons in the same row render unevenly instead
   of splitting the row equally (real bug, caught in review - visible on
   this row and on the "like it / search again" row below it). */
.row button { flex: 1; width: auto; margin-top: 0; }
/* "Open link" on a vacancy card is an <a> (real navigation, not a JS
   handler), styled to match the buttons next to it so the row reads as
   equal actions, not a button pair plus a stray text link. */
.row a.btn-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  padding: 12px;
  border-radius: 8px;
  background: var(--tg-theme-button-color, #2481cc);
  color: var(--tg-theme-button-text-color, #ffffff);
  font-size: 16px;
  font-weight: 600;
}
.spinner {
  width: 28px;
  height: 28px;
  margin: 40px auto;
  border-radius: 50%;
  border: 3px solid var(--tg-theme-hint-color, #dddddd);
  border-top-color: var(--tg-theme-button-color, #2481cc);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* Inline spinner for a busy button (see setButtonBusy in core.js) - uses
   currentColor so it matches whatever text color the button variant
   (primary/secondary/danger) already has, no extra theming needed. */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  opacity: 0.85;
  animation: spin 0.6s linear infinite;
}
/* A large, unmissable loading state for steps that call out to the AI or
   a live search and take a few seconds - real user feedback that the
   small inline .hint version was easy to miss entirely (read as "the
   button isn't doing anything"), not just easy to overlook. See
   core.js's bigLoader(). */
.big-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 30vh;
  text-align: center;
  padding: 24px;
}
.big-loader .spinner { width: 48px; height: 48px; margin: 0 0 16px; border-width: 4px; }
.big-loader .big-loader-text { font-size: 16px; color: var(--tg-theme-text-color, #000000); }
.big-loader .big-loader-text .icon { width: 18px; height: 18px; }
.qty-stepper { display: flex; align-items: stretch; gap: 8px; margin-top: 12px; }
.qty-stepper input {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}
.qty-stepper .qty-btn {
  width: 52px;
  flex: none;
  margin: 0;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}
#result { margin-top: 20px; }
.card {
  border: 1px solid var(--tg-theme-hint-color, #dddddd);
  border-radius: 10px;
  padding: 14px;
}
.card.clickable { cursor: pointer; }
.card h3 { margin: 0 0 4px; font-size: 18px; }
.card .company { color: var(--tg-theme-hint-color, #999999); font-size: 14px; margin-bottom: 8px; }
/* Caps a vacancy card's summary at 5 lines - real feedback that a long
   posting pushed the actual action buttons too far down the screen. The
   full text is still one tap away via "Open"/"Copy". */
.clamp-5 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}
.card a { color: var(--tg-theme-link-color, #2481cc); }
.file-picker { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.file-picker .hint { margin-bottom: 0; }
.card.active-cv { border-color: #2e9e44; }
.active-cv-badge { color: #2e9e44; font-weight: 600; font-size: 14px; }
.error { color: #d33; font-size: 15px; }
.chip {
  display: inline-block;
  border: 1px solid var(--tg-theme-hint-color, #cccccc);
  border-radius: 20px;
  padding: 8px 14px;
  margin: 4px 4px 0 0;
  font-size: 15px;
  cursor: pointer;
  background: var(--tg-theme-secondary-bg-color, #f5f5f5);
}
.selected-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--tg-theme-secondary-bg-color, #f5f5f5);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.selected-title b { font-size: 16px; }
/* A visually distinct, more noticeable block for questions/prompts -
   these were plain small .hint text before and easy to miss */
.prompt-block {
  background: var(--tg-theme-secondary-bg-color, #f5f5f5);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 16px;
  font-size: 16px;
  font-weight: 600;
}
.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.nav-row button { width: auto; margin-top: 0; padding: 8px 14px; font-size: 15px; }
.nav-counter { color: var(--tg-theme-hint-color, #999999); font-size: 14px; }
.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.screen-header .hint { margin: 0; }
.controls-row { display: flex; gap: 8px; margin-bottom: 12px; }
.controls-row select { font-size: 16px; padding: 8px; }
[hidden] { display: none !important; }
input[type="file"] { border: none; padding: 8px 0; background: none; }
/* Icon set (icons.js) replacing emoji in labels/messages - real user
   feedback that the emoji didn't fit the app's look. .icon-row centers
   an icon next to a short single-line label (buttons, badges);
   .icon-row-top top-aligns the icon against text that may wrap
   (error/hint/prompt-block messages). */
.icon { width: 16px; height: 16px; flex: none; }
.icon-row { display: inline-flex; align-items: center; gap: 6px; }
button.icon-row, .menu-option .icon-row, .nav-chip.icon-row { width: 100%; justify-content: center; }
.icon-row-top { display: flex; align-items: flex-start; gap: 8px; }
.icon-row-top .icon { margin-top: 2px; }

/* Browser mode (app.chashma.uz): on a laptop the phone-sized layout would
   stretch edge to edge - keep it in a centered column, tab bar included. */
body.web-mode { max-width: 520px; margin: 0 auto; }
body.web-mode #tab-bar { max-width: 520px; margin: 0 auto; }
#google-signin-btn { margin: 16px 0; min-height: 44px; }
#signin-lang select, #onboarding-lang select, #profile-web-account select { margin: 8px 0 12px; }
#profile-web-account { margin-top: 16px; }
/* Browser mode on a laptop/desktop: navigation as a top bar, the usual
   place on a website. Phones (in a browser or Telegram) keep the bottom
   tab bar - it's where thumbs reach. */
@media (min-width: 700px) {
  body.web-mode { padding: 72px 16px 24px 16px; }
  body.web-mode #tab-bar {
    top: 0;
    bottom: auto;
    max-width: none;
    justify-content: center;
    gap: 8px;
    border-top: none;
    border-bottom: 1px solid var(--tg-theme-hint-color, #dddddd);
    padding: 8px 16px;
  }
  body.web-mode .tab-btn {
    flex: 0 0 auto;
    flex-direction: row;
    gap: 6px;
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 8px;
  }
  body.web-mode .tab-btn .tab-icon svg { width: 18px; height: 18px; }
  body.web-mode .tab-btn.active { background: rgba(36, 129, 204, 0.08); }
}
