:root {
  color-scheme: light;
  --glass-bg: rgba(246, 248, 252, 0.82);
  --surface: rgba(255, 255, 255, 0.64);
  --surface-hover: rgba(255, 255, 255, 0.88);
  --border: rgba(15, 23, 42, 0.10);
  --text: #18181b;
  --text-muted: #52525b;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.14);
  --lunar-crimson: #dc2626;
  --lunar-crimson-soft: rgba(220, 38, 38, 0.12);
  --good-color: #15803d;
  --good-bg: rgba(22, 163, 74, 0.13);
  --bad-color: #b45309;
  --bad-bg: rgba(217, 119, 6, 0.13);
  --gold: #d97706;
  --mini-card-bg: rgba(217, 119, 6, 0.08);
  --mini-card-border: rgba(217, 119, 6, 0.22);
  --moon-dark-inner: #475569;
  --moon-dark-outer: #334155;
  --moon-rim: rgba(15, 23, 42, 0.22);
  --radius: 10px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --glass-bg: rgba(24, 24, 30, 0.78);
  --surface: rgba(42, 43, 52, 0.58);
  --surface-hover: rgba(58, 60, 72, 0.78);
  --border: rgba(255, 255, 255, 0.10);
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.20);
  --lunar-crimson: #f87171;
  --lunar-crimson-soft: rgba(248, 113, 113, 0.16);
  --good-color: #4ade80;
  --good-bg: rgba(74, 222, 128, 0.15);
  --bad-color: #fbbf24;
  --bad-bg: rgba(251, 191, 36, 0.14);
  --gold: #fbbf24;
  --mini-card-bg: rgba(54, 50, 46, 0.62);
  --mini-card-border: rgba(251, 191, 36, 0.16);
  --moon-dark-inner: #2B3345;
  --moon-dark-outer: #171C26;
  --moon-rim: rgba(255, 255, 255, 0.16);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background: transparent;
  color: var(--text);
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-size: 12.5px;
  line-height: 1.35;
  overflow: hidden;
  user-select: none;
}

.hidden {
  display: none !important;
}

.osd-shell {
  width: 100vw;
  height: 100vh;
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-good {
  color: var(--good-color);
  background: var(--good-bg);
}

.badge-bad {
  color: var(--bad-color);
  background: var(--bad-bg);
}

/* ==================== MINI VIEW ==================== */
.mini-view {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: auto;
}

.mini-lunar-zone {
  height: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  cursor: pointer;
  transition: background 0.15s ease;
}

.mini-lunar-zone:hover {
  background: rgba(255, 255, 255, 0.03);
}

.mini-lunar-zone:hover .mini-footer {
  color: var(--text);
  background: var(--surface-hover);
}

.mini-main {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  min-height: 0;
}

.mini-lunar-card {
  width: 90px;
  flex-shrink: 0;
  background: var(--mini-card-bg);
  border: 1px solid var(--mini-card-border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7px 6px;
  text-align: center;
}

.mini-lunar-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.7px;
  color: var(--lunar-crimson);
  opacity: 0.9;
}

.mini-lunar-date-row {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  margin: 1px 0;
}

.mini-lunar-day {
  font-size: 29px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--lunar-crimson);
}

