/* ========================================
   ZEN NEWS - iOS-Style Design
   ======================================== */

/* ---------- CSS VARIABLES ---------- */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-logo: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;

  /* Text scaling (0.85 → 1.2, driven by settings slider) */
  --text-scale: 1;
  /* Dampened scale for UI labels (Why This Matters / Explore History buttons).
     Derived from --text-scale in CSS — override this here to adjust button text.
     Formula: 0.6 + (0.55 × text-scale) gives smaller size range vs full 85%–120%. */
  --text-scale-ui: calc(0.6 + 0.55 * var(--text-scale));

  /* Glass chrome background (semi-transparent for blur effect) */
  --bg-chrome: rgba(237, 240, 245, 0.82);

  /* Light mode colors */
  --bg-primary: rgb(237, 240, 245);
  --bg-card: rgb(250, 250, 250);
  --bg-importance: rgb(245, 245, 242);
  --bg-button: rgba(255, 255, 255, 0.342);   
  --text-primary: rgb(17, 24, 39);
  --text-headline:rgb(0, 0, 0); 
  --text-secondary: rgb(75, 85, 99);
  --text-importance-label: rgba(44, 26, 14, 0.856);
  --text-tertiary: rgb(107, 114, 128);
  --text-interactive: rgb(43, 118, 240);  
  --border-color: rgb(234, 235, 238);
  --shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); 
  --logo-shadow: rgba(57, 70, 206, 0.35);  
  --shadow-shade: rgba(0, 0, 0, 0.15);
  --bg-press: rgba(167, 139, 250, 0.15);
  --bg-segmented: rgba(118, 118, 128, 0.12);
  --bg-tab-active: rgba(0, 122, 255, 0.85);
  --text-tab-active: #fff;
  --shadow-tab-button: 0 2px 4px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --refresh-pill: rgb(0, 156, 44);
  --refresh-pill-bg: rgba(0, 156, 0, 0.1);
  --bg-tabs-left: rgba(118, 118, 128, 0.06);
}

html[data-mode="nightMan"] {
  --bg-chrome: rgba(0, 0, 0, 0.80);

  /* Dark mode colors */
  --bg-primary: rgb(0, 0, 0);
  --bg-card: rgba(255, 255, 255, 0.08);  
  --bg-importance: rgb(28, 28, 30);
  --bg-button: rgba(255, 255, 255, 0.05);
  --text-primary: rgb(230, 230, 230);
  --text-headline:rgb(255, 255, 255); 
  --text-secondary: rgb(200, 200, 200);
	--text-importance-label: rgb(164, 148, 252);
  --text-tertiary: rgb(155, 155, 168);
  --text-interactive: rgb(59, 130, 246);
  --border-color: rgb(29, 29, 29);
  --shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --logo-shadow: rgba(139, 146, 250, 0.35);
  --shadow-shade: rgba(0, 0, 0, 0.30);
  --bg-press: rgba(167, 139, 250, 0.15);
  --bg-segmented: rgba(118, 118, 128, 0.24);
  --bg-tab-active: rgba(59, 131, 246, 0.75);
  --text-tab-active: var(--text-primary);
  --shadow-tab-button: 0 2px 8px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.4);
  --refresh-pill: rgb(52, 199, 89);
  --refresh-pill-bg: rgba(52, 199, 89, 0.20);
  --bg-tabs-left: rgba(118, 118, 128, 0.25);
}

/* ---------- RESET & BASE ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  max-width: 500px;
  margin: 0 auto;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.2s, color 0.2s;
  touch-action: manipulation;
}

body {
  position: relative;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  transition: opacity 0.2s, color 0.2s;
}

button:hover {
  opacity: 0.8;
}

button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

a {
  color: var(--text-interactive);
  text-decoration: none;
}

a:visited {
  color: var(--text-interactive);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---------- APP CONTAINER ---------- */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* Use dynamic viewport height for iOS */
  overflow: hidden;
  position: relative;
}

/* Constrain footer to mobile width */
.bottom-nav {
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- HEADER / TOP CHROME ---------- */
.top-chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: transparent;
}

/* Header Row: Logo + Icons */
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(30px + env(safe-area-inset-top, 0px)) 1.25rem 0.6rem;
  background: var(--bg-primary);
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-interactive);
  font-family: var(--font-logo);
  text-shadow: 0 8px 10px var(--logo-shadow);
}

.header-icons {
  display: flex;
  gap: .50rem;
  align-items: center;
}

