/* ============================================
   LastCork Account Area Styles
   ============================================ */

/* --- Layout --- */
.account-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}
.sidebar-nav a.active {
  color: var(--accent);
  background: rgba(201, 168, 76, 0.06);
  border-left-color: var(--accent);
}

.sidebar-nav .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-plan {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem 2.5rem;
  min-width: 0;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* --- Mobile sidebar toggle --- */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-toggle {
    display: block;
  }
  .sidebar.open ~ .sidebar-overlay {
    display: block;
  }
  .main-content {
    margin-left: 0;
    padding: 4rem 1.5rem 2rem;
  }
}

/* --- Dashboard Stats --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  padding: 1.25rem 1.5rem;
}

.stat-card .stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.stat-card .stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
}

.stat-card .stat-change {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.stat-card .stat-change.positive { color: #27ae60; }
.stat-card .stat-change.negative { color: #e74c3c; }

/* --- Dashboard Sections --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.dash-section {
  padding: 1.5rem;
}

.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.dash-section-header h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
}

/* --- Match List --- */
.match-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.match-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.match-item .wine-color {
  width: 8px;
  height: 40px;
  border-radius: 4px;
  flex-shrink: 0;
}

.match-item .wine-color.red { background: #8B0000; }
.match-item .wine-color.white { background: #C9A84C; }
.match-item .wine-color.rose { background: #d4837f; }

.match-info {
  flex: 1;
  min-width: 0;
}

.match-name {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.match-price {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--accent);
  white-space: nowrap;
}

.match-action {
  flex-shrink: 0;
}

/* --- Rules List --- */
.rule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.rule-item + .rule-item {
  margin-top: 0.5rem;
}

.rule-info h4 {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
}

.rule-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.875rem;
}

/* --- Toggle Switch (for rules) --- */
.toggle-sm {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}

.toggle-sm.on {
  background: var(--primary);
  border-color: var(--primary);
}

.toggle-sm::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text);
  border-radius: 50%;
  transition: transform var(--transition);
}

.toggle-sm.on::after {
  transform: translateX(18px);
}

/* --- Logout button in sidebar --- */
.btn-logout {
  width: 100%;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.btn-logout:hover {
  color: #e74c3c;
}

/* --- Page Header Row --- */
.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* --- Loading State --- */
.loading-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.9375rem;
}

/* --- Form Sections --- */
.form-section {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-section h3 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.form-section p.text-muted {
  margin-bottom: 1rem;
}

.form-actions {
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 600px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.section-title {
  font-size: 1.25rem;
  margin: 2rem 0 1.25rem;
}

/* --- Custom Toggle Switch --- */
.toggle-switch-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.toggle-switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch-track {
  display: block;
  width: 44px;
  height: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  position: relative;
}

.toggle-switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform var(--transition), background var(--transition);
}

.toggle-switch-input:checked + .toggle-switch-track {
  background: var(--primary);
  border-color: var(--primary);
}

.toggle-switch-input:checked + .toggle-switch-track::after {
  transform: translateX(20px);
  background: #fff;
}

.toggle-switch-input:focus-visible + .toggle-switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Large toggle for master switch */
.toggle-track-lg {
  width: 56px;
  height: 30px;
}

.toggle-track-lg::after {
  width: 24px;
  height: 24px;
}

.toggle-switch-input:checked + .toggle-track-lg::after {
  transform: translateX(26px);
}

/* Toggle row (label + switch) */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0;
  cursor: pointer;
  gap: 1rem;
}

.toggle-label {
  font-size: 0.9375rem;
  color: var(--text);
}

/* Master toggle section */
.master-toggle-section {
  border: 1px solid var(--primary);
}

.master-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

/* --- Chip / Tag Input --- */
.chip-input-wrap {
  margin-bottom: 0.5rem;
}

.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
  min-height: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  background: rgba(201, 168, 76, 0.12);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
}

.chip-remove {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.chip-remove:hover {
  opacity: 1;
}

/* --- Checkbox Grid --- */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}

.checkbox-grid-sm {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.checkbox-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.checkbox-card:hover {
  border-color: var(--accent);
  color: var(--text);
}

.checkbox-card input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-card:has(input:checked) {
  background: rgba(201, 168, 76, 0.08);
  border-color: var(--accent);
  color: var(--accent);
}

.checkbox-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Range Slider --- */
.form-range {
  width: 100%;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--card);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.form-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

.threshold-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 600px) {
  .threshold-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Sites Grid --- */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.25rem;
}

@media (max-width: 480px) {
  .sites-grid {
    grid-template-columns: 1fr;
  }
}

.site-card {
  padding: 1.25rem 1.5rem;
}

