/* Tripzant — travel panel (inherits site light/dark theme) */

.tripzant-widget {
  --tz-ink: var(--ink);
  --tz-surface: var(--card);
  --tz-surface-2: var(--card);
  --tz-well: var(--card);
  --tz-panel: var(--card);
  --tz-line: var(--line);
  --tz-text: var(--text);
  --tz-muted: var(--muted);
  --tz-cyan: var(--red);
  --tz-blue: var(--red);
  --tz-green: var(--green);
  --tz-amber: var(--orange);
  --tz-accent-soft: var(--soft-red);
  --tz-input-bg: var(--card);
  --tz-input-focus: var(--soft-red);
  --tz-on-accent: #fff;
  --tz-radius: 22px;
  --tz-ease: var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  color: var(--tz-text);
  color-scheme: inherit;
  border-radius: var(--tz-radius);
  border: 1px solid var(--tz-line);
  padding: 0;
  box-shadow: var(--shadow);
  font-family: var(--font-ui), "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.4;
  box-sizing: border-box;
  background:
    radial-gradient(120% 80% at 100% -10%, color-mix(in srgb, var(--red) 10%, transparent), transparent 42%),
    var(--tz-panel);
}

/* Light theme: keep Tripzant surfaces white (not grey) */
html[data-theme="light"] .tripzant-widget,
html:not([data-theme]) .tripzant-widget {
  --tz-surface: #ffffff;
  --tz-surface-2: #ffffff;
  --tz-well: #ffffff;
  --tz-panel: #ffffff;
  --tz-input-bg: #ffffff;
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] .tripzant-widget {
    --tz-surface: #ffffff;
    --tz-surface-2: #ffffff;
    --tz-well: #ffffff;
    --tz-panel: #ffffff;
    --tz-input-bg: #ffffff;
  }
}

.tripzant-widget::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--tz-text) 4%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--tz-text) 4%, transparent) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

.tripzant-widget > * {
  position: relative;
  z-index: 1;
}

.tz-anchor {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Top bar */
.tz-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 16px 6px;
  flex: 0 0 auto;
}

.tz-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.tz-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--soft-red);
  border: 1px solid color-mix(in srgb, var(--red) 35%, var(--tz-line));
  color: var(--red);
  font-size: 16px;
  box-shadow: var(--shadow-sm);
}

.tz-brand-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.tz-header h3,
.tz-brand-copy h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.tz-header-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding-left: 48px; /* align under title text beside plane icon */
  box-sizing: border-box;
}

.tz-header p,
.tz-brand-copy p,
.tz-header-sub p {
  margin: 0;
  color: var(--tz-muted);
  font-size: 11px;
  font-weight: 600;
  min-width: 0;
}

.tz-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--green) 28%, var(--tz-line));
  color: var(--tz-green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

.tz-live-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tz-green);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 45%, transparent);
  animation: tz-pulse 1.8s ease-in-out infinite;
  font-style: normal;
}

@keyframes tz-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 40%, transparent); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

.amadeus-logo {
  display: none;
}

/* Mode switch */
.tz-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 16px 8px;
  padding: 3px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--tz-line);
  flex: 0 0 auto;
}

.tz-tab {
  position: relative;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--tz-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 750;
  padding: 8px 12px;
  cursor: pointer;
  transition: color 0.18s var(--tz-ease), background 0.18s var(--tz-ease), transform 0.18s var(--tz-ease);
}

.tz-tab:hover { color: var(--tz-text); }

.tz-tab.active {
  background: var(--chrome);
  color: var(--chrome-text);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--chrome) 40%, var(--tz-line)),
    var(--shadow-sm);
}

.tz-tab {
  position: relative;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--tz-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 750;
  padding: 10px 12px;
  cursor: pointer;
  transition: color 0.18s var(--tz-ease), background 0.18s var(--tz-ease), transform 0.18s var(--tz-ease);
}

.tz-tab:hover { color: var(--tz-text); }

.tz-tab.active {
  background: var(--chrome);
  color: var(--chrome-text);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--chrome) 40%, var(--tz-line)),
    var(--shadow-sm);
}

/* Main panels — grow to fill leftover space above tools */
.tz-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 14px;
  overflow: hidden;
  position: relative;
  z-index: 3;
}

