:root {
  color-scheme: light;
  --po-bg: #ffffff;
  --po-panel: #f8fafc;
  --po-panel-strong: #eef2f7;
  --po-line: #d9e1ea;
  --po-line-soft: #edf2f7;
  --po-text: #111827;
  --po-muted: #5b6675;
  --po-accent: #0f766e;
  --po-accent-soft: #e6fffb;
  --po-group-a: #ffffff;
  --po-group-b: #f6f9fc;
  --po-group-start: #eef8f7;
  --po-group-start-b: #eef3f8;
  --po-group-line: rgba(15, 118, 110, 0.55);
  --po-section-bg: #eaf7f5;
  --po-section-border: rgba(15, 118, 110, 0.28);
  --po-double-bg: #fff4cf;
  --po-double-bg-hover: #ffec99;
  --po-double-head-bg: #7c4a03;
  --po-double-text: #3b2a05;
  --po-double-head-text: #fff7d6;
  --po-double-border: rgba(180, 83, 9, 0.42);
  --po-plan-bg: #ecfdf5;
  --po-plan-text: #047857;
  --po-plan-border: rgba(5, 150, 105, 0.32);
  --po-danger: #b91c1c;
  --po-radius: 8px;
  --po-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --po-bg: #0f172a;
  --po-panel: #172033;
  --po-panel-strong: #1e293b;
  --po-line: #334155;
  --po-line-soft: #263448;
  --po-text: #e5e7eb;
  --po-muted: #a7b0be;
  --po-accent: #2dd4bf;
  --po-accent-soft: rgba(45, 212, 191, 0.12);
  --po-group-a: #0f172a;
  --po-group-b: #121c30;
  --po-group-start: #17333d;
  --po-group-start-b: #18263a;
  --po-group-line: rgba(45, 212, 191, 0.62);
  --po-section-bg: #112f3a;
  --po-section-border: rgba(45, 212, 191, 0.34);
  --po-double-bg: rgba(245, 158, 11, 0.18);
  --po-double-bg-hover: rgba(245, 158, 11, 0.28);
  --po-double-head-bg: #4a3413;
  --po-double-text: #fde68a;
  --po-double-head-text: #fef3c7;
  --po-double-border: rgba(251, 191, 36, 0.42);
  --po-plan-bg: rgba(16, 185, 129, 0.14);
  --po-plan-text: #a7f3d0;
  --po-plan-border: rgba(52, 211, 153, 0.3);
  --po-danger: #fca5a5;
  --po-shadow: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--po-bg);
  color: var(--po-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.po-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--po-line);
  background: var(--po-bg);
}

.po-page-header h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.po-page-header p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--po-muted);
}

.po-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.po-header-actions a,
.po-header-actions button,
.po-source-tabs button,
.po-view-tab {
  min-height: 34px;
  border: 1px solid var(--po-line);
  border-radius: var(--po-radius);
  background: var(--po-panel);
  color: var(--po-text);
  text-decoration: none;
  padding: 7px 11px;
  cursor: pointer;
}

.po-header-actions a:hover,
.po-header-actions button:hover,
.po-source-tabs button:hover,
.po-view-tab:hover {
  border-color: var(--po-accent);
}

.po-shell {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: 14px 18px 44px;
}

.po-toolbar {
  display: grid;
  grid-template-columns: auto minmax(180px, 420px) 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--po-line);
  border-radius: var(--po-radius);
  background: var(--po-panel);
  box-shadow: var(--po-shadow);
}

.po-search-label {
  color: var(--po-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

#po-search {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--po-line);
  border-radius: var(--po-radius);
  background: var(--po-bg);
  color: var(--po-text);
  padding: 8px 10px;
  outline: none;
}

#po-search:focus {
  border-color: var(--po-accent);
  box-shadow: 0 0 0 3px var(--po-accent-soft);
}

.po-view-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.po-view-tab[aria-selected="true"],
.po-source-tabs button[aria-selected="true"] {
  border-color: var(--po-accent);
  background: var(--po-accent-soft);
  color: var(--po-text);
  font-weight: 800;
}

.po-check {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: var(--po-muted);
  white-space: nowrap;
}

.po-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--po-accent);
}

.po-source-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 12px 2px 4px;
  scrollbar-width: thin;
}

.po-source-tabs button {
  white-space: nowrap;
}

.po-status-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 10px;
  color: var(--po-muted);
  font-size: 0.88rem;
}

.po-status-row p {
  margin: 0;
}

.po-content {
  min-height: 260px;
}