.mini-lunar-month {
  position: absolute;
  left: 100%;
  bottom: 2px;
  margin-left: 2px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.mini-card-badge {
  margin-top: 4px;
  font-size: 9.5px;
  padding: 1px 6px;
}

.mini-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.mini-solar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.mini-solar-date {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-highlight {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-highlight.is-holiday {
  color: var(--lunar-crimson);
  font-weight: 600;
}

.mini-moon-box {
  width: 54px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.mini-moon-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(251, 191, 36, 0.18));
}

.mini-moon-pct {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1;
  white-space: nowrap;
}

.moon-phase-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.mini-footer {
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 11px;
  color: var(--text-muted);
}

.mini-view:hover .mini-footer {
  color: var(--text);
  background: var(--surface-hover);
}

.mini-footer-arrow {
  font-size: 15px;
  line-height: 1;
  font-weight: 600;
}

/* ==================== DETAIL VIEW ==================== */
.detail-view {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  animation: fadeIn 0.14s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0.65; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-header {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 13px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.detail-header-cal {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 2px;
}

.detail-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.header-title-wrap {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.header-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-title-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 6px;
  margin-left: -6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.header-title-btn:hover,
.header-title-btn:focus-visible {
  background: var(--surface-hover);
  border-color: var(--border);
  outline: none;
}

.header-title-chevron {
  flex-shrink: 0;
  opacity: 0.65;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.header-title-btn:hover .header-title-chevron {
  opacity: 1;
}

.header-title-btn.is-picker-open .header-title-chevron {
  transform: rotate(180deg);
  opacity: 0.9;
}

.header-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.icon-btn,
.pill-btn,
.conv-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.icon-btn {
  width: 23px;
  height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.pill-btn {
  height: 23px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 600;
}

.icon-btn:hover,
.pill-btn:hover,
.conv-toggle:hover {
  background: var(--surface-hover);
}

.close-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.detail-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 12px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.detail-body::-webkit-scrollbar {
  width: 5px;
}
.detail-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 2px;
}

.wk-sat { color: var(--accent); }
.wk-sun { color: var(--lunar-crimson); }

.calendar-stage {
  position: relative;
  padding: 0 2px;
}

.calendar-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.picker-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 6px;
  height: 244px;
}

.picker-cell {
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.picker-cell:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

.picker-cell:disabled {
  opacity: 0.24;
  cursor: default;
  background: transparent;
  border-color: transparent;
}

.picker-cell.is-other-decade {
  opacity: 0.42;
  background: transparent;
}

.picker-cell.is-current {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.picker-cell.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.picker-cell.is-selected:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.day-cell {
  position: relative;
  min-width: 0;
  overflow: hidden;
  height: 34px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease;
}

.day-cell:hover {
  background: var(--surface-hover);
}

.day-cell.is-other-month {
  opacity: 0.38;
  background: transparent;
}

.day-cell.is-today {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.day-cell.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.day-cell.is-selected .day-lunar,
.day-cell.is-selected .day-solar {
  color: #ffffff !important;
}

.day-solar {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.15;
}

.day-cell.is-sunday:not(.is-selected) .day-solar {
  color: var(--lunar-crimson);
}

.day-lunar {
  font-size: 9.5px;
  line-height: 1.1;
  color: var(--text-muted);
  margin-top: 1px;
}

.day-cell.is-lunar-special:not(.is-selected) .day-lunar {
  color: var(--text);
  font-weight: 700;
}

.day-dot {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
}

.day-dot.is-holiday {
  background: var(--lunar-crimson);
}

.day-cell.is-selected .day-dot {
  background: #ffffff;
  opacity: 0.95;
}

.day-cell.is-hoangdao:not(.is-selected) .day-lunar {
  color: var(--good-color);
}

/* Selected Day Detail Card */
.selected-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.selected-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.sel-main-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sel-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.selected-card:not(.cath-selected-card) .sel-badges {
  margin-top: 5px;
}

.sel-moon-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(251, 191, 36, 0.16));
}

.selected-card:not(.cath-selected-card) .sel-main-left {
  gap: 10px;
}

.selected-card:not(.cath-selected-card) .sel-date-wrap {
  flex: 0 1 auto;
}

.sel-moon-slot {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
}

.selected-card:not(.cath-selected-card) .sel-moon-icon {
  width: 64px;
  height: 64px;
}

.sel-date-wrap {
  flex: 1;
  min-width: 0;
}

.sel-solar {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.sel-lunar {
  font-size: 11px;
  color: var(--lunar-crimson);
  font-weight: 600;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sel-moon-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.holiday-banner {
  font-size: 11px;
  font-weight: 600;
  color: var(--lunar-crimson);
  background: var(--lunar-crimson-soft);
  border-radius: 6px;
  padding: 4px 8px;
}

.canchi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.canchi-item {
  min-width: 0;
  overflow: hidden;
  background: rgba(127, 127, 127, 0.08);
  border-radius: 7px;
  padding: 4px 7px;
  display: flex;
  flex-direction: column;
}

.canchi-label {
  font-size: 9.5px;
  color: var(--text-muted);
}

.canchi-val {
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hours-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hours-title {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.hours-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.hour-chip {
  font-size: 10.5px;
  padding: 3px 5px;
  border-radius: 6px;
  background: rgba(127, 127, 127, 0.08);
  text-align: center;
  white-space: nowrap;
}

.hour-chip strong {
  color: var(--good-color);
  font-weight: 600;
}

/* Converter Bar */
.converter-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 6px;
}

.conv-toggle {
  height: 24px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

.conv-input {
  height: 24px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(127, 127, 127, 0.10);
  color: var(--text);
  font-family: inherit;
  font-size: 11px;
  text-align: center;
  outline: none;
}

.conv-input:focus {
  border-color: var(--accent);
}

.conv-input::-webkit-inner-spin-button,
.conv-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.conv-sm { width: 28px; }
.conv-yr { width: 42px; }

.conv-sep {
  color: var(--text-muted);
  font-size: 10.5px;
}

.conv-leap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.conv-go {
  margin-left: auto;
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  flex-shrink: 0;
}

.conv-go:hover {
  background: var(--accent);
  opacity: 0.9;
}

.conv-error {
  font-size: 11px;
  color: var(--lunar-crimson);
  padding: 0 4px;
}


/* ==================== ZODIAC CALENDAR WATERMARK ==================== */
.zodiac-bg {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 156px;
  height: 156px;
  opacity: 0.16;
  pointer-events: none;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zodiac-svg {
  width: 100%;
  height: 100%;
  animation: zodiacBob 3.2s ease-in-out infinite;
  transform-origin: center bottom;
}

.zodiac-svg .z-ear-l {
  transform-origin: 16px 16px;
  animation: zodiacEarL 4.2s ease-in-out infinite;
}

.zodiac-svg .z-ear-r {
  transform-origin: 32px 16px;
  animation: zodiacEarR 4.2s ease-in-out infinite;
}

.zodiac-svg .z-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: zodiacBlink 5s ease-in-out infinite;
}

.zodiac-svg .z-tongue {
  transform-origin: 24px 35px;
  animation: zodiacTongue 2.2s ease-in-out infinite;
}

@keyframes zodiacBob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-1.5px) scale(1.03); }
}

@keyframes zodiacEarL {
  0%, 82%, 100% { transform: rotate(0deg); }
  88% { transform: rotate(-8deg); }
  94% { transform: rotate(3deg); }
}

@keyframes zodiacEarR {
  0%, 82%, 100% { transform: rotate(0deg); }
  88% { transform: rotate(8deg); }
  94% { transform: rotate(-3deg); }
}

@keyframes zodiacBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.15); }
}

@keyframes zodiacTongue {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.72); }
}

/* ==================== TERM EXPLANATIONS & GLOSSARY ==================== */
.term-trigger {
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.canchi-item.term-trigger:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.hours-title.term-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hours-title.term-trigger:hover {
  color: var(--accent);
}

.term-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--border);
  line-height: 1;
}

.term-hover-tip {
  position: absolute;
  z-index: 25;
  max-width: 260px;
  pointer-events: none;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 9px;
  padding: 7px 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
  animation: fadeIn 0.1s ease-out;
}

.term-explain-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}

