/* ============================================================
   Cheaply: Components
   Cheaply-calibre: clean, breathable, trustworthy
   ============================================================ */

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  z-index: var(--z-sticky);
}

.navbar-inner {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Logo */
.navbar-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.navbar-logo svg,
.navbar-logo img {
  height: 32px !important;
  width: auto !important;
  display: block !important;
  object-fit: contain !important;
  transition: transform 0.3s ease;
}

.navbar-logo:hover img {
  transform: scale(1.05);
}

/* Search pill: Cheaply signature */
.navbar-search {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 440px;
  margin: 0 auto;
}

/* Spacer: fills remaining space on mobile when search is hidden */
.navbar-spacer {
  display: none;
  flex: 1;
}

.search-pill {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  padding: 8px 8px 8px 20px;
  box-shadow: var(--shadow-search);
  transition: box-shadow var(--transition-base);
  background: var(--white);
  gap: 8px;
}

.search-pill:hover,
.search-pill:focus-within {
  box-shadow: var(--shadow-search-hover);
}

.search-pill input {
  flex: 1;
  border: none;
  outline: none;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--gray-900);
  background: transparent;
  min-width: 0;
}

.search-pill input::placeholder {
  color: var(--gray-400);
  font-weight: var(--weight-normal);
}

.search-pill-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--black);
  color: var(--white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.search-pill-btn:hover {
  background: var(--gray-800);
}

.search-pill-btn:active {
  transform: scale(0.94);
}

.search-pill-btn svg {
  width: 16px;
  height: 16px;
}

/* Search trigger: mobile-only icon button */
.search-trigger-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-700);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.search-trigger-btn:hover {
  background: var(--gray-50);
  box-shadow: var(--shadow-sm);
}

/* Search overlay: full-screen mobile search */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.search-overlay.open {
  opacity: 1;
}

.search-overlay-inner {
  width: 100%;
  max-width: 600px;
  padding: 16px;
  margin-top: env(safe-area-inset-top, 12px);
  transform: translateY(-20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-overlay.open .search-overlay-inner {
  transform: translateY(0);
}

.search-overlay-form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border-radius: var(--radius-full);
  padding: 8px 8px 8px 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.search-overlay-form input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  font-weight: var(--weight-medium);
  color: var(--gray-900);
  background: transparent;
  min-width: 0;
}

.search-overlay-form input::placeholder {
  color: var(--gray-400);
}

.search-overlay-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--gray-100);
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.search-overlay-close:hover {
  background: var(--gray-200);
}

.search-overlay-submit {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--black);
  color: var(--white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.search-overlay-submit:hover {
  background: var(--gray-800);
}

/* Right nav actions */
.navbar-end {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link-text {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--gray-700);
  padding: 8px 12px;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.nav-link-text:hover {
  background: var(--gray-50);
  color: var(--black);
  text-decoration: none;
}

.nav-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.nav-icon-btn:hover {
  background: var(--gray-50);
}

.nav-icon-btn svg {
  width: 20px;
  height: 20px;
}

.nav-badge {
  position: absolute;
  top: 0px;
  right: 0px;
  min-width: 16px;
  height: 16px;
  background: var(--black);
  color: var(--white);
  font-size: 9px;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1.5px solid var(--white);
  line-height: 1;
  z-index: 2;
  transform: translate(25%, -25%);
}

/* Badge for Avatar specific context */
.avatar-badge {
  top: 2px;
  right: 2px;
}

/* Custom Select styling (monochrome) */
.custom-select-wrap {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.custom-select-trigger:hover {
  border-color: var(--gray-400);
}

.custom-select-options {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
}

.custom-select-options.open {
  display: block;
}

.custom-select-option {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--gray-700);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.custom-select-option:hover {
  background: var(--black);
  color: var(--white);
}

.custom-select-option.selected {
  background: var(--gray-100);
  font-weight: 700;
  color: var(--black);
}

/* ── Notification Panel ────────────────────────────────────── */
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: -40px;
  width: 360px;
  max-height: 440px;
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  z-index: var(--z-dropdown);
  overflow: hidden;
  animation: notifSlideIn 0.2s ease-out;
}

@keyframes notifSlideIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-150);
}

.notif-panel-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--gray-900);
}

