.ccdst-wrap {
  --ccdst-face: #fcfcfd;
  --ccdst-ring: #b9c1cb;
  --ccdst-numbers: #353b44;
  --ccdst-ticks: #98a1ac;
  --ccdst-hour: #2e333a;
  --ccdst-minute: #b83232;
  --ccdst-second: #df5050;
  --ccdst-surface: #fff;
  --ccdst-surface-soft: #f7f8fa;
  --ccdst-text: #171a1f;
  --ccdst-muted: #667085;
  --ccdst-border: #dfe3e8;
  --ccdst-sync-neutral: #98a1ac;
  --ccdst-sync-good: #3f8f68;
  --ccdst-sync-warning: #b0792d;
  --ccdst-sync-error: #ba4a4a;
  box-sizing: border-box;
  width: 100%;
  color: var(--ccdst-text);
}

.ccdst-wrap *,
.ccdst-wrap *::before,
.ccdst-wrap *::after {
  box-sizing: border-box;
}

.ccdst-wrap--home,
.ccdst-wrap--city {
  container-type: inline-size;
}

.ccdst-home-shell {
  margin: 0;
  padding: 0;
}

.ccdst-home-header {
  margin: 0 0 10px;
}

.ccdst-home-title {
  margin: 0;
  color: var(--ccdst-text);
  font-size: clamp(24px, 2.15vw, 31px);
  font-weight: 780;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.ccdst-home-layout,
.ccdst-home-grid {
  display: grid;
  gap: 20px;
  align-items: center;
}

.ccdst-home-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.ccdst-home-analog,
.ccdst-home__analog {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
}

.ccdst-clock-svg {
  display: block;
  width: min(100%, 375px);
  height: auto;
  aspect-ratio: 1 / 1;
  overflow: visible;
}

.ccdst-clock-face { fill: var(--ccdst-face); }
.ccdst-clock-ring { fill: none; stroke: var(--ccdst-ring); stroke-width: 5.2; }
.ccdst-clock-tick { stroke: var(--ccdst-ticks); stroke-width: 1.4; stroke-linecap: round; }
.ccdst-clock-tick--hour { stroke-width: 2.25; }
.ccdst-clock-tick--quarter { stroke-width: 2.9; }
.ccdst-clock-number {
  fill: var(--ccdst-numbers);
  font-family: inherit;
  font-size: 24px;
  font-weight: 650;
  text-anchor: middle;
  dominant-baseline: middle;
}
.ccdst-clock-hand { transform-origin: 200px 200px; }
.ccdst-clock-hand line { stroke-linecap: round; }
.ccdst-clock-hand--hour line { stroke: var(--ccdst-hour); stroke-width: 10.5; }
.ccdst-clock-hand--minute line { stroke: var(--ccdst-minute); stroke-width: 7.5; }
.ccdst-clock-hand--second line { stroke: var(--ccdst-second); stroke-width: 3.2; }
.ccdst-clock-centre-outer { fill: var(--ccdst-hour); }
.ccdst-clock-centre { fill: var(--ccdst-second); }

.ccdst-home-info,
.ccdst-home__info {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.ccdst-digital-card,
.ccdst-dst-card {
  min-width: 0;
  background: var(--ccdst-surface);
  border: 1px solid var(--ccdst-border);
  border-radius: 15px;
}

.ccdst-digital-card {
  padding: 17px 18px 16px;
  text-align: center;
}

.ccdst-city-name {
  margin-bottom: 2px;
  color: var(--ccdst-muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.ccdst-time {
  display: block;
  min-height: 53px;
  color: var(--ccdst-text);
  font-size: clamp(42px, 4vw, 52px);
  font-weight: 790;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  line-height: 1.02;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.ccdst-daydate {
  min-height: 21px;
  margin-top: 4px;
  color: var(--ccdst-muted);
  font-size: 15px;
  line-height: 1.35;
}

.ccdst-city-meta {
  display: flex;
  margin-top: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--ccdst-muted);
  font-size: 13px;
}

.ccdst-tzlabel {
  padding: 4px 8px;
  background: var(--ccdst-surface-soft);
  border-radius: 8px;
}

.ccdst-home-device-sync,
.ccdst-sync-status {
  display: flex;
  min-height: 19px;
  margin-top: 7px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--ccdst-muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.ccdst-sync-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--ccdst-sync-neutral);
  border-radius: 50%;
}
.ccdst-sync[data-sync-state="good"] .ccdst-sync-dot { background: var(--ccdst-sync-good); }
.ccdst-sync[data-sync-state="warning"] .ccdst-sync-dot { background: var(--ccdst-sync-warning); }
.ccdst-sync[data-sync-state="error"] .ccdst-sync-dot { background: var(--ccdst-sync-error); }
.ccdst-sync[data-sync-state="checking"] .ccdst-sync-dot { animation: ccdst-soft-pulse 1.4s ease-in-out infinite; }
.ccdst-sync-tech { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@keyframes ccdst-soft-pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ccdst-sync[data-sync-state="checking"] .ccdst-sync-dot { animation: none; } }

.ccdst-dst-status {
  display: flex;
  min-height: 49px;
  padding: 12px 15px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--ccdst-border);
  font-size: 14px;
}
.ccdst-dst-status span { display: flex; align-items: center; gap: 7px; font-weight: 750; }
.ccdst-dst-status i { width: 7px; height: 7px; flex: 0 0 auto; background: var(--ccdst-second); border-radius: 50%; }
.ccdst-dst-status strong { font-size: 13px; }

.ccdst-home-dst-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ccdst-dst-row {
  display: flex;
  min-width: 0;
  min-height: 168px;
  padding: 18px 16px;
  flex-direction: column;
  justify-content: center;
}

.ccdst-home-dst-event + .ccdst-home-dst-event { border-left: 1px solid var(--ccdst-border); }
.ccdst-dst-label {
  min-height: 25px;
  margin-bottom: 7px;
  color: var(--ccdst-muted);
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: 0.075em;
}
.ccdst-dst-value {
  color: var(--ccdst-text);
  font-size: 16px;
  font-weight: 780;
  line-height: 1.28;
  overflow-wrap: anywhere;
}
.ccdst-dst-muted,
.ccdst-dst-countdown {
  color: var(--ccdst-muted);
  font-size: 12.5px;
  line-height: 1.42;
}
.ccdst-dst-muted { display: flex; margin-top: 6px; flex-direction: column; gap: 1px; }
.ccdst-dst-countdown {
  min-height: 18px;
  margin-top: 9px;
  color: var(--ccdst-text);
  font-weight: 750;
}

/* Wide home layout: one unified information panel. */
.ccdst-wrap--home .ccdst-home-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.43fr) minmax(0, 0.57fr);
  grid-template-rows: auto 1fr;
  column-gap: 18px;
}
.ccdst-wrap--home .ccdst-home-header { grid-column: 1; grid-row: 1; }
.ccdst-wrap--home .ccdst-home-layout { display: contents; }
.ccdst-wrap--home .ccdst-home-analog { grid-column: 1; grid-row: 2; }
.ccdst-wrap--home .ccdst-clock-svg { width: min(100%, 328px); }
.ccdst-wrap--home .ccdst-home-info {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: stretch;
  background: var(--ccdst-surface);
  border: 1px solid var(--ccdst-border);
  border-radius: 15px;
}
.ccdst-wrap--home .ccdst-digital-card,
.ccdst-wrap--home .ccdst-dst-card {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.ccdst-wrap--home .ccdst-digital-card { flex: 0 0 auto; }
.ccdst-wrap--home .ccdst-dst-card { display: flex; flex: 1 1 auto; flex-direction: column; border-top: 1px solid var(--ccdst-border); }
.ccdst-wrap--home .ccdst-home-dst-grid { flex: 1 1 auto; }

/* Hybrid component layout. */
@container (max-width: 739px) and (min-width: 560px) {
  .ccdst-wrap--home .ccdst-home-shell { display: block; }
  .ccdst-wrap--home .ccdst-home-header { margin-bottom: 12px; }
  .ccdst-wrap--home .ccdst-home-layout {
    display: grid;
    grid-template-columns: minmax(220px, 0.9fr) minmax(270px, 1.1fr);
    gap: 16px 18px;
    align-items: center;
  }
  .ccdst-wrap--home .ccdst-home-info { display: contents; margin: 0; border: 0; }
  .ccdst-wrap--home .ccdst-home-analog { grid-column: 1; grid-row: 1; }
  .ccdst-wrap--home .ccdst-clock-svg { width: min(100%, 285px); }
  .ccdst-wrap--home .ccdst-home-primary {
    grid-column: 2;
    grid-row: 1;
    border: 1px solid var(--ccdst-border);
    border-radius: 15px;
  }
  .ccdst-wrap--home .ccdst-home-dst {
    grid-column: 1 / -1;
    grid-row: 2;
    border: 1px solid var(--ccdst-border);
    border-radius: 15px;
  }
  .ccdst-wrap--home .ccdst-dst-row { min-height: 150px; }
  .ccdst-wrap--home .ccdst-dst-value { font-size: 16px; }
}

/* Mobile component layout. */
@container (max-width: 559px) {
  .ccdst-wrap--home .ccdst-home-shell { display: block; }
  .ccdst-wrap--home .ccdst-home-header { width: 100%; margin-bottom: 8px; text-align: center; }
  .ccdst-wrap--home .ccdst-home-title { width: 100%; margin-inline: auto; text-align: center; }
  .ccdst-wrap--home .ccdst-home-layout { display: grid; grid-template-columns: 1fr; gap: 0; }
  .ccdst-wrap--home .ccdst-home-analog,
  .ccdst-wrap--home .ccdst-home-info { grid-column: auto; grid-row: auto; width: 100%; }
  .ccdst-wrap--home .ccdst-clock-svg { width: min(100%, 375px); }
  .ccdst-wrap--home .ccdst-home-info { margin: 0; }
  .ccdst-wrap--home .ccdst-home-dst-grid { grid-template-columns: 1fr; }
  .ccdst-wrap--home .ccdst-home-dst-event + .ccdst-home-dst-event { border-top: 1px solid var(--ccdst-border); border-left: 0; }
  .ccdst-wrap--home .ccdst-dst-row { min-height: 0; padding: 15px 14px; justify-content: flex-start; }
  .ccdst-wrap--home .ccdst-dst-label { min-height: 0; }
  .ccdst-wrap--home .ccdst-dst-value { font-size: 15.5px; }
  .ccdst-wrap--home .ccdst-time { font-size: clamp(40px, 13cqw, 48px); }
}

@media (max-width: 559px) {
  .ccdst-wrap--home .ccdst-home-shell { display: block; }
  .ccdst-wrap--home .ccdst-home-header,
  .ccdst-wrap--home .ccdst-home-title { width: 100%; text-align: center; }
  .ccdst-wrap--home .ccdst-home-layout { display: grid; grid-template-columns: 1fr; gap: 0; }
  .ccdst-wrap--home .ccdst-home-analog,
  .ccdst-wrap--home .ccdst-home-info { grid-column: auto; grid-row: auto; width: 100%; }
}

@media (max-width: 340px) {
  .ccdst-wrap--home .ccdst-clock-svg { width: min(100%, 375px); }
  .ccdst-wrap--home .ccdst-time { min-height: 42px; font-size: 40px; }
  .ccdst-wrap--home .ccdst-home-device-sync { font-size: 12px; }
}

/* City comparison line mirrors the home sync line without implying an error state. */
.ccdst-city-comparison {
  display: flex;
  min-height: 19px;
  margin-top: 7px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--ccdst-muted);
  font-size: 12.5px;
  line-height: 1.35;
}
.ccdst-city-comparison-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--ccdst-sync-neutral);
  border-radius: 50%;
}
.ccdst-city-comparison .ccdst-ljdiff { min-width: 0; }
.ccdst-city-comparison .ccdst-ljdiff-value { font-weight: 500; }