.term-explain-desc {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text);
}

.help-btn {
  font-weight: 700;
  font-size: 12px;
}

.detail-view {
  position: relative;
}

.glossary-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(10, 12, 18, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.glossary-card {
  width: 100%;
  max-height: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

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

.glossary-title {
  font-size: 13px;
  font-weight: 700;
}

.glossary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.glossary-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}

.glossary-term {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}

.glossary-desc {
  font-size: 11px;
  color: var(--text);
  line-height: 1.42;
}

.glossary-tip {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.4;
  padding-top: 4px;
}


/* ==================== SETTINGS VIEW ==================== */
.settings-view {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  animation: fadeIn 0.14s ease-out;
}

.settings-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.settings-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 12px 14px;
  overflow-y: auto;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.settings-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  padding: 2px 4px 0;
}

.setting-group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.setting-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  transition: background-color 0.12s ease;
}

.setting-item-row:not(.setting-item-row-col):hover {
  background: var(--surface-hover);
}

.setting-item-row-col {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.setting-item-sub {
  padding-left: 18px;
  background: rgba(127, 127, 127, 0.03);
}

.setting-item-divider {
  height: 1px;
  background: var(--border);
  opacity: 0.6;
}

.setting-item-row:has(#set-hover-delay:disabled) {
  opacity: 0.45;
}

.ics-sources-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ics-sources-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
}

.ics-add-form-wrapper {
  background: rgba(127, 127, 127, 0.05);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeIn 0.15s ease-out;
}

.ics-add-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.setting-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 11px;
}

.setting-card-col {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.setting-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.setting-info {
  min-width: 0;
}

.setting-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.setting-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.38;
}

.hotkey-pill {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.setting-hotkey-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hotkey-recorder {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rec-win-btn {
  flex-shrink: 0;
  font-size: 11px;
  padding: 0 8px;
}

.rec-win-btn.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.hotkey-capture-input {
  flex: 1;
  min-width: 0;
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--accent);
  background: var(--surface-hover);
  color: var(--text);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
  outline: none;
}

.setting-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.setting-btn-primary:hover {
  background: var(--accent);
  opacity: 0.9;
}

.settings-footer-note {
  margin-top: auto;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(127, 127, 127, 0.08);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.backup-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.backup-import-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(127, 127, 127, 0.06);
}

.backup-import-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.backup-import-filename {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.backup-import-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.backup-import-checks {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.backup-mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
}

.backup-mode-label {
  font-weight: 600;
  color: var(--text-muted);
}

.backup-radio-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--text);
}

.backup-radio-item input {
  accent-color: var(--accent);
  margin: 0;
}

.backup-import-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.backup-status-msg {
  font-size: 11.5px;
  padding: 7px 10px;
  border-radius: 7px;
  line-height: 1.35;
}

.backup-status-msg.is-ok {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

body[data-theme="dark"] .backup-status-msg.is-ok {
  color: #86efac;
}

.backup-status-msg.is-err {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

body[data-theme="dark"] .backup-status-msg.is-err {
  color: #fca5a5;
}

.cloud-head-row {
  align-items: flex-start;
  gap: 8px;
}

.cloud-sub-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(127, 127, 127, 0.06);
}

.cloud-sub-label {
  font-size: 11px;
  color: var(--text-muted);
}

.cloud-server-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cloud-server-row .ics-input {
  flex: 1;
  min-width: 0;
}

.cloud-choice-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: rgba(127, 127, 127, 0.35);
  border-radius: 999px;
  transition: background 0.16s ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.16s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.switch input:checked + .slider {
  background: var(--accent);
}

.switch input:checked + .slider::before {
  transform: translateX(18px);
}

.setting-select {
  flex-shrink: 0;
  height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.setting-select:focus {
  border-color: var(--accent);
}

body[data-theme="dark"] .setting-select,
body[data-theme="dark"] .pe-input {
  color-scheme: dark;
}

body[data-theme="dark"] .setting-select option {
  background: #1f2430;
  color: #f1f5f9;
}

body[data-theme="light"] .setting-select option {
  background: #ffffff;
  color: #1e293b;
}

/* ==================== ABOUT VIEW ==================== */
.about-body {
  gap: 10px;
}

.about-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 12px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.about-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.about-app-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.about-app-tag {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.about-card {
  gap: 6px;
}

.about-list {
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.42;
}

.about-list b {
  color: var(--text);
}

.sel-badges {
  flex-shrink: 0;
}

.sel-badges .badge {
  font-size: 10px;
  padding: 2px 6px;
}

/* ==================== CALENDAR EDGE ARROWS ==================== */
.cal-edge-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 16px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--glass-bg);
  color: var(--text-muted);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
  transition: opacity 0.14s ease, background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.calendar-stage:hover .cal-edge-nav,
.cal-edge-nav:focus-visible {
  opacity: 0.85;
  pointer-events: auto;
}

.cal-edge-nav:hover {
  opacity: 1;
  background: var(--surface-hover);
  color: var(--accent);
  border-color: var(--accent);
}

.cal-edge-prev {
  left: -10px;
}

.cal-edge-next {
  right: -10px;
}

/* ==================== SCROLL MORE INDICATOR ==================== */
.scroll-more-hint {
  position: absolute;
  right: 14px;
  bottom: 6px;
  z-index: 15;
  width: 28px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass-bg);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
  animation: scrollHintBounce 1.8s ease-in-out infinite;
}

.scroll-more-hint:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

@keyframes scrollHintBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(2.5px); }
}

