:root {
  --bg: #000;
  --fg: #f5f5f5;
  --muted: rgba(255, 255, 255, 0.55);
  --dim: rgba(255, 255, 255, 0.3);
  --accent: #8ec8ff;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  overflow: hidden;
}

.plane {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #000;
  overflow: hidden;
}

.widget {
  position: absolute;
  overflow: hidden;
  color: var(--fg);
}

.widget.disabled {
  display: none !important;
}

/* ---- widget content ---- */
.w-greeting {
  font-size: clamp(1.4rem, 4vw, 2.8rem);
  font-weight: 300;
  text-align: right;
  line-height: 1.15;
}

.w-title {
  font-size: clamp(0.9rem, 2vw, 1.3rem);
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}

.w-digital .time {
  font-size: clamp(1.8rem, 5vw, 3.8rem);
  font-weight: 200;
  line-height: 1.1;
}

.w-digital .date {
  margin-top: 0.35rem;
  font-size: clamp(0.8rem, 1.6vw, 1.15rem);
  color: var(--muted);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Internet model (analog-clock CDN) + outer bezel chrome */
.widget[data-widget-id="analog_clock"] {
  overflow: visible;
  min-width: 100px;
  min-height: 100px;
}

.w-analog {
  position: relative;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

/* Square clock sized by the smaller of widget width/height */
.analog-bezel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: 92%;
  width: auto;
  aspect-ratio: 1 / 1;
  max-width: 92%;
  border-radius: 50%;
  padding: 4%;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 30% 25%, rgba(180, 210, 255, 0.35), transparent 40%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.04) 40%, rgba(0, 0, 0, 0.55));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 10px 28px rgba(0, 0, 0, 0.55),
    0 0 24px rgba(142, 200, 255, 0.12);
}

.analog-bezel-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-sizing: border-box;
  background: radial-gradient(circle at 50% 50%, #0b0f18, #000 70%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 0 18px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.w-analog analog-clock,
.analog-clock-cdn {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  border-radius: 50%;
}

.w-todos h3 {
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: clamp(1rem, 2vw, 1.4rem);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding-bottom: 0.4rem;
  margin-bottom: 0.7rem;
}

.w-todos ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: calc(100% - 2.5rem);
  overflow: hidden;
}

.w-todos li {
  display: flex;
  gap: 0.6rem;
  font-size: clamp(0.95rem, 1.8vw, 1.35rem);
  font-weight: 300;
  line-height: 1.25;
}

.w-todos li.done {
  color: var(--dim);
  text-decoration: line-through;
}

.w-todos .num {
  color: var(--accent);
  min-width: 1.4rem;
  font-weight: 200;
}

.w-weather {
  text-align: right;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.w-weather .wx-city {
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.w-weather .wx-icon {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
}

.w-weather .wx-temp {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 200;
  line-height: 1;
}

.w-weather .wx-label {
  color: var(--muted);
  font-weight: 300;
  font-size: clamp(0.95rem, 1.8vw, 1.3rem);
}

.w-weather .wx-meta {
  color: var(--dim);
  font-size: 0.9rem;
  font-weight: 300;
}

.w-weather .wx-days {
  list-style: none;
  margin-top: 0.6rem;
  width: 100%;
  max-width: 14rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 0.5rem;
}

.w-weather .wx-days li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--muted);
  margin-top: 0.3rem;
}

.w-aquila {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.42;
  mix-blend-mode: screen;
  pointer-events: none;
  user-select: none;
}

/* ---- news ---- */
.w-news {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.w-news-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 0.4rem;
  margin-bottom: 0.55rem;
}

.w-news h3,
.w-markets h3 {
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: clamp(0.95rem, 1.8vw, 1.25rem);
}

.w-news .meta {
  font-size: 0.75rem;
  color: var(--dim);
  font-weight: 300;
}

.w-news ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow: hidden;
  min-height: 0;
}

.w-news li {
  display: flex;
  gap: 0.45rem;
  font-size: clamp(0.8rem, 1.4vw, 1.05rem);
  font-weight: 300;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.82);
}

.w-news .news-dot {
  color: var(--accent);
  flex-shrink: 0;
}

.w-news .news-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- markets (top 100 crypto) ---- */
.w-markets {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.w-markets-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 0.4rem;
  margin-bottom: 0.4rem;
  flex-shrink: 0;
}

.w-markets h3 {
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: clamp(0.9rem, 1.6vw, 1.15rem);
  border: none;
  margin: 0;
  padding: 0;
}

.w-markets .meta {
  font-size: 0.72rem;
  color: var(--dim);
  font-weight: 300;
}

.mkt-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(142, 200, 255, 0.35) transparent;
}

.w-markets ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.mkt-row {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr) auto auto;
  gap: 0.4rem;
  align-items: baseline;
  font-weight: 300;
  font-size: clamp(0.78rem, 1.3vw, 0.98rem);
}

.mkt-rank {
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 0.9em;
}

.mkt-sym {
  color: var(--fg);
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mkt-price {
  color: rgba(255, 255, 255, 0.88);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.mkt-chg {
  min-width: 3.8rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.92em;
}

.mkt-chg.up { color: #7dffb3; }
.mkt-chg.down { color: #ff8e8e; }
.mkt-chg.flat { color: var(--dim); }

.placeholder {
  color: var(--dim);
  font-weight: 300;
}

.studio-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  border: 1px solid rgba(255,255,255,0.18);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.5);
  cursor: pointer;
}

.studio-fab:hover {
  color: #fff;
  border-color: var(--accent);
}

body.studio-body {
  cursor: default;
}