.theme-toggle,
.notif-toggle {
  width: 1.7rem;
  height: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  line-height: 1;
  background: var(--bg-button);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.notif-toggle::before {
  content: "🔕";
}

.notif-toggle[aria-pressed="true"]::before {
  content: "🔔";
}

html[data-mode="nightMan"] .theme-toggle::before {
  content: "☀️";
}

html:not([data-mode="nightMan"]) .theme-toggle::before {
  content: "🌙";
}

.theme-toggle:hover,
.notif-toggle:hover {
  opacity: 0.8;
}

.theme-toggle:active,
.notif-toggle:active {
  transform: scale(0.92);
  background: var(--bg-press);
}

/* ---------- TABS (iOS Segmented Control) ---------- */
.top-tabs {
  display: flex;
  align-items: center;
  padding: 0.25rem 1.0em 0rem;
  background: linear-gradient(
    to bottom,
    var(--bg-primary) 0%,
    transparent 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tabs-left {
  display: flex;
  flex: 1;
  background: var(--bg-tabs-left);
  border-radius: 0.5rem;
  padding: 0.125rem;
  position: relative;
}

.tabs-date {
  color: var(--text-primary);
  font-size: 0.7rem;
  padding-right: 0.5rem;
  white-space: nowrap;
  font-weight: 600;
}

/* Refresh pill — replaces date when new content available */
.refresh-pill {
  display: none;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  margin-right: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--refresh-pill);
  background: var(--refresh-pill-bg);
  border: 1.5px solid var(--refresh-pill);
  border-radius: 1rem;
  cursor: pointer;
  white-space: nowrap;
  animation: pill-fade-in 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.refresh-pill:active {
  opacity: 0.8;
  transform: scale(0.96);
}
.refresh-pill.visible {
  display: flex;
}
.refresh-pill .pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--refresh-pill);
  animation: pill-pulse 1.5s ease-in-out infinite;
}
@keyframes pill-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pill-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}


.tab {
  flex: 1;
  color: var(--text-secondary);
  font-weight: 400;
  font-size: calc(0.75rem * var(--text-scale-ui));
  letter-spacing: 0.0rem;
  padding: 0.35rem 0 0.35rem 0;
  border: none;
  border-radius: 0.4375rem;
  text-align: center;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 1;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--text-tab-active);
  font-weight: 500;
  background: var(--bg-tab-active);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08),
              0 1px 2px rgba(0, 0, 0, 0.06);
  transition: none;
  opacity: 1;
}