/* ==================== CATHOLIC CALENDAR MODULE ==================== */
:root {
  --cath-white-fg: #334155;
  --cath-white-bg: rgba(255, 255, 255, 0.85);
  --cath-white-dot: #f8fafc;
  --cath-red-fg: #dc2626;
  --cath-red-bg: rgba(220, 38, 38, 0.13);
  --cath-red-dot: #ef4444;
  --cath-green-fg: #15803d;
  --cath-green-bg: rgba(22, 163, 74, 0.13);
  --cath-green-dot: #10b981;
  --cath-purple-fg: #7e22ce;
  --cath-purple-bg: rgba(147, 51, 234, 0.13);
  --cath-purple-dot: #9333ea;
  --cath-rose-fg: #be185d;
  --cath-rose-bg: rgba(219, 39, 119, 0.13);
  --cath-rose-dot: #ec4899;
}

[data-theme="dark"] {
  --cath-white-fg: #f8fafc;
  --cath-white-bg: rgba(255, 255, 255, 0.14);
  --cath-white-dot: #f8fafc;
  --cath-red-fg: #f87171;
  --cath-red-bg: rgba(248, 113, 113, 0.16);
  --cath-red-dot: #f87171;
  --cath-green-fg: #4ade80;
  --cath-green-bg: rgba(74, 222, 128, 0.15);
  --cath-green-dot: #4ade80;
  --cath-purple-fg: #c084fc;
  --cath-purple-bg: rgba(192, 132, 252, 0.16);
  --cath-purple-dot: #c084fc;
  --cath-rose-fg: #f472b6;
  --cath-rose-bg: rgba(244, 114, 182, 0.16);
  --cath-rose-dot: #f472b6;
}

.badge-cath-white {
  color: var(--cath-white-fg);
  background: var(--cath-white-bg);
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.badge-cath-red { color: var(--cath-red-fg); background: var(--cath-red-bg); }
.badge-cath-green { color: var(--cath-green-fg); background: var(--cath-green-bg); }
.badge-cath-purple { color: var(--cath-purple-fg); background: var(--cath-purple-bg); }
.badge-cath-rose { color: var(--cath-rose-fg); background: var(--cath-rose-bg); }

.badge-rank-solemnity { color: var(--lunar-crimson); background: var(--lunar-crimson-soft); }
.badge-rank-feast { color: var(--accent); background: var(--accent-soft); }
.badge-rank-memorial { color: var(--good-color); background: var(--good-bg); }
.badge-rank-neutral { color: var(--text-muted); background: rgba(127, 127, 127, 0.14); }

/* Mini Catholic Zone */
.mini-catholic-zone {
  flex: 0 0 auto;
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 13px 9px;
  border-top: 1px solid var(--border);
  background: rgba(127, 127, 127, 0.04);
  cursor: pointer;
  transition: background 0.15s ease;
}

.mini-catholic-zone:hover {
  background: var(--surface-hover);
}

.mini-cath-card {
  width: 66px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 4px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  text-align: center;
}

.mini-cath-card.is-white { background: var(--cath-white-bg); border-color: rgba(245, 158, 11, 0.30); color: var(--cath-white-fg); }
.mini-cath-card.is-red { background: var(--cath-red-bg); border-color: rgba(239, 68, 68, 0.30); color: var(--cath-red-fg); }
.mini-cath-card.is-green { background: var(--cath-green-bg); border-color: rgba(16, 185, 129, 0.30); color: var(--cath-green-fg); }
.mini-cath-card.is-purple { background: var(--cath-purple-bg); border-color: rgba(168, 85, 247, 0.30); color: var(--cath-purple-fg); }
.mini-cath-card.is-rose { background: var(--cath-rose-bg); border-color: rgba(236, 72, 153, 0.30); color: var(--cath-rose-fg); }

.mini-cath-cross {
  font-size: 13px;
  line-height: 1;
}

.mini-cath-color {
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
}

.mini-cath-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.mini-cath-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.mini-cath-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-cath-rank {
  flex-shrink: 0;
  font-size: 9.5px;
  padding: 1px 6px;
}

.mini-cath-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mini-cath-meta {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-cath-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  color: var(--text-muted);
  transition: color 0.14s ease;
}

.mini-catholic-zone:hover .mini-cath-cta {
  color: var(--accent);
  font-weight: 600;
}

/* Catholic Detail View */
.cath-watermark-bg {
  opacity: 0.13;
}

.cath-watermark-svg {
  width: 100%;
  height: 100%;
}

.cath-day-cell {
  height: 44px;
  justify-content: flex-start;
  padding: 3px 1px 2px;
  gap: 1px;
}

.cath-day-cell .day-solar {
  font-size: 12px;
  line-height: 1.1;
}

.day-cath-tag {
  font-size: 8px;
  font-weight: 400;
  line-height: 1.12;
  color: var(--text-muted);
  width: 100%;
  padding: 0;
  text-align: center;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.cath-day-tooltip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  max-width: 240px;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-size: 11px;
  line-height: 1.3;
  font-weight: 500;
  text-align: center;
  white-space: normal;
  transition: opacity 0.1s ease;
}

.cath-day-tooltip.hidden {
  display: none;
}

#lunar-day-tooltip,
#cath-day-tooltip {
  max-width: 260px;
  padding: 7px 10px;
  text-align: left;
}

