/* Android / iOS touch layout. Load after styles.css and extras.css. */
.mobile-tabs,
.mobile-wordmark {
  display: none;
}

@media (max-width: 620px) {
  html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(84px + env(safe-area-inset-top, 0px));
  }

  body {
    font-size: 14px;
    line-height: 1.7;
    overscroll-behavior-y: none;
  }

  button,
  input,
  select,
  summary,
  .check-row {
    touch-action: manipulation;
  }

  .sidebar,
  .sidebar.open,
  .mobile-menu,
  .topbar .breadcrumb,
  .topbar .today-label,
  .topbar .top-divider,
  .topbar .avatar,
  .topbar .traveler-label {
    display: none;
  }

  .app-shell {
    margin-left: 0;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    min-height: 65px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) max(17px, env(safe-area-inset-right, 0px)) 10px max(17px, env(safe-area-inset-left, 0px));
    gap: 12px;
    background: #fcfdfbf5;
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }

  .mobile-wordmark {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--green);
    white-space: nowrap;
  }

  .mobile-wordmark .brand-symbol {
    width: 29px;
    height: 31px;
    border-radius: 9px 9px 9px 3px;
    font-size: 29px;
    letter-spacing: 0;
  }

  .topbar-right {
    margin-left: auto;
    gap: 9px;
  }

  .topbar .install-app {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    gap: 6px;
    margin-left: auto;
    padding: 8px 13px;
    border: 1px solid #dbe5d5;
    border-radius: 9px;
    background: #f0f5ec;
    color: #365d43;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
  }

  .topbar .install-app .icon {
    width: 17px;
    height: 17px;
  }

  main {
    width: 100%;
    max-width: 100%;
    padding: 24px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  }

  .view {
    min-width: 0;
  }

  h1 {
    font-size: clamp(23px, 6.3vw, 30px);
    letter-spacing: -.4px;
    line-height: 1.45;
  }

  .page-heading {
    gap: 12px;
    margin-bottom: 22px;
  }

  .page-heading > div {
    min-width: 0;
  }

  .eyebrow {
    font-size: 8px;
    letter-spacing: 1.4px;
    margin-bottom: 10px;
  }

  .page-heading p {
    font-size: 12px;
    color: #7c8a78;
    line-height: 1.8;
    margin-top: 9px;
  }

  .hero {
    height: 224px;
    border-radius: 14px;
  }

  .hero > img {
    object-position: 57% center;
  }

  .hero-copy {
    left: 21px;
    top: 18px;
  }

  .hero-pill {
    padding: 4px 10px;
    font-size: 10px;
  }

  .hero-copy h2 {
    font-size: clamp(24px, 6.7vw, 30px);
    letter-spacing: 1.5px;
    line-height: 1.6;
    margin-top: 13px;
  }

  .hero-copy p {
    font-size: 10px;
    margin-top: 7px;
  }

  .hero-counter {
    left: 21px;
    bottom: 17px;
    font-size: 8px;
  }

  .hero-place {
    min-height: 44px;
    right: 14px;
    bottom: 13px;
    border-radius: 8px;
    padding: 7px 11px;
    font-size: 11px;
  }

  .hero-place small {
    font-size: 7px;
  }

  .planner-card {
    padding: 22px 17px 0;
    margin-top: 17px;
    border-radius: 14px;
  }

  .card-topline {
    margin-bottom: 22px;
  }

  .card-topline h2 {
    font-size: 15px;
    gap: 9px;
  }

  .form-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 12px;
  }

  .form-grid .field:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }

  .form-grid .field:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
  }

  .form-grid .date-field:nth-child(4) {
    grid-column: 1;
    grid-row: 2;
  }

  .form-grid .date-field:nth-child(5) {
    grid-column: 2;
    grid-row: 2;
  }

  .form-grid .travelers-field {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .swap-button {
    position: absolute;
    top: -64px;
    left: auto;
    right: -6px;
    width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    display: grid;
    place-items: center;
    color: #7d9476;
    border-radius: 50%;
    z-index: 1;
  }

  .swap-button:active {
    background: #edf3e8;
  }

  .swap-button .icon {
    width: 18px;
    height: 18px;
  }

  .field,
  .field .input-wrap,
  .field input,
  .field select {
    min-width: 0;
    min-inline-size: 0;
    max-width: 100%;
  }

  .field > span {
    font-size: 12px;
    margin-bottom: 8px;
    color: #62755c;
  }

  .input-wrap,
  .form-grid .travelers-field .input-wrap {
    width: 100%;
    height: 50px;
    border-radius: 9px;
    padding: 0 10px;
    gap: 7px;
  }

  .input-wrap input,
  .input-wrap input[type="date"],
  .input-wrap select,
  .currency-fields select,
  .base-currency-label select,
  .rates-mini input {
    width: 100%;
    min-width: 0;
    min-inline-size: 0;
    height: 48px;
    font-size: 16px;
    line-height: normal;
    letter-spacing: -.3px;
  }

  .input-wrap input[type="date"] {
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
  }

  .input-wrap input[type="date"]::-webkit-date-and-time-value {
    min-width: 0;
    text-align: left;
  }

  .input-wrap input[type="date"]::-webkit-datetime-edit {
    padding: 0;
  }

  .input-wrap input[type="date"]::-webkit-calendar-picker-indicator {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 0 0 0 2px;
    padding: 0;
  }

  .input-wrap > span .icon {
    width: 17px;
    height: 17px;
  }

  .budget-label {
    font-size: 12px;
    margin: 25px 0 12px;
  }

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

  .budget-option {
    min-height: 112px;
    padding: 13px 7px 11px;
    border-radius: 9px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 9px;
    text-align: center;
  }

  .budget-copy {
    display: block;
    width: 100%;
  }

  .budget-copy strong {
    padding: 0;
    white-space: normal;
    font-size: 12px;
    line-height: 1.6;
    letter-spacing: -.3px;
  }

  .budget-copy small {
    display: block;
    white-space: normal;
    margin-top: 5px;
    font-size: 10px;
    line-height: 1.65;
    letter-spacing: 0;
    color: #7f8b76;
  }

  .radio-mark {
    position: static;
    width: 16px;
    height: 16px;
    margin: 0 auto;
  }

  .budget-option:has(input:checked) .radio-mark {
    box-shadow: inset 0 0 0 3px #fff;
  }

  .extra-options {
    margin-top: 18px;
    font-size: 12px;
  }

  .extra-options summary {
    min-height: 44px;
    gap: 10px;
  }

  .extra-options summary span {
    font-size: 11px;
    flex-shrink: 0;
  }

  .extra-options-content {
    margin-top: 5px;
    padding: 15px 12px;
  }

  .preference-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    margin-bottom: 10px;
  }

  .preference-options label {
    min-height: 40px;
    font-size: 12px;
    gap: 8px;
  }

  .preference-options input {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }

  .base-currency-label {
    display: block;
    font-size: 12px;
  }

  .base-currency-label select {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 0 8px;
    border-radius: 8px;
  }

  .extra-options-content .small-note {
    font-size: 11px;
  }

  .planner-bottom {
    margin-top: 17px;
    padding: 17px 0 18px;
  }

  .planner-bottom > span {
    font-size: 11px;
    line-height: 1.8;
    margin-bottom: 13px;
    flex-wrap: wrap;
  }

  .button,
  .planner-bottom .button {
    min-height: 48px;
    border-radius: 9px;
    font-size: 14px;
    padding: 12px 17px;
  }

  .planner-bottom .button {
    min-height: 52px;
    width: 100%;
    font-weight: 600;
  }

  .section-heading {
    gap: 13px;
    margin-top: 28px;
  }

  .section-heading h2 {
    font-size: 17px;
    line-height: 1.6;
  }

  .section-heading p {
    font-size: 12px;
    color: #7c8a74;
  }

  .section-heading .text-button {
    min-height: 44px;
    padding: 0;
    font-size: 11px;
    white-space: nowrap;
  }

  .text-button {
    min-height: 44px;
    font-size: 12px;
    padding: 9px 0;
  }

  .discovery-grid {
    gap: 11px;
  }

  .destination-card {
    min-height: 220px;
    border-radius: 12px;
  }

  .destination-caption {
    left: 13px;
    right: 13px;
    bottom: 17px;
  }

  .destination-caption strong {
    font-size: 22px;
  }

  .destination-caption strong small {
    font-size: 11px;
    margin-top: 2px;
  }

  .destination-caption > span {
    font-size: 10px;
    line-height: 1.8;
  }

  .card-tag {
    font-size: 10px;
    top: 13px;
    left: 13px;
    padding: 3px 7px;
  }

  .trust-strip {
    gap: 14px 9px;
    padding: 25px 0;
  }

  .trust-strip > span {
    width: calc(50% - 5px);
    gap: 6px;
    font-size: 10px;
  }

  .trust-strip .icon {
    width: 14px;
    height: 14px;
  }

  .page-footer {
    margin: 0 16px;
    padding: 17px 0 10px;
    font-size: 10px;
    gap: 7px 13px;
    line-height: 1.9;
  }

  .footer-brand {
    font-size: 10px;
  }

  .page-footer button {
    min-height: 44px;
    font-size: 11px;
    padding: 6px 0;
  }

  .mobile-tabs {
    position: fixed;
    z-index: 50;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 6px max(7px, env(safe-area-inset-right, 0px)) calc(7px + env(safe-area-inset-bottom, 0px)) max(7px, env(safe-area-inset-left, 0px));
    border-top: 1px solid #dde6d7;
    background: #fcfdfbf7;
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: 0 -4px 22px #1d43290a;
  }

  .mobile-tab {
    min-width: 0;
    min-height: 57px;
    padding: 2px 0 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    border-radius: 10px;
    color: #8b9a81;
    font-size: 11px;
    line-height: 1.5;
    font-weight: 500;
  }

  .mobile-tab > [data-icon] {
    display: grid;
    place-items: center;
    width: 40px;
    height: 28px;
    border-radius: 10px;
  }

  .mobile-tab .icon {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
  }

  .mobile-tab.active,
  .mobile-tab[aria-current="page"] {
    color: var(--green);
    font-weight: 650;
  }

  .mobile-tab.active > [data-icon],
  .mobile-tab[aria-current="page"] > [data-icon] {
    background: #e8f0e2;
  }

  .mobile-tab:active {
    background: #edf2e7;
  }

  #result {
    scroll-margin-top: calc(90px + env(safe-area-inset-top, 0px));
  }

  .result-top {
    display: block;
    margin-top: 7px;
    margin-bottom: 15px;
  }

  .result-top h2 {
    font-size: clamp(21px, 6vw, 27px);
    line-height: 1.6;
    overflow-wrap: anywhere;
  }

  .result-top p {
    font-size: 12px;
    line-height: 1.9;
    margin-top: 6px;
  }

  .result-actions {
    flex-direction: row;
    gap: 10px;
    margin-top: 15px;
  }

  .result-actions .button {
    min-height: 45px;
    flex: 1;
    padding: 9px 10px;
    font-size: 12px;
    border-radius: 8px;
  }

  .result-actions .icon {
    width: 16px;
    height: 16px;
  }

  .result-tabs {
    display: flex;
    max-width: 100%;
    gap: 22px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .result-tabs::-webkit-scrollbar {
    display: none;
  }

  .result-tab {
    flex-shrink: 0;
    min-height: 48px;
    padding: 11px 0;
    font-size: 13px;
  }

  .result-panel {
    min-width: 0;
  }

  .surface {
    min-width: 0;
    border-radius: 12px;
    padding: 22px 19px;
  }

  .surface h2 {
    font-size: 17px;
    line-height: 1.6;
  }

  .small-note,
  .route-note,
  .tip-list,
  .loading-line,
  .summary-card p,
  .summary-card a,
  .rates-mini .small-note {
    font-size: 12px;
    line-height: 1.9;
    color: #7d8d72;
  }

  .inline-notice {
    font-size: 12px;
    line-height: 1.95;
    padding: 16px;
    overflow-wrap: anywhere;
  }

  .source-line {
    font-size: 11px;
    line-height: 1.9;
    gap: 9px 13px;
    overflow-wrap: anywhere;
  }

  .source-line a {
    padding: 4px 0;
    min-height: 32px;
  }

  .day-card {
    border-radius: 12px;
    padding: 20px 17px;
    margin-bottom: 15px;
  }

  .day-heading {
    gap: 12px;
  }

  .day-heading h3 {
    font-size: 15px;
    line-height: 1.65;
  }

  .day-heading p {
    font-size: 11px;
    line-height: 1.8;
    margin-top: 4px;
  }

  .day-number {
    flex-shrink: 0;
  }

  .day-number small {
    font-size: 9px;
  }

  .stops {
    font-size: 13px;
    gap: 8px;
  }

  .stops span {
    padding: 7px 10px;
  }

  .day-detail,
  .day-tip {
    font-size: 12px;
    line-height: 1.95;
  }

  .day-detail {
    margin: 12px 0;
    gap: 9px;
  }

  .day-detail .icon {
    width: 16px;
    height: 16px;
    margin-top: 4px;
  }

  .day-tip {
    padding: 13px;
    border-radius: 8px;
  }

  .summary-card {
    padding: 23px 20px;
    border-radius: 12px;
  }

  .summary-card h3 {
    font-size: 15px;
  }

  .summary-row {
    font-size: 13px;
    margin: 11px 0;
  }

  .summary-card .summary-price {
    font-size: 33px;
  }

  .weather-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }

  .weather-day {
    min-width: 0;
    padding: 19px 12px;
    border-radius: 12px;
  }

  .weather-day p,
  .weather-day .weather-label,
  .weather-day .clothing {
    font-size: 12px;
    line-height: 1.9;
  }

  .weather-day h3 {
    font-size: 24px;
  }

  .weather-day h3 small {
    font-size: 15px;
  }

  .weather-day .weather-symbol {
    font-size: 32px;
  }

  .refresh-button {
    flex-shrink: 0;
    min-height: 44px;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 8px;
  }

  .overseas-card h3 {
    font-size: 16px;
    line-height: 1.8;
  }

  .overseas-card h4 {
    font-size: 14px;
    line-height: 1.8;
  }

  .overseas-card p,
  .overseas-card li,
  .overseas-card a,
  .budget-policy p {
    font-size: 12px;
    line-height: 2;
  }

  .embassy-info {
    padding: 13px;
    border-radius: 8px;
  }

  .budget-table {
    width: 100%;
    table-layout: fixed;
  }

  .budget-table th,
  .budget-table td {
    padding: 14px 8px;
    font-size: 12px;
    overflow-wrap: anywhere;
  }

  .budget-table th:nth-child(1),
  .budget-table td:nth-child(1) {
    width: 25%;
  }

  .budget-table th:nth-child(2),
  .budget-table td:nth-child(2) {
    width: 45%;
  }

  .budget-table th:nth-child(3),
  .budget-table td:nth-child(3) {
    width: 30%;
  }

  .budget-policy h3 {
    font-size: 15px;
  }

  .filter-row {
    gap: 8px;
    margin: 25px 0 21px;
  }

  .filter {
    min-height: 44px;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 8px;
  }

  .filter-row > span {
    width: 100%;
    margin: 3px 0 0;
    font-size: 11px;
  }

  .inspiration-grid {
    gap: 12px;
  }

  .city-tile {
    padding: 21px 14px 15px;
    border-radius: 12px;
  }

  .city-tile .city-meta {
    font-size: 10px;
    letter-spacing: 0;
  }

  .city-tile h3 {
    font-size: 24px;
  }

  .city-tile p {
    font-size: 12px;
    min-height: 44px;
    line-height: 1.85;
  }

  .city-tile .city-bottom {
    display: block;
    font-size: 11px;
    line-height: 1.9;
    padding-top: 12px;
    margin-top: 15px;
  }

  .city-bottom > span:last-child {
    display: block;
    margin-top: 7px;
  }

  .tool-layout {
    margin-top: 25px;
    margin-bottom: 35px;
  }

  .converter .field {
    margin-top: 20px;
  }

  .converter .input-wrap {
    height: 59px;
  }

  .converter .input-wrap input {
    font-size: 26px;
  }

  .currency-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
    gap: 8px;
  }

  .currency-fields select {
    font-size: 16px;
    padding: 0 8px;
  }

  .tool-note p,
  .tool-note li,
  .tool-note a,
  .converter-result {
    font-size: 12px;
    line-height: 2;
  }

  .converted-amount {
    font-size: 29px;
  }

  .checklist-grid {
    gap: 17px;
  }

  #checklist-progress {
    margin-top: 24px;
    gap: 12px;
    font-size: 12px;
  }

  .checklist-group h2 {
    font-size: 17px;
    margin-bottom: 15px;
  }

  .check-row {
    min-height: 62px;
    padding: 17px 0;
    gap: 12px;
  }

  .check-row input {
    width: 21px;
    height: 21px;
    margin-top: 2px;
  }

  .check-row span {
    min-width: 0;
    font-size: 14px;
    line-height: 1.8;
  }

  .check-row small {
    font-size: 12px;
    line-height: 1.9;
    margin-top: 6px;
  }

  .page-heading > .secondary {
    min-height: 44px;
    padding: 8px 11px;
    font-size: 12px;
    border-radius: 8px;
  }

  .saved-card h2 {
    font-size: 23px;
    overflow-wrap: anywhere;
  }

  .saved-card .saved-date {
    font-size: 12px;
  }

  .saved-card p {
    font-size: 13px;
  }

  .saved-card .saved-actions {
    margin-top: 21px;
    gap: 12px;
  }

  .empty-state {
    margin-top: 27px;
    padding: 62px 20px;
  }

  .empty-state h2 {
    font-size: 21px;
    line-height: 1.8;
  }

  .empty-state p {
    font-size: 13px;
    line-height: 1.9;
  }

  dialog {
    width: calc(100vw - 30px);
    max-height: calc(100vh - 44px);
    max-height: calc(100dvh - 44px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    padding: 31px 22px;
    border-radius: 16px;
    overscroll-behavior: contain;
  }

  .dialog-close {
    width: 44px;
    height: 44px;
    top: 6px;
    right: 7px;
  }

  #dialog-content h2 {
    font-size: 23px;
    line-height: 1.6;
    padding-right: 22px;
  }

  .dialog-section h3 {
    font-size: 16px;
  }

  .dialog-section p,
  .dialog-section li {
    font-size: 13px;
    line-height: 2;
  }

  .form-error {
    font-size: 12px;
    padding: 14px;
    line-height: 1.9;
  }

  #toast {
    bottom: calc(91px + env(safe-area-inset-bottom, 0px));
    width: max-content;
    max-width: calc(100vw - 34px);
    font-size: 13px;
    padding: 13px 17px;
    line-height: 1.8;
    text-align: center;
  }
}

@media (max-width: 360px) {
  main {
    padding-left: max(13px, env(safe-area-inset-left, 0px));
    padding-right: max(13px, env(safe-area-inset-right, 0px));
  }

  .planner-card {
    padding-left: 14px;
    padding-right: 14px;
  }

  .form-grid {
    gap: 17px 10px;
  }

  .form-grid .date-field:nth-child(4) {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .form-grid .date-field:nth-child(5) {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .form-grid .travelers-field {
    grid-row: 4;
  }

  .hero-copy h2 {
    font-size: 24px;
    letter-spacing: 1px;
  }

  .hero-copy p {
    display: none;
  }

  .budget-options {
    gap: 6px;
  }

  .budget-option {
    padding-left: 5px;
    padding-right: 5px;
  }

  .budget-copy strong {
    letter-spacing: -.6px;
  }

  .currency-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .currency-fields > .icon {
    display: none;
  }

  .currency-fields .field {
    margin-top: 15px;
  }

  .section-heading .text-button {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-tab,
  .topbar,
  .view,
  #toast {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
