:root {
  --bg: #0e3040;
  /* Background color */
  --panel: #124054;
  /* Panel/Table background color */
  --text: #e7f3f9;
  /* Main text color */
  --muted: #f8f8f8;
  ;
  /* Muted text color */
  --accent: #7be3ff;
  /* Primary accent color */
  --accent-2: #ffa117;
  /* Secondary accent color (e.g., for legend dots) */
  --text-color-dark: #0e3040;
  --border: rgba(255, 255, 255, .12);
  --shadow-dark: 0 16px 32px rgba(0, 0, 0, .6);

  /* New variable for region background */
  --region-bg: #0d8c7a;

  /* Legend Dot Colors */
  --region-dot: #0d8c7a;
  --theme-dot: #ffa117;
  --type-dot: #8fb0c2;
  --source-dot: #a97bff;

  --radius-soft: 8px;
  --radius-pill: 999px;
  --radius-card: 12px;

  --font-size-small: 13px;
  --font-size-body: 14px;
  --font-size-head: 15px;

  --col-gap: 24px;
  /* space between date and headline columns */

  /* NEW: Importance icon color */
  --importance-color: #ff5e5e;

  /* NEW: Gauge Color Definitions (Re-added Importance Scale Variables) */
  --gauge-color-5: #ef4444;
  /* Red */
  --gauge-color-4: #f97316;
  /* Orange */
  --gauge-color-3: #eab308;
  /* Lemon/Gold */
  --gauge-color-2: #84cc16;
  /* Lime */
  --gauge-color-1: #16a34a;
  /* Green */
  --gauge-hub-color: #8fb0c2;
  /* Muted Blue/Gray - used for Needle/Hub */
  --gauge-muted-fill: #8fb0c2;
  /* Muted Blue/Gray - used for segments */
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  margin: 0;
}

.site-content {
  max-width: 1350px;
  margin: 0 auto;
  padding: 30px 16px 60px;
}

/* ===== Calendar Container ===== */


/* ===== Omnibox ===== */
.omnibox {
  width: 100%;
  position: relative;
}

.omnibox-inner {
  display: flex;
  align-items: center;
  height: 40px;
  /* background: rgba(0, 0, 0, .18); */
  background: #124054;
  background: var(--bg-color);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0 14px;
  gap: 8px;
}

.tags-wrap {
  display: flex;
  gap: 6px;
  overflow: hidden;
}

.tag-placeholder {
  font-size: .82rem;
  color: var(--muted);
  white-space: nowrap;
}

#globalSearch {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
}

/* dropdown (UPDATED for smooth transition) */
.omnibox-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  background: var(--panel);
  /* FIX: Corrected from --card to --panel */
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 12px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, .35);
  z-index: 1000;
  max-height: 500px;
  overflow-y: auto;

  /* NEW: for smooth transition */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

/* NEW: Active state for smooth transition */
.omnibox-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.omnibox-body {
  padding: 10px;
}

.dropdown-section {
  background: rgba(0, 0, 0, .03);
  border: 1px solid rgba(255, 255, 255, .01);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.dropdown-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.dropdown-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Dropdown suggestion pills – styled like Newswire tag pills */
.suggestion-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.suggestion-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: var(--theme-dot);
}

/* Type-specific dots to mirror Newswire styling */
.suggestion-pill[data-kind="region"]::before {
  background: var(--region-dot);
}

.suggestion-pill[data-kind="calendar"]::before {
  background: var(--type-dot);
}

.suggestion-pill[data-kind="category"]::before {
  background: var(--theme-dot);
}

.suggestion-pill[data-kind="subcategory"]::before {
  background: var(--source-dot);
}

.suggestion-pill[data-kind="keyword"]::before {
  background: var(--source-dot);
}

.suggestion-pill:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(123, 227, 255, .08);
}


/* Tag pills shown inside the omnibox search bar */
.omnibox .tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  background: var(--panel-2);
  border: 1px solid var(--border);
  /* color: var(--muted); */
  color: #0e3040;
}

/* Dot on the left of each tag-pill */
.omnibox .tag-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: var(--theme-dot);
}

/* Type-specific dots for tag pills */
.omnibox .tag-pill[data-group="region"]::before {
  background: var(--region-dot);
}

.omnibox .tag-pill[data-group="calendar"]::before {
  background: var(--type-dot);
}

.omnibox .tag-pill[data-group="category"]::before {
  background: var(--theme-dot);
}

.omnibox .tag-pill[data-group="subcategory"]::before {
  background: var(--source-dot);
}

.omnibox .tag-pill[data-group="keyword"]::before {
  background: var(--source-dot);
}

/* Remove button inside tag pill */
.omnibox .tag-remove {
  border: none;
  background: transparent;
  color: #0e3040;
  font-size: 0.8em;
  margin-left: 4px;
  cursor: pointer;
}

.omnibox .tag-remove:hover {
  color: var(--accent);
}

/* ===== Table ===== */
.cal-table {
  width: 100%;
  border-spacing: 0;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text-color);
}

/* ===== Table ===== */
.cal-table th,
.cal-table td {
  padding: 10px 12px;
  text-align: left;
  /* font-size: .78rem; */
  font-size: .82rem;
  vertical-align: top;
}

/* --- NEW: Reduced horizontal padding for col-region and col-event --- */
.cal-table td.col-region,
.cal-table td.col-event {
  padding-left: 4px;
  /* Reduced from 6px */
  padding-right: 4px;
  /* Reduced from 6px */
}