.notif-mark-all {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: var(--weight-medium);
  color: var(--gray-500);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.notif-mark-all:hover {
  background: var(--gray-50);
  color: var(--black);
}

.notif-panel-body {
  overflow-y: auto;
  max-height: 370px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.notif-item:hover {
  background: var(--gray-50);
}

.notif-item.unread {
  background: #f5f5f5;
}

.notif-item.unread:hover {
  background: #eeeeee;
}

.notif-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-icon-wrap svg {
  width: 16px;
  height: 16px;
  color: var(--gray-600);
}

.notif-item.unread .notif-icon-wrap {
  background: var(--black);
}

.notif-item.unread .notif-icon-wrap svg {
  color: var(--white);
}

.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-text {
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-item.unread .notif-text {
  font-weight: var(--weight-medium);
  color: var(--gray-900);
}

.notif-time {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 3px;
}

.notif-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--gray-400);
  font-size: 14px;
}

@media (max-width: 640px) {
  .notif-panel {
    width: 320px;
    right: -80px;
  }
}

/* Custom currency dropdown: fully monochrome, no browser blue */
.curr-dd {
  position: relative;
}

.curr-dd-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--gray-100);
  border: none;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 800;
  color: var(--black);
  cursor: pointer;
  border-radius: 4px;
  font-family: inherit;
  transition: background var(--transition-fast);
  white-space: nowrap;
  line-height: 1;
}

.curr-dd-btn:hover,
.curr-dd-open .curr-dd-btn {
  background: var(--gray-200);
}

.curr-dd-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 4px 0;
  min-width: 110px;
  z-index: 9000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  list-style: none;
  margin: 0;
}

.curr-dd-open .curr-dd-list {
  display: block;
}

.curr-dd-item {
  padding: 9px 14px;
  font-size: 13px;
  color: var(--black);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.curr-dd-item:hover {
  background: var(--gray-100);
}

.curr-dd-item.curr-dd-selected {
  font-weight: 700;
  background: var(--gray-100);
}

/* ── App-level custom select (avoids all OS-native blue) ──────
   Same pattern as .curr-dd but full-width for form use.
   Usage: see layouts/main.php initAppSelect() helper.
   ─────────────────────────────────────────────────────────── */
.app-select {
  position: relative;
  width: 100%;
}

.app-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #ddd;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: #111;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
  transition: border-color .15s;
}

.app-select-btn:hover {
  border-color: #111;
}

.app-select-open .app-select-btn {
  border-color: #111;
}

.app-select-btn svg {
  flex-shrink: 0;
  transition: transform .15s;
}

.app-select-open .app-select-btn svg {
  transform: rotate(180deg);
}

.app-select-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid #111;
  border-top: none;
  z-index: 1200;
  max-height: 260px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 4px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .07);
}

.app-select-open .app-select-list {
  display: block;
}

.app-select-item {
  padding: 10px 14px;
  font-size: 13px;
  color: #111;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-select-item:hover,
.app-select-item.app-select-selected {
  background: #111;
  color: #fff;
}

/* Search box (auto-mounts when the option count >= 8). Sits between the
   trigger and the list so the list scrolls under it. Monochrome, native-
   feel, no browser default focus ring. */
.app-select-search-wrap {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-bottom: none;
  padding: 8px;
  z-index: 51;
}
.app-select-open .app-select-search-wrap {
  display: block;
}
.app-select.app-select-has-search.app-select-open .app-select-list {
  /* Push the list down so the search box doesn't overlap the first item.
     Only applied to search-equipped dropdowns; plain ones keep top:100%. */
  top: calc(100% + 49px);
}
.app-select-search {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid #e0e0e0;
  background: #fff;
  color: #111;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  border-radius: 0;
  box-sizing: border-box;
}
.app-select-search:focus {
  border-color: #111;
}
.app-select-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.app-select-item.app-select-hidden {
  display: none;
}
.app-select-empty {
  padding: 14px;
  font-size: 12px;
  color: #888;
  text-align: center;
  font-style: italic;
  list-style: none;
}
.app-select-empty[hidden] { display: none; }

/* ── Global Monochrome Inputs ───────────────────────────────── */
input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--black);
  cursor: pointer;
}

/* User menu pill: Cheaply style */
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  padding: 6px 6px 6px 14px;
  cursor: pointer;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
  background: var(--white);
  position: relative;
}

.user-pill:hover {
  box-shadow: var(--shadow-md);
}

.user-pill-icon {
  width: 16px;
  height: 16px;
  color: var(--gray-700);
}

.user-pill-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: var(--gray-900);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  overflow: hidden;
  flex-shrink: 0;
}

.user-pill-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Dropdown */
.dropdown {
  position: fixed;
  top: auto;
  right: auto;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
  z-index: calc(var(--z-dropdown) + 10);
}

.dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-section {
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-150);
}

.dropdown-section:last-child {
  border-bottom: none;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  font-size: var(--text-sm);
  color: var(--gray-700);
  transition: background var(--transition-fast);
  width: 100%;
  text-align: left;
  background: none;
  border: none;
}

.dropdown-item:hover {
  background: var(--gray-50);
  color: var(--black);
}

.dropdown-item.bold {
  font-weight: var(--weight-semibold);
  color: var(--black);
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
  color: var(--gray-500);
  flex-shrink: 0;
}

/* ── Category filter bar ───────────────────────────────────── */
.category-bar {
  position: sticky;
  top: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-150);
  z-index: calc(var(--z-sticky) - 10);
  height: var(--category-bar-height);
  display: flex;
  align-items: center;
}

.category-bar-inner {
  flex: 1;
  min-width: 0;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-bar-inner::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border: 1px solid transparent;
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
  white-space: nowrap;
}

.cat-pill:hover {
  border-color: var(--gray-300);
  color: var(--black);
}

.cat-pill.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.cat-more-wrap {
  position: relative;
  flex-shrink: 0;
}

.cat-more-btn {
  display: inline-flex;
  align-items: center;
}

.cat-more-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  max-height: 320px;
  overflow-y: auto;
  z-index: var(--z-dropdown);
  padding: 6px;
}

.cat-more-dropdown.open {
  display: block;
}

.cat-more-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--gray-700);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.cat-more-item:hover {
  background: var(--gray-50);
  color: var(--black);
}

.cat-more-item.active {
  background: var(--gray-900);
  color: var(--white);
}

.filter-btn-wrap {
  position: relative;
  flex-shrink: 0;
  padding-right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--gray-700);
  background: var(--white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--gray-900);
  box-shadow: var(--shadow-xs);
}

.filter-btn svg {
  width: 14px;
  height: 14px;
}

.sort-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 24px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: var(--z-dropdown);
  padding: 6px;
}

.sort-dropdown.open {
  display: block;
}

.sort-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--gray-700);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.sort-item:hover {
  background: var(--gray-50);
  color: var(--black);
}

