/* GC Koala shared publish polish */
:root { --motion-ease: cubic-bezier(.2,.7,.2,1); }
html { scroll-behavior: smooth; }
a, button, .tab, .step-card, .card, .chapter, .link-btn, .hero-cta { -webkit-tap-highlight-color: transparent; }
.hero-cta, .link-btn, .step-nav a {
  transition: transform .22s var(--motion-ease), box-shadow .22s var(--motion-ease), background-color .22s var(--motion-ease), border-color .22s var(--motion-ease);
}
.hero-cta:hover, .link-btn:hover, .step-nav a:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(20, 35, 60, .14);
}
.step-card {
  transition: transform .24s var(--motion-ease), box-shadow .24s var(--motion-ease), border-color .24s var(--motion-ease);
}
.step-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(25, 35, 55, .13);
}
.step-card-visual {
  transition: transform .38s var(--motion-ease), filter .38s var(--motion-ease);
  transform-origin: center;
}
.step-card:hover .step-card-visual {
  transform: scale(1.025);
  filter: saturate(1.04);
}
.tab {
  transition: background-color .18s var(--motion-ease), color .18s var(--motion-ease), border-color .18s var(--motion-ease), transform .18s var(--motion-ease);
}
.tab:hover { transform: translateY(-1px); }
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .46s var(--motion-ease), transform .46s var(--motion-ease);
}
.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.site-disclaimer {
  max-width: 1120px;
  margin: 28px auto 0;
  padding: 16px 20px 34px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.8;
  text-align: center;
}
.site-disclaimer a {
  color: #1268d6;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (max-width: 540px) {
  .step-card:hover, .hero-cta:hover, .link-btn:hover, .step-nav a:hover, .tab:hover {
    transform: none;
  }
  .site-disclaimer {
    margin-top: 18px;
    padding: 14px 16px 28px;
    text-align: left;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Affiliate recommendation cards */
.affiliate-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  margin: 0 0 14px;
  border: 1px solid rgba(15, 45, 99, .08);
  background: #fff;
}
.affiliate-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.affiliate-card {
  position: relative;
}
.affiliate-card .affiliate-note {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #fff8e5;
  border: 1px solid #f3d37e;
  color: #725200;
}
.affiliate-disclosure {
  margin-top: 10px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
}
@media (max-width: 540px) {
  .affiliate-media {
    border-radius: 10px;
    margin-bottom: 12px;
  }
}

/* Mobile readability upgrade: category routes and compact visual summaries */
.mobile-route {
  display: none;
}

.all-steps-toggle {
  display: none;
}

.quick-scan {
  max-width: 1120px;
  margin: 16px auto 10px;
  padding: 16px;
  border: 1px solid var(--border, #e8e0d6);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, var(--soft, #fff7f0) 100%);
  box-shadow: 0 8px 24px rgba(15, 45, 99, .06);
}

.quick-scan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.quick-scan-head span {
  color: var(--primary-dark, #0b2f73);
  font-size: 12px;
  font-weight: 900;
}

.quick-scan-head b {
  color: var(--muted, #687386);
  font-size: 11px;
  font-weight: 900;
}

.quick-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.quick-chip {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 76px;
  padding: 10px;
  border: 1px solid rgba(15, 45, 99, .08);
  border-radius: 12px;
  background: #fff;
}

.quick-chip i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--primary, #e8621a);
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.quick-chip span {
  color: var(--text, #172033);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.quick-scan-note {
  margin: 10px 2px 0;
  color: var(--muted, #687386);
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 540px) {
  .mobile-route {
    display: block;
    width: 100%;
    max-width: 100vw;
    padding: 18px 16px 0;
    overflow: hidden;
  }

  .route-intro {
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
  }

  .route-intro span {
    color: #e8621a;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
  }

  .route-intro h2 {
    margin: 0;
    color: #0b2f73;
    font-size: 20px;
    line-height: 1.25;
  }

  .route-intro p {
    margin: 0;
    color: #687386;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.65;
  }

  .route-card-grid {
    display: grid;
    gap: 10px;
    width: 100%;
    min-width: 0;
  }

  .route-group {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(15, 45, 99, .1);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 45, 99, .06);
    overflow: hidden;
  }

  .route-group summary {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 12px;
    color: #172033;
    cursor: pointer;
    list-style: none;
  }

  .route-group summary::-webkit-details-marker {
    display: none;
  }

  .route-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: var(--route-color, #e8621a);
    color: #fff;
    font-size: 15px;
    font-weight: 900;
  }

  .route-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
  }

  .route-copy b {
    font-size: 14px;
    line-height: 1.35;
  }

  .route-copy small {
    color: #687386;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.4;
  }

  .route-count {
    color: var(--route-color, #e8621a);
    font-size: 11px;
    font-weight: 900;
  }

  .route-step-list {
    display: grid;
    gap: 6px;
    padding: 0 10px 12px 46px;
    min-width: 0;
  }

  .route-step-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 12px;
    background: #f8fbff;
    color: #172033;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
  }

  .route-step-list a em {
    flex: 0 0 auto;
    color: var(--route-color, #e8621a);
    font-size: 11px;
    font-style: normal;
  }

  .search-area {
    display: none;
  }

  #guide {
    padding-top: 18px;
  }

  #guide .section-label {
    margin-bottom: 10px;
  }

  #step-grid {
    display: none;
  }

  #step-grid.is-expanded {
    display: grid;
  }

  .all-steps-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    margin: 0 0 12px;
    border: 1px solid rgba(232, 98, 26, .28);
    border-radius: 999px;
    background: #fff7f1;
    color: #e8621a;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
  }

  .quick-scan {
    width: auto;
    max-width: none;
    margin: 14px 16px 0;
    padding: 14px 0 14px 14px;
    overflow: hidden;
  }

  .quick-scan-head,
  .quick-scan-note {
    padding-right: 14px;
  }

  .quick-flow {
    display: flex;
    grid-template-columns: none;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 14px 2px 0;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .quick-flow::-webkit-scrollbar {
    height: 0;
  }

  .quick-chip {
    flex: 0 0 156px;
    grid-template-columns: 28px 1fr;
    align-items: center;
    min-height: 58px;
    scroll-snap-align: start;
  }
}

@media (min-width: 541px) {
  #step-grid {
    display: grid !important;
  }
}