.po-table-wrap {
  overflow: auto;
  border: 1px solid var(--po-line);
  border-radius: var(--po-radius);
  background: var(--po-bg);
  box-shadow: var(--po-shadow);
}

.po-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
}

.po-table th,
.po-table td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--po-line-soft);
  vertical-align: top;
  text-align: start;
}

.po-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--po-panel-strong);
  color: var(--po-muted);
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.po-pricing-table th.po-double-head {
  background: var(--po-double-head-bg);
  color: var(--po-double-head-text);
  box-shadow: inset 1px 0 0 var(--po-double-border), inset -1px 0 0 var(--po-double-border);
}

.po-table tbody tr.po-price-row.po-hotel-band-a td {
  background: var(--po-group-a);
}

.po-table tbody tr.po-price-row.po-hotel-band-b td {
  background: var(--po-group-b);
}

.po-table tbody tr.po-price-row:hover td,
.po-table tbody tr.po-section-row:hover td {
  background: var(--po-panel-strong);
}

.po-pricing-table td.po-double-cell {
  background: var(--po-double-bg) !important;
  color: var(--po-double-text);
  font-weight: 900;
  box-shadow: inset 1px 0 0 var(--po-double-border), inset -1px 0 0 var(--po-double-border);
}

.po-pricing-table tr.po-price-row:hover td.po-double-cell {
  background: var(--po-double-bg-hover) !important;
}

.po-section-row td {
  border-top: 8px solid var(--po-bg);
  border-bottom: 1px solid var(--po-section-border);
  padding: 0;
  background: var(--po-section-bg);
}

.po-section-row:first-child td {
  border-top: 0;
}

.po-section-cell {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 9px 12px 9px 15px;
  box-shadow: inset 5px 0 0 var(--po-accent);
}

.po-section-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 10px;
  font-size: 0.98rem;
  font-weight: 850;
  line-height: 1.25;
  color: var(--po-text);
}

.po-section-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: var(--po-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.po-section-stats {
  justify-content: flex-end;
}

.po-section-stat {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--po-section-border);
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--po-bg);
  white-space: nowrap;
}

.po-num,
.po-market,
.po-date,
.po-updated {
  white-space: nowrap;
}

.po-num {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.po-room-plan {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.po-room-main {
  font-weight: 700;
}

.po-plan-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid var(--po-plan-border);
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--po-plan-bg);
  color: var(--po-plan-text);
  font-size: 0.74rem;
  font-weight: 850;
  white-space: nowrap;
}

.po-hotel-name {
  min-width: 190px;
  font-weight: 800;
}

.po-hotel-title {
  display: block;
  line-height: 1.35;
}

.po-hotel-start .po-hotel-title {
  font-size: 0.92rem;
}

.po-hotel-continued .po-hotel-title {
  color: var(--po-muted);
  font-weight: 650;
}

.po-hotel-subline {
  display: block;
  margin-top: 2px;
  color: var(--po-muted);
  font-size: 0.73rem;
  font-weight: 600;
}

.po-muted {
  color: var(--po-muted);
}

.po-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid var(--po-line);
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--po-panel);
  color: var(--po-muted);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.po-policy-table .po-policy-cell {
  min-width: 380px;
  max-width: 920px;
  white-space: pre-wrap;
}

.po-empty,
.po-loading,
.po-error {
  border: 1px solid var(--po-line);
  border-radius: var(--po-radius);
  background: var(--po-panel);
  color: var(--po-muted);
  padding: 28px 18px;
  text-align: center;
}

.po-error {
  color: var(--po-danger);
}

.po-error code {
  color: var(--po-text);
}

.po-policy-missing {
  color: var(--po-muted);
  font-style: italic;
}

@media print {
  .po-page-header,
  .po-toolbar,
  .po-source-tabs {
    display: none;
  }

  .po-shell {
    padding: 0;
  }

  .po-table-wrap {
    border: none;
    overflow: visible;
  }

  .po-table th {
    position: static;
  }
}

@media (max-width: 900px) {
  .po-page-header {
    flex-direction: column;
  }

  .po-header-actions {
    justify-content: flex-start;
  }

  .po-toolbar {
    grid-template-columns: 1fr;
  }

  .po-search-label {
    display: none;
  }

  .po-check {
    justify-content: flex-start;
  }

  .po-status-row {
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 13px;
  }

  .po-page-header {
    padding: 16px;
  }

  .po-shell {
    padding-left: 10px;
    padding-right: 10px;
  }
}