.sort-item.active {
  background: var(--gray-900);
  color: var(--white);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  padding: 12px 22px;
  cursor: pointer;
  position: relative;
  transition: background var(--transition-fast), border-color var(--transition-fast),
    box-shadow var(--transition-fast), transform var(--transition-fast),
    color var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* Primary */
.btn-primary {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.btn-primary:hover {
  background: var(--gray-800);
  border-color: var(--gray-800);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

/* Secondary / outline */
.btn-secondary {
  background: var(--white);
  color: var(--black);
  border-color: var(--gray-900);
}

.btn-secondary:hover {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--gray-700);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--gray-50);
  color: var(--black);
}

/* Sizes */
.btn-sm {
  padding: 8px 16px;
  font-size: var(--text-xs);
}

.btn-lg {
  padding: 16px 28px;
  font-size: var(--text-md);
}

.btn-xl {
  padding: 18px 32px;
  font-size: var(--text-lg);
}

.btn-full {
  width: 100%;
}

/* Join deal CTA: prominent */
.btn-join {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
  border-radius: var(--radius-full);
  padding: 12px 24px;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.btn-join:hover {
  background: var(--gray-800);
  color: var(--white);
  transform: scale(1.01);
  box-shadow: var(--shadow-sm);
}

/* ── Avatar ────────────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-700);
  font-weight: var(--weight-semibold);
  overflow: hidden;
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-xs {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.avatar-md {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 16px;
}

.avatar-xl {
  width: 64px;
  height: 64px;
  font-size: 20px;
}

/* ── Badge / chip ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.badge-dark {
  background: var(--black);
  color: var(--white);
}

.badge-light {
  background: var(--gray-100);
  color: var(--gray-700);
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.badge-error {
  background: var(--color-error-bg);
  color: var(--color-error);
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--gray-700);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--gray-400);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--gray-400);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-text);
  box-shadow: var(--focus-ring);
}

.form-textarea {
  resize: vertical;
  min-height: 96px;
  line-height: var(--leading-relaxed);
}

/* ── Global link color: monochrome brand (override browser default blue) ──── */
a {
  color: #111;
  text-decoration: none;
}

a:hover {
  color: #000;
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:visited {
  color: inherit;
}

a:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

/* Buttons rendered as anchors must never inherit link color or underline.
   Each button variant owns its own foreground colour in every state.
   This guard kills the global a:hover underline for anchor-styled buttons. */
a.btn, a.btn:link, a.btn:visited, a.btn:hover, a.btn:focus, a.btn:active,
a[class*="-btn"]:hover, a[class*="-btn"]:focus, a[class*="-btn"]:active,
a[class*="btn-"]:hover, a[class*="btn-"]:focus, a[class*="btn-"]:active {
  text-decoration: none;
}

/* ── Monochrome select / form element overrides ─────────────── */
/* Remove OS-native blue arrow and background on selects */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23111' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px !important;
}

/* Suppress the browser-default blue highlight on selected/active options */
select option:checked,
select option:hover {
  background: #111;
  color: #fff;
  /* Chrome/Windows inset shadow trick for native dropdown list */
  box-shadow: 0 0 10px 100px #111 inset;
}

select option {
  background: #fff;
  color: #111;
}

/* Kill any browser-default blue outline; replace with monochrome border */
select:focus,
input:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
  box-shadow: none;
}

/* Monochrome checkbox and radio accent */
input[type="checkbox"],
input[type="radio"] {
  accent-color: #111;
}

/* Text selection color */
::selection {
  background: #111;
  color: #fff;
}

::-moz-selection {
  background: #111;
  color: #fff;
}

/* ── Toast ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: var(--z-toast);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 380px;
  pointer-events: auto;
  animation: slideToast 0.3s var(--ease-out);
}

@keyframes slideToast {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--gray-900);
  margin-bottom: 2px;
}

.toast-message {
  font-size: var(--text-xs);
  color: var(--gray-500);
  line-height: var(--leading-relaxed);
}

.toast-close {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.toast-close:hover {
  color: var(--gray-700);
}

.toast-success .toast-icon {
  color: var(--color-success);
}

.toast-error .toast-icon {
  color: var(--color-error);
}

.toast-info .toast-icon {
  color: var(--gray-700);
}

/* ── Cookie Consent Banner ──────────────────────────────── */
/* While the cookie banner is visible, reserve space at the bottom of the page
   so the fixed banner never overlaps form controls (Save buttons, etc.). */
body.cookie-banner-active {
  padding-bottom: 96px;
}

.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #111;
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cookie-consent-text {
  font-size: 14px;
  line-height: 1.5;
  color: #ccc;
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.btn-cookie-primary {
  padding: 9px 20px;
  background: #fff;
  color: #111;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-cookie-primary:hover {
  background: #f0f0f0;
}

.btn-cookie-secondary {
  padding: 9px 20px;
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-cookie-secondary:hover {
  border-color: #fff;
}

@media (max-width: 640px) {
  body.cookie-banner-active {
    padding-bottom: 160px;
  }

  .cookie-consent {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .cookie-actions {
    width: 100%;
  }

  .btn-cookie-primary,
  .btn-cookie-secondary {
    flex: 1;
    text-align: center;
  }
}

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.96) translateY(16px);
  transition: transform var(--transition-slow);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-150);
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--gray-100);
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.modal-close:hover {
  background: var(--gray-200);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-150);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--gray-150);
  margin: 0;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gray-400);
  font-size: var(--text-xs);
}

.divider-text::before,
.divider-text::after {
  flex: 1;
  content: '';
  border-top: 1px solid var(--gray-150);
}

/* ── Empty state ───────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-10) var(--space-4);
  gap: var(--space-2);
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  color: var(--gray-300);
  margin-bottom: 8px;
}

.empty-state-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--gray-900);
}

.empty-state-text {
  font-size: var(--text-base);
  color: var(--gray-500);
  max-width: 320px;
  line-height: var(--leading-relaxed);
}

/* ── Skeleton loader ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-xs);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-img {
  aspect-ratio: 4/3;
  border-radius: var(--radius-md);
}

.skeleton-line {
  height: 14px;
  border-radius: 7px;
}

.skeleton-line.w-3-4 {
  width: 75%;
}

.skeleton-line.w-1-2 {
  width: 50%;
}

.skeleton-line.w-1-4 {
  width: 25%;
}

/* ── Flash messages ────────────────────────────────────────── */
.flash-banner {
  padding: 14px 24px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  display: flex;
  align-items: center;
  gap: 10px;
}

.flash-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border-bottom: 1px solid #d0d0d0;
}

.flash-error {
  background: var(--color-error-bg);
  color: var(--color-error);
  border-bottom: 1px solid #d0d0d0;
}