.tz-tab-panel {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.tz-tab-panel.active {
  display: flex;
  flex-direction: column;
  animation: tz-fade 0.28s var(--tz-ease);
}

@keyframes tz-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.tz-flight-card,
.tz-hotel-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--tz-line);
  overflow: hidden;
  isolation: isolate;
}

.tz-top-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100% - 48px);
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

/* Prefer showing the route form before trend/results when space is tight */
.tz-top-scroll > .tz-core {
  flex: 0 0 auto;
}

.tz-top-scroll > .tz-price-trend,
.tz-top-scroll > .tz-below {
  flex: 0 0 auto;
}

.tz-core {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: visible;
}

.tz-search-btn {
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--chrome) 0%, color-mix(in srgb, var(--chrome) 78%, #000) 100%);
  color: var(--chrome-text);
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  box-sizing: border-box;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--tz-ease), filter 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  z-index: 5;
}

.tz-search-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: var(--shadow);
}

.tz-search-btn.is-loading { opacity: 0.75; cursor: wait; }

.tz-search-btn .tz-btn-arrow {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  font-size: 15px;
  flex-shrink: 0;
  color: var(--chrome-text);
}

.tz-search-btn-hotel {
  background: linear-gradient(135deg, var(--chrome), color-mix(in srgb, var(--chrome) 78%, #000));
}

/* Results sit under the graph (inside top scroll); Search stays pinned below */
.tz-below {
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: visible;
  padding: 0;
  position: relative;
  z-index: 0;
}

.tz-results-scroll {
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding: 0 2px 2px 0;
}

.tz-hotel-card > .tz-below {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
}

.tz-hotel-card > .tz-below .tz-results-scroll,
.tz-hotel-card .tz-top-scroll > .tz-below .tz-results-scroll {
  flex: 0 0 auto;
  overflow: visible;
}

.tz-extras { display: none !important; }

.tz-scroll {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  outline: none;
}

/* Only reveal when this scroll panel itself is hovered/focused */
.tz-scroll:hover,
.tz-scroll:focus,
.tz-scroll:focus-within {
  scrollbar-color: color-mix(in srgb, var(--red) 55%, var(--muted)) var(--tz-well);
}

.tz-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.tz-scroll::-webkit-scrollbar-button,
.tz-scroll::-webkit-scrollbar-button:start:decrement,
.tz-scroll::-webkit-scrollbar-button:end:increment,
.tz-scroll::-webkit-scrollbar-button:single-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
  border: 0 !important;
}

.tz-scroll::-webkit-scrollbar-corner {
  background: transparent;
}

.tz-scroll::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
  margin: 2px 0;
}

.tz-scroll::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  min-height: 28px;
}

.tz-scroll:hover::-webkit-scrollbar-track,
.tz-scroll:focus::-webkit-scrollbar-track,
.tz-scroll:focus-within::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.2);
}

.tz-scroll:hover::-webkit-scrollbar-thumb,
.tz-scroll:focus::-webkit-scrollbar-thumb,
.tz-scroll:focus-within::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--red) 65%, var(--muted));
  border: 2px solid transparent;
  background-clip: padding-box;
}

.tz-scroll:hover::-webkit-scrollbar-thumb:hover,
.tz-scroll:focus-within::-webkit-scrollbar-thumb:hover {
  background: var(--red);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Hotels tab: always-visible custom scrollbar */
#tz-panel-hotels .tz-scroll,
#tz-panel-hotels .tz-top-scroll,
#tz-panel-hotels .tz-results-scroll {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--red) 60%, var(--muted)) color-mix(in srgb, var(--tz-line) 70%, transparent);
}

#tz-panel-hotels .tz-scroll::-webkit-scrollbar-track,
#tz-panel-hotels .tz-top-scroll::-webkit-scrollbar-track,
#tz-panel-hotels .tz-results-scroll::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--tz-line) 55%, transparent);
  border-radius: 999px;
  margin: 4px 0;
}

#tz-panel-hotels .tz-scroll::-webkit-scrollbar-thumb,
#tz-panel-hotels .tz-top-scroll::-webkit-scrollbar-thumb,
#tz-panel-hotels .tz-results-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--red) 60%, var(--muted));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  min-height: 28px;
}

#tz-panel-hotels .tz-scroll::-webkit-scrollbar-thumb:hover,
#tz-panel-hotels .tz-top-scroll::-webkit-scrollbar-thumb:hover,
#tz-panel-hotels .tz-results-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--red);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Route map — FROM / plane / TO on one aligned row */
.tz-plane-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 4px 2px 2px;
}