/* NEW: anchor preview card to the event column */
.cal-table td.col-event {
  position: relative;
  padding-right: 19px;
}

.cal-table td.col-event.td-full {
  max-width: 1069px;
}

.cal-table td.col-event.td-full .event-right {
  display: none;
}

/* ------------------------------------------------------------------ */


.cal-table th {
  color: var(--muted);
  color: var(--text-color);
  font-weight: 600;
  vertical-align: middle;
  padding-bottom: 8px;
}

/* ===== Column widths (9 columns total) ===== */
.col-date-time {
  width: 170px;
  position: relative;
  /* anchor date dropdown */
}

/* MODIFIED: Reduced width for the region column */
.col-region {
  width: 40px;
  /* Reduced from 12.5px (which was too small) or 40px if that was the intended value */
  text-align: center;
}

/* FIX: Remove left/right padding from col-toggle */
.col-toggle {
  width: 5px;
  text-align: center;
  padding: 10px 0;
  /* Set vertical padding to 10px, horizontal to 0 */
}

/* Combined header for Region+Toggle+Event (spans 3 cols) */
.col-region-event {
  text-align: left;
  min-width: 550px;
  position: relative;
  padding-right: 0 !important;
}

/* --- START: Omnibox Stretching FIX (Corrected Alignment) --- */
/* Edge-to-edge look + smooth widen on focus/hover for the Omnibox */
th.col-region-event .omnibox {
  position: relative;
  left: -10px;
  /* MODIFIED: Shifted left by an additional 4px to match flag content (12px th padding - 8px = 4px offset) */
  width: calc(100% + 8px);
  transition: left .2s ease, width .2s ease, box-shadow .2s ease;
}

/* Active state toggled via JS on focusin/out */
th.col-region-event .omnibox.is-active {
  left: -10px;
  /* MODIFIED: Shifted left by an additional 4px to maintain the stretch relative to the new default position */
  width: calc(100% + 12px);
}

/* Soft glow on hover/focus */
th.col-region-event .omnibox-inner:focus-within,
th.col-region-event .omnibox.is-active .omnibox-inner,
th.col-region-event .omnibox:hover .omnibox-inner {
  box-shadow: 0 0 0 0.75px rgba(123, 227, 255, .15);
}

/* --- END: Omnibox Stretching FIX --- */


/* ===== Metric Columns (Period, Survey, Actual, Prior, Revision) ===== */
.col-period,
.col-metric {
  text-align: right;
  padding-right: 12px;
  font-variant-numeric: tabular-nums;
}

.col-period {
  /* width: 90px; */
  /* width: 99px; */
  width: 95px;
}

.col-metric {
  /* width: 78px; */
  /* width: 99px; */
  width: 96px;
}

/* Ensure headers + body cells align perfectly */
.cal-table th.col-period,
.cal-table th.col-metric,
.cal-table td.col-period,
.cal-table td.col-metric {
  text-align: right;
  padding-right: 12px;
  font-variant-numeric: tabular-nums;
}

/* ===== Date header button (UPDATED for consistent sizing) ===== */
.date-header-btn {
  min-width: 167px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-color);
  /* font-size: var(--font-size-head); */
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  /* prevent wrapping */
  flex-wrap: nowrap;
  /* ensure icons + text stay in one line */
}

.date-header-btn:hover {
  /* background: rgba(255, 255, 255, .08); */
  /* border-color: var(--accent); */
  color: var(--accent);
}

/* .date-header-btn i {
  color: var(--accent);
  color: var(--text-color);
} */

.date-header-btn span {
  line-height: 1;
}

/* Chevron inside date button */
.date-header-btn .date-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  font-size: 0.7rem;
  /* color: var(--muted); */
  transition: transform .2s ease, color .2s ease;
}

.date-header-btn .date-chevron i {
  pointer-events: none;
}

/* Rotate chevron anti-clockwise 90° when dropdown is open */
.date-header-btn.is-open .date-chevron {
  transform: rotate(-90deg);
  /* down → right (anti-clockwise) */
  color: var(--accent);
}


/* ===== Date dropdown (Original positioning) ===== */
.date-dropdown {
  position: absolute;
  top: 50%;
  left: 100%;
  /* transform: translateY(0); */
  transform: translate(-5px, -50%);
  margin-left: 8px;

  background: var(--panel);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .44);
  border: 1px solid rgba(255, 255, 255, .08);
  padding: 5px 10px;
  min-width: 260px;
  z-index: 40;
  display: none;
}

.date-dropdown.is-open {
  display: block;
}

.date-dropdown-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 25px;
}


/* today + reset pills (UPDATED for consistent sizing) */
.date-preset,
.date-reset-pill {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease;

  /* NEW for consistent sizing */
  height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  font-weight: 600;
}

.date-preset {
  background: rgba(0, 0, 0, .15);
  color: var(--text);
  padding: 0 18px;
}

.date-preset:hover {
  background: rgba(255, 255, 255, .08);
}

.date-reset-pill {
  background: transparent;
  color: var(--muted);
}

.date-reset-pill:hover {
  background: rgba(255, 255, 255, .08);
}

/* inline date inputs (UPDATED for consistent sizing) */
.date-custom-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.date-custom-inline input[type="date"] {
  background: var(--panel);
  /* FIX: Corrected from --card to --panel */
  color: var(--text);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .12);

  /* NEW for consistent sizing */
  height: 32px;
  box-sizing: border-box;
  padding: 0 6px;
  font-size: .8rem;
  line-height: 1;
  font-weight: 600;
}