html[data-mode="nightMan"] .tab.active {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* ---------- PWA BANNER ---------- */
.pwa-banner {
  padding: 0.5rem 1.5rem 0;
  text-align: center;
  font-size: 0.875rem;
	margin-bottom: .25rem;
  position: relative;
  z-index: 10;
}



/* ---------- MAIN VIEWPORT (Horizontal Scroll) ---------- */
.viewport {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  display: flex;
  /* Hide scrollbar but keep functionality */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.viewport::-webkit-scrollbar {
  display: none;
}

/* ---------- SLIDES ---------- */
.slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding-top: calc(7.5rem + env(safe-area-inset-top, 0px));
  padding-right: 1.0rem;
  padding-left: 1.0rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ---------- STORY CARD ---------- */


.deck-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
	padding-top: 0.5rem;
}

.deck {
  background: var(--bg-card);
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  padding: 0rem 1.0rem 5.0rem;
  display: flex;
  flex-direction: column;

}

.headline {
  font-size: calc(1.4rem * var(--text-scale));
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02rem;
  color: var(--text-headline);
  margin: 0.5rem 0 1.0rem;
}

.summary {
  font-size: calc(1rem * var(--text-scale));
  line-height: 1.41;
  color: var(--text-secondary);
}

.summary ul {
  padding-left: 1.0rem;
  list-style-type: disc;
}

.summary li {
  margin-bottom: 0.75rem;
}

.summary li:last-child {
  margin-bottom: 0;
}

/* ---------- SOURCES ---------- */
.sources-wrapper {
  padding-top: 0.75rem;
  padding-left: .875rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.content-type-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.content-type-svg {
  width: 1.0rem;
  height: 1.0rem;
  color: var(--text-secondary);
}

.sources-list {
  font-size: calc(0.80rem * var(--text-scale));
  font-weight: 500;
  color: var(--text-interactive);
}

/* ---------- TAB NAVIGATION (iOS Segmented Control) ---------- */
.tab-navigation {
  display: flex;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 0.5rem;
  padding: 0.125rem;
  position: relative;
}

html[data-mode="nightMan"] .tab-navigation {
  background: rgba(255, 255, 255, 0.08);
}

.tab-button {
  flex: 1;
  padding: 0.35rem 0.5rem;
  font-size: calc(0.75rem * var(--text-scale-ui));
  font-weight: 400;
  color: var(--text-tertiary);
  border: none;
  border-radius: 0.4375rem;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  z-index: 1;
  white-space: nowrap;
  text-align: center;
  background: transparent;
}

.tab-button::before {
  font-size: calc(0.75rem * var(--text-scale-ui));
  /* margin-right: 0.35rem; */
}

.tab-button[data-tab="why-matters"]::before {
  content: "⚡";
}

.tab-button[data-tab="history"]::before {
  content: "📜";
  margin-right: 0.25rem;
}

.tab-button:hover {
  color: var(--text-secondary);
}

.tab-button.active {
  color: var(--text-tab-active);
  font-weight: 500;
  background: var(--bg-tab-active);
  box-shadow: var(--shadow-tab-button);
  opacity: 1;
}

.tab-content-wrapper {
  margin-top: 1.25rem;
  margin-left: 0.25rem;
  margin-right: 0.25rem;
  background: var(--bg-importance);
  border-left: 3px solid var(--bg-tab-active);
  padding: 0.5rem 1.0rem;
  border-radius: 0.75rem;

}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-panel .importance-text {
  font-size: calc(0.95rem * var(--text-scale));
  font-weight: 300;
  line-height: 1.47;
  color: var(--text-secondary);
}

/* ---------- HISTORY TAB CONTENT ---------- */

.ppp-block {
  margin-bottom: 1.5rem;
}

.ppp-block:last-child {
  margin-bottom: 0;
}

.label {
  padding-top: .25rem;
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.pattern-text,
.phase-text,
.parallels-text {
  font-size: calc(0.95rem * var(--text-scale));
	font-weight: 300;
  line-height: 1.47;
  color: var(--text-secondary);
}


.parallel-item {
  padding-left: 0.4em;
  text-indent: -0.6em;
  margin-bottom: 0.6em;
}
.scroll-anchor {
  height: 1px;
	scroll-margin-top: 700px;
}

/* ---------- END SLIDE ---------- */
.end-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 5.0rem;
}

.xLarge {
  font-size: 4rem;
  color: var(--text-secondary);
  opacity: 0.5;
}
.list-viewport {
  overflow-y: auto;
  overflow-x: hidden;
  padding: calc(7rem + env(safe-area-inset-top, 0px)) 1.0rem 5rem;
}

.list-slide {
  width: 100%;
}

.top-dead-space {
  height: 0.9rem;
}


.list-container {
  /* List container */
  padding-bottom: 4rem;
}

.list-day {
  margin: 0 0 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 0.5rem 0.5rem 0.5rem 0.5rem;
}

.list-date {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 0.5rem 0.25rem;
  padding-bottom: .25rem;
}

.list-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.list-row {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  padding: 0 0.5rem 1.25rem;

  cursor: pointer;
  transition: background-color 0.2s;
}

.list-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}


.list-row:hover {
  opacity: 0.8;
}

.list-headline {
  font-size: calc(1rem * var(--text-scale));
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  margin-top: 0.25rem;
  line-height: 1.4;
}

.list-row-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.list-sources {
  font-size: calc(0.8125rem * var(--text-scale));
  color: var(--text-interactive);
  font-weight: 500;
}

.list-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(5rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--bg-primary) 50%
  );
  pointer-events: none;
  z-index: 100;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.list-footer-inner {
  display: none;
}

/* ---------- BOTTOM NAVIGATION ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding-top: 1.0rem;
  padding-left: 1.0rem;
  padding-right: 1.0rem;
  padding-bottom: calc(0.25rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--bg-primary) 50%
  );
  z-index: 100;
  pointer-events: none;
}

/* PWA standalone: Safari already provides bottom inset, so skip safe-area */
@media (display-mode: standalone) {
  html[data-platform="web"] .bottom-nav {
    padding-bottom: 0.25rem;
  }
  html[data-platform="web"] .list-footer {
    height: 5rem;
  }
}

.bottom-nav-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-height: 2.8rem;
  position: relative;
  gap: 1rem;
  pointer-events: auto;
}

.bottom-nav button {
  color: var(--text-primary);
  width: 2.8rem;
  height: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-button);
  border: 1px solid var(--border-color);
  border-radius: 0.875rem;
  transition: all 0.2s ease;
  backdrop-filter: blur(5px);
}

.bottom-nav button:hover:not(:disabled) {
  opacity: 0.8;
}

.bottom-nav button:active:not(:disabled) {
  transform: scale(0.92);
  background: var(--bg-press);
  border-color: var(--text-interactive);
}