.lunar-tip-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lunar-tip-holiday {
  font-size: 11px;
  font-weight: 600;
  color: var(--lunar-crimson);
  line-height: 1.3;
}

.lunar-tip-holiday.is-accent {
  color: var(--accent);
}

.lunar-tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  line-height: 1.3;
}

.lunar-tip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lunar-tip-time {
  font-size: 10.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.lunar-tip-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lunar-tip-more {
  font-size: 10.5px;
  color: var(--text-muted);
  padding-left: 12px;
}

.day-cell.is-cath-solemnity:not(.is-selected) .day-cath-tag {
  color: var(--lunar-crimson);
}

.day-cell.is-cath-feast:not(.is-selected) .day-cath-tag {
  color: var(--accent);
}

.day-cell.is-cath-memorial:not(.is-selected) .day-cath-tag {
  color: var(--good-color);
}

.day-cell.is-selected .day-cath-tag {
  color: #ffffff !important;
}

.day-dot.cath-dot {
  width: 5px;
  height: 5px;
}

.day-dot.cath-dot.dot-white { background: var(--cath-white-dot); }
.day-dot.cath-dot.dot-red { background: var(--cath-red-dot); }
.day-dot.cath-dot.dot-green { background: var(--cath-green-dot); }
.day-dot.cath-dot.dot-purple { background: var(--cath-purple-dot); }
.day-dot.cath-dot.dot-rose { background: var(--cath-rose-dot); }

.day-dot.cath-dot.is-solemnity {
  width: 6px;
  height: 6px;
  box-shadow: 0 0 0 1.5px var(--glass-bg);
}

.cath-sel-icon {
  width: 44px;
  height: 44px;
  filter: none;
}

.cath-icon-svg {
  width: 100%;
  height: 100%;
}

.sel-cath-primary {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 1px;
  line-height: 1.3;
}

.cath-celebrations-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(127, 127, 127, 0.07);
  border-radius: 7px;
  padding: 5px 8px;
}

.cath-cel-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
}

.cath-cel-left {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.cath-cel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.cath-cel-dot.dot-white {
  background: var(--cath-white-dot);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.55);
}
.cath-cel-dot.dot-red { background: var(--cath-red-dot); }
.cath-cel-dot.dot-green { background: var(--cath-green-dot); }
.cath-cel-dot.dot-purple { background: var(--cath-purple-dot); }
.cath-cel-dot.dot-rose { background: var(--cath-rose-dot); }

.cath-cel-title {
  color: var(--text);
  font-weight: 500;
  line-height: 1.3;
  word-break: break-word;
}

.cath-cel-item.is-primary .cath-cel-title {
  font-weight: 700;
}

.cath-cel-rank {
  font-size: 9.5px;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
  margin-top: 1px;
}

.cath-readings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cath-lookup-btn {
  border: 1px solid var(--border);
  background: rgba(127, 127, 127, 0.08);
  color: var(--accent);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.cath-lookup-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.cath-readings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.cath-daily-quote {
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(127, 127, 127, 0.08);
  border-left: 2.5px solid var(--accent);
  cursor: pointer;
  transition: background 0.15s ease;
}

.cath-daily-quote:hover {
  background: rgba(127, 127, 127, 0.13);
}

.cath-quote-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}