.date-separator {
  font-size: .9rem;
  color: var(--muted);
}

/* close X pill (UPDATED for consistent sizing) */
.date-close-btn {
  position: absolute;
  top: 12.5px;
  right: 8px;
  background: none;

  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  /* Adjusted font size */
  color: var(--text);
  opacity: 0.85;
  transition: opacity .15s ease;

  /* NEW for consistent sizing */
  width: 28px;
  height: 28px;
  line-height: 1;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.date-close-btn:hover {
  opacity: 1;
  border: 1px solid var(--muted);
  background: rgba(255, 255, 255, .12);
}


/* ===== Rows ===== */
.calendar-row {
  border-bottom: 1px solid rgba(255, 255, 255, .02);
  transition: background .12s;
  position: relative;
  /* this can stay */
}


.calendar-row:hover {
  background: rgba(255, 255, 255, .02);
}

.calendar-row.has-sub-events:hover {
  background: rgba(255, 255, 255, .02);
}

/* date + time */
.date-time-wrap {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  /* PREVIOUS FIX: Center the content horizontally */
  justify-content: center;
  width: 100%;
  flex-direction: row-reverse;
}

.date-time-wrap .date {
  /* font-size: .74rem; */
  font-size: 0.86rem;
  /* color: var(--muted); */
  color: var(--text-color);
}

.date-time-wrap .time {
  /* font-weight: 600; */
  font-size: 0.86rem;
  letter-spacing: .02em;
}

/* ===== Event Cell ===== */
.event-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.event-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

/* FIX APPLIED HERE */
.event-title {
  font-weight: 500;
  color: var(--accent-2);
  font-size: 0.86rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;

  /* FIX: Change display to inline-flex and add width: max-content to wrap title tightly */
  display: inline-flex;
  width: max-content;
  position: relative;
  /* Required anchor for the preview card */
  flex: 0 0 auto;
  /* don't stretch in flex row */
  max-width: 100%;
}

.event-source-line {
  font-size: 0.68rem;
  color: var(--muted);
  color: var(--text-color);
  opacity: .8;
  font-style: italic;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 1px;
}

/* Right stack: cat + subcat + bell */
.event-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  min-width: 130px;
  text-align: right;
  align-self: flex-start;
  justify-content: flex-start;
}

.event-right-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* PREVIOUS FIX: Using flex and gap on the parent block ensures vertical spacing collapses when the sub-category is missing. */
.event-cat-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  line-height: 1.2;
}

.event-cat-right {
  font-size: .74rem;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.event-subcat {
  font-size: .68rem;
  color: var(--muted);
  white-space: nowrap;
}

/* NEW: Style for the event source line (Added to fulfill user request) */
.event-source {
  font-size: .68rem;
  color: var(--muted);
  opacity: 0.85;
  white-space: nowrap;
  padding-left: 1px;
}

/* ==========================================================
   NEW: Importance SVG Gauge system (Re-added)
   ========================================================== */

.importance-icons-wrap {
  display: flex;
  align-items: center;
  transform: translateY(0px);
  /* Adjusted for visual centering with new size */
  /* INCREASED SIZE HERE: Use 40px/22px for a slightly larger, clearer gauge */
  width: 44px;
  height: 24px;
  overflow: hidden;
}

.importance-gauge-svg {
  /* Scale the SVG content to fit the tiny container */
  width: 100%;
  height: 100%;
  overflow: visible;
  /* Enable transitions for smooth needle movement */
  transition: transform 0.3s ease;
}

/* Segment color classes */
.gauge-segment {
  transition: fill 0.3s ease;
}

.gauge-color-1 {
  fill: var(--gauge-color-1);
}

.gauge-color-2 {
  fill: var(--gauge-color-2);
}

.gauge-color-3 {
  fill: var(--gauge-color-3);
}

.gauge-color-4 {
  fill: var(--gauge-color-4);
}

.gauge-color-5 {
  fill: var(--gauge-color-5);
}

/* Muted color for inactive segments */
.muted-fill {
  fill: rgba(255, 255, 255, 0.15) !important;
}

/* Needle and Hub styling */
.hub-color {
  fill: var(--gauge-hub-color);
  transition: transform 0.3s ease;
  /* Transition on needle movement */
}

/* Bell button */
.inline-bell-btn {
  width: 28px;
  height: 26px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .25);
  border: 1px solid rgba(255, 255, 255, .05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s;
  margin-top: 0;
}

.inline-bell-btn:hover {
  background: rgba(255, 255, 255, .12);
}

.inline-bell-btn i {
  font-size: .8rem;
  color: var(--muted);
}

/* metrics colors */
.actual-good {
  color: var(--success);
  font-weight: 600;
}

.actual-bad {
  color: var(--danger);
  font-weight: 600;
}

/* ===== Inline sub-events under the event description (DEPRECATED - now uses rows) ===== */
.subevent-inline {
  margin-top: 8px;
  padding: 8px 8px 8px 12px;
  border-left: 3px solid var(--accent-2);
  background: rgba(0, 0, 0, .08);
  border-radius: 6px;
}

.subevent-inline.hidden {
  display: none;
}

.subevent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: .78rem;
}