.tz-plane-line > div { min-width: 0; }

.tz-label {
  display: block;
  color: var(--tz-cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.tz-plane-line strong,
#trip-from-code {
  display: block;
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tz-plane-line small,
#trip-from-name {
  display: block;
  margin-top: 2px;
  color: var(--tz-muted);
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tz-right { text-align: right; }

.tz-airport-field {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 2px;
  align-items: flex-end;
  justify-content: flex-start;
  min-width: 0;
}

.tz-airport-input,
.tz-date-input,
.tz-price-alert-input,
.tz-alert-target-input {
  border: 1px solid var(--tz-line);
  background: var(--tz-input-bg);
  color: var(--tz-text);
  border-radius: 12px;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.tz-airport-input {
  width: auto;
  max-width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tz-airport-input.code {
  flex: 0 0 auto;
  max-width: 100%;
  width: 4.5ch;
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 850;
  letter-spacing: -0.04em;
  text-align: right;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--tz-text);
  padding: 0;
}

.tz-airport-input.name {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 140px;
  width: 100%;
  font-size: 11px;
  font-weight: 600;
  color: var(--tz-muted);
  text-align: right;
  line-height: 1.2;
  padding: 0;
}

.tz-airport-input:focus,
.tz-date-input:focus,
.tz-price-alert-input:focus,
.tz-alert-target-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--red) 55%, var(--tz-line));
  background: var(--tz-input-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent);
}

/* Flight TO fields mirror FROM (plain type, not boxed inputs) */
.tz-plane-line .tz-airport-input.code:focus,
.tz-plane-line .tz-airport-input.name:focus {
  border: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--red) 55%, transparent);
}

.tz-airport-input.hotel-city {
  max-width: 100%;
  width: 100%;
  font-size: 16px;
  font-weight: 750;
  text-align: left;
  text-transform: none;
  padding: 10px 12px;
  border: 1px solid var(--tz-line);
  border-radius: 12px;
  background: var(--tz-input-bg);
}

.tz-airport-input.hotel-city:focus {
  border-color: color-mix(in srgb, var(--red) 55%, var(--tz-line));
  background: var(--tz-input-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent);
}

.tz-airport-input::placeholder {
  color: color-mix(in srgb, var(--tz-muted) 70%, transparent);
}

.tz-plane {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--tz-on-accent);
  background: linear-gradient(145deg, var(--red), var(--red-deep));
  border: 0;
  box-shadow: var(--shadow-sm);
  font-size: 15px;
  position: relative;
  margin-bottom: 4px;
}

.tz-plane:before,
.tz-plane:after {
  content: "";
  position: absolute;
  top: 50%;
  width: 18px;
  border-top: 1.5px dashed color-mix(in srgb, var(--red) 45%, transparent);
}

.tz-plane:before { right: calc(100% + 4px); }
.tz-plane:after { left: calc(100% + 4px); }

/* Meta chips */
.tz-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.tz-details > div {
  min-width: 0;
  padding: 6px 7px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--tz-line);
}

.tz-details-fare {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.tz-details-fare span {
  margin-bottom: 0;
}

.tz-details-fare strong {
  margin-left: auto;
  font-size: 14px;
}

.tz-details-fare small {
  width: 100%;
}

.tz-details span {
  display: block;
  color: var(--tz-muted);
  font-size: 9px;
  font-weight: 750;
  margin-bottom: 2px;
}

.tz-details strong {
  display: block;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
}

.tz-details small {
  color: var(--tz-muted);
  font-size: 10px;
}

.tz-price {
  color: var(--tz-green) !important;
  font-size: 14px !important;
  font-weight: 850 !important;
}

.tz-date-input {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 6px;
  font-size: 11px;
  font-weight: 700;
  color-scheme: light;
  margin-top: 3px;
}

.tz-date-input::-webkit-calendar-picker-indicator {
  opacity: 1;
  cursor: pointer;
  width: 1.15em;
  height: 1.15em;
  padding: 0;
  margin: 0 0 0 4px;
}

html[data-theme="dark"] .tz-date-input,
html[data-theme="dark"] .tz-price-alert-input {
  color-scheme: dark;
}

html[data-theme="dark"] .tz-date-input::-webkit-calendar-picker-indicator,
html[data-theme="dark"] .tz-price-alert-input::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.35);
  opacity: 1;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .tz-date-input,
  html:not([data-theme="light"]) .tz-price-alert-input {
    color-scheme: dark;
  }

  html:not([data-theme="light"]) .tz-date-input::-webkit-calendar-picker-indicator,
  html:not([data-theme="light"]) .tz-price-alert-input::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.35);
    opacity: 1;
  }
}

