.stx-panel {
  --stx-accent: #0f766e;
  --stx-accent-soft: #ccfbf1;
  --stx-surface: var(--ct-surface, #fff);
  --stx-border: var(--ct-border, #e2e8f0);
  --stx-muted: #64748b;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.stx-layout {
  display: grid;
  grid-template-columns: minmax(0, 650px) minmax(0, 1fr);
  gap: 1.15rem;
  align-items: start;
}

.stx-layout > :first-child {
  max-width: 650px;
  width: 100%;
}

.stx-layout > .stx-result-card {
  min-width: 0;
  width: 100%;
}

@media (max-width: 991.98px) {
  .stx-layout { grid-template-columns: 1fr; }
  .stx-layout > :first-child { max-width: none; }
}

.stx-section {
  margin-bottom: 0.9rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--stx-border);
  border-radius: 0.5rem;
  background: var(--stx-surface);
}

.stx-section-title {
  font-weight: 650;
  font-size: 0.9rem;
  margin-bottom: 0.55rem;
}

.stx-result-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stx-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.75rem;
}

.stx-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 575.98px) {
  .stx-grid, .stx-grid-3 { grid-template-columns: 1fr; }
}

.stx-section label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
  color: #334155;
  margin: 0;
}

.stx-fullbase-label {
  margin: 0;
}

.stx-check-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f766e;
  cursor: pointer;
}

.stx-check-row input {
  width: 1rem;
  height: 1rem;
  accent-color: #0f766e;
}

.stx-budget-label {
  grid-column: 1 / -1;
}

.stx-budget-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.stx-budget-presets .btn {
  min-width: 3.75rem;
}

.stx-actions .btn-with-icon,
.stx-budget-presets .btn-with-icon {
  gap: 0.3rem;
}

.stx-budget-presets .btn-with-icon svg {
  width: 0.85em;
  height: 0.85em;
  opacity: 0.85;
}

.stx-budget-label .stx-hint {
  display: block;
  margin-top: 0.3rem;
  margin-bottom: 0;
}

.stx-city-block {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.stx-city-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.25rem;
}

.stx-city-select {
  min-width: 10rem;
  max-width: 14rem;
}

.stx-rate-table-wrap {
  width: 100%;
  overflow-x: hidden;
}

.stx-rate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  table-layout: fixed;
}

.stx-rate-table th,
.stx-rate-table td {
  border: 1px solid var(--stx-border);
  padding: 0.3rem 0.2rem;
  vertical-align: middle;
  text-align: center;
}

.stx-rate-table th {
  background: #f8fafc;
  color: var(--stx-muted);
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.7rem;
}

.stx-rate-table .stx-rate-name {
  text-align: left;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  width: 2.6rem;
  padding-left: 0.3rem;
  padding-right: 0.15rem;
}

.stx-rate-table input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  text-align: right;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
  font-size: 0.75rem;
}

.stx-hint {
  font-size: 0.78rem;
  color: var(--stx-muted);
  margin: 0.35rem 0 0;
}

.stx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.stx-result-card {
  border: 1px solid var(--stx-border);
  border-radius: 0.5rem;
  padding: 1rem;
  background: linear-gradient(180deg, #f0fdfa 0%, var(--stx-surface) 42%);
  position: sticky;
  top: 0.75rem;
}

.stx-bracket-peek td {
  background: var(--stx-accent-soft);
}

.stx-bonus-merged td {
  background: #ecfdf5;
}

.stx-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.stx-kpi-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 575.98px) {
  .stx-kpi-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stx-kpi {
  padding: 0.55rem 0.65rem;
  border-radius: 0.4rem;
  background: #fff;
  border: 1px solid var(--stx-border);
}

.stx-kpi-accent {
  border-color: #99f6e4;
  background: var(--stx-accent-soft);
}

.stx-kpi-label {
  display: block;
  font-size: 0.72rem;
  color: var(--stx-muted);
  margin-bottom: 0.15rem;
}

.stx-kpi-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  word-break: break-all;
}

.stx-table-wrap {
  overflow-x: auto;
  margin-top: 0.75rem;
}

.stx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.stx-plan-row.is-selected td {
  background: #ccfbf1;
}

.stx-table th,
.stx-table td {
  border-bottom: 1px solid var(--stx-border);
  padding: 0.35rem 0.3rem;
  text-align: right;
  white-space: nowrap;
  font-size: 0.75rem;
}

.stx-table th:first-child,
.stx-table td:first-child {
  text-align: left;
}

.stx-table th {
  color: var(--stx-muted);
  font-weight: 600;
  background: #f8fafc;
}

.stx-table tbody tr {
  transition: background-color 0.15s ease;
}

.stx-table tbody tr:hover {
  background: var(--stx-accent-soft, #ccfbf1);
}

.stx-table tbody tr:hover td {
  border-bottom-color: #99f6e4;
}

.stx-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 767.98px) {
  .stx-compare { grid-template-columns: 1fr; }
}

.stx-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 0.25rem;
  background: var(--stx-accent-soft);
  color: var(--stx-accent);
  font-weight: 600;
}

.stx-month-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

@media (max-width: 767.98px) {
  .stx-month-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.stx-warn {
  color: #b45309;
  font-size: 0.8rem;
  margin: 0.5rem 0 0;
}

.stx-rate-ref {
  margin-top: 1.25rem;
  max-width: 720px;
  width: 100%;
}

.stx-rate-ref-table th,
.stx-rate-ref-table td {
  text-align: center;
}

.stx-rate-ref-table td:nth-child(2) {
  text-align: left;
}

.stx-tool { display: none; }
.stx-tool.is-active { display: block; }

.stx-winner {
  outline: 2px solid var(--stx-accent);
  outline-offset: 2px;
}