.subevent-title {
  color: var(--muted);
  padding-right: 12px;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* This width is controlled via JS to match visible header columns */
.subevent-metrics {
  display: flex;
  text-align: right;
  justify-content: flex-end;
  width: var(--sub-metrics-width, 450px);
}

.col-metric-inline,
.subevent-metric-period {
  text-align: right;
  padding: 0 12px;
  font-variant-numeric: tabular-nums;
}

.col-metric-inline {
  width: 78px;
}

.subevent-metric-period {
  width: 90px;
}

/* Responsive: hide 8th/9th columns and let JS recompute width */
/* @media(max-width:960px) {

  .cal-table th:nth-child(8),
  .cal-table td:nth-child(8),
  .cal-table th:nth-child(9),
  .cal-table td:nth-child(9) {
    display: none;
  }
} */

/* ===== Toggle button ===== */
.subevent-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--accent-2);
  transition: color .2s;
  display: block;
  margin: 0 auto;
}

.subevent-toggle:hover {
  color: var(--accent-2);
}

.subevent-toggle i {
  font-size: 1.1em;
}

/* Sub-event rows rendered as separate <tr>s (UPDATED for smooth transition) */
.subevent-row {
  background: rgba(0, 0, 0, .08);
  /* NEW: for smooth max-height transition */
  max-height: 500px;
  overflow: hidden;
  opacity: 1;
  transition: max-height 0.3s ease-out, background 0.15s ease, border-left 0.15s ease, opacity 0.3s ease 0s;
}

.subevent-row.hidden {
  /* Use max-height for collapse effect */
  max-height: 0;
  /* Also use opacity to hide content that might still show in overflow */
  opacity: 0;
  transition: max-height 0.3s ease-out, opacity 0.3s ease 0s;
}

.subevent-row td {
  padding-top: 1px;
  padding-bottom: 1px;
  transition: padding 0.3s ease-out;
}

.subevent-row.hidden td {
  padding-top: 0;
  padding-bottom: 0;
}

.subevent-row:hover {
  background: rgba(255, 255, 255, .04);
  border-left: 2px solid var(--accent);
  cursor: pointer;
}

.subevent-row:hover .subevent-title {
  color: var(--accent-2);

  font-weight: 500;
}


.subevent-row.hidden {
  display: none;
}

/* Fallback/compatibility */

.subevent-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
}

.subevent-row .subevent-title {
  color: var(--muted);
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================
   Circular sub-event toggle 
   ========================================================== */
.subevent-circle-toggle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
  border: 0px solid rgba(255, 255, 255, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    color 0.15s ease;
  /* FIX: Ensure no extra margin/padding from user-defined style */
  margin: 0 !important;
  padding: 0 !important;
}

.subevent-circle-toggle i {
  font-size: 0.5rem;
  color: var(--accent-2);
  transition: color .15s ease;
}

.subevent-circle-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.25);
}

.subevent-circle-toggle:hover i {
  color: var(--accent);
}

/* ===== 🚩 Flag Icon Styling (NEW ADDITION) ===== */

/* General container for region/flag */
.cal-table td.col-region {
  text-align: center;
  /* Keep region code centered */
}

.region-flag-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  /* space between region code and flag */
  font-weight: 600;
  color: var(--text);
}

.flag-icon-rect {
  display: inline-block;
  width: 20px;
  /* Flag width */
  height: 15px;
  /* Flag height (Aspect ratio: 4:3) */
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 2px;
  background-size: cover;
  background-position: center center;
  flex-shrink: 0;
  box-shadow: 0 0 4px rgba(0, 0, 0, .15);
}

/* --- Region-Specific Flags (Placeholder for images) --- */
/* === NEW: flag-icons (cdn) styling === */

.flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.flag span {
  width: 22px;
  height: 16px;
  border-radius: 2px;
  box-shadow: 0 0 4px rgba(0, 0, 0, .25);
}

/* ===============================
   FLAG + ISO PILL
   =============================== */

/* FLAG + ISO (simple, inline, no pill) */
.region-flagline {
  display: inline-flex;
  align-items: center;
  gap: 1.5px;
  white-space: nowrap;
}

.region-iso {
  font-size: 0.72rem;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  opacity: 0.85;
  letter-spacing: .3px;
  color: var(--text);
  color: var(--text-color);
  margin-left: 4px;
}

.region-flagline .fi {
  border-radius: 2px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.25);
}

/* In styles.css (or a more specific rule): */
.cal-table td.col-toggle {
  width: 5px;
  text-align: center;
  /* Explicitly set top/bottom padding to 10px and left/right padding to 0 */
  padding: 10px 0;
}

/* === Row positioning for hover preview === */
.calendar-row {
  border-bottom: 1px solid rgba(255, 255, 255, .02);
  transition: background .12s;
  position: relative;
  /* anchor for preview card */
}

.calendar-row:hover {
  background: rgba(255, 255, 255, .02);
}

.calendar-row.has-sub-events:hover {
  background: rgba(255, 255, 255, .02);
}

/* === Hover preview card (like Newswire) === */
.event-preview-card {
  position: absolute;
  width: 300px;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: var(--shadow-dark);
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  opacity: 0;
  transform: translateY(0);
  transition: opacity .2s ease, transform .2s ease;
  z-index: 999999 !important;
  visibility: hidden;
}

.event-preview-card.is-visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}


.preview-title {
  font-weight: 600;
  color: var(--accent-2);
  font-size: 0.86rem;
  line-height: 1.3;
  margin-bottom: 4px;
}