/* Wide city layout: the same unified premium panel used on the home clock. */
.ccdst-city-shell { margin: 0; padding: 0; }
.ccdst-wrap--city .ccdst-city-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.43fr) minmax(0, 0.57fr);
  gap: 18px;
  align-items: stretch;
}
.ccdst-wrap--city .ccdst-home__analog { min-height: 376px; }
.ccdst-wrap--city .ccdst-clock-svg { width: min(100%, 328px); }
.ccdst-wrap--city .ccdst-home-info {
  align-self: stretch;
  background: var(--ccdst-surface);
  border: 1px solid var(--ccdst-border);
  border-radius: 15px;
}
.ccdst-wrap--city .ccdst-digital-card,
.ccdst-wrap--city .ccdst-dst-card {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.ccdst-wrap--city .ccdst-digital-card { flex: 0 0 auto; }
.ccdst-wrap--city .ccdst-dst-card {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  border-top: 1px solid var(--ccdst-border);
}
.ccdst-wrap--city .ccdst-home-dst-grid { flex: 1 1 auto; }
.ccdst-wrap--city .ccdst-dst-row { min-height: 168px; }

/* Hybrid city layout. */
@container (max-width: 739px) and (min-width: 560px) {
  .ccdst-wrap--city .ccdst-city-layout {
    grid-template-columns: minmax(220px, 0.9fr) minmax(270px, 1.1fr);
    gap: 16px 18px;
    align-items: center;
  }
  .ccdst-wrap--city .ccdst-home-info { display: contents; border: 0; }
  .ccdst-wrap--city .ccdst-home__analog { grid-column: 1; grid-row: 1; min-height: 0; }
  .ccdst-wrap--city .ccdst-clock-svg { width: min(100%, 285px); }
  .ccdst-wrap--city .ccdst-home-primary {
    grid-column: 2;
    grid-row: 1;
    border: 1px solid var(--ccdst-border);
    border-radius: 15px;
  }
  .ccdst-wrap--city .ccdst-home-dst {
    grid-column: 1 / -1;
    grid-row: 2;
    border: 1px solid var(--ccdst-border);
    border-radius: 15px;
  }
  .ccdst-wrap--city .ccdst-dst-row { min-height: 150px; }
}

/* Mobile city layout. */
@container (max-width: 559px) {
  .ccdst-wrap--city .ccdst-city-layout { grid-template-columns: 1fr; gap: 0; }
  .ccdst-wrap--city .ccdst-home__analog,
  .ccdst-wrap--city .ccdst-home-info { grid-column: auto; grid-row: auto; width: 100%; }
  .ccdst-wrap--city .ccdst-home__analog { min-height: 0; }
  .ccdst-wrap--city .ccdst-clock-svg { width: min(100%, 375px); }
  .ccdst-wrap--city .ccdst-home-dst-grid { grid-template-columns: 1fr; }
  .ccdst-wrap--city .ccdst-home-dst-event + .ccdst-home-dst-event { border-top: 1px solid var(--ccdst-border); border-left: 0; }
  .ccdst-wrap--city .ccdst-dst-row { min-height: 0; padding: 15px 14px; justify-content: flex-start; }
  .ccdst-wrap--city .ccdst-dst-label { min-height: 0; }
  .ccdst-wrap--city .ccdst-dst-value { font-size: 15.5px; }
  .ccdst-wrap--city .ccdst-time { font-size: clamp(40px, 13cqw, 48px); }
}

@media (max-width: 559px) {
  .ccdst-wrap--city .ccdst-city-layout { display: grid; grid-template-columns: 1fr; gap: 0; }
  .ccdst-wrap--city .ccdst-home__analog,
  .ccdst-wrap--city .ccdst-home-info { width: 100%; }
  .ccdst-wrap--city .ccdst-clock-svg { width: min(100%, 375px); }
}

@media (max-width: 340px) {
  .ccdst-wrap--city .ccdst-clock-svg { width: min(100%, 375px); }
  .ccdst-wrap--city .ccdst-time { min-height: 42px; font-size: 40px; }
}

.ccdst-dst-static {
  display: flex;
  min-height: 168px;
  padding: 24px 20px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: left;
}
.ccdst-dst-static-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  background: var(--ccdst-surface-soft);
  border: 1px solid var(--ccdst-border);
  border-radius: 50%;
  color: var(--ccdst-muted);
  font-size: 18px;
  line-height: 1;
}
.ccdst-dst-static-title {
  color: var(--ccdst-text);
  font-size: 16px;
  font-weight: 780;
  line-height: 1.25;
}
.ccdst-dst-static-text {
  max-width: 360px;
  margin-top: 4px;
  color: var(--ccdst-muted);
  font-size: 13px;
  line-height: 1.45;
}
@container (max-width: 559px) {
  .ccdst-dst-static { min-height: 0; padding: 22px 18px; align-items: flex-start; }
}