.flash-info {
  background: var(--gray-50);
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
}

/* ── Share panel ───────────────────────────────────────────── */
.share-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: var(--z-modal);
  padding: 24px 24px 32px;
  transform: translateY(100%);
  transition: transform var(--transition-slow) var(--ease-out);
}

.share-panel.open {
  transform: translateY(0);
}

.share-panel-handle {
  width: 40px;
  height: 4px;
  background: var(--gray-200);
  border-radius: 999px;
  margin: 0 auto 24px;
}

.share-panel-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: 20px;
  letter-spacing: var(--tracking-tight);
}

.share-link-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 20px;
}

.share-link-input {
  flex: 1;
  padding: 11px 14px;
  border: none;
  outline: none;
  font-size: var(--text-sm);
  color: var(--gray-600);
  background: var(--gray-50);
}

.share-link-copy {
  padding: 11px 16px;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  background: var(--black);
  color: var(--white);
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.share-link-copy:hover {
  background: var(--gray-800);
}

.share-platforms {
  display: flex;
  gap: 12px;
}

.share-platform-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--gray-150);
  border-radius: var(--radius-md);
  background: var(--white);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--gray-700);
  cursor: pointer;
  flex: 1;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.share-platform-btn:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-xs);
}

.share-platform-btn svg {
  width: 22px;
  height: 22px;
}

/* ── Typography utilities ──────────────────────────────────── */
.text-xs {
  font-size: var(--text-xs);
}

.text-sm {
  font-size: var(--text-sm);
}

.text-base {
  font-size: var(--text-base);
}

.text-lg {
  font-size: var(--text-lg);
}

.text-xl {
  font-size: var(--text-xl);
}

.text-2xl {
  font-size: var(--text-2xl);
}

.text-3xl {
  font-size: var(--text-3xl);
}

.text-4xl {
  font-size: var(--text-4xl);
}

.font-normal {
  font-weight: var(--weight-normal);
}

.font-medium {
  font-weight: var(--weight-medium);
}

.font-semibold {
  font-weight: var(--weight-semibold);
}

.font-bold {
  font-weight: var(--weight-bold);
}

.text-black {
  color: var(--black);
}

.text-muted {
  color: var(--color-text-muted);
}

.text-subtle {
  color: var(--color-text-subtle);
}

.text-white {
  color: var(--white);
}

.text-success {
  color: var(--color-success);
}

.text-error {
  color: var(--color-error);
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tracking-tight {
  letter-spacing: var(--tracking-tight);
}

.leading-tight {
  line-height: var(--leading-tight);
}

/* ══════════════════════════════════════════════════════════════
   Mobile Bottom Navigation: Cheaply-style, cheaply customised
   ══════════════════════════════════════════════════════════════ */
.bottom-nav {
  display: none;
  /* hidden on desktop */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  background: var(--white);
  border-top: 1px solid var(--gray-150);
  /* Safe area for iPhone home indicator */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 64px;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 8px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--gray-400);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
  min-width: 56px;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--black);
}

.bottom-nav-item.active svg {
  stroke-width: 2.5;
}

/* Centre "Post" button: prominent CTA */
.bottom-nav-post {
  width: 48px;
  height: 48px;
  background: var(--black);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  margin-bottom: 2px;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.bottom-nav-post svg {
  width: 22px;
  height: 22px;
  stroke: var(--white);
}

.bottom-nav-item:hover .bottom-nav-post {
  transform: scale(1.08);
  background: var(--gray-800);
}

/* Body padding so content isn't hidden behind nav */
@media (max-width: 768px) {
  .bottom-nav {
    display: block;
  }

  /* Push page content above the bottom nav */
  .page-body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Ensure footer doesn't overlap bottom nav */
  .site-footer {
    margin-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
}

/* ── User Greeting ────────────────────────────────────────── */
.user-greeting-section {
  padding: 32px 0 16px;
}

.greeting-text {
  font-size: 32px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 8px;
}

.greeting-sub {
  color: var(--color-text-muted);
  font-size: 16px;
  font-weight: 400;
  margin-bottom: 32px;
  text-align: center;
}

/* ── AI Search Home Banner ───────────────────────────────────── */
.dh-home-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 14px 18px;
  background: var(--black);
  border-radius: var(--radius-md);
  color: var(--white);
  text-decoration: none;
  transition: background var(--transition-fast);
  max-width: 580px;
  /* Prevent stretching on wide desktop layouts */
}

.dh-home-banner:hover {
  background: var(--gray-800);
}

.dh-home-banner-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
}