.cath-quote-label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.cath-quote-ref {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.cath-quote-text {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  font-style: italic;
  color: var(--text-primary);
}

.cath-reading-chip {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 7px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: rgba(127, 127, 127, 0.08);
  font-family: inherit;
  font-size: 10.5px;
  min-width: 0;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.cath-reading-chip:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

.cath-reading-chip.is-copied {
  border-color: var(--good-color);
  background: var(--good-bg);
}

.cath-reading-label {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.cath-reading-ref {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cath-reading-chip.is-gospel .cath-reading-ref {
  color: var(--accent);
}

.cath-reading-chip.is-gospel.is-span-full {
  grid-column: 1 / -1;
}

.cath-readings-note {
  font-size: 9.5px;
  color: var(--text-muted);
  line-height: 1.3;
  padding: 1px 2px 0;
}

.cath-glossary-dots {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 5px;
  font-size: 11px;
  color: var(--text-muted);
}

.cath-glossary-dots > span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cath-glossary-dots .cath-cel-dot {
  margin-top: 0;
  width: 7px;
  height: 7px;
}

.cath-upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cath-upcoming-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: rgba(127, 127, 127, 0.08);
  font-family: inherit;
  font-size: 10.5px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.cath-upcoming-item:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.cath-up-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.cath-up-date {
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.cath-up-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cath-up-countdown {
  flex-shrink: 0;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface);
}

.cath-upcoming-item.is-today .cath-up-countdown {
  color: var(--lunar-crimson);
  background: var(--lunar-crimson-soft);
}

/* ==================== CATHOLIC FULL READINGS MODAL ==================== */
.cath-readings-modal-card {
  max-height: 92%;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
}

.cath-rm-head-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.cath-rm-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cath-rm-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.cath-rm-body {
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cath-rm-cache-badge {
  align-self: flex-start;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--good-color);
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 7px;
  border-radius: 999px;
}

.cath-rm-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cath-rm-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 3px;
}

.cath-rm-prose p {
  margin: 0 0 6px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text);
}

.cath-rm-prose sup {
  font-size: 8.5px;
  color: var(--text-muted);
  margin-right: 1px;
}

.cath-rm-status,
.cath-rm-error {
  font-size: 11.5px;
  line-height: 1.45;
  padding: 12px 8px;
  text-align: center;
  color: var(--text-muted);
}

.cath-rm-error {
  color: var(--lunar-crimson);
}

/* ==================== ICS CALENDAR INTEGRATION ==================== */
.day-ev-markers {
  position: absolute;
  top: 2px;
  left: 3.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5px;
  pointer-events: none;
}

.day-ev-markers .day-dot.is-ics {
  position: static;
}

.day-personal-icon {
  width: 7px;
  height: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #3b82f6);
  pointer-events: none;
}

.day-cell.is-selected .day-personal-icon {
  color: #ffffff;
}

.personal-event-icon {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #3b82f6);
}

.ics-event-row .personal-event-icon {
  margin-top: 3px;
}

.mini-ics-item .personal-event-icon {
  margin-top: 0;
}

.lunar-tip-personal-icon {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #3b82f6);
}

.mini-ics-zone {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 13px 7px;
  border-top: 1px solid var(--border);
  background: rgba(127, 127, 127, 0.03);
  cursor: pointer;
  transition: background 0.15s ease;
}

.mini-ics-zone:hover {
  background: var(--surface-hover);
}

.mini-ics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mini-ics-badge {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--accent);
}

.mini-ics-count {
  font-size: 10px;
  color: var(--text-muted);
}

.mini-ics-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mini-ics-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: 1.3;
  min-width: 0;
}

.mini-ics-item .ics-event-dot {
  margin: 0 1px;
}

.mini-ics-item.is-ongoing .ics-event-dot {
  animation: mini-ics-pulse 1.6s ease-in-out infinite;
}

.mini-ics-item.is-ongoing .mini-ics-title {
  font-weight: 600;
}

.mini-ics-item.is-past {
  opacity: 0.52;
}

@keyframes mini-ics-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}

.mini-ics-time {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.mini-ics-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.ics-events-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(127, 127, 127, 0.06);
  border: 1px solid var(--border);
}

.ics-events-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ics-expand-btn {
  align-self: flex-start;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ics-expand-btn:hover {
  background: rgba(127, 127, 127, 0.12);
}

.ics-event-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 11px;
  line-height: 1.35;
}

.ics-event-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin: 4px 1px 0;
}

.ics-event-time {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 66px;
  font-variant-numeric: tabular-nums;
}

.ics-event-body {
  flex: 1;
  min-width: 0;
}

.ics-event-title {
  color: var(--text);
  font-weight: 500;
  word-break: break-word;
}

.ics-event-loc {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.ics-loc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.85;
}

.ics-loc-text {
  min-width: 0;
  word-break: break-word;
}

/* Settings ICS Section */
.ics-setting-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ics-help-box {
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--text-muted);
  background: rgba(127, 127, 127, 0.08);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ics-help-box code {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(127, 127, 127, 0.16);
}

.ics-display-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 2px 0;
}

.ics-check-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text);
  cursor: pointer;
}

.ics-refresh-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ics-refresh-label {
  font-size: 11.5px;
  color: var(--text-muted);
}

.ics-add-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ics-add-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ics-input {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 11.5px;
  outline: none;
}

.ics-input:focus {
  border-color: var(--accent);
}