.preview-meta {
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.preview-dot {
  opacity: .6;
}

.preview-tag {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  font-size: 0.68rem;
}

.preview-desc {
  font-size: 0.72rem;
  line-height: 1.35;
  margin: 0 0 8px;
  color: var(--text);
}

.preview-metrics {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.preview-metrics .preview-value,
.preview-metrics .preview-actual-value {
  color: var(--text);
  font-weight: 600;
  margin-left: 3px;
}

.preview-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.preview-link i {
  font-size: 0.7rem;
}

.preview-link:hover {
  text-decoration: underline;
}

/* Optional: hide preview on narrow screens */
@media (max-width: 1100px) {
  .event-preview-card {
    display: none;
  }
}

/* ==========================================================
   NEW: Omnibox Dropdown Footer & Toggle Switch
   ========================================================== */

/* Footer container style */
.omnibox-footer {
  border-top: 1px solid rgba(255, 255, 255, .05);
  padding: 10px 14px;
  background: rgba(0, 0, 0, .08);
  /* Slightly darker background for distinction */
  border-radius: 0 0 12px 12px;
  /* Match the bottom curve of the dropdown */
}

.omnibox-footer-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.toggle-label {
  font-size: var(--font-size-small);
  color: var(--muted);
  user-select: none;
  cursor: pointer;
  font-weight: 500;
}

/* --- Toggle Switch Styles (Pure CSS) --- */

.toggle-switch {
  /* Hide the default checkbox */
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 38px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  /* Off-state background */
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
  margin: 0;
}

/* Switch handle (the circle) */
.toggle-switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text);
  /* White handle */
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Checked (ON) state */
.toggle-switch:checked {
  background: var(--accent);
  /* On-state background (e.g., bright blue) */
}

/* Move the handle to the right when checked */
.toggle-switch:checked::before {
  transform: translateX(18px);
}

/* Right-side actions */
.omnibox-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 8px;
}

/* Small clear-all "X" button that appears when filters are active */
.omnibox-clearall-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .28);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--muted);
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}

.omnibox-clearall-btn:hover {
  background: rgba(255, 255, 255, .12);
  color: var(--accent);
}


/* My Calendars pill */
.mycal-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.24);
  background: var(--bg-color);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border: 1px solid var(--color-border);
  color: var(--muted);
  color: var(--text-color);
  transition: 0.15s ease;
}

.mycal-pill:hover {
  background: var(--accent);
  color: var(--text-color-dark);
}

.mycal-pill i {
  font-size: 0.85rem;
}

/* Download button */
.download-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: 0.15s ease;
  color: var(--muted);
}

.download-btn:hover {
  background: var(--accent);
  color: var(--text-color-dark);
}

.download-btn i {
  font-size: 0.9rem;
}

#omnibox {
  position: relative;
}


/* === Settings button in omnibox actions === */
.icon-btn#settingsBtn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  /* background: rgba(6, 28, 43, 0.9); */
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.icon-btn#settingsBtn i {
  pointer-events: none;
  /* color: #fff; */
  color: var(--text-color);
}

.icon-btn#settingsBtn:hover {
  background: rgba(16, 74, 108, 0.95);
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.22);
}

.icon-btn#settingsBtn.is-active {
  background: var(--accent);
  color: #021015;
  border-color: var(--accent);
}

/* === Settings popover === */

.settings-popover {
  position: absolute;
  top: 0;
  /* just below omniboxInner; tweak if needed */
  right: 0;
  /* aligns with settings button */
  min-width: 260px;
  /* width: calc(100% - 30px); */
  width: max-content;
  width: 100%;
  background: #124054 !important;
  border-radius: 10px;
  /* box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55); */
  border: none;
  padding: 6px 12px;
  z-index: 1400;
  display: none;
}

.settings-popover.is-open {
  display: block;
}

.settings-popover-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-section {
  padding: 6px 2px;
  border-radius: 8px;
}

.settings-section-header {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(180, 200, 215, 0.85);
  margin-bottom: 4px;
}

.settings-popover .entry-type-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-action-btn {
  width: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 9px;
  border: none;
  padding: 7px 8px;
  background: transparent;
  color: #e3f4ff;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.settings-action-btn i {
  font-size: 0.9rem;
}

/* .settings-action-btn:hover {
  background: rgba(12, 55, 82, 0.98);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
} */


/* Settings section: Show Details toggle row */
.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.8rem;
}

.settings-toggle-label {
  color: var(--muted);
}

/* Omnibox dropdown footer Ok button */
.omnibox-footer {
  display: flex;
  justify-content: flex-end;
  padding: 8px 12px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.omnibox-footer-inner {
  display: flex;
  justify-content: flex-end;
}

.dropdown-ok-btn {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(4, 22, 33, 0.95);
  color: #e7f5ff;
  padding: 5px 16px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.dropdown-ok-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #021015;
  transform: translateY(-1px);
}


/* === My Calendars modal === */

.mycal-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.mycal-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mycal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.mycal-dialog {
  position: relative;
  z-index: 1;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow-dark);
  padding: 18px 20px 16px;
  width: 760px;
  max-width: 94vw;
  color: var(--text);
  display: flex;
  flex-direction: column;
  margin-top: -8%;
}

/* Header */

.mycal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.mycal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
}

.mycal-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.3);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.mycal-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
}

/* Layout: list + detail */

.mycal-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  margin-top: 6px;
}

/* Left column: list */

.mycal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
}

/* NEW: Divider for calendar list */
.mycal-list-divider {
  margin: 6px 0 2px;
  /* Top/Bottom margin to separate it from buttons */
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  /* Faint line */
}