.dh-home-banner-text {
  flex: 1;
  min-width: 0;
}

.dh-home-banner-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
}

.dh-home-banner-text span {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dh-home-banner-arrow {
  flex-shrink: 0;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 600px) {
  .dh-home-banner-text span {
    display: none;
  }
}

/* ── Social Post Box ────────────────────────────────────────── */
.social-post-section {
  padding: 16px 0 32px;
  max-width: 680px;
  margin: 0 auto;
}

.social-post-box {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.social-post-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
}

.social-avatar-sm {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gray-800), var(--black));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--white);
  font-size: 14px;
  letter-spacing: 0.1em;
  overflow: hidden;
  flex-shrink: 0;
}

.social-avatar-sm span {
  display: block;
  line-height: 1;
}

.social-avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-post-input-bridge {
  flex: 1;
  background: var(--gray-100);
  border-radius: 20px;
  padding: 12px 18px;
  color: var(--gray-600);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.social-post-input-bridge:hover {
  background: var(--gray-150);
  color: var(--black);
}

.social-post-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 12px 4px 4px;
}

.social-post-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gray-500);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
  cursor: pointer;
}

.social-post-btn:hover {
  background: var(--gray-50);
  color: var(--black);
}

.social-post-btn svg {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  flex-shrink: 0;
}

/* ── Standardize Modal Inputs ─────────────────────────────── */
.input-minimal {
  width: 100%;
  font-size: 48px !important;
  font-weight: 800;
  border: none;
  padding: 0;
  color: var(--gray-900);
  outline: none;
  text-align: center !important;
  background: transparent;
}

.input-minimal::placeholder {
  color: var(--gray-200);
}

/* Account settings: typography-led, unified user model */
.settings-page-minimal {
  min-height: calc(100vh - var(--header-height));
  background: var(--color-bg);
  padding: 56px 0 96px;
}