.site-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.site-card-name {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.site-card-url {
  font-size: 0.75rem;
  word-break: break-all;
}

.site-login-status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
  font-size: 0.8125rem;
}

.site-card-toggles {
  margin-bottom: 1rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.25rem 0;
}

.site-card-actions {
  display: flex;
  gap: 0.5rem;
}

/* --- Rule Cards --- */
.rule-card {
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.rule-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.rule-card-info h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.rule-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.rule-card-actions {
  display: flex;
  gap: 0.25rem;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
}

.modal-close {
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1rem 0;
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* --- Purchase Table --- */
.purchase-wine-name {
  font-weight: 500;
}

/* --- Plan Cards (Subscription) --- */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.plan-card {
  padding: 1.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
}

.plan-card-header {
  margin-bottom: 1.25rem;
}

.plan-card-header h3 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.plan-price {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
}

.plan-period {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted);
}

.plan-features {
  flex: 1;
  margin-bottom: 1.5rem;
}

.plan-features li {
  padding: 0.375rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  position: relative;
  padding-left: 1.25rem;
}

.plan-features li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.plan-featured {
  border-color: var(--accent);
}

.plan-badge {
  position: absolute;
  top: -10px;
  right: 1rem;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
}

.plan-current {
  border-color: var(--primary);
  background: rgba(139, 0, 0, 0.08);
}

/* --- Current Plan Row --- */
.current-plan-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.current-plan-meta {
  text-align: right;
  font-size: 0.875rem;
}

.current-plan-meta > div {
  margin-bottom: 0.25rem;
}

/* --- Friends Page --- */
.friend-code-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.friend-code-value {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  user-select: all;
}

.add-friend-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .add-friend-row {
    flex-direction: column;
    align-items: stretch;
  }
}

.form-feedback {
  font-size: 0.8125rem;
  margin-top: 0.5rem;
  min-height: 1.25rem;
}

.form-feedback.success {
  color: #27ae60;
}

.form-feedback.error {
  color: #e74c3c;
}

.subsection-label {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  margin-top: 1rem;
}

.subsection-label:first-child {
  margin-top: 0;
}

.friend-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.friend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.friend-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.friend-name {
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-actions {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 999px;
}

.badge-muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.badge-success {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

.badge-error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.badge-warning {
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
}

/* ============================================
   Subscription / Billing Styles
   ============================================ */

/* --- Billing Cycle Toggle Row --- */
.billing-cycle-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.billing-cycle-toggle {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.cycle-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.cycle-save-badge {
  display: inline-block;
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.25rem;
  vertical-align: middle;
}

/* --- Plan Card Current Badge --- */
.plan-badge-current {
  background: var(--accent);
  color: var(--bg);
}

.plan-current {
  border-color: var(--accent);
  background: rgba(201, 168, 76, 0.06);
  box-shadow: 0 0 0 1px var(--accent);
}

/* --- Cancel / Danger Buttons --- */
.btn-danger {
  background: #8B0000;
  color: #fff;
}

.btn-danger:hover {
  background: #a00000;
}

.btn-danger-outline {
  color: #8B0000;
  border-color: #8B0000;
}

.btn-danger-outline:hover {
  background: rgba(139, 0, 0, 0.1);
  color: #a00000;
}

/* --- Test Mode Banner --- */
.test-mode-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.3);
  color: #facc15;
  border-radius: var(--radius-sm, 6px);
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

/* --- Upgrade Modal Summary --- */
.upgrade-plan-summary {
  text-align: center;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border);
}

.upgrade-plan-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.upgrade-plan-price {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}

.upgrade-plan-final {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: #4ade80;
}

.promo-discount {
  font-size: 0.8125rem;
  color: #4ade80;
  margin-top: 0.375rem;
}

/* --- CC Form --- */
.cc-form {
  margin-bottom: 1.25rem;
}

/* --- Promo Code Row --- */
.promo-row {
  margin-bottom: 0.75rem;
}

.promo-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.promo-input-row .form-input {
  flex: 1;
}

.promo-result {
  font-size: 0.8125rem;
  padding: 0.375rem 0;
  margin-bottom: 0.5rem;
}

.promo-result-success {
  color: #4ade80;
}

.promo-result-error {
  color: #ef4444;
}

/* --- Billing History Table --- */
.billing-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.billing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.billing-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.billing-table td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.billing-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* --- Signup Billing Section --- */
.signup-billing-section {
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
  padding-top: 1.5rem;
}

.signup-billing-section h2 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.signup-plan-price {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

/* --- Responsive tweaks for subscription page --- */
@media (max-width: 768px) {
  .billing-cycle-toggle-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .plans-grid {
    grid-template-columns: 1fr;
  }

  .current-plan-row {
    flex-direction: column;
  }

  .current-plan-meta {
    text-align: left;
  }
}