.ics-color-input {
  width: 30px;
  height: 28px;
  padding: 2px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.ics-sources-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ics-empty-note {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.ics-source-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(127, 127, 127, 0.05);
}

.ics-source-item.is-disabled {
  opacity: 0.6;
}

.ics-source-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ics-source-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ics-source-left .ics-event-dot {
  margin-top: 0;
}

.ics-source-color-picker {
  width: 15px;
  height: 15px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
}

.ics-source-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.ics-source-color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.ics-rename-input {
  flex: 1;
  min-width: 80px;
  height: 22px;
  padding: 0 6px;
  border-radius: 5px;
  border: 1px solid var(--accent);
  background: var(--surface);
  color: var(--text);
  font-size: 11.5px;
  outline: none;
}

.ics-source-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ics-source-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.ics-mini-btn {
  padding: 2px 7px;
  font-size: 10.5px;
}

.ics-del-btn:hover {
  color: var(--lunar-crimson);
  border-color: var(--lunar-crimson);
}

.ics-source-meta {
  font-size: 10.5px;
  color: var(--text-muted);
}

.ics-source-loc-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 10.5px;
  color: var(--text-muted);
}

.ics-source-provider {
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(127, 127, 127, 0.14);
  color: var(--text);
  font-size: 9.5px;
  font-weight: 600;
}

.ics-source-loc-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.85;
}

.ics-source-meta.is-error {
  color: var(--lunar-crimson);
}

/* =========================================================
   Personal Events (Row Actions & Modal)
   ========================================================= */
.ics-event-row.is-personal {
  cursor: pointer;
  border-radius: 5px;
  padding: 0 4px;
  margin: 0 -4px;
  transition: background 0.15s;
}

.ics-event-row.is-personal:hover {
  background: rgba(127, 127, 127, 0.1);
}

.pe-row-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.72;
}

.ics-event-row.is-personal:hover .pe-row-actions {
  opacity: 1;
}

.pe-row-btn {
  width: 16px;
  height: 15px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pe-row-btn:hover {
  background: rgba(127, 127, 127, 0.16);
  color: var(--text);
}

.pe-row-btn.is-danger:hover {
  color: var(--lunar-crimson);
  background: rgba(220, 38, 38, 0.12);
}

.pe-modal {
  z-index: 30;
}

.pe-card {
  max-width: 360px;
  overflow-y: auto;
}

.pe-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pe-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pe-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.pe-input,
.pe-select {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 9px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(127, 127, 127, 0.08);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  outline: none;
}

.pe-input:focus,
.pe-select:focus {
  border-color: #3b82f6;
}

.pe-date-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pe-date-wrap .pe-input {
  padding-right: 30px;
}

.pe-date-picker-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.pe-date-picker-btn:hover {
  color: var(--text);
  background: rgba(127, 127, 127, 0.16);
}

.pe-date-native {
  position: absolute;
  right: 6px;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
}

.pe-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pe-lunar-preview {
  padding: 6px 9px;
  border-radius: 7px;
  border: 1px dashed var(--border);
  font-size: 11.5px;
  color: var(--text);
  background: rgba(127, 127, 127, 0.04);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pe-allday-row {
  display: flex;
  align-items: center;
}

.pe-color-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pe-color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}

.pe-color-swatch:hover {
  transform: scale(1.1);
}

.pe-color-swatch.is-active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px #3b82f6;
}

.pe-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.pe-actions-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.pe-btn-delete {
  color: var(--lunar-crimson);
  border-color: rgba(220, 38, 38, 0.35);
}

.pe-btn-delete:hover {
  background: rgba(220, 38, 38, 0.14);
}

.pe-scope-modal {
  z-index: 40;
}

.pe-scope-card {
  max-width: 310px;
}

.pe-scope-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pe-scope-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(127, 127, 127, 0.06);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.pe-scope-option:hover {
  background: rgba(127, 127, 127, 0.12);
}

.pe-scope-option:has(input:checked) {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.12);
}

.pe-scope-option input[type="radio"] {
  margin-top: 2px;
  accent-color: #3b82f6;
  cursor: pointer;
}

.pe-scope-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pe-scope-main {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.pe-scope-sub {
  font-size: 10.5px;
  color: var(--text-muted);
}

.pe-repeat-badge {
  display: inline-block;
  margin-left: 5px;
  font-size: 10.5px;
  color: var(--text-muted);
  opacity: 0.85;
  vertical-align: baseline;
}

.ev-src-tip {
  position: fixed;
  z-index: 35;
  max-width: 240px;
  padding: 6px 9px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ev-src-tip-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.ev-src-tip-sub {
  font-size: 10px;
  color: var(--text-muted);
  padding-left: 13px;
}


/* ============================================================
   PROACTIVE REMINDER TOAST OSD & SETTINGS
   ============================================================ */
.toast-view {
  width: 100%;
  padding: 0;
}

.toast-card {
  position: relative;
  display: flex;
  align-items: stretch;
  background: var(--bg-surface, rgba(28, 32, 42, 0.96));
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

.toast-accent {
  width: 4px;
  flex-shrink: 0;
  background: #f59e0b;
}

.toast-body {
  flex: 1;
  min-width: 0;
  padding: 10px 12px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toast-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.toast-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--accent-gold, #f59e0b);
}

.toast-close-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  border-radius: 4px;
}

.toast-close-btn:hover {
  color: var(--text);
  background: var(--bg-hover, rgba(255, 255, 255, 0.08));
}

.toast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.toast-btn {
  border: 1px solid var(--border);
  background: var(--bg-card, rgba(255, 255, 255, 0.06));
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.toast-btn:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.12));
}

.toast-btn-primary {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.45);
  color: var(--accent-gold, #f59e0b);
  font-weight: 600;
}