.settings-shell {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.settings-back-link {
  color: var(--gray-600);
  display: inline-flex;
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: 28px;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.settings-heading {
  align-items: flex-end;
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 36px;
}

.settings-kicker,
.settings-section-label {
  color: var(--gray-500);
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.settings-page-title {
  color: var(--black);
  font-size: 48px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0 0 14px;
}

.settings-page-sub {
  color: var(--gray-600);
  font-size: 18px;
  line-height: 1.65;
  margin: 0;
  max-width: 720px;
}

.settings-identity-strip {
  align-items: center;
  display: flex;
  gap: 16px;
  min-width: 280px;
  padding-bottom: 6px;
}

.settings-profile-avatar,
.settings-avatar-preview {
  align-items: center;
  background: var(--black);
  border-radius: 50%;
  color: var(--white);
  display: flex;
  flex-shrink: 0;
  font-size: 22px;
  font-weight: 800;
  height: 72px;
  justify-content: center;
  overflow: hidden;
  width: 72px;
}

.settings-profile-avatar img,
.settings-avatar-preview img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.settings-identity-strip strong,
.settings-identity-strip span {
  display: block;
}

.settings-identity-strip strong {
  color: var(--black);
  font-size: 18px;
  font-weight: 800;
}

.settings-identity-strip span {
  color: var(--gray-500);
  font-size: 14px;
  margin-top: 4px;
}

.settings-tabs {
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  gap: 28px;
  margin-bottom: 8px;
  overflow-x: auto;
  padding-bottom: 14px;
}

.settings-tabs a {
  color: var(--gray-600);
  flex: 0 0 auto;
  font-size: var(--text-sm);
  font-weight: 800;
  text-decoration: none;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.settings-tabs a:hover,
.settings-tabs a:focus {
  color: var(--black);
  transform: translateY(-1px);
}

.settings-alert {
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 22px;
  padding: 14px 18px;
  transition: opacity var(--transition-fast);
}

.settings-alert ul {
  margin: 0;
  padding-left: 18px;
}

.settings-alert-success {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  color: var(--black);
}

.settings-alert-error {
  background: var(--gray-900);
  border: 1px solid var(--gray-900);
  color: var(--white);
}

.settings-flow {
  display: flex;
  flex-direction: column;
}

.settings-section {
  display: grid;
  gap: 64px;
  grid-template-columns: 280px minmax(0, 1fr);
  padding: 48px 0;
  border-bottom: 1px solid var(--gray-100);
}

.settings-section:last-child {
  border-bottom: none;
  padding-bottom: 32px;
}

.settings-section-copy h2 {
  color: var(--black);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0 0 12px;
}

.settings-section-copy p,
.settings-inline-actions span {
  color: var(--gray-600);
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
}

.settings-section-body {
  max-width: 680px;
}

.settings-file-input,
.settings-hidden-action {
  display: none;
}

.settings-avatar-form {
  align-items: center;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.settings-inline-actions {
  align-items: center;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-grid-2 {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-submit {
  align-self: flex-start;
  margin-top: 8px;
}

.settings-toggle-row {
  align-items: center;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 18px 0;
  transition: opacity var(--transition-fast), background var(--transition-fast);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: var(--radius-sm);
}

.settings-toggle-row:first-child {
  padding-top: 8px;
}

.settings-toggle-row:last-child {
  border-bottom: none;
}

.settings-toggle-row:hover {
  opacity: 0.8;
  background: var(--gray-50);
}

.settings-toggle-row strong,
.settings-toggle-row small {
  display: block;
}

.settings-toggle-row strong {
  color: var(--black);
  font-size: 15px;
  font-weight: 800;
}

.settings-toggle-row small {
  color: var(--gray-500);
  font-size: 13px;
  line-height: 1.55;
  margin-top: 4px;
}

.settings-toggle-row input {
  accent-color: var(--black);
  flex: 0 0 auto;
  height: 18px;
  width: 18px;
}

.settings-link-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-link-list a,
.settings-link-list button {
  align-items: center;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--gray-150);
  color: var(--black);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  justify-content: space-between;
  padding: 17px 0;
  text-align: left;
  text-decoration: none;
  transition: opacity var(--transition-fast), padding-left var(--transition-fast);
  width: 100%;
}

.settings-link-list a::after,
.settings-link-list button::after {
  content: "›";
  color: var(--gray-500);
  font-size: 22px;
  line-height: 1;
}

.settings-link-list a:hover,
.settings-link-list button:hover {
  opacity: 0.7;
  padding-left: 6px;
}

.settings-danger-section {
  border-bottom: none;
}

.settings-delete-confirm {
  max-width: 320px;
}

.settings-crop-modal {
  align-items: center;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 9999;
}

.settings-crop-dialog {
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow-xl);
  max-width: 360px;
  padding: 24px;
  width: 100%;
}

.settings-crop-dialog h3 {
  color: var(--black);
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 16px;
}

.settings-crop-frame {
  background: var(--gray-50);
  border: 3px solid var(--black);
  border-radius: 50%;
  height: 240px;
  margin: 0 auto 10px;
  overflow: hidden;
  width: 240px;
}

.settings-crop-frame canvas {
  cursor: grab;
  display: block;
  touch-action: none;
}

.settings-crop-dialog p {
  color: var(--gray-500);
  font-size: 12px;
  margin: 0 0 16px;
  text-align: center;
}

.settings-crop-dialog input[type="range"] {
  accent-color: var(--black);
  width: 100%;
}

.settings-crop-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}
/* Batch countdown timer */
.batch-countdown { display:inline-flex; align-items:center; gap:8px; font-size:13px; font-weight:700; color:#111; background:#fafafa; border:1px solid #eee; padding:6px 12px; border-radius:4px; margin:8px 0; }
.batch-countdown .cd-label { color:#666; font-weight:600; }
.batch-countdown .cd-time { font-variant-numeric:tabular-nums; }
.batch-countdown.cd-done { background:#fff0f0; border-color:#fcc; color:#900; }

/* Custom monochrome date picker (app-date) */
.app-date { position: relative; display: inline-block; width: 100%; }
.app-date-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 46px; padding: 10px 14px;
  background: #fff; color: #111; border: 1.5px solid #e0e0e0; border-radius: 0;
  font-family: inherit; font-size: 14px; font-weight: 500; text-align: left;
  cursor: pointer; gap: 12px; transition: border-color 0.15s;
}
.app-date-btn:hover { border-color: #111; }
.app-date-btn:focus { outline: none; border-color: #111; box-shadow: 0 0 0 2px #111 inset; box-shadow: 0 0 0 1px #111; }
.app-date-btn svg { flex-shrink: 0; color: #666; }
.app-date-btn[aria-expanded="true"] { border-color: #111; }
.app-date-label { flex: 1; color: #111; font-variant-numeric: tabular-nums; }
.app-date-pop[hidden] { display: none; }
.app-date-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 9000;
  width: 300px; max-width: calc(100vw - 16px);
  background: #fff; border: 1.5px solid #111; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  display: flex; flex-direction: column;
}
.app-date-head { display: flex; align-items: center; padding: 10px 8px; border-bottom: 1px solid #eee; gap: 6px; }
.app-date-nav {
  width: 36px; height: 36px; border: none; background: #fff; color: #111;
  font-size: 22px; line-height: 1; cursor: pointer; border-radius: 0;
  display: flex; align-items: center; justify-content: center;
}
.app-date-nav:hover { background: #f0f0f0; }
.app-date-title {
  flex: 1; border: none; background: #fff; color: #111;
  font-size: 14px; font-weight: 700; text-align: center; cursor: pointer;
  padding: 8px 10px; border-radius: 0; font-family: inherit;
}
.app-date-title:hover { background: #f0f0f0; }
.app-date-body { padding: 8px; }
.app-date-grid { display: grid; gap: 2px; }
.app-date-grid-7 { grid-template-columns: repeat(7, 1fr); }
.app-date-grid-3 { grid-template-columns: repeat(3, 1fr); }
.app-date-dow {
  text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: #888; padding: 6px 0;
}
.app-date-cell {
  border: none; background: #fff; color: #111;
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; border-radius: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s;
}
.app-date-day { height: 36px; font-variant-numeric: tabular-nums; }
.app-date-month, .app-date-year { height: 44px; font-weight: 600; }
.app-date-cell:hover:not(:disabled) { background: #f0f0f0; }
.app-date-muted { color: #ccc; }
.app-date-today { outline: 1px solid #111; outline-offset: -3px; font-weight: 700; }
.app-date-sel {
  background: #111 !important; color: #fff !important;
}
.app-date-sel:hover { background: #000 !important; }
.app-date-dis { color: #ddd; cursor: not-allowed; }
.app-date-dis:hover { background: #fff !important; }
.app-date-foot {
  display: flex; justify-content: space-between; padding: 8px 12px;
  border-top: 1px solid #eee; gap: 8px;
}
.app-date-link {
  border: none; background: none; color: #111;
  font-family: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; padding: 6px 10px; border-radius: 0;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.app-date-link:hover { background: #f0f0f0; }

/* KYC upload component (clean, no legacy chrome) */
.kyc-upload-root { display: flex; flex-direction: column; gap: 8px; }
.kyc-up-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.kyc-up-label { font-size: 13px; font-weight: 700; color: #111; }
.kyc-up-hint  { font-size: 12px; color: #888; }
.kyc-up-drop {
  border: 1.5px dashed #c8c8c8; background: #fafafa;
  padding: 26px 18px; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: border-color 0.15s, background 0.15s;
  outline: none;
}
.kyc-up-drop:hover, .kyc-up-drop:focus-visible { border-color: #111; background: #fff; }
.kyc-up-drop.is-drag { border-color: #111; background: #fff; border-style: solid; }
.kyc-up-drop[hidden] { display: none; }
.kyc-up-drop-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.kyc-up-icn { color: #111; }
.kyc-up-drop-title { font-size: 14px; font-weight: 700; color: #111; }
.kyc-up-drop-sub   { font-size: 12px; color: #888; }
.kyc-up-card {
  position: relative; display: grid; grid-template-columns: 64px 1fr auto; align-items: center;
  gap: 14px; padding: 12px 14px; border: 1.5px solid #111; background: #fff;
}
.kyc-up-card[hidden] { display: none; }
.kyc-up-thumb {
  width: 64px; height: 64px; background: #f0f0f0; border: 1px solid #e0e0e0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  flex-shrink: 0;
}
.kyc-up-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kyc-up-pdf {
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; color: #666;
}
.kyc-up-meta  { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kyc-up-name  { font-size: 13.5px; font-weight: 700; color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kyc-up-status{ font-size: 12px; color: #666; }
.kyc-up-status.is-err { color: #a00; font-weight: 700; }
.kyc-up-size  { font-size: 11px; color: #999; font-variant-numeric: tabular-nums; }
.kyc-up-remove{
  background: none; border: none; cursor: pointer; color: #666;
  font-size: 22px; line-height: 1; padding: 4px 8px; align-self: start;
}
.kyc-up-remove:hover { color: #111; }
.kyc-up-bar { grid-column: 1 / -1; height: 3px; background: #f0f0f0; overflow: hidden; }
.kyc-up-bar-fill {
  height: 100%; width: 0%; background: #111; transition: width 0.15s linear;
}
.kyc-up-bar-fill.is-err { background: #a00; }