/* Index photo hero and chapter carousels */
.home-page .header + .hero {
  background:
    linear-gradient(180deg, rgba(10, 42, 76, .38) 0%, rgba(232, 98, 26, .48) 46%, rgba(232, 98, 26, .60) 100%),
    url('../images/index-hero.jpg') center 54% / cover no-repeat;
  min-height: 330px;
  display: grid;
  align-content: center;
  isolation: isolate;
}

.home-page .header + .hero::before,
.home-page .header + .hero::after {
  display: none;
}

.home-page .header + .hero .hero-eyebrow,
.home-page .header + .hero .hero-sub,
.home-page .header + .hero .hero-audience {
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 2px 14px rgba(0, 0, 0, .24);
}

.home-page .header + .hero .hero-title {
  text-shadow: 0 3px 18px rgba(0, 0, 0, .28);
}

@media (max-width: 540px) {
  .home-page .header + .hero {
    min-height: 430px;
    padding: 32px 18px 28px;
    background:
      linear-gradient(180deg, rgba(7, 34, 66, .34) 0%, rgba(232, 98, 26, .52) 48%, rgba(232, 98, 26, .66) 100%),
      url('../images/index-hero.jpg') center top / cover no-repeat;
  }

  .home-page .header + .hero .hero-title {
    font-size: 34px;
    line-height: 1.22;
  }

  .home-page .header + .hero .hero-sub {
    font-size: 13px;
  }

  .chapter .visa-cards,
  .chapter .flow,
  .chapter .warn-grid,
  .chapter .checklist,
  .chapter .grid,
  .chapter .card-grid,
  .chapter .two-col {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 2px 4px 12px !important;
    margin-left: -4px;
    margin-right: -4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .chapter .visa-cards::-webkit-scrollbar,
  .chapter .flow::-webkit-scrollbar,
  .chapter .warn-grid::-webkit-scrollbar,
  .chapter .checklist::-webkit-scrollbar,
  .chapter .grid::-webkit-scrollbar,
  .chapter .card-grid::-webkit-scrollbar,
  .chapter .two-col::-webkit-scrollbar {
    height: 0;
  }

  .chapter .visa-card,
  .chapter .flow-item,
  .chapter .warn-card,
  .chapter .checklist > *,
  .chapter .grid > *,
  .chapter .card-grid > *,
  .chapter .two-col > * {
    flex: 0 0 min(82vw, 340px) !important;
    width: min(82vw, 340px) !important;
    max-width: min(82vw, 340px) !important;
    scroll-snap-align: start;
  }

  .chapter .flow-item {
    min-height: 250px;
    align-items: flex-start;
  }

  .chapter .checklist > * {
    align-self: stretch;
  }

  .chapter .table-wrap,
  .chapter .table-scroll {
    margin-left: -4px;
    margin-right: -4px;
  }
}

/* Mobile carousel readability fixes */
@media (max-width: 540px) {
  .chapter .flow > *,
  .chapter .flow-row {
    flex: 0 0 min(84vw, 350px) !important;
    width: min(84vw, 350px) !important;
    min-width: min(84vw, 350px) !important;
    max-width: min(84vw, 350px) !important;
    scroll-snap-align: start;
  }

  .chapter .flow-row,
  .chapter .flow-row *,
  .chapter .card,
  .chapter .card *,
  .chapter .flow-item,
  .chapter .flow-item * {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    word-break: normal !important;
    line-break: auto !important;
    overflow-wrap: anywhere !important;
  }

  .chapter .checklist,
  .chapter .final-check .checklist,
  #docs .checklist {
    display: block !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    scroll-snap-type: none !important;
  }

  .chapter .checklist > *,
  .chapter .final-check .checklist > *,
  #docs .checklist > * {
    flex: none !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    scroll-snap-align: none !important;
  }

  .table-scroll::after,
  .table-wrap::after {
    display: none !important;
    content: none !important;
  }

  .table-scroll,
  .table-wrap {
    position: relative;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }
}

/* UI priority and visa tab polish */
.route-mark {
  font-size: 22px;
  background: none;
  padding: 0;
  min-width: unset;
  border-radius: 0;
  line-height: 1;
}

.visa-tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 14px;
}

.visa-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--orange);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.visa-tab.active {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

.visa-compare-table table {
  min-width: 0;
}

@media (max-width: 540px) {
  .visa-tab-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .visa-tab-nav::-webkit-scrollbar {
    height: 0;
  }

  .visa-tab {
    flex: 0 0 auto;
  }

  .visa-compare-table table {
    width: 100%;
    min-width: 0;
  }

  .visa-compare-table th:first-child,
  .visa-compare-table td:first-child {
    width: 38%;
  }
}
