/* ================================================================
   Responsive Styles (responsive.css)
   Contains all media query breakpoints and responsive design rules.
   ================================================================ */

/* ── Mobile-first touch baseline (applied at ALL widths) ── */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Prevent iOS zoom on input focus — only for 16px-and-below native inputs */
@media (max-width: 768px) {
  input, select, textarea, button {
    font-size: max(16px, inherit) !important;
  }
}

/* Ensure all interactive elements have adequate touch targets */
@media (max-width: 768px) {
  button, [role="button"], .nav-btn, .cta-btn,
  .records-action-btn, .auth-submit-btn, .small-btn,
  .planning-card, .tencent-job-card {
    min-height: 44px;
    touch-action: manipulation;
  }
}

/* ================================================================
   TABLET / SMALL DESKTOP (max-width: 980px)
   ================================================================ */
@media (max-width: 980px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
  }

  .app {
    height: auto;
    min-height: 100vh;
    overflow-y: visible !important;
    overflow-x: hidden !important;
    padding-bottom: 0;
  }

  /* Make views flow normally on tablet/mobile */
  .view {
    position: relative !important;
    inset: auto !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  .view:not(.active) {
    display: none !important;
  }

  /* ── CTA row — hidden on tablet (workflow replaces it) ── */
  #homeView .cta-row {
    display: none !important;
  }

  /* ── Hero content — hidden on tablet (workflow replaces it) ── */
  #homeView .hero-content {
    display: none !important;
  }

  #homeView .hero {
    min-height: auto !important;
    height: auto !important;
    padding-top: 0 !important;
  }

  #homeView {
    position: relative !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  /* ── Topbar ── */
  .topbar {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: min(100% - 28px, 780px);
    margin: var(--space-lg) auto 0;
    grid-template-columns: 1fr;
  }

  .brand-title {
    font-size: 34px;
  }

  .brand-sub {
    font-size: 14px;
  }

  /* ── Hero — workflow-home.css handles all hero content on tablet ── */
  .hero {
    min-height: auto !important;
    height: auto !important;
  }

  /* ── World Map — background only, subtle ── */
  .world-map-bg {
    opacity: 0.15 !important;
    z-index: 1 !important;
  }

  /* ── Footer — normal document flow ── */
  .footer {
    margin-top: 40px;
    padding-bottom: 24px;
    font-size: 12px;
  }

  .footer-privacy-note {
    font-size: 12px;
  }

  .footer-links {
    font-size: 12px;
  }

  /* ── CTA button ── */
  .cta-btn {
    height: 48px;
    min-width: 160px;
    padding: 0 26px;
    font-size: 16px;
  }

  /* Career profile */
  .career-profile-scroll {
    position: relative;
    top: auto;
    bottom: auto;
    padding-bottom: 60px;
  }

  .career-profile {
    width: min(100% - 28px, 780px);
    min-height: auto;
    padding-bottom: 40px;
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .profile-card-header {
    padding: 24px 24px 16px;
  }

  .profile-card-header h2 {
    font-size: 21px;
  }

  .profile-card-body {
    padding: 20px 24px 16px;
  }

  .profile-card-footer {
    padding: 12px 24px 24px;
  }

  .steps-card-header {
    padding: 24px 24px 12px;
  }

  .steps-list {
    padding: 0 24px 24px;
  }
}

/* ================================================================
   MOBILE / TABLET PORTRAIT (max-width: 768px)
   ================================================================ */