.bottom-nav svg {
  width: 1.80rem;
  height: 1.80rem;
}
#share{
  position: absolute;
  left: 0;
}
#share svg {
  width: 1.60rem;
  height: 1.60rem;
}

.counter {
  color: var(--text-secondary);
  font-size: 0.80rem;
  font-weight: 500;
  min-width: 45px;
  text-align: center;
  text-shadow: 10px var(--bg-primary);
}

#settings-btn {
  position: absolute;
  top: 0;
  right: 0;
}
#settings-btn svg {
  width: 1.60rem;
  height: 1.60rem;
}

/* ---------- SETTINGS MODAL ---------- */
#settings-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
}

#settings-modal[hidden] {
  display: none;
}

.settings-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1;
}

.settings-modal-content {
  position: relative;
  background: var(--bg-primary);
  border-radius: 1rem;
  width: 92%;
  max-width: 420px;
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px);
  overflow-y: auto;
  box-shadow: 0 20px 60px -12px rgba(0, 0, 0, 0.25);
  z-index: 2;
  -webkit-overflow-scrolling: touch;
}

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

.settings-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.settings-modal-close {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-segmented);
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}
.settings-modal-close:hover {
  background: var(--bg-press);
  color: var(--text-primary);
}
.settings-modal-close svg {
  width: 1rem;
  height: 1rem;
}

.settings-body {
  padding: 0.75rem 1.25rem 1.5rem;
}

/* --- Settings Groups (iOS-style) --- */
.settings-group {
  margin-bottom: 1.25rem;
}
.settings-group:last-child {
  margin-bottom: 0;
}

.settings-group-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  padding: 0 0.1rem 0.5rem;
}

.settings-row {
  background: var(--bg-card);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.settings-row.placeholder {
  min-height: 3.5rem;
  justify-content: center;
}

.settings-placeholder-text {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  font-style: italic;
}

/* --- Text Size Slider --- */
.text-size-label {
  color: var(--text-secondary);
  font-weight: 600;
  flex-shrink: 0;
  line-height: 1;
}
.text-size-label.small {
  font-size: 0.75rem;
}
.text-size-label.large {
  font-size: 1.3rem;
}

.settings-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-segmented);
  outline: none;
}
.settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.22), 0 0 0 0.5px rgba(0,0,0,0.04);
  cursor: pointer;
}
.settings-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.22), 0 0 0 0.5px rgba(0,0,0,0.04);
  cursor: pointer;
  border: none;
}

.text-size-sample {
  margin-top: 0.55rem;
  padding: 0 0.1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* --- Toggle Rows (Notifications) --- */
.settings-row.toggle-row {
  justify-content: space-between;
  border-radius: 0;
  border-bottom: 1px solid var(--border-color);
}
.settings-row.toggle-row:first-of-type {
  border-radius: 0.75rem 0.75rem 0 0;
}
.settings-row.toggle-row:last-of-type {
  border-radius: 0 0 0.75rem 0.75rem;
  border-bottom: none;
}
.settings-row.toggle-row:only-of-type {
  border-radius: 0.75rem;
  border-bottom: none;
}

.toggle-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}
.toggle-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}
.toggle-subtitle {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  line-height: 1.3;
}

/* iOS-style toggle switch */
.ios-toggle {
  position: relative;
  flex-shrink: 0;
  width: 51px;
  height: 31px;
  cursor: pointer;
}
.ios-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg-segmented);
  border-radius: 15.5px;
  transition: background 0.25s ease;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 0 0 0.5px rgba(0,0,0,0.04);
  transition: transform 0.25s ease;
}
.ios-toggle input:checked + .toggle-track {
  background: rgb(52, 199, 89);
}
.ios-toggle input:checked + .toggle-track::after {
  transform: translateX(20px);
}

/* --- Segmented Control (Refresh Mode) --- */
.settings-row.segmented-row {
  padding: 0.6rem 0.5rem;
}

.settings-row.segmented-row.with-description {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0.6rem 0.5rem 0.65rem;
}

.segmented-control {
  display: flex;
  width: 100%;
  background: var(--bg-segmented);
  border-radius: 0.5rem;
  padding: 2px;
}

.segmented-control .segment {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 0.4rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  text-align: center;
}

.segmented-control .segment.active {
  background: var(--bg-tab-active);
  color: var(--text-tab-active);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.notif-type-description,
.notif-level-description {
  padding: 0 0.35rem;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  line-height: 1.35;
}

/* --- Notification Options Disabled State --- */
.notif-options.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.settings-group.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.settings-select {
  width: 100%;
  background: var(--bg-segmented);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  padding: 0.55rem 0.7rem;
}

/* ---------- UTILITY ---------- */