.tz-flight-date-inline {
  margin-top: 3px;
  margin-bottom: 0;
}

#trip-flight-date-label {
  display: none;
}

/* Trend — compact so tools row stays fully visible */
.tz-price-trend {
  flex: 0 0 auto;
  position: relative;
  z-index: 0;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--red) 18%, var(--tz-line));
  background:
    linear-gradient(180deg, var(--soft-red), transparent 78%);
  padding: 6px 8px 5px;
  color: var(--tz-text);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.tz-price-trend.is-highlight {
  border-color: color-mix(in srgb, var(--red) 55%, var(--tz-line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 28%, transparent);
}

.trend-chart {
  width: 100%;
  height: 42px;
  margin-top: 2px;
  display: block;
  overflow: visible;
  color: var(--red);
}

#trip-flight-trend-line {
  stroke: var(--red) !important;
}

#trip-flight-trend-dots circle {
  fill: var(--red);
}

#trip-flight-trend-dots circle[fill="var(--green)"],
#trip-flight-trend-dots circle.is-lowest {
  fill: var(--green);
}

.trend-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--tz-text);
  font-weight: 750;
}

.trend-up,
.trend-down,
.trend-flat,
.trend-badge {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
}

.trend-up { color: var(--red); background: var(--soft-red); }
.trend-down { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.trend-flat { color: var(--tz-muted); background: var(--tz-well); }

.trend-footer {
  display: flex;
  justify-content: space-between;
  color: var(--tz-muted);
  font-size: 10px;
  font-weight: 700;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

/* CTA styles moved above with pinned search layout */

/* Hotels */
.tz-hotel-destination {
  padding-bottom: 2px;
}

.tz-hotel-field {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0;
  margin-top: 4px;
  min-width: 0;
}

.tz-hotel-field .hotel-city {
  width: auto;
  flex: 0 1 auto;
  min-width: 4ch;
  max-width: calc(100% - 6rem);
  field-sizing: content;
}

.tz-hotel-field small {
  color: var(--tz-muted);
  font-size: 13px;
  font-weight: 650;
  min-width: 0;
}

.tz-hotel-field small:not(:empty)::before {
  content: ", ";
}

.tz-hotel-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tz-hotel-date { min-width: 0; }

.tz-hotel-guests {
  padding: 12px;
  border: 1px solid var(--tz-line);
  border-radius: 14px;
  background: var(--tz-panel);
}

.tz-hotel-guests-value {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.tz-hotel-guests-value strong {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.tz-hotel-guests-value small {
  color: var(--tz-muted);
  font-size: 10px;
}

.tz-hotel-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.tz-hotel-stat {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 10px;
  background: var(--tz-panel);
  border: 1px solid var(--tz-line);
}

.tz-hotel-stat > span {
  display: block;
  color: var(--tz-muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.tz-hotel-stat strong {
  display: block;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
}

.tz-hotel-stat strong.tz-price {
  color: var(--tz-green);
  font-size: 13px;
}

.tz-hotel-stat strong.tz-price em {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: color-mix(in srgb, var(--green) 75%, var(--tz-muted));
}

.tz-hotel-stat small {
  display: block;
  color: var(--tz-muted);
  font-size: 9px;
  margin-top: 2px;
}

.tz-hotel-results {
  display: grid;
  gap: 6px;
}

.tz-extras .tz-hotel-results {
  max-height: none;
}

.tz-hotel-result {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  padding: 9px 10px;
  border: 1px solid var(--tz-line);
  border-radius: 12px;
  background: var(--tz-panel);
}

.tz-hotel-result-name {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--tz-text);
}

.tz-hotel-result-meta {
  font-size: 10px;
  color: var(--tz-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  align-self: center;
}

.tz-hotel-result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.tz-hotel-result-price {
  font-size: 11px;
  font-weight: 800;
  color: var(--tz-green);
  text-align: right;
  white-space: nowrap;
}

.tz-hotel-result-price small {
  font-size: 9px;
  color: color-mix(in srgb, var(--green) 75%, var(--tz-muted));
  font-weight: 600;
}

.tz-result-history-btn {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--red) 45%, var(--tz-line));
  background: var(--tz-accent-soft);
  color: var(--red);
  border-radius: 999px;
  width: 26px;
  height: 26px;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.tz-result-history-btn svg {
  display: block;
}

.tz-result-history-btn:hover {
  background: color-mix(in srgb, var(--red) 16%, var(--tz-panel));
  border-color: var(--red);
  transform: translateY(-1px);
}

.tz-result-history-btn:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.tz-hotel-alert {
  border-color: color-mix(in srgb, var(--red) 35%, var(--tz-line));
  background: var(--tz-accent-soft);
}

.tz-hotel-loading {
  letter-spacing: 2px;
  opacity: 0.7;
}

/* Tools — one reserved chip row; expand only when a panel is open */
.tz-tools-zone {
  flex: 0 0 auto;
  height: auto;
  min-height: 56px;
  max-height: 64px;
  overflow-x: hidden;
  overflow-y: hidden;
  padding: 6px 14px 0;
  position: relative;
  z-index: 1;
  background: var(--tz-panel);
  border-top: 1px solid var(--tz-line);
}

.tripzant-widget.tz-tools-open .tz-tools-zone {
  min-height: 56px;
  max-height: min(240px, 38%);
  overflow-y: auto;
}

.tz-tools {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  outline: none;
}

.tz-tools:hover,
.tz-tools:focus,
.tz-tools:focus-within {
  scrollbar-color: color-mix(in srgb, var(--red) 55%, var(--muted)) var(--tz-well);
}

.tz-tools::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.tz-tools::-webkit-scrollbar-button,
.tz-tools::-webkit-scrollbar-button:start:decrement,
.tz-tools::-webkit-scrollbar-button:end:increment,
.tz-tools::-webkit-scrollbar-button:single-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
  border: 0 !important;
}

.tz-tools::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
}

.tz-tools::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}

.tz-tools:hover::-webkit-scrollbar-thumb,
.tz-tools:focus::-webkit-scrollbar-thumb,
.tz-tools:focus-within::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--red) 65%, var(--muted));
}