.mycal-list-item {
  width: 100%;
  border-radius: 999px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(6, 28, 43, 0.8);
  color: var(--muted);
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mycal-list-item.is-active {
  background: var(--accent);
  color: var(--text-color-dark);
}

.mycal-list-item:hover:not(.is-active) {
  background: rgba(16, 74, 108, 0.95);
}

.mycal-create-btn {
  /* Removed margin-top: 4px; to rely on .mycal-list-divider below it */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  background: transparent;
  color: var(--accent);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.mycal-create-btn i {
  font-size: 0.9rem;
}

.mycal-create-btn:hover {
  background: rgba(123, 227, 255, 0.06);
  border-color: var(--accent);
}

/* Right column: detail */

.mycal-detail {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Name row */

.mycal-field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.mycal-field-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.mycal-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mycal-name-input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  padding: 6px 10px;
  font-size: 0.8rem;
}

.mycal-name-input:focus {
  outline: none;
  border-color: var(--accent);
}

.mycal-name-edit {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.3);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.mycal-name-edit:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
}

/* Field groups (Region / Calendar / Categories) */

.mycal-field-group {
  margin-top: 4px;
}

.mycal-field-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.mycal-field-label-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent-2);
}

.mycal-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Chips */

.mycal-chip {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 4px 12px;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.32);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mycal-chip-region.is-selected {
  background: var(--region-bg);
  border-color: var(--region-bg);
  color: #e6fffa;
}

.mycal-chip-accent {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: var(--text-color-dark);
}

.mycal-chip-muted {
  background: rgba(0, 0, 0, 0.24);
}

.mycal-chip:hover {
  border-color: var(--accent);
}

.mycal-chip-remove {
  font-size: 0.9em;
  opacity: 0.8;
}

.mycal-chip-add {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.8rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.mycal-chip-add:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
}

/* Divider + toggle row */

