/* ===== Settings sheet ===== */

.settings-sheet {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #F8F8F8;
  z-index: 10003;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 18px calc(30px + env(safe-area-inset-bottom, 0px)) 18px;
  box-sizing: border-box;
  font-family: 'Quicksand', sans-serif;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0, 0, 1);
}

.settings-sheet.open {
  transform: translateX(0);
}

html.settings-open,
body.settings-open {
  overflow: hidden !important;
}

.settings-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.settings-sheet-title {
  font-size: 18px;
  font-weight: 700;
  color: #2D2D2D;
}

.settings-icon-btn {
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #FFFFFF !important;
  color: #2D2D2D !important;
  border: none !important;
  border-radius: 50% !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
  font-size: 14px !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.settings-icon-btn:active { background: #F0EDE9 !important; }
.settings-icon-btn:hover,
.settings-icon-btn:focus {
  background: #FFFFFF !important;
  color: #2D2D2D !important;
  outline: none !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
}

/* Grouped cards */
.settings-group { margin-bottom: 18px; }

.settings-group-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #B3A99C;
  margin: 0 4px 8px 4px;
}

.settings-card {
  background: #FFFFFF;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid #F4F1ED;
  -webkit-tap-highlight-color: transparent;
}

.settings-row:last-child { border-bottom: none; }
.settings-row:active { background: #FAF7F3; }

.settings-row-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(247, 148, 29, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  color: #F7941D;
}
.settings-row-icon svg { display: block; }

.settings-row-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.settings-row-title {
  font-size: 15px;
  font-weight: 600;
  color: #2D2D2D;
}

.settings-row-sub {
  font-size: 12px;
  font-weight: 500;
  color: #8A8A8A;
}

.settings-row-value {
  font-size: 13.5px;
  font-weight: 600;
  color: #F7941D;
  white-space: nowrap;
}

.settings-row-chevron { display: flex; flex-shrink: 0; }

.settings-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #F7941D;
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Expandable option lists (week start / store) */
.settings-options { border-bottom: 1px solid #F4F1ED; }

.settings-option {
  padding: 12px 16px 12px 62px;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  border-top: 1px solid #F8F5F1;
  -webkit-tap-highlight-color: transparent;
}

.settings-option:active { background: #FAF7F3; }

.settings-option.selected {
  color: #F7941D;
  font-weight: 700;
}

.settings-option.selected::after { content: '  ✓'; }

.settings-hint {
  font-size: 12.5px;
  font-weight: 500;
  color: #A39A8D;
  line-height: 1.5;
  margin: 4px 4px 12px 4px;
}

/* ----- Aisle manager ----- */

.settings-aisle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid #F4F1ED;
  background: #FFFFFF;
}

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

.settings-aisle-row.dragging {
  opacity: 0.85;
  background: #FFF6EA;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  position: relative;
  z-index: 2;
}

.settings-aisle-handle {
  display: flex;
  align-items: center;
  padding: 6px 4px;
  cursor: grab;
  flex-shrink: 0;
}

.settings-aisle-badge {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(247, 148, 29, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.settings-aisle-badge.aisle-badge-number {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  color: #E07A10;
}

.settings-aisle-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: #2D2D2D;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
}

.settings-aisle-rename {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
  color: #2D2D2D;
  border: 1.5px solid #F7941D;
  border-radius: 10px;
  padding: 6px 10px;
  outline: none;
  min-width: 0;
}

.settings-aisle-count {
  font-size: 11.5px;
  font-weight: 700;
  color: #B3A99C;
  background: #F4F1ED;
  border-radius: 10px;
  padding: 3px 9px;
  flex-shrink: 0;
}

.settings-aisle-delete {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 8px !important;
  display: flex !important;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.settings-aisle-delete:hover,
.settings-aisle-delete:focus,
.settings-aisle-delete:active {
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
}

.settings-aisle-confirm {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #FFF3F0;
  border-bottom: 1px solid #F4F1ED;
  font-family: 'Quicksand', sans-serif;
}

.settings-aisle-confirm-msg {
  flex: 1;
  font-size: 12.5px;
  font-weight: 600;
  color: #C0392B;
}

.settings-aisle-confirm-yes {
  background: #E74C3C !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 14px !important;
  padding: 7px 14px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  font-family: 'Quicksand', sans-serif !important;
  box-shadow: none !important;
  cursor: pointer;
}

.settings-aisle-confirm-no {
  background: transparent !important;
  color: #888 !important;
  border: none !important;
  box-shadow: none !important;
  padding: 7px 8px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  font-family: 'Quicksand', sans-serif !important;
  cursor: pointer;
}

.settings-aisle-add {
  display: flex;
  gap: 10px;
  margin: 12px 0 20px 0;
}

.settings-aisle-add input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #E8E3DD;
  border-radius: 16px;
  font-size: 14px;
  font-family: 'Quicksand', sans-serif;
  color: #2D2D2D;
  background: #FFFFFF;
  outline: none;
  min-width: 0;
}

.settings-aisle-add input:focus { border-color: #F7941D; }

.settings-aisle-add-btn {
  background: #F7941D !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 16px !important;
  padding: 0 22px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  font-family: 'Quicksand', sans-serif !important;
  box-shadow: 0 3px 10px rgba(247, 148, 29, 0.3) !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.settings-aisle-add-btn:active { background: #E07A10 !important; }
.settings-aisle-add-btn:hover,
.settings-aisle-add-btn:focus {
  background: #F7941D !important;
  outline: none !important;
}

.settings-forget-btn {
  background: #F4F1ED !important;
  color: #8A7F72 !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 6px 13px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  font-family: 'Quicksand', sans-serif !important;
  box-shadow: none !important;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.settings-forget-btn:active { background: #E8E3DD !important; }
.settings-forget-btn:hover,
.settings-forget-btn:focus {
  background: #F4F1ED !important;
  color: #8A7F72 !important;
  outline: none !important;
}

.settings-learned-row { cursor: default; }

/* Account sheet log-out */
.settings-logout-btn {
  display: block;
  width: 100%;
  margin: 8px 0 20px 0;
  padding: 15px 16px;
  background: #FFFFFF !important;
  color: #E74C3C !important;
  border: none !important;
  border-radius: 16px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.settings-logout-btn:active { background: #FBEDEC !important; }
.settings-logout-btn:hover,
.settings-logout-btn:focus {
  background: #FFFFFF !important;
  color: #E74C3C !important;
  outline: none !important;
}
.settings-logout-btn:disabled { opacity: 0.6; }

/* Household sheet */
.household-primary-btn {
  display: block;
  width: 100%;
  margin: 4px 0 22px 0;
  padding: 15px 16px;
  background: #F7941D !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 12px rgba(247, 148, 29, 0.3) !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.household-primary-btn:active { background: #E07A10 !important; }
.household-primary-btn:hover,
.household-primary-btn:focus { background: #F7941D !important; color: #FFFFFF !important; outline: none !important; }
.household-primary-btn:disabled { opacity: 0.6; }

.household-divider-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #B8B2A8;
  margin: 4px 2px 8px 2px;
}
.household-join-row { display: flex; gap: 8px; }
.household-join-input {
  flex: 1;
  min-width: 0;
  padding: 13px 14px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 2px solid #E7E2DB;
  border-radius: 14px;
  font-family: 'Quicksand', sans-serif;
  background: #FFFFFF;
  color: #2D2D2D;
  box-sizing: border-box;
}
.household-join-input:focus { outline: none; border-color: #F7941D; }
/* The uppercase transform styles typed codes, but shouting the example
   placeholder ("E.G. XK4P7N") reads wrong — keep it sentence case. */
.household-join-input::placeholder {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  color: #B8B2A8;
}
.household-join-btn {
  flex: 0 0 auto;
  padding: 0 22px !important;
  background: #FFFFFF !important;
  color: #E07A10 !important;
  border: 1.5px solid #F7941D !important;
  border-radius: 14px !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.household-join-btn:active { background: #FFF4E8 !important; }
.household-join-btn:hover,
.household-join-btn:focus { background: #FFFFFF !important; color: #E07A10 !important; outline: none !important; }
.household-join-btn:disabled { opacity: 0.6; }

.household-error {
  color: #C62828;
  font-size: 13.5px;
  font-weight: 600;
  margin: 10px 2px 0 2px;
}

.household-code-box {
  background: #FFFFFF;
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 20px;
  text-align: center;
  margin-bottom: 18px;
}
.household-code {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: #2D2D2D;
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}
.household-share-btn {
  padding: 10px 22px !important;
  background: rgba(247, 148, 29, 0.12) !important;
  color: #E07A10 !important;
  border: none !important;
  border-radius: 14px !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.household-share-btn:active { opacity: 0.7; }
.household-share-btn:hover,
.household-share-btn:focus { background: rgba(247, 148, 29, 0.12) !important; color: #E07A10 !important; outline: none !important; }

/* Delete account — quiet entry link, explicit confirm step */
.settings-delete-account-link {
  display: block;
  width: 100%;
  margin: 0 0 24px 0;
  padding: 10px;
  background: transparent !important;
  color: #B8B2A8 !important;
  border: none !important;
  box-shadow: none !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.settings-delete-account-link:active { opacity: 0.6; }
.settings-delete-account-link:hover,
.settings-delete-account-link:focus {
  background: transparent !important;
  color: #B8B2A8 !important;
  outline: none !important;
  opacity: 1;
}

.settings-delete-confirm { padding: 18px 16px; }
.settings-delete-title {
  font-size: 17px;
  font-weight: 700;
  color: #2D2D2D;
  margin-bottom: 10px;
}
.settings-delete-text {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.55;
  color: #7A756C;
  margin: 0 0 10px 0;
}
.settings-delete-text:last-child { margin-bottom: 0; }

.settings-delete-account-btn {
  display: block;
  width: 100%;
  margin: 14px 0 0 0;
  padding: 15px 16px;
  background: #E74C3C !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.28) !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.settings-delete-account-btn:active { background: #C0392B !important; }
.settings-delete-account-btn:hover,
.settings-delete-account-btn:focus {
  background: #E74C3C !important;
  color: #FFFFFF !important;
  outline: none !important;
}
.settings-delete-account-btn:disabled { opacity: 0.6; }

.settings-delete-cancel-btn {
  display: block;
  width: 100%;
  margin: 10px 0 24px 0;
  padding: 13px 16px;
  background: transparent !important;
  color: #8A857C !important;
  border: none !important;
  box-shadow: none !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 14.5px !important;
  font-weight: 700 !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.settings-delete-cancel-btn:active { opacity: 0.6; }
.settings-delete-cancel-btn:hover,
.settings-delete-cancel-btn:focus {
  background: transparent !important;
  color: #8A857C !important;
  outline: none !important;
  opacity: 1;
}
