:root {
  --bg: #0f1512;
  --card-bg: #1a221d;
  --accent: #4caf6d;
  --accent-dark: #388e5c;
  --text: #f2f5f3;
  --text-dim: #9fada5;
  --danger: #c0463c;
  --border: #2b352f;
  --tent-accent: #d98a3d;
  --nights-accent: #4a90d9;
  --felagar-accent: #33b8a1;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 480px;
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 16px 16px 0;
  border-bottom: 1px solid var(--border);
}

.topbar h1 {
  margin: 0 0 12px;
  font-size: 1.5rem;
}

.tabs {
  display: flex;
  gap: 8px;
}

.tab-btn {
  flex: 1;
  padding: 12px 8px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.95rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.view {
  padding: 16px;
  padding-bottom: 48px;
}

.view.hidden {
  display: none;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: var(--text-dim);
}

.stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px;
  margin: 0 -8px;
  border-bottom: 1px solid var(--border);
  border-radius: 10px;
}

.stepper-row:last-child {
  border-bottom: none;
}

.tent-row {
  background: rgba(217, 138, 61, 0.1);
  border-bottom-color: transparent;
  margin-top: 6px;
}

.row-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 10px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.tent-row .row-icon {
  color: var(--tent-accent);
}

.nights-row {
  background: rgba(74, 144, 217, 0.1);
  border-bottom: none;
  margin-top: 22px;
  margin-bottom: 4px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.nights-row .row-icon {
  color: var(--nights-accent);
}

.felagar-row {
  background: rgba(51, 184, 161, 0.1);
  border-bottom: none;
  margin-bottom: 4px;
}

.felagar-row .row-icon {
  color: var(--felagar-accent);
}

.switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s;
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s;
}

.switch input:checked + .switch-slider {
  background: var(--felagar-accent);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}

.row-label {
  font-size: 0.95rem;
  flex: 1;
}

.row-price {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stepper button {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #232d27;
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
}

.stepper button:active {
  background: var(--accent-dark);
}

.stepper span {
  min-width: 24px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
}

.live-preview {
  display: none;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  padding: 10px 0 0;
}

.live-preview .felagi-part {
  color: var(--accent);
  font-weight: 600;
}

.summary-table tr.savings-row td {
  color: var(--accent);
  font-weight: 600;
}

.savings-note {
  display: none;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--felagar-accent);
  padding: 6px 0 0;
}

.primary-btn {
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #08120c;
  font-size: 1rem;
  font-weight: 700;
}

.primary-btn:active {
  background: var(--accent-dark);
}

.primary-btn:disabled {
  background: #2b352f;
  color: var(--text-dim);
}

.cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cart-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.cart-list li .line-desc {
  color: var(--text);
}

.cart-list li .line-price {
  font-weight: 600;
  white-space: nowrap;
  margin-left: 8px;
}

.cart-list li .remove-line {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 1.1rem;
  padding: 4px 8px;
}

.empty-msg {
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 8px 0;
  text-align: center;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 14px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.total-row.big {
  font-size: 1.3rem;
  color: var(--accent);
}

.pay-buttons {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.pay-btn {
  flex: 1;
  padding: 16px 8px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #08120c;
  font-size: 1rem;
  font-weight: 700;
}

.pay-btn:disabled {
  background: #2b352f;
  color: var(--text-dim);
}

.payment-split {
  margin-top: 4px;
}

.payment-split-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  color: var(--text-dim);
  padding: 6px 0;
  border-top: 1px solid var(--border);
}

.payment-split-row span:last-child {
  color: var(--text);
  font-weight: 600;
}

.danger-btn {
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--danger);
  background: none;
  color: var(--danger);
  font-size: 0.95rem;
  font-weight: 600;
}

.clear-btn {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 600;
}

.clear-btn:disabled {
  opacity: 0.5;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.summary-table th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--border);
}

.summary-table th:not(:first-child),
.summary-table td:not(:first-child) {
  text-align: right;
}

.summary-table td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
}

.summary-table tr.total-line td {
  border-bottom: none;
  border-top: 1px solid var(--border);
  font-weight: 700;
  padding-top: 10px;
}

.pie-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 4px;
}

.pie-chart {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--border);
}

.pie-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.pie-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  padding: 6px 0;
}

.pie-legend .swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.pie-legend .pie-label {
  flex: 1;
  color: var(--text);
}

.pie-legend .pie-value {
  color: var(--text-dim);
  font-weight: 600;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.history-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.history-list .hist-top {
  display: flex;
  align-items: center;
  font-weight: 700;
}

.history-list .hist-time {
  color: var(--text-dim);
  font-size: 0.85rem;
  flex: 1;
}

.history-list .remove-order {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 1.1rem;
  padding: 4px 4px 4px 12px;
  font-weight: 400;
}

.history-list .hist-details {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 4px;
}