@media (max-width: 768px) {

  /* ── Global ── */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-y: auto !important;
  }

  /* Modal lock override — must come after html,body for priority */
  body.modal-lock {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    touch-action: pan-y !important;
  }

  body.modal-lock .app {
    padding-bottom: 0 !important;
    overflow: hidden !important;
  }

  .app {
    min-height: 100svh !important;
    height: auto !important;
    padding-bottom: 80px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .topbar {
    width: calc(100% - 28px);
    margin-top: 18px;
  }

  .top-actions {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .brand {
    max-width: calc(100vw - 56px);
    text-align: center !important;
    margin-top: 4px !important;
  }

  .brand-title {
    white-space: normal;
    word-break: keep-all;
    font-size: 28px !important;
    line-height: 1.12 !important;
  }

  .brand-sub {
    font-size: 12px !important;
    margin-top: 6px !important;
  }

  .brand::after {
    width: 140px !important;
    margin: 8px auto 0 !important;
  }

  .nav-btn {
    height: 42px;
    min-width: 68px;
    padding: 0 10px;
    font-size: 13px;
  }

  /* ── User Dropdown Mobile ── */
  .user-dropdown-menu {
    right: 0;
    min-width: 140px;
    border-radius: 12px;
    padding: 5px 0;
  }

  .user-dropdown-item {
    width: calc(100% - 12px);
    margin: 2px 6px;
    padding: 9px 12px;
    font-size: 12px;
    min-height: 36px;
  }

  /* ── Hero — vertical flex, content-driven height ── */
  #homeView {
    position: relative !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  .hero {
    padding-top: 18px !important;
    height: auto !important;
    min-height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  /* ── World Map — pure background, absolute, does NOT push content ── */
  .world-map-bg {
    position: absolute !important;
    left: 50% !important;
    top: 190px !important;
    width: min(92vw, 520px) !important;
    height: 26vh !important;
    max-height: 220px !important;
    transform: translateX(-50%) !important;
    margin-top: 0 !important;
    opacity: 0.15 !important;
    z-index: 0 !important;
    pointer-events: none !important;
    -webkit-mask-image: radial-gradient(
      ellipse at center,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 0, 0, 0.55) 32%,
      rgba(0, 0, 0, 0.12) 55%,
      rgba(0, 0, 0, 0) 100%
    ) !important;
    mask-image: radial-gradient(
      ellipse at center,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 0, 0, 0.55) 32%,
      rgba(0, 0, 0, 0.12) 55%,
      rgba(0, 0, 0, 0) 100%
    ) !important;
  }

  .world-map-img {
    opacity: 0.15 !important;
  }

  .map-glow {
    opacity: 0.22 !important;
  }

  /* ── Hero content — positioned below topbar, above CTA ── */
  .hero-content {
    position: relative !important;
    z-index: 5 !important;
    max-width: calc(100vw - 32px) !important;
    width: 100% !important;
    margin-top: clamp(100px, 15vh, 150px) !important;
    padding: 0 !important;
    transform: none !important;
    align-self: auto !important;
  }

  /* ── Title — MUST be ≤30px, 2-3 lines max ── */
  .hero-title {
    font-size: 30px !important;
    line-height: 1.12 !important;
    letter-spacing: -0.04em !important;
    max-width: calc(100vw - 32px) !important;
    margin: 0 auto 12px !important;
    text-align: left !important;
  }

  .hero-desc {
    font-size: 14px !important;
    line-height: 1.7 !important;
    max-width: calc(100vw - 32px) !important;
    margin: 0 auto !important;
    opacity: 0.86;
  }

  /* ── CTA row — in flow, centered ── */
  #homeView .cta-row {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    z-index: var(--z-content) !important;
    justify-content: center !important;
    margin-top: 20px !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    width: 100% !important;
  }

  .cta-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 48px !important;
    height: 48px !important;
    min-width: 172px !important;
    padding: 0 24px !important;
    margin: 0 auto !important;
    font-size: 16px !important;
    border-radius: 14px !important;
    position: relative !important;
    z-index: 5 !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* ── Footer — MUST stay at bottom, never overlap content ── */
  .footer {
    margin-top: 48px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-bottom: 20px !important;
    font-size: 12px !important;
  }

  .footer-privacy-note {
    font-size: 11px !important;
    margin-bottom: 8px !important;
  }

  .footer-links {
    font-size: 11px !important;
  }

  /* ── Diagnosis ── */
  .diagnosis {
    grid-template-columns: 1fr;
    padding-top: 28px;
    gap: 16px;
    width: min(100% - 32px, 600px);
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  /* ── Career Profile ── */
  .career-profile {
    width: calc(100% - 28px);
  }

  .profile-field-row {
    flex-direction: column;
    gap: 14px;
  }

  .profile-field-row .profile-field {
    margin-bottom: 0;
  }

  .planning-cards {
    flex-direction: column;
    gap: 10px;
  }

  .planning-card {
    padding: 16px;
  }

  /* Resume upload zone */
  .resume-upload-zone {
    min-height: 130px;
    padding: 24px 18px;
  }

  .resume-upload-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .resume-upload-text {
    font-size: 13px;
  }

  /* ── Tencent Jobs ── */
  .tencent-filter-row {
    grid-template-columns: 1fr;
  }

  .tencent-job-card {
    padding: 14px 16px;
  }

  .tencent-job-card-meta {
    gap: 6px;
  }

  .tencent-job-card-tag {
    font-size: 10px;
    padding: 3px 8px;
  }

  .school-autocomplete-list {
    max-height: 220px;
  }

  /* ── Modal lock — hide page chrome behind auth modal ── */
  body.modal-lock .topbar,
  body.modal-lock .brand,
  body.modal-lock .hero,
  body.modal-lock .footer,
  body.modal-lock .marquee {
    display: none !important;
    pointer-events: none !important;
  }

  /* ── Auth Modal ── */
  .auth-overlay {
    align-items: flex-start;
    padding: 16px 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .auth-modal {
    width: calc(100vw - 32px);
    max-width: 420px;
    max-height: none;
    height: auto;
    overflow-y: visible;
    padding: 32px 24px 24px;
    border-radius: 18px;
    margin: auto;
  }

  .auth-title {
    font-size: 18px;
    margin-bottom: 20px;
  }

  .auth-field input {
    height: 44px;
    font-size: 16px; /* prevent iOS zoom */
  }

  .auth-submit-btn {
    height: 46px;
    font-size: 15px;
  }

  .auth-switch {
    font-size: 13px;
    margin-top: 14px;
  }

  .auth-close-btn {
    top: 10px;
    right: 12px;
    width: 40px;
    height: 40px;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ── Records Modal ── */
  .records-overlay {
    align-items: flex-start;
    padding: 16px 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .records-modal {
    width: calc(100vw - 24px);
    max-width: 720px;
    max-height: none;
    height: auto;
    border-radius: 16px;
    margin: auto;
    overflow: visible;
  }

  .records-header {
    padding: 18px 18px 12px;
  }

  .records-header h2 {
    font-size: 16px;
  }

  .records-content {
    padding: 16px 18px 20px;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .records-section {
    margin-bottom: 20px;
  }

  .records-close-btn {
    width: 40px;
    height: 40px;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Records table → card-like on mobile */
  .records-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .records-table {
    font-size: 12px;
  }

  .records-table th,
  .records-table td {
    padding: 8px 8px;
  }

  /* Records action buttons — touch-friendly */
  .records-table td:last-child {
    white-space: normal;
  }

  .records-action-btn {
    padding: 8px 12px;
    font-size: 12px;
    margin: 3px 3px 3px 0;
    display: inline-block;
    white-space: nowrap;
    min-height: 44px;
  }

  .records-hint {
    display: block;
    margin-top: 4px;
    white-space: normal;
    font-size: 11px;
  }

  /* Gap report in records — readable on mobile */
  .gap-detail-area {
    padding: 14px;
    margin-top: 12px;
  }

  .gap-report {
    font-size: 13px;
    line-height: 1.6;
  }

  .gap-score {
    font-size: 28px;
    padding: 6px 18px;
  }

  .gap-section-title {
    font-size: 13px;
    margin: 14px 0 8px;
  }

  .gap-item {
    font-size: 12px;
    line-height: 1.6;
    padding: 6px 0 6px 16px;
  }

  .gap-tags {
    gap: 4px;
  }

  .gap-tag {
    font-size: 10px;
    padding: 3px 8px;
  }

  /* Records toast */
  .records-toast {
    bottom: 20px;
    left: 16px;
    right: 16px;
    transform: none;
    text-align: center;
    font-size: 12px;
    padding: 10px 16px;
    border-radius: 10px;
  }

  @keyframes toast-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ── Job Detail Modal ── */
  .job-detail-modal {
    width: calc(100vw - 24px);
    max-height: 90vh;
    border-radius: 20px;
  }

  .job-detail-modal-header {
    padding: 22px 18px 16px;
  }

  .job-detail-modal-title {
    font-size: 22px;
  }

  .job-detail-modal-body {
    padding: 18px;
  }

  .job-detail-overview-grid {
    grid-template-columns: 1fr 1fr;
  }

  .job-detail-modal-footer {
    padding: 16px 18px 20px;
    flex-direction: column-reverse;
  }

  .job-detail-secondary-btn,
  .job-detail-primary-btn {
    width: 100%;
    min-height: 44px;
  }

  .job-detail-modal-close {
    width: 40px;
    height: 40px;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ── Job Selection Modal — Mobile Rewrite ── */
  .job-selection-modal {
    position: fixed !important;
    inset: 0 !important;
    left: 0 !important;
    top: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    height: 100% !important;
    border-radius: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    display: flex !important;
    flex-direction: column !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.24s ease !important;
  }

  .job-selection-modal.active {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .job-selection-modal-overlay {
    display: none !important;
  }

  .job-selection-modal-overlay.active {
    display: block !important;
  }

  /* ── Header ── */
  .job-selection-modal-header {
    padding: calc(env(safe-area-inset-top, 0px) + 14px) 14px 12px !important;
    flex-shrink: 0 !important;
  }

  #jobSelectionModalTitle {
    font-size: 20px !important;
    max-width: calc(100vw - 60px) !important;
  }

  .job-selection-modal-header p {
    font-size: 13px !important;
    max-width: calc(100vw - 60px) !important;
  }

  .job-selection-modal-close {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    font-size: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* ── Filters — single column ── */
  .job-selection-modal-filters {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 12px 14px !important;
    flex-shrink: 0 !important;
  }

  .job-selection-modal-filters input,
  .job-selection-modal-filters select {
    width: 100% !important;
    min-height: 46px !important;
    height: 46px !important;
    font-size: 16px !important;
    border-radius: 14px !important;
    padding: 0 14px !important;
  }

  .job-selection-modal-filters select {
    padding-right: 32px !important;
  }

  /* ── Content — list panel only (hide desktop detail) ── */
  .job-selection-modal-content {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    padding: 12px 14px !important;
    gap: 0 !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  /* Hide desktop detail panel on mobile */
  .job-selection-detail-panel {
    display: none !important;
  }

  .job-selection-list-panel {
    width: 100% !important;
    border-radius: 18px !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    background: rgba(255, 255, 255, 0.035) !important;
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 200px !important;
    overflow: hidden !important;
  }

  .job-selection-list-header {
    flex-shrink: 0 !important;
    padding: 0 14px !important;
    height: 44px !important;
    font-size: 13px !important;
  }

  .modal-tencent-job-list {
    flex: 1 1 auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 10px 12px !important;
    gap: 12px !important;
  }

  /* ── Job cards ── */
  .modal-job-card {
    width: 100% !important;
    padding: 14px 15px !important;
    min-height: auto !important;
    border-radius: 16px !important;
    margin-bottom: 0 !important;
    cursor: pointer !important;
  }

  .modal-job-card:active {
    border-color: rgba(212, 175, 55, 0.44) !important;
    background: rgba(9, 26, 60, 0.82) !important;
  }

  .modal-job-card-title {
    font-size: 15px !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .modal-job-card-meta {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .modal-job-card-meta span {
    font-size: 11px !important;
    padding: 3px 8px !important;
    white-space: nowrap !important;
  }

  .modal-job-card-desc {
    font-size: 13px !important;
    line-height: 1.55 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  /* ── Desktop footer — hide on mobile (mobile has its own) ── */
  .job-selection-modal-footer {
    display: none !important;
  }

  /* ── Mobile select bar — already styled in career-profile.css ── */

  /* ── Job card selected state ── */
  .modal-job-card.is-selected {
    border-color: rgba(244, 211, 94, 0.9) !important;
    background: rgba(244, 211, 94, 0.08) !important;
    box-shadow: 0 0 0 1px rgba(244, 211, 94, 0.25) !important;
  }

  /* ── List panel padding for bottom bar ── */
  .job-selection-list-panel.has-mobile-bar {
    padding-bottom: 90px !important;
  }

  /* ── Detail panel in desktop mode — already hidden above ── */
  .modal-tencent-job-detail {
    max-height: none !important;
  }

  .modal-job-detail-title {
    font-size: 20px !important;
  }

  .modal-job-empty {
    min-height: 120px !important;
    font-size: 14px !important;
  }

  /* ── Gap Analysis (career-profile.css gap elements) ── */
  .gap-score-section {
    padding: 16px;
    margin-bottom: 16px;
  }

  .gap-score-circle {
    width: 80px;
    height: 80px;
  }

  .gap-score-value {
    font-size: 26px;
  }

  .gap-section {
    padding: 12px 14px;
    margin-bottom: 12px;
  }

  .gap-list li {
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 6px;
  }

  /* ── Feature Toast ── */
  .feature-toast {
    left: 16px;
    right: 16px;
    transform: translateX(0) translateY(20px);
    text-align: center;
    font-size: 13px;
    padding: 12px 20px;
  }

  .feature-toast.show {
    transform: translateX(0) translateY(0);
  }

  /* ── Profile back button ── */
  .profile-back-btn {
    min-height: 44px;
  }

  /* ── Selected job card ── */
  .selected-job-card {
    padding: 14px 16px;
  }

  .selected-job-select-btn,
  .selected-job-reselect-btn {
    min-height: 44px;
  }
}

/* ================================================================
   SMALL MOBILE (max-width: 480px)
   ================================================================ */
@media (max-width: 480px) {

  /* ── Topbar / Brand ── */
  .topbar {
    width: calc(100% - 20px);
    margin-top: 14px;
  }

  .brand-title {
    font-size: 26px;
  }

  .brand-sub {
    font-size: 11px;
  }

  .brand::after {
    width: 100px;
  }

  .nav-btn {
    height: 38px;
    min-width: 60px;
    padding: 0 8px;
    font-size: 12px;
  }

  .top-actions {
    gap: 6px;
  }

  .lang-toggle {
    padding: 0 6px;
  }

  .lang-option {
    min-width: 28px;
    height: 24px;
    padding: 0 6px;
    font-size: 12px;
  }

  /* ── Hero ── */
  .hero {
    padding-top: 12px !important;
    min-height: auto !important;
  }

  /* ── World Map — barely visible, pure atmosphere ── */
  .world-map-bg {
    top: 200px !important;
    width: 88vw !important;
    height: 20vh !important;
    max-height: 160px !important;
    opacity: 0.10 !important;
  }

  .world-map-img {
    opacity: 0.10 !important;
  }

  .map-glow {
    opacity: 0.16 !important;
  }

  /* ── Hero content ── */
  .hero-content {
    margin-top: clamp(90px, 13vh, 120px) !important;
    padding: 0 !important;
  }

  /* ── Title — 28px max ── */
  .hero-title {
    font-size: 28px !important;
    line-height: 1.12 !important;
    letter-spacing: -0.04em !important;
    max-width: calc(100vw - 28px) !important;
    margin: 0 auto 10px !important;
  }

  .hero-desc {
    font-size: 14px !important;
    line-height: 1.65 !important;
    max-width: calc(100vw - 28px) !important;
  }

  /* ── CTA ── */
  #homeView .cta-row {
    margin-top: 18px !important;
  }

  .cta-btn {
    min-height: 48px !important;
    height: 48px !important;
    min-width: 168px !important;
    padding: 0 24px !important;
    font-size: 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    z-index: 5 !important;
    max-width: calc(100vw - 32px) !important;
  }

  /* ── Body overflow control for modals ── */
  body.modal-lock {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
  }

  /* ── Auth Modal ── */
  .auth-overlay {
    align-items: flex-start;
    padding: 12px 0;
  }

  .auth-modal {
    padding: 28px 18px 20px;
    border-radius: 16px;
    width: calc(100vw - 24px);
    max-height: calc(100svh - 28px);
    margin-top: 8px;
  }

  .auth-title {
    font-size: 18px;
    margin-bottom: 18px;
  }

  .auth-field {
    margin-bottom: 14px;
  }

  .auth-field label {
    font-size: 11px;
  }

  .auth-field input {
    height: 44px;
    min-height: 44px;
    padding: 0 12px;
    font-size: 16px;
  }

  .auth-submit-btn {
    height: 46px;
  }

  .auth-switch {
    font-size: 12px;
  }

  .auth-error-message {
    font-size: 12px;
    padding: 8px 12px;
  }

  .auth-close-btn {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  /* ── Records Modal ── */
  .records-overlay {
    align-items: flex-start;
    padding: 12px 0;
  }

  .records-modal {
    width: calc(100vw - 16px);
    max-height: none;
    height: auto;
    border-radius: 14px;
    margin: auto;
    overflow: visible;
  }

  .records-header {
    padding: 14px 14px 10px;
  }

  .records-header h2 {
    font-size: 15px;
  }

  .records-content {
    padding: 12px 14px 16px;
    max-height: 55vh;
    overflow-y: auto;
  }

  .records-section-title {
    font-size: 13px;
  }

  .records-table th,
  .records-table td {
    padding: 6px 6px;
    font-size: 11px;
  }

  .records-action-btn {
    padding: 8px 10px;
    font-size: 11px;
    min-height: 44px;
  }

  .records-close-btn {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  /* ── Career Profile ── */
  .career-profile-scroll {
    padding-bottom: 48px;
  }

  .career-profile {
    width: calc(100% - 20px);
    padding-bottom: 48px;
    gap: 16px;
  }

  .profile-card-header {
    padding: 20px 20px 12px;
  }

  .profile-card-header h2 {
    font-size: 18px;
  }

  .profile-card-header p {
    font-size: 13px;
  }

  .profile-card-body {
    padding: 16px 20px 12px;
  }

  .profile-card-footer {
    padding: 10px 20px 20px;
  }

  .steps-card-header {
    padding: 20px 20px 10px;
  }

  .steps-list {
    padding: 0 20px 20px;
  }

  .profile-section-label {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .profile-field label {
    font-size: 12px;
  }

  .profile-field input,
  .profile-field select {
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 11px;
  }

  .date-selects {
    gap: 6px;
  }

  .date-selects select {
    padding: 10px 8px;
    font-size: 13px;
  }

  .edu-block {
    padding: 14px 14px;
    margin-bottom: 14px;
  }

  .edu-period-selects {
    gap: 6px;
  }

  .edu-period-selects select {
    padding: 10px 8px;
    font-size: 13px;
  }

  .edu-period-sep {
    font-size: 11px;
  }

  .edu-research-toggle select {
    font-size: 13px;
    padding: 10px 12px;
  }

  .profile-field textarea {
    font-size: 14px;
    padding: 10px 12px;
  }

  /* Resume upload */
  .resume-upload-zone {
    min-height: 110px;
    padding: 20px 14px;
    border-radius: 14px;
  }

  .resume-upload-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
    margin-bottom: 8px;
  }

  .resume-upload-text {
    font-size: 12px;
  }

  .resume-upload-subtext {
    font-size: 11px;
  }

  .resume-upload-hint {
    font-size: 11px;
  }

  /* Planning cards */
  .planning-card {
    padding: 14px;
  }

  .planning-card-icon {
    font-size: 18px;
    margin-bottom: 6px;
  }

  .planning-card-title {
    font-size: 13px;
  }

  .planning-card-desc {
    font-size: 10px;
  }

  .planning-detail {
    padding: 14px 14px;
  }

  .planning-detail-label {
    font-size: 11px;
  }

  /* ── Tencent Jobs ── */
  .tencent-search-input {
    height: 42px;
    font-size: 14px;
    padding: 0 14px;
  }

  .tencent-filter-select {
    height: 40px;
    font-size: 12px;
  }

  .tencent-job-card-title {
    font-size: 15px;
  }

  .tencent-job-card {
    padding: 12px 14px;
  }

  .tencent-submit-btn {
    height: 44px;
    font-size: 14px;
  }

  /* ── Job Detail Modal ── */
  .job-detail-overview-grid {
    grid-template-columns: 1fr;
  }

  .job-detail-modal-title {
    font-size: 20px;
  }

  .job-detail-section-title {
    font-size: 14px;
  }

  .job-detail-list li {
    font-size: 13px;
  }

  .job-detail-modal-body {
    padding: 14px;
  }

  .job-detail-modal-close {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  .job-detail-secondary-btn,
  .job-detail-primary-btn {
    min-height: 44px;
  }

  /* ── Job Selection Modal — already handled at 768px, just fine-tune ── */
  #jobSelectionModalTitle {
    font-size: 18px !important;
  }

  .job-selection-modal-header p {
    font-size: 12px !important;
  }

  .modal-job-card-title {
    font-size: 14px !important;
  }

  .modal-job-card {
    padding: 12px 14px !important;
  }

  .modal-job-card-desc {
    font-size: 12px !important;
  }

  .job-selection-modal-filters input,
  .job-selection-modal-filters select {
    min-height: 44px !important;
    height: 44px !important;
    font-size: 16px !important;
  }

  /* ── Diagnosis ── */
  .diagnosis {
    width: calc(100% - 24px);
    padding-top: 20px;
  }

  .diag-form {
    padding: 18px;
  }

  .diag-result {
    padding: 18px;
  }

  .diag-form h2,
  .diag-result h2 {
    font-size: 20px;
  }

  .diag-actions {
    flex-direction: column;
    gap: 10px;
  }

  .small-btn {
    height: 44px;
    width: 100%;
  }

  /* ── Steps Card ── */
  .step-item {
    gap: 10px;
  }

  .step-num {
    width: 28px;
    height: 28px;
    font-size: 12px;
    border-radius: 8px;
  }

  .step-body strong {
    font-size: 13px;
  }

  .step-body span {
    font-size: 11px;
  }

  /* ── Selected Job Overview ── */
  .selected-job-card {
    padding: 14px 16px;
  }

  .selected-job-title {
    font-size: 16px;
  }

  .selected-job-meta {
    gap: 6px;
  }

  .selected-job-badge {
    font-size: 11px;
    padding: 4px 8px;
  }

  .selected-job-reselect-btn,
  .selected-job-select-btn {
    height: 40px;
    font-size: 12px;
    padding: 0 16px;
  }

  /* ── Profile back button ── */
  .profile-back-btn {
    height: 44px;
    padding: 0 18px;
    font-size: 13px;
    min-height: 44px;
  }

  /* ── Form error summary ── */
  .form-error-summary,
  .form-success-summary {
    padding: 12px 14px;
  }

  .form-error-summary strong {
    font-size: 12px;
  }

  .form-error-summary ul {
    font-size: 12px;
  }

  /* ── Resume parse result ── */
  .resume-parse-result {
    padding: 12px 14px;
  }

  .resume-parse-preview {
    font-size: 12px;
    max-height: 150px;
    padding: 8px 10px;
  }

  .resume-parse-btn,
  .resume-parse-json-btn {
    font-size: 11px;
    padding: 0 14px;
    height: 34px;
  }

  .resume-json-signal {
    font-size: 11px;
    padding: 4px 10px;
  }

  .resume-json-skill-tag {
    font-size: 10px;
    padding: 3px 8px;
  }

  /* ── Gap Analysis ── */
  .gap-score-section {
    padding: 14px;
  }

  .gap-score-circle {
    width: 70px;
    height: 70px;
  }

  .gap-score-value {
    font-size: 22px;
  }

  .gap-score-label {
    font-size: 10px;
  }

  .gap-score-job {
    font-size: 14px;
  }

  .gap-section {
    padding: 10px 12px;
  }

  .gap-section-title {
    font-size: 12px;
  }

  .gap-list li {
    font-size: 11px;
    padding-left: 14px;
  }

  /* ── Footer ── */
  .footer {
    font-size: 11px;
    margin-top: 30px;
    padding-bottom: 14px;
  }

  .footer-privacy-note {
    font-size: 11px;
  }

  .footer-links {
    font-size: 11px;
  }

  /* ── School autocomplete ── */
  .school-autocomplete-list {
    max-height: 180px;
  }

  .school-autocomplete-item {
    padding: 10px 12px;
  }

  .school-autocomplete-item-name {
    font-size: 13px;
  }
}

/* ================================================================
   EXTRA SMALL (max-width: 390px)
   ================================================================ */
@media (max-width: 390px) {
  .hero {
    padding-top: 10px !important;
  }

  .hero-title {
    font-size: 26px !important;
    line-height: 1.14 !important;
    letter-spacing: -0.03em !important;
    max-width: calc(100vw - 24px) !important;
    margin: 0 auto 10px !important;
  }

  .hero-desc {
    font-size: 13px !important;
    line-height: 1.6 !important;
    max-width: calc(100vw - 24px) !important;
  }

  .hero-content {
    margin-top: clamp(100px, 14vh, 130px) !important;
    padding: 0 !important;
  }

  .world-map-bg {
    top: 190px !important;
    height: 18vh !important;
    max-height: 140px !important;
    opacity: 0.08 !important;
  }

  .world-map-img {
    opacity: 0.08 !important;
  }

  .cta-btn {
    min-height: 48px !important;
    height: 48px !important;
    min-width: 160px !important;
    padding: 0 22px !important;
    font-size: 15px !important;
  }

  #homeView .cta-row {
    margin-top: 18px !important;
  }

  .brand-title {
    font-size: 24px !important;
  }

  .brand-sub {
    font-size: 11px !important;
  }
}

/* ================================================================
   EXTRA SMALL (max-width: 360px)
   ================================================================ */
@media (max-width: 360px) {
  .brand-title {
    font-size: 22px !important;
  }

  .brand-sub {
    font-size: 10px;
  }

  .brand::after {
    width: 80px;
  }

  .nav-btn {
    height: 38px;
    min-width: 48px;
    padding: 0 6px;
    font-size: 11px;
    border-radius: 8px;
  }

  .top-actions {
    gap: 4px;
  }

  .hero {
    padding-top: 8px !important;
  }

  .hero-title {
    font-size: 24px !important;
    line-height: 1.15 !important;
    max-width: calc(100vw - 20px) !important;
  }

  .hero-desc {
    font-size: 12px !important;
    line-height: 1.6 !important;
  }

  .hero-content {
    margin-top: clamp(90px, 12vh, 110px) !important;
  }

  .world-map-bg {
    display: none !important;
  }

  .cta-btn {
    min-height: 48px !important;
    height: 48px !important;
    min-width: 150px !important;
    padding: 0 20px !important;
    font-size: 15px !important;
  }

  #homeView .cta-row {
    margin-top: 16px !important;
  }

  .auth-modal {
    padding: 22px 12px 14px;
    border-radius: 14px;
  }

  .auth-field input {
    height: 42px;
  }

  .auth-submit-btn {
    height: 44px;
  }

  .records-modal {
    width: calc(100vw - 10px);
    border-radius: 12px;
  }

  .records-content {
    max-height: 50vh;
  }

  .records-action-btn {
    padding: 7px 8px;
    font-size: 10px;
  }

  .career-profile {
    width: calc(100% - 12px);
  }

  .profile-card-header {
    padding: 16px 14px 10px;
  }

  .profile-card-body {
    padding: 12px 14px 10px;
  }

  .profile-card-footer {
    padding: 8px 14px 16px;
  }
}

/* ================================================================
   TABLET LANDSCAPE / SMALL DESKTOP (768px - 980px)
   ================================================================ */
@media (min-width: 768px) and (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr 1fr;
  }

  .top-actions {
    justify-self: end;
  }
}

/* ================================================================
   iPAD / TABLET (768px - 1024px)
   — workflow-home.css now handles all hero/workflow layout
   ================================================================ */
@media (min-width: 768px) and (max-width: 1024px) {
  /* Marquee hidden on tablet to save vertical space */
  .marquee {
    display: none !important;
  }

  /* Topbar stays absolute but compact */
  .topbar {
    position: absolute;
    top: 32px;
  }

  .brand-title {
    font-size: 34px;
  }

  .brand-sub {
    font-size: 14px;
  }

  /* CTA button size */
  .cta-btn {
    min-height: 50px !important;
    font-size: 17px !important;
    padding: 0 30px !important;
  }
}

/* ================================================================
   LARGE DESKTOP FINE-TUNING (min-width: 1441px)
   ================================================================ */
@media (min-width: 1441px) {
  .hero-content {
    max-width: 860px;
  }

  .hero-title {
    font-size: 72px;
  }
}