.tz-tools:hover::-webkit-scrollbar-track,
.tz-tools:focus-within::-webkit-scrollbar-track {
  background: var(--tz-well);
}

/* Keep one horizontal chip row (scroll sideways) when browsing tools */
.tz-tools.is-expanded {
  flex-wrap: nowrap;
  overflow-x: auto;
}

/* Open panel drops onto its own full-width row under the chips */
.tripzant-widget.tz-tools-open .tz-tools {
  flex-wrap: wrap;
  overflow-x: hidden;
  overflow-y: visible;
}

.tz-tools:not(.is-expanded) .tz-tool-extra {
  display: none !important;
}

.tz-tool-item {
  display: grid;
  gap: 0;
  position: relative;
  min-width: 126px;
  max-width: 158px;
  flex: 0 0 auto;
}

.tz-price-alert-item {
  min-width: 132px;
  grid-column: auto;
}

.tz-tools-more {
  flex: 0 0 auto;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 96px;
  padding: 7px 10px;
  border: 1px dashed color-mix(in srgb, var(--red) 40%, var(--tz-line));
  border-radius: 12px;
  background: transparent;
  color: var(--tz-text);
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.tz-tools-more:hover,
.tz-tools-more[aria-expanded="true"] {
  border-style: solid;
  border-color: color-mix(in srgb, var(--red) 45%, var(--tz-line));
  background: var(--tz-accent-soft);
  color: var(--red);
}

.tz-tools-more em {
  font-style: normal;
  font-size: 12px;
  line-height: 1;
  transition: transform 0.15s ease;
}

.tz-tools-more[aria-expanded="true"] em {
  transform: rotate(180deg);
}

.tz-tool-item.active,
.tz-price-alert-item.active {
  max-width: 100%;
  flex: 1 1 100%;
  min-width: 100%;
  order: 99;
}

.tz-tool-content {
  display: grid;
  gap: 6px;
  padding: 8px 10px 10px;
  border: 1px solid color-mix(in srgb, var(--red) 28%, var(--tz-line));
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: var(--tz-well);
  font-size: 11px;
  color: var(--tz-muted);
  max-height: min(140px, 28vh);
  overflow-y: auto;
}

.tz-tool-content[hidden] { display: none !important; }

.tz-tool {
  color: inherit;
  text-decoration: none;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--tz-line);
  background: var(--card);
  border-radius: 12px;
  padding: 7px 8px;
  width: 100%;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tz-tool:hover,
.tz-tool.active {
  border-color: color-mix(in srgb, var(--red) 40%, var(--tz-line));
  background: var(--tz-accent-soft);
  transform: none;
}

.tz-tool em {
  color: var(--tz-muted);
  font-style: normal;
  font-size: 13px;
  transition: transform 0.15s ease;
}

.tz-tool-item.active .tz-tool,
.tz-price-alert-item.active .tz-tool {
  border-radius: 12px 12px 0 0;
  border-bottom-color: transparent;
}

.tz-tool-item.active .tz-tool em,
.tz-price-alert-item.active .tz-tool em {
  transform: rotate(90deg);
}

.tz-tool strong {
  display: block;
  font-size: 10px;
  font-weight: 800;
}

.tz-tool span {
  display: none;
}

.tool-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
}

