
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

/* Header & Navigation - Aligned across all mobile screens */
.header-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 14px 0;
  width: 100%;
  box-sizing: border-box;
}

.logo-area {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
}

.logo-icon {
  width: 44px;
  height: 44px;
  font-size: 1.35rem;
  border-radius: 12px;
  flex-shrink: 0;
}

.logo-title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.2;
}

.logo-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 2px;
}

.header-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  width: 100%;
}

.currency-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.currency-select-wrap label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin: 0;
}

.currency-select {
  flex: 1;
  width: 100%;
  min-height: 40px;
  height: 40px;
  padding: 0 12px;
  font-size: 0.86rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  box-sizing: border-box;
}

.theme-toggle-btn {
  min-height: 40px;
  height: 40px;
  padding: 0 16px;
  white-space: nowrap;
  font-size: 0.86rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  box-sizing: border-box;
}

/* Hero Section & Role Selection */
.hero-section {
  padding: 24px 0 16px;
}

.hero-title {
  font-size: 1.65rem;
  line-height: 1.25;
}

.hero-desc {
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.role-picker {
  grid-template-columns: 1fr;
  gap: 14px;
}

.role-card {
  padding: 20px 16px;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.role-cta-btn {
  top: 14px;
  right: 14px;
  padding: 5px 12px;
  font-size: 0.75rem;
  border-radius: 16px;
}

.role-title {
  font-size: 1.15rem;
  padding-right: 85px;
}

.role-desc {
  font-size: 0.84rem;
  margin-bottom: 12px;
}

.role-bottom-pill {
  font-size: 0.78rem;
}

/* Active Role Compact Banner */
.role-active-banner {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 14px;
  text-align: center;
}

.role-active-left {
  justify-content: center;
}

.btn-switch-role {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 200px;
  max-width: 260px;
  margin: 0 auto;
  padding: 10px 20px;
  text-align: center;
  font-size: 0.86rem;
}

/* Explainer & Interactive Simulator */
.explainer-section {
  margin: 24px 0 36px;
}

.explainer-title {
  font-size: 1.35rem;
}

.explainer-subtitle {
  font-size: 0.88rem;
}

.simulator-box {
  padding: 16px 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.simulator-title-bar {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 16px;
  padding-bottom: 12px;
}

.simulator-title-bar h3 {
  font-size: 1rem;
}

.simulator-grid,
.sim-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.sim-controls,
.sim-output-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

/* Inner simulator boxes: perfectly contained inside the outer box */
.sim-card-box,
.sim-output-card {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 14px 12px !important;
  min-width: 0 !important;
  overflow: hidden;
  border-radius: 10px;
}

.sim-box-header,
.sim-output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  width: 100%;
  box-sizing: border-box;
}

.sim-box-title {
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.sim-val-pill {
  font-size: 0.84rem;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.sim-badge-hint {
  font-size: 0.68rem;
  padding: 2px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.sim-slider-container {
  width: 100%;
  box-sizing: border-box;
  padding: 0 2px;
  min-height: 38px;
  display: flex;
  align-items: center;
}

.sim-slider {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Persons in this Room Buttons on Mobile */
.sim-roommates-picker,
.sim-rm-buttons {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  margin: 4px 0 0 !important;
}

.sim-btn-rm {
  flex: 1 1 0% !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 40px !important;
  padding: 8px 4px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  text-align: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  border-radius: var(--radius-sm) !important;
}

/* Splitting Method Buttons on Mobile */
.sim-mode-toggle {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  margin: 4px 0 0 !important;
}

.sim-mode-btn {
  flex: 1 1 0% !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 40px !important;
  padding: 8px 6px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  text-align: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  border-radius: var(--radius-sm) !important;
}

.sim-person-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  gap: 6px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.sim-p-name {
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.sim-p-share {
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.features-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

/* Room Setup Form */
.card-header {
  padding: 14px 16px;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.card-header-title {
  font-size: 1.05rem;
}

.card-body {
  padding: 16px 12px;
}

.room-setup-banner {
  padding: 14px;
}

.quick-room-picker,
.quick-rooms-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
  padding: 4px 0;
}

.btn-quick-room {
  width: 100%;
  text-align: center;
  padding: 12px 14px;
  font-size: 0.86rem;
  font-weight: 700;
}

.room-box-header {
  padding: 12px 14px;
}

.room-box-body {
  padding: 14px 12px;
}

.occupancy-prompt-box {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 14px;
  text-align: center;
}

.occupancy-input-wrap {
  justify-content: center;
}

.occupancy-input-wrap input {
  width: 80px;
  height: 42px;
  font-size: 1.1rem;
}

.form-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

/* 16px minimum prevents iOS zoom on focus */
.form-input {
  font-size: 16px;
  min-height: 44px;
}

.split-mode-selector {
  flex-direction: column;
  gap: 8px;
}

.split-pill {
  min-width: 100%;
  padding: 12px;
}

/* Person staying in room - cleanly aligned card layout on mobile */
.roommate-entry,
.roommate-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.roommate-row .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.roommate-row .form-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
  display: block;
}

/* Slimmer, thinner Remove Person button on mobile */
.btn-icon-del,
.btn-del-occupant {
  width: 100% !important;
  min-height: 35px !important;
  height: 35px !important;
  padding: 6px 14px !important;
  border-radius: var(--radius-sm) !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  background: rgba(239, 68, 68, 0.06) !important;
  color: #ef4444 !important;
  border: 1.5px solid rgba(239, 68, 68, 0.35) !important;
  cursor: pointer !important;
  margin-top: 6px !important;
  transition: all 0.2s ease !important;
}

.btn-icon-del:active,
.btn-del-occupant:active {
  background: rgba(239, 68, 68, 0.15) !important;
}

.btn-icon-del .btn-del-text,
.btn-del-occupant .btn-del-text {
  display: inline !important;
  font-size: 0.8rem;
  font-weight: 600;
}

[data-theme="dark"] .btn-icon-del,
[data-theme="dark"] .btn-del-occupant {
  background: rgba(248, 113, 113, 0.1) !important;
  border-color: rgba(248, 113, 113, 0.4) !important;
  color: #fca5a5 !important;
}

.btn-add-person {
  width: 100% !important;
  min-height: 40px !important;
  padding: 9px 16px !important;
  border-radius: var(--radius-sm) !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  background: var(--primary-light) !important;
  color: var(--primary) !important;
  border: 1.5px solid #c7d2fe !important;
  cursor: pointer !important;
  margin-top: 8px !important;
}

/* Add Room button on mobile: same length as change role button & centered */
.btn-add-room {
  width: fit-content !important;
  min-width: 200px !important;
  max-width: 260px !important;
  margin: 18px auto 6px !important;
  padding: 10px 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  font-size: 0.86rem !important;
  border-radius: var(--radius-md) !important;
}

/* Calculate Button */
.calculate-bar {
  margin: 20px 0 30px;
}

.btn-calc {
  width: 100%;
  padding: 16px 20px;
  font-size: 1.05rem;
  justify-content: center;
  border-radius: 14px;
}

/* Breakdown & Results */
.summary-banner {
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.summary-stat-card {
  padding: 12px 10px;
  gap: 8px;
  flex-direction: column;
  align-items: flex-start;
}

.stat-icon {
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
}

.stat-title {
  font-size: 0.72rem;
}

.stat-value {
  font-size: 1.1rem;
}

.stay-meta-box {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
}

.stay-meta-item {
  flex-direction: row;
  justify-content: space-between;
  width: 100%;
}

.breakdown-grid {
  grid-template-columns: 1fr;
  gap: 16px;
}

.person-card-header {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.person-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.person-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
}

.person-meta-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.person-name {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-room-tag {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

.itemized-table td {
  padding: 8px 12px;
  font-size: 0.82rem;
}

.payment-box {
  padding: 14px 12px;
}

/* Payment transaction form on mobile: Full width amount and aligned inputs */
.add-tx-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.add-tx-row .tx-amt-input {
  grid-column: span 2;
  width: 100%;
  min-height: 42px;
  font-size: 0.95rem;
  padding: 10px 14px;
}

.add-tx-row input[type="date"],
.add-tx-row .tx-date-input {
  grid-column: 1;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  font-size: 0.85rem;
}

.add-tx-row select,
.add-tx-row .tx-method-select {
  grid-column: 2;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  font-size: 0.85rem;
}

.btn-add-tx {
  grid-column: span 2;
  width: 100%;
  min-height: 42px;
  padding: 11px;
  font-size: 0.88rem;
  font-weight: 700;
  justify-content: center;
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
}

/* Remove Room button on mobile */
.btn-remove-room {
  padding: 6px 12px !important;
  font-size: 0.8rem !important;
  min-height: 34px !important;
  border-radius: var(--radius-sm) !important;
}

/* Export Toolbar & Buttons on Mobile: Resized identical to Select Number of Rooms buttons */
.export-toolbar {
  flex-direction: column;
  align-items: stretch;
  padding: 18px 14px;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.export-toolbar-title {
  text-align: center;
}

.export-toolbar-title h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.export-toolbar-title p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.export-buttons-group,
.export-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  margin-top: 6px;
}

.btn-export {
  width: 100% !important;
  min-height: 50px !important;
  padding: 13px 12px !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  text-align: center !important;
  border-radius: var(--radius-sm) !important;
  border: 1.5px solid var(--border) !important;
  background: var(--bg-card) !important;
  color: var(--text-main) !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  transition: all 0.2s ease !important;
}

.btn-export .dl-symbol {
  font-size: 1.05rem;
  line-height: 1;
}

.btn-export .dl-text {
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.btn-export:hover,
.btn-export:active {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  background: var(--primary-light) !important;
  transform: translateY(-1px) !important;
}

.btn-export.pdf {
  border-color: #fca5a5 !important;
}

.btn-export.pdf:hover,
.btn-export.pdf:active {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  color: #dc2626 !important;
}

.btn-export.csv {
  border-color: #86efac !important;
}

.btn-export.csv:hover,
.btn-export.csv:active {
  border-color: #10b981 !important;
  background: #f0fdf4 !important;
  color: #059669 !important;
}

.btn-export.text {
  border-color: #c7d2fe !important;
}

.btn-export.text:hover,
.btn-export.text:active {
  border-color: #6366f1 !important;
  background: #eef2ff !important;
  color: #4f46e5 !important;
}

.btn-export.print {
  border-color: #cbd5e1 !important;
}

.btn-export.print:hover,
.btn-export.print:active {
  border-color: #64748b !important;
  background: #f1f5f9 !important;
  color: #334155 !important;
}

/* Dark mode export buttons on mobile */
[data-theme="dark"] .btn-export {
  background: var(--bg-subtle) !important;
  border-color: var(--border) !important;
  color: var(--text-main) !important;
}

[data-theme="dark"] .btn-export.pdf {
  border-color: #7f1d1d !important;
}
[data-theme="dark"] .btn-export.pdf:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #fca5a5 !important;
}

[data-theme="dark"] .btn-export.csv {
  border-color: #064e3b !important;
}
[data-theme="dark"] .btn-export.csv:hover {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #86efac !important;
}

[data-theme="dark"] .btn-export.text {
  border-color: #3730a3 !important;
}
[data-theme="dark"] .btn-export.text:hover {
  background: rgba(99, 102, 241, 0.2) !important;
  color: #a5b4fc !important;
}

[data-theme="dark"] .btn-export.print {
  border-color: #334155 !important;
}
[data-theme="dark"] .btn-export.print:hover {
  background: rgba(148, 163, 184, 0.2) !important;
  color: #cbd5e1 !important;
}

@media (max-width: 380px) {
  .summary-banner {
    grid-template-columns: 1fr;
  }
  .export-buttons-group {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .quick-rooms-selector,
  .quick-room-picker {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}