.mycal-divider {
  margin: 8px 0 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Entry types row inside modal */
.mycal-entrytypes-row {
  display: flex;
  align-items: center;
  /* justify-content: space-between; */
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}

.mycal-entrytypes-label {
  font-size: 0.8rem;
  color: var(--muted);
}

/* --- CALENDAR ENTRY TYPES (Restored Checkbox Look) --- */

/* Parent container for entry type pills - reset to minimal styling */
.mycal-entrytypes-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

/* Individual entry type button (Checkbox wrapper) */
.mycal-entrytype-btn {
  border-radius: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 0.78rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 400;
  transition: color 0.15s ease;
}

.mycal-entrytype-btn:hover {
  color: var(--text);
}

/* Style the actual checkbox square */
.mycal-entrytype-btn .mycal-entrytype-check {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
  position: relative;
}

/* Active state for the checkbox square */
.mycal-entrytype-btn.is-active {
  border-color: transparent;
  background: transparent;
  color: var(--text);
}

/* Active check square */
.mycal-entrytype-btn.is-active .mycal-entrytype-check {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}

/* Add the 'X' icon inside the active checkbox */
.mycal-entrytype-btn.is-active .mycal-entrytype-check::after {
  content: "\f00d";
  /* FontAwesome 'X' icon (times) */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.8rem;
  color: var(--text-color-dark);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* --- END UPDATED CALENDAR ENTRY TYPES --- */


.mycal-toggle-row {
  display: flex;
  align-items: center;
  /* justify-content: space-between; */
  justify-content: flex-start;
  gap: 12px;
  margin: 15px 0;
  /* Add margin for separation */
}

.mycal-toggle-label {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Footer buttons */

.mycal-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mycal-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mycal-danger-btn,
.mycal-secondary-btn,
/* Applies to Save button */
.mycal-primary-btn {
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mycal-danger-btn {
  background: transparent;
  border-color: rgba(248, 113, 113, 0.5);
  color: #fecaca;
}

.mycal-danger-btn:hover {
  background: rgba(248, 113, 113, 0.16);
}

.mycal-secondary-btn {
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--muted);
}

.mycal-secondary-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.mycal-primary-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-color-dark);
}

.mycal-primary-btn:hover {
  filter: brightness(1.05);
}

/* Basic responsive tweak */

@media (max-width: 820px) {
  .mycal-dialog {
    width: 100%;
    margin: 0 10px;
  }

  .mycal-layout {
    grid-template-columns: 1fr;
  }

  .mycal-detail {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 10px;
  }
}

.mycal-name-input-container {
  /* This is the key: it acts as the reference point for absolute positioning */
  position: relative;
  flex: 1;
  /* Allow it to take up available space */
}




/* === Inline calendar name edit icon inside input === */
.mycal-name-wrap {
  position: relative;
  width: 100%;
}

.mycal-name-input {
  width: 100%;
  padding-right: 34px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.mycal-name-input.is-editing {
  border-color: var(--accent);
  background: rgba(123, 227, 255, 0.08);
}

.mycal-name-edit {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.mycal-name-edit i {
  font-size: 0.95rem;
  color: var(--muted);
  pointer-events: none;
  transition: color 0.2s ease;
}

.mycal-name-edit:hover i {
  color: var(--accent);
}

/* Hide main category label so only sub-category is ever shown */
.event-cat-right {
  display: none !important;
}

/* NEW: Left side container for Save and Delete buttons */
.mycal-footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  /* Space between Save and Delete buttons */
}

/* Hide legacy Search… placeholder div inside omnibox; use input placeholder instead */
.omnibox .tags-wrap .tag-placeholder {
  display: none;
}

.tag-icon {
  font-size: 0.75rem;
  margin-right: 4px;
  opacity: 0.8;
}

/* REMOVE OLD COLOR DOT FOR OMNIBOX PILLS */
.omnibox .tag-pill::before {
  content: none !important;
}

.entry-type-pill {
  border-radius: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 0.78rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 400;
  transition: color 0.15s ease;
}

.entry-type-pill:hover {
  color: var(--text);
}

/* Checkbox square */
.entry-type-pill .entry-type-check {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
  position: relative;
}

/* Active state */
.entry-type-pill.is-active {
  border-color: transparent;
  background: transparent;
  color: var(--text);
}

.entry-type-pill.is-active .entry-type-check {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}

/* Optional: little “x” inside the active square (like your modal) */
.entry-type-pill.is-active .entry-type-check::after {
  content: "\f00d";
  /* Font Awesome 'X' */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.8rem;
  color: var(--text-color-dark);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* custom */
.page-template-tpl-calenda-v3 .sidebar-right {
  display: none;
}

.page-template-tpl-calenda-v3 .layout {
  /* grid-template-columns: 160px 1fr 0; */
  grid-template-columns: 25px 1fr 0;
  gap: 0;
}

.page-template-tpl-calenda-v3 .site-content {
  /* max-width: 1440px; */
  max-width: 1300px;
}

.clear-active-btn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.clear-active-btn:hover {
  background: rgba(0, 0, 0, .25);
  color: var(--text);
}

.sth-wrap-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.sth-packet-lang .sth-omnibox-chip {
  width: max-content;
}

.custom-field-group {
  display: flex;
  gap: 10px;
  position: relative;
}

.custom-field-group {
  margin-top: 0;
}

.custom-field-group .mycal-field-label-row {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding-right: 10px;
  width: 100px;
  margin-bottom: 0;
  padding: 10px 0;
  padding-right: 10px;
}

.custom-field-group .mycal-chip-row {
  width: calc(100% - 110px);
}

.mycal-name-input.active {
  pointer-events: inherit;
}

.mycal-name-input {
  pointer-events: none;
}

.sth-list-wrap-calendar {
  display: none;
  position: absolute;
  top: 90%;
  right: 0;
}

.sth-list-wrap-calendar.active {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-soft);
  box-shadow: var(--shadow-dark);
  z-index: 1;
}

.sth-list-wrap-calendar .sth-tax-dropdown {
  position: unset;
  margin-top: 0;
  border: none;
}

.langMenuPacket.active {
  background: var(--panel);
}

.sth-group-region .mycal-chip {
  background: var(--region-bg);
  border-color: var(--region-bg);
  color: #e6fffa;
}

.sth-group-calendar .mycal-chip {
  background: var(--type-dot);
  border-color: var(--type-dot);
  color: #e6fffa;
}

.sth-group-categories .mycal-chip {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: var(--text-color-dark);
}

.sth-entrytype-btn {
  border-radius: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 0.78rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 400;
  transition: color 0.15s ease;
}

.sth-entrytypes-row {
  display: flex;
  align-items: center;
  /* justify-content: space-between; */
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 15px;
  margin-top: 15px;
}

.sth-entrytypes-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.sth-entrytypes-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.sth-entrytype-btn .sth-entrytype-check {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
  position: relative;
}

.sth-entrytype-btn.is-active .sth-entrytype-check {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}

.sth-entrytype-btn.is-active .sth-entrytype-check::after {
  content: "\f00d";
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.8rem;
  color: var(--text-color-dark);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.sth-detail-item.active {
  display: block;
}

.sth-detail-item {
  display: none;
}

.suggestion-pill[data-kind="source"]::before {
  background: var(--accent);
}

.packet-dropdown-menu li {
  list-style: none;
}

#packet_add .mycal-danger-btn {
  display: none;
}

.sthcalSaveAdd.disable,
.sthcalSaveBtn.disable {
  pointer-events: none;
}

.date-custom-inline {
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto !important;
  width: auto !important;
  border-radius: 9999px;
  padding: 4px 8px;
  padding-right: 12px;
  line-height: 1;

}

.date-dropdown-inner {
  padding-right: 0;
}

.date-custom-inline input[type="date"] {
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: var(--radius-pill);
  flex: 0 0 auto !important;
  padding: 4px 6px !important;
  border: none;
}

.date-reset-pill {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--menu-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  padding: 0;
}

/* Tighten built-in Chrome/Edge padding + icon spacing */
.date-custom-inline input[type="date"]::-webkit-datetime-edit {
  padding: 0 !important;
  margin: 0 !important;
}

.date-custom-inline input[type="date"]::-webkit-calendar-picker-indicator {
  margin-left: -12px !important;
  /* was -10 */
  padding: 0 !important;
  width: 14px;
}

.date-custom-inline input[type="date"]::-webkit-inner-spin-button,
.date-custom-inline input[type="date"]::-webkit-calendar-picker-indicator {
  color: #fff !important;
  filter: invert(1);
}

.date-close-btn {
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #0e3040;
  border: none;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  width: auto;
  height: auto;
  position: unset;
}

.date-dropdown {
  width: max-content;
}

.date-close-btn:hover {
  opacity: 1;
  border: none;
  background: var(--accent);
}

.omnibox .tag-pill[data-group='calendar'] {
  background: var(--theme-dot);
}

.omnibox .tag-pill[data-group='region'] {
  background: var(--region-dot);
}

.omnibox .tag-pill[data-group='source'] {
  background: var(--accent);
}

.omnibox .tag-pill[data-group='category'] {
  background: var(--type-dot);
}

#dateHeaderText {
  margin-top: 3px;
  /* color: var(--text-color); */
}

.sth-close-empty {
  position: absolute;
  top: 10px;
  right: 10px;
}

.mycal-dialog {
  min-height: 100px;
}

.settings-ok-btn {
  height: 26px;
  padding: 0 10px;
  margin-left: 4px;
  border-radius: 10px;
  border: 1px solid rgba(123, 227, 255, 0.35);
  background: transparent;
  color: var(--text-color);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.custom-popover-box .settings-ok-btn {
  color: var(--muted);
}

.settings-ok-btn:hover {
  background: rgba(123, 227, 255, 0.15);
}

.settings-section.d-flex {
  display: flex;
  gap: 10px;
}

.settings-entry-label {
  color: var(--muted);
  font-size: 0.8rem;
}

/* "Option date" button */
.sth-selected-date {
  background: var(--bg);
  border: none;
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  gap: 7px;
  align-items: center;

}

.sth-selected-date {
  margin-bottom: 0;
}

/* .sth-selected-date.active i {
  transform: rotate(90deg);
} */

.sth-opt-item {
  font-size: 12px;
  display: block;
  background: transparent;
  padding: 7px 7px;
  width: 100%;
  color: var(--text);
  border: none;
  cursor: pointer;
  text-align: left;
}

.sth-opt-item:hover {
  color: var(--accent);
}

.sth-selected-date:hover {
  background: rgba(255, 255, 255, .08);
}

.sth-option-date {
  position: absolute;
  top: calc(100% + 8px);
  right: auto;
  left: 0;
  background: #124054;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, .6);
  padding: 10px;
  z-index: 60;
  width: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-2px);
  transition: opacity .15s ease, visibility .15s ease, transform .15s ease;
}

.sth-option-date.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.wrap-option-date {
  position: relative;
}

.close-omnibox {
  position: absolute;
  right: 10px;
  top: 10px;
  background-color: transparent;
  border: none;
  color: var(--text-color);
  padding: 5px;
  cursor: pointer;
}

.close-omnibox i {
  font-size: 1rem;
}

/* .cal-table {
  table-layout: fixed;
  width: 100%;
} */
@media screen and (max-width: 1600px) {
  .cal-table {
    display: flex;
    flex-direction: column;
  }

  .cal-table thead tr {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0;
  }

  .cal-table thead tr th {
    display: block;
  }

  .cal-table thead {
    width: 100%;
    display: flex;
  }

  .cal-table thead .col-date-time {
    width: 170px;
  }

  .col-region-event {
    width: calc(100% - 200px);
    margin-left: 30px;
    min-width: unset;
  }

  .calendar-row {
    display: flex;
  }

  .cal-table td.col-event {
    /* width: calc(100% - 602px); */
    width: calc(100% - 695px);
  }

  .event-title {
    /* width: 100%; */
    width: max-content;
    white-space: normal;
  }

  .event-right {
    min-width: 75px;
  }

  .cal-table td.col-toggle {
    width: 20px;
  }

  .col-region {
    width: 50px;
  }

  #calendarBody .col-date-time {
    width: 130px;
  }
}