.tool-icon.yellow { background: color-mix(in srgb, var(--yellow) 18%, transparent); color: var(--orange); }
.tool-icon.green { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.tool-icon.red { background: var(--soft-red); color: var(--red); }
.tool-icon.purple,
.tool-icon.blue { background: var(--soft-red); color: var(--red); }

.tz-tool-content[hidden] { display: none !important; }

.tz-tool-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--tz-line);
  border-radius: 10px;
  background: var(--tz-panel);
}

.tz-tool-row strong { color: var(--tz-text); font-size: 11px; }
.tz-tool-row span { color: var(--tz-muted); font-size: 10px; }

.tz-tool-row.is-best {
  border-color: color-mix(in srgb, var(--green) 40%, var(--tz-line));
  background: color-mix(in srgb, var(--green) 10%, var(--tz-panel));
}

.tz-tool-row.is-best strong { color: var(--tz-green); }

.tz-tool-btn {
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: var(--tz-on-accent);
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 850;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
}

.tz-tool-btn.secondary {
  background: var(--tz-panel);
  color: var(--tz-text);
  border: 1px solid var(--tz-line);
}

.tz-tool-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.tz-tool-note {
  font-size: 10px;
  color: var(--tz-muted);
  line-height: 1.35;
}

.tz-tool-switch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.tz-tool-switch label { display: grid; gap: 1px; }
.tz-tool-switch strong { font-size: 11px; color: var(--tz-text); }
.tz-tool-switch small { font-size: 10px; color: var(--tz-muted); }

.tz-price-alert-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  color: var(--tz-text);
  font-size: 11px;
}

.tz-price-alert-input {
  flex: 1;
  max-width: 130px;
  padding: 6px 8px;
  font-size: 11px;
}

.tz-price-alert-target {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--tz-green);
  font-weight: 800;
}

.tz-price-alert-item.is-collapsed { display: none !important; }

.switch input { display: none; }

.switch span {
  width: 36px;
  height: 20px;
  background: var(--red);
  border-radius: 999px;
  display: block;
  position: relative;
}

.switch span:after {
  content: "";
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  right: 3px;
  top: 3px;
}

.switch input:not(:checked) + span { background: var(--muted); }
.switch input:not(:checked) + span:after { left: 3px; right: auto; }

.tz-alert-currency,
.tz-alert-or-lower {
  font-size: 10px;
  color: var(--tz-green);
  font-weight: 700;
}

.tz-alert-target-input {
  width: 56px;
  padding: 5px 6px;
  font-size: 11px;
  font-weight: 800;
}

.tz-alert-status {
  margin: 4px 0 0;
  font-size: 10px;
  line-height: 1.35;
  color: var(--tz-amber);
}

/* Footer */
.tz-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 6px 16px 8px;
  color: var(--tz-muted);
  font-size: 10px;
  border-top: 0;
  margin-top: 0;
  background: var(--tz-panel);
}

.tz-footer strong {
  color: var(--red);
  font-size: 12px;
  letter-spacing: -0.02em;
}

.tz-footer .dot { color: var(--tz-muted); }

.tz-header small {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .tz-live-pill i,
  .tz-tab-panel.active,
  .tz-search-btn,
  .tz-tool {
    animation: none;
    transition: none;
  }
}

@media (max-width: 480px) {
  .tz-header-sub {
    padding-left: 0;
  }

  .tz-details {
    grid-template-columns: 1fr;
  }

  .tz-tool-item,
  .tz-price-alert-item {
    min-width: 120px;
  }
}