.toast-btn-primary:hover {
  background: rgba(245, 158, 11, 0.26);
}

.toast-progress-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.toast-progress-bar {
  height: 100%;
  width: 100%;
  background: var(--accent-gold, #f59e0b);
  transform-origin: left center;
}

@keyframes toastCountdown {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.toast-view.is-hovering .toast-progress-bar {
  animation-play-state: paused !important;
}

.reminders-options-wrap.is-disabled {
  opacity: 0.48;
  pointer-events: none;
}

.reminder-time-input {
  width: 96px;
  padding: 4px 8px;
  font-size: 12px;
}

.reminder-test-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   WEB / PWA / TELEGRAM MINI APP & NOTIFICATIONS (PHASE 4 & 5)
   ============================================================ */
.web-only {
  display: none;
}

body[data-platform="web"] .web-only,
body[data-platform="tma"] .web-only {
  display: inline-flex;
}

body[data-platform="web"] #cloud-notifications-panel .web-only,
body[data-platform="tma"] #cloud-notifications-panel .web-only {
  display: flex;
}

body[data-platform="web"] #cloud-notif-divider.web-only,
body[data-platform="tma"] #cloud-notif-divider.web-only {
  display: block;
}

body[data-platform="web"] [data-win-only="true"],
body[data-platform="tma"] [data-win-only="true"],
body[data-platform="web"] #btn-close,
body[data-platform="tma"] #btn-close,
body[data-platform="web"] #btn-cath-close,
body[data-platform="tma"] #btn-cath-close,
body[data-platform="web"] #btn-settings-close,
body[data-platform="tma"] #btn-settings-close,
body[data-platform="web"] #btn-about-close,
body[data-platform="tma"] #btn-about-close {
  display: none !important;
}

.cloud-notif-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cloud-notif-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.cloud-ios-hint {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--gold);
}

body[data-platform="web"],
body[data-platform="tma"] {
  background: #0b1120;
  min-height: 100dvh;
  overflow: hidden;
}

body[data-platform="web"][data-theme="light"],
body[data-platform="tma"][data-theme="light"] {
  background: #e2e8f0;
}

body[data-platform="web"] .osd-shell,
body[data-platform="tma"] .osd-shell {
  width: 100%;
  max-width: 780px;
  height: 100dvh;
  margin: 0 auto;
  border-radius: 0;
  border-top: none;
  border-bottom: none;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (min-width: 820px) {
  body[data-platform="web"] .osd-shell {
    height: min(94dvh, 880px);
    margin: 3dvh auto;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.35);
  }
}

@media (max-width: 768px) {
  body[data-platform="web"] .osd-shell,
  body[data-platform="tma"] .osd-shell {
    max-width: 100%;
    border-left: none;
    border-right: none;
  }

  body[data-platform="web"] .detail-header,
  body[data-platform="tma"] .detail-header {
    padding: 10px 12px 8px;
  }

  body[data-platform="web"] .detail-body,
  body[data-platform="tma"] .detail-body,
  body[data-platform="web"] .settings-body,
  body[data-platform="tma"] .settings-body {
    padding: 8px 10px calc(18px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }

  body[data-platform="web"] .day-cell,
  body[data-platform="tma"] .day-cell {
    min-height: 44px;
    height: 46px;
  }

  body[data-platform="web"] .day-solar,
  body[data-platform="tma"] .day-solar {
    font-size: 13.5px;
  }

  body[data-platform="web"] .day-lunar,
  body[data-platform="tma"] .day-lunar {
    font-size: 10px;
  }

  body[data-platform="web"] .icon-btn,
  body[data-platform="tma"] .icon-btn {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }

  body[data-platform="web"] .pill-btn,
  body[data-platform="tma"] .pill-btn {
    min-height: 30px;
    padding: 0 10px;
    font-size: 11.5px;
  }

  body[data-platform="web"] .converter-bar,
  body[data-platform="tma"] .converter-bar {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  body[data-platform="web"] .pe-row-2,
  body[data-platform="tma"] .pe-row-2 {
    grid-template-columns: 1fr;
  }

  body[data-platform="web"] .cloud-notif-row,
  body[data-platform="tma"] .cloud-notif-row {
    flex-direction: column;
    align-items: flex-start;
  }

  body[data-platform="web"] .cloud-notif-actions,
  body[data-platform="tma"] .cloud-notif-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  body[data-platform="web"] .canchi-grid,
  body[data-platform="tma"] .canchi-grid {
    grid-template-columns: 1fr;
  }

  body[data-platform="web"] .ics-add-row,
  body[data-platform="tma"] .ics-add-row {
    flex-wrap: wrap;
  }

  body[data-platform="web"] .cloud-server-row,
  body[data-platform="tma"] .cloud-server-row {
    flex-wrap: wrap;
  }

  body[data-platform="web"] .glossary-modal,
  body[data-platform="tma"] .glossary-modal {
    padding: 8px;
  }
}

@media (hover: none) {
  body[data-platform="web"] .term-hover-tip,
  body[data-platform="tma"] .term-hover-tip,
  body[data-platform="web"] .cath-day-tooltip,
  body[data-platform="tma"] .cath-day-tooltip {
    display: none !important;
  }
}