@media screen and (max-width: 1200px) {
  .page-template-tpl-calenda-v3 .layout {
    grid-template-columns: 0 1fr 0;
  }

  .col-metric,
  .col-period {
    width: 89px;
  }

  .cal-table td.col-event {
    width: calc(100% - 645px);
  }
}

.sth-responsive {
  display: none;
}

@media screen and (max-width: 1023px) {
  .sth-responsive {
    display: flex;
    justify-content: flex-end;

  }

  .col-metric,
  .col-period {
    width: 79px;
  }

  .cal-table td.col-event {
    width: calc(100% - 595px);
  }

  .sth-responsive td {
    color: var(--muted);
    font-weight: 600;
    vertical-align: bottom;
    padding: 10px 12px;
    width: 78px;
    padding-bottom: 8px;
    text-align: right;
  }

  #calendarBody {
    overflow: auto;
  }

  #calendarBody tr {
    min-width: 810px;
  }

  .cal-table thead th.col-period,
  .cal-table thead th.col-metric {
    display: none;
  }
}

@media screen and (max-width: 900px) {

  .mycal-dialog {
    margin-top: 0;
  }

  .page-template-tpl-calenda-v3 .layout {
    display: block;
  }

  .col-region-event {
    width: 100%;
    margin-left: 0;
  }

  .tags-wrap {
    flex-wrap: wrap;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .omnibox-inner {
    height: max-content;
  }


}

@media screen and (max-width: 767px) {
  .omnibox-inner {
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .cal-table thead tr {
    width: 100%;
  }

  .omnibox-actions {
    width: 100%;
  }

  .page-template-tpl-calenda-v3 .site-content {
    padding-left: 0;
    padding-right: 0;
  }
}

@media screen and (max-width: 414px) {
  .omnibox .tag-pill {
    padding: 2px 5px;
    font-size: 11px;
  }

  .tag-icon {
    font-size: 0.5rem;
  }

  .page-template-tpl-calenda-v3 .layout {
    padding-left: 60px;
    padding-right: 20px;
  }

  th.col-region-event .omnibox {
    left: 0;
  }
}