.ccdst-dst-only { color: var(--ccdst-text); }
.ccdst-dst-only .dst-summary { margin-bottom: 8px; padding: 10px 12px; background: var(--ccdst-surface-soft); border: 1px solid var(--ccdst-border); border-radius: 12px; }
.ccdst-dst-only .dst-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ccdst-dst-only .dst-pill { padding: 9px 11px; background: var(--ccdst-surface); border: 1px solid var(--ccdst-border); border-radius: 10px; font-size: 14px; }
.ccdst-dst-only .dst-pill em { color: var(--ccdst-muted); font-style: normal; }

html[data-theme="dark"] .ccdst-wrap {
  --ccdst-surface: #171a20;
  --ccdst-surface-soft: #1d2128;
  --ccdst-face: #15181d;
  --ccdst-text: #f3f5f7;
  --ccdst-muted: #a6aeb9;
  --ccdst-border: #2d333c;
  --ccdst-ring: #59616d;
  --ccdst-ticks: #818a96;
  --ccdst-numbers: #f3f5f7;
  --ccdst-hour: #eceff2;
  --ccdst-minute: #c94747;
  --ccdst-second: #e45d5d;
  --ccdst-sync-good: #65b68a;
  --ccdst-sync-warning: #d3a253;
  --ccdst-sync-error: #dc7373;
}
