/* ==========================================================================
   Tessra homepage — widget internals
   --------------------------------------------------------------------------
   One block per widget type, in the same order as the catalog: time,
   productivity, finance, info, web, developer, random, integrations, plus a
   few page-only widgets (catalog, theme swatch, data-flow, link columns).

   Where a class name matches the extension (.sticky, .sticky-curl, .flip-*)
   the styling is deliberately copied from newtab.css so the marketing page
   and the real product are visually indistinguishable.
   ========================================================================== */

/* ===================== TIME ============================================= */

/* --- Clock · flip watchface ---------------------------------------------- */
.flip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.flip-d {
  position: relative;
  min-width: 23px;
  padding: 5px 3px 6px;
  border-radius: 5px;
  background: var(--tint-2);
  font-size: 26px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  text-align: center;
  line-height: 1;
  letter-spacing: -1px;
}
/* Hairline across the middle sells the split-flap look */
.flip-d::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  border-top: 1px solid var(--widget-bg);
}
.flip-colon {
  font-size: 20px;
  font-weight: 300;
  color: var(--muted);
  padding: 0 1px;
}
.flip-date {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

/* --- Clock · digital watchface (the extension's default) ----------------- */
.clock-digital {
  font-size: 48px;
  font-weight: 300;
  letter-spacing: -2px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.clock-digital .sec { font-size: 26px; color: var(--muted); letter-spacing: -1px; }
.clock-date { color: var(--muted); font-size: 12px; margin-top: 7px; }

/* --- World clock -------------------------------------------------------- */
.wc-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
}
.wc-row + .wc-row { border-top: 1px solid var(--hair); }
.wc-city { color: var(--muted); }
.wc-city small { display: block; font-size: 9.5px; color: var(--faint); }
.wc-t {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.4px;
}
.wc-t .d { font-size: 9.5px; color: var(--faint); margin-left: 4px; font-weight: 400; }

/* --- Pomodoro / timer / stopwatch ring ---------------------------------- */
.ring-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ring { width: 62px; height: 62px; flex: 0 0 auto; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .trk { stroke: var(--tint-2); }
.ring .fil {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 163.4;          /* 2πr, r = 26 */
  stroke-dashoffset: 52;
  transition: stroke-dashoffset 0.5s linear;
}
.ring-num {
  font-size: 25px;
  font-weight: 300;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.ring-lbl { color: var(--muted); font-size: 10.5px; }

.time-big {
  font-size: 38px;
  font-weight: 300;
  letter-spacing: -1.6px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.time-big .cs { font-size: 20px; color: var(--muted); }

/* --- Countdown / holiday ------------------------------------------------ */
.cd-num {
  font-size: 52px;
  font-weight: 300;
  letter-spacing: -3px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cd-lbl { color: var(--muted); font-size: 12px; margin-top: 2px; }
.cd-bars { display: flex; gap: 3px; margin-top: 12px; }
.cd-bars i {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: var(--tint-2);
}
.cd-bars i.on { background: var(--accent); }

/* --- Day & year progress ------------------------------------------------ */
.prog + .prog { margin-top: 11px; }
.prog-l {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}
.prog-l span:first-child {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--muted);
}
.prog-l span:last-child { font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* --- Sunset countdown --------------------------------------------------- */
.sun-arc { width: 100%; height: 62px; overflow: visible; }
.sun-arc .arc { fill: none; stroke: var(--tint-2); stroke-width: 2; }
.sun-arc .arc-lit { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.sun-arc .sun-dot { fill: var(--accent); }
.sun-rows { width: 100%; margin-top: 6px; }

/* --- Alarms ------------------------------------------------------------- */
.alarm-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  font-size: 13px;
}
.alarm-row + .alarm-row { border-top: 1px solid var(--hair); }
.alarm-row .t { font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 400; letter-spacing: -0.5px; }
.alarm-row .lbl { color: var(--muted); font-size: 11px; flex: 1; }
.sw {
  width: 30px;
  height: 17px;
  border-radius: 99px;
  background: var(--tint-3);
  position: relative;
  flex: 0 0 auto;
  cursor: pointer;
  transition: background 0.16s;
}
.sw::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.16s;
}
.sw.on { background: var(--accent); }
.sw.on::after { transform: translateX(13px); }

/* ===================== PRODUCTIVITY ===================================== */

/* --- To-do -------------------------------------------------------------- */
.todo { list-style: none; margin: 0; padding: 0; }
.todo li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 5px 0;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.todo .b {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  border-radius: 4px;
  border: 1.5px solid var(--tint-3);
  position: relative;
  transition: background 0.14s, border-color 0.14s;
}
.todo li:hover .b { border-color: var(--muted); }
.todo li.done .b { background: var(--accent); border-color: var(--accent); }
.todo li.done .b::after {
  content: "";
  position: absolute;
  left: 3.5px; top: 1px;
  width: 5px; height: 8px;
  border: solid var(--accent-ink);
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(42deg);
}
.todo li.done > span:last-child { color: var(--faint); text-decoration: line-through; }

/* --- Habit tracker ------------------------------------------------------ */
.habit {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.habit i {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--tint-2);
  cursor: pointer;
  transition: background 0.14s, transform 0.1s;
}
.habit i:hover { transform: scale(1.14); }
.habit i.on { background: var(--accent); }
.habit i.on.light { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.habit-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 5px;
  font-size: 8.5px;
  color: var(--faint);
  text-align: center;
  letter-spacing: 0.3px;
}

/* --- Goals -------------------------------------------------------------- */
.goal + .goal { margin-top: 12px; }
.goal-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
  font-size: 12.5px;
}
.goal-top small { color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }

/* --- Water tracker ------------------------------------------------------ */
.water-glasses {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}
/* Named .wt-glass, not .glass: a bare .glass would collide with the Surface
   style demo's "Glass" tile (.surf.glass) and force its height to 24px. */
.wt-glass {
  width: 17px;
  height: 24px;
  border: 1.5px solid var(--tint-3);
  border-top: none;
  border-radius: 2px 2px 5px 5px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.14s;
}
.wt-glass:hover { border-color: var(--muted); }
.wt-glass::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 0;
  background: color-mix(in srgb, #38bdf8 70%, var(--accent));
  transition: height 0.22s ease;
}
.wt-glass.on::after { height: 78%; }

/* --- Counter ------------------------------------------------------------ */
.counter-num {
  font-size: 46px;
  font-weight: 300;
  letter-spacing: -2px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.counter-btns { display: flex; gap: 8px; margin-top: 12px; }
.counter-btns .w-btn { width: 40px; font-size: 16px; padding: 5px 0; }

/* --- Calculator --------------------------------------------------------- */
.calc-screen {
  font-family: var(--mono);
  font-size: 19px;
  text-align: right;
  padding: 9px 11px;
  border-radius: 7px;
  background: var(--tint-2);
  margin-bottom: 9px;
  overflow: hidden;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.calc-pad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.calc-pad button {
  font: inherit;
  font-size: 13.5px;
  padding: 8px 0;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--tint);
  color: var(--fg);
  cursor: pointer;
  transition: background 0.1s;
}
.calc-pad button:hover { background: var(--tint-2); }
.calc-pad button:active { background: var(--tint-3); }
.calc-pad button.op { color: var(--muted); }
.calc-pad button.eq { background: var(--accent); color: var(--accent-ink); }
.calc-pad button.eq:hover { filter: brightness(1.14); }

/* --- Unit converter ----------------------------------------------------- */
.conv-row { display: flex; gap: 7px; align-items: center; }
.conv-row + .conv-row { margin-top: 8px; }
.conv-in {
  font: inherit;
  font-size: 15px;
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid var(--widget-border);
  background: var(--tint);
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.conv-in:focus { outline: none; border-color: var(--muted); }
.conv-unit {
  font-size: 11px;
  color: var(--muted);
  width: 34px;
  flex: 0 0 auto;
}

/* --- Sticky note (copied from newtab.css) ------------------------------- */
.widget[data-type="stickies"] {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  overflow: visible;
}
.widget[data-type="stickies"]:hover { box-shadow: none; }
.widget[data-type="stickies"] > .widget-header { display: none; }
.widget[data-type="stickies"] > .widget-body { padding: 12px; overflow: visible; }

.sticky {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  background: var(--sticky-bg, #fff59d);
  background-image: linear-gradient(135deg,
    rgba(255, 255, 255, 0.30) 0%,
    rgba(255, 255, 255, 0)    35%,
    rgba(0, 0, 0, 0)          70%,
    rgba(0, 0, 0, 0.04)       100%);
  border-radius: 2px 2px 10px 2px;
  padding: 22px 14px 16px;
  color: #1c1c1c;
  transform: rotate(-4.5deg);
  transform-origin: 50% 50%;
  overflow: hidden;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.14), 0 1px 2px rgba(0, 0, 0, 0.10);
  cursor: grab;
}
.sticky-textarea {
  flex: 1;
  min-height: 60px;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: inherit;
  font-family: "Caveat", "Marker Felt", "Bradley Hand", "Comic Sans MS", cursive, system-ui;
  font-size: 17px;
  line-height: 1.4;
  padding: 0;
  letter-spacing: 0.2px;
  cursor: text;
}
.sticky-textarea::placeholder { color: rgba(0, 0, 0, 0.35); font-style: italic; }
.sticky-curl {
  position: absolute;
  bottom: 0; right: 0;
  width: 24px; height: 24px;
  background: linear-gradient(135deg,
    transparent 49%,
    rgba(0, 0, 0, 0.06) 50%,
    rgba(0, 0, 0, 0.14) 100%);
  border-bottom-right-radius: 10px;
  pointer-events: none;
}
.sticky-color-btn {
  position: absolute;
  top: 5px; right: 6px;
  width: 14px; height: 14px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: var(--sticky-edge, #f9a825);
  cursor: pointer;
  opacity: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: opacity 0.15s, transform 0.12s;
  z-index: 3;
}
.sticky:hover .sticky-color-btn { opacity: 1; }
.sticky-color-btn:hover { transform: scale(1.14); }

/* --- Snippets / clipboard ---------------------------------------------- */
.snip {
  padding: 7px 9px;
  border-radius: 6px;
  background: var(--tint);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.12s, color 0.12s;
}
.snip + .snip { margin-top: 5px; }
.snip:hover { background: var(--tint-2); color: var(--fg); }
.snip b { display: block; font-family: var(--font); font-size: 11px; color: var(--fg); margin-bottom: 2px; }

/* --- Reading list ------------------------------------------------------- */
.read-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 7px 0;
  font-size: 12.5px;
}
.read-item + .read-item { border-top: 1px solid var(--hair); }
.read-fav {
  flex: 0 0 auto;
  width: 17px; height: 17px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: var(--tint-2);
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
}
.read-item .t { line-height: 1.32; }
.read-item .t small { display: block; color: var(--faint); font-size: 10px; margin-top: 1px; }

/* --- Colour palette ---------------------------------------------------- */
.pal { display: flex; gap: 5px; height: 54px; }
.pal i {
  flex: 1;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.12s;
}
.pal i:hover { transform: translateY(-3px); }
.pal-hex {
  display: flex;
  gap: 5px;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--faint);
}
.pal-hex span { flex: 1; text-align: center; }

/* ===================== FINANCE ========================================== */

/* --- Crypto / stocks rows ---------------------------------------------- */
.coin {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
}
.coin + .coin { border-top: 1px solid var(--hair); }
.coin-i {
  flex: 0 0 auto;
  width: 25px; height: 25px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.coin-i.btc  { background: #f7931a; }
.coin-i.eth  { background: #627eea; }
.coin-i.aave { background: #b6509e; }
.coin-i.sol  { background: #14f195; color: #0b2b1f; }
.coin-n { flex: 1; min-width: 0; line-height: 1.25; }
.coin-n b { display: block; font-size: 12.5px; font-weight: 600; }
.coin-n small { color: var(--faint); font-size: 10px; }
.coin-p { text-align: right; line-height: 1.25; }
.coin-p b { display: block; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.coin-p small { font-size: 10px; font-variant-numeric: tabular-nums; }

/* --- Sparkline --------------------------------------------------------- */
.spark { width: 100%; height: 46px; margin-top: 8px; }
.spark-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.spark-sym { font-size: 13px; font-weight: 650; letter-spacing: 0.2px; }
.spark-price { font-size: 17px; font-weight: 400; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }

/* --- Fear & greed gauge ------------------------------------------------- */
.gauge { width: 100%; max-width: 170px; overflow: visible; }
.gauge .trk { fill: none; stroke: var(--tint-2); stroke-width: 11; stroke-linecap: round; }
.gauge .fil { fill: none; stroke: var(--accent); stroke-width: 11; stroke-linecap: round; }
.gauge-num {
  font-size: 32px;
  font-weight: 300;
  letter-spacing: -1.4px;
  margin-top: -14px;
  font-variant-numeric: tabular-nums;
}
.gauge-lbl { font-size: 12px; font-weight: 600; letter-spacing: 0.2px; }
.gauge-scale {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 170px;
  font-size: 8.5px;
  color: var(--faint);
  letter-spacing: 0.3px;
}

/* ===================== INFO ============================================= */

/* --- Weather ----------------------------------------------------------- */
.wx-main {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 5px 0 1px;
}
.wx-emoji { font-size: 31px; line-height: 1; }
.wx-temp { font-size: 33px; font-weight: 300; letter-spacing: -1.6px; font-variant-numeric: tabular-nums; }
.wx-cond { font-size: 12.5px; }
.wx-stats { color: var(--muted); font-size: 10.5px; margin-top: 3px; }
.wx-fc {
  display: flex;
  gap: 6px;
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid var(--hair);
}
.wx-fc > div {
  flex: 1;
  text-align: center;
  font-size: 10px;
  line-height: 1.7;
}
.wx-fc span { display: block; color: var(--faint); font-size: 9px; letter-spacing: 0.3px; }
.wx-fc b { display: block; font-size: 9.5px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* --- Air quality ------------------------------------------------------- */
.aqi-num { font-size: 40px; font-weight: 300; letter-spacing: -2px; line-height: 1; }
.aqi-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  background: color-mix(in srgb, var(--pos) 18%, transparent);
  color: var(--pos);
}

/* --- Moon phase --------------------------------------------------------
   The phase glyph itself is the widget's hero element. Apple's emoji font
   renders these in colour on iOS/macOS; the fallbacks keep a sensible
   symbol everywhere else. */
.moon-emoji {
  font-size: 68px;
  line-height: 1;
  flex: 0 0 auto;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  /* Emoji glyphs sit on a text baseline with leading above and below; this
     trims the slack so the glyph optically centres with the labels. */
  margin: -4px 0 2px;
}
.moon-name { font-size: 13px; font-weight: 600; margin-top: 4px; }
.moon-ill { color: var(--muted); font-size: 11px; }
.moon-rows { width: 100%; margin-top: 8px; }

/* --- ISS tracker ------------------------------------------------------- */
.iss-map {
  position: relative;
  width: 100%;
  height: 92px;
  border-radius: 7px;
  background: var(--tint);
  overflow: hidden;
}
.iss-map svg { width: 100%; height: 100%; }
.iss-map .land { fill: var(--tint-3); }
.iss-dot { fill: var(--accent); }
.iss-ping {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  animation: iss-pulse 2.4s ease-out infinite;
}
@keyframes iss-pulse {
  0%   { r: 3; opacity: 0.9; }
  100% { r: 13; opacity: 0; }
}

/* --- System info / net speed / browser stats --------------------------- */
.stat-row { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 12px; }
.stat-row + .stat-row { border-top: 1px solid var(--hair); }
.stat-row .k { color: var(--muted); width: 54px; flex: 0 0 auto; font-size: 10.5px; }
.stat-row .w-bar { flex: 1; min-width: 0; }
/* Wide enough for a "1280×720" screen value without pushing the row over. */
.stat-row .v {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  width: 66px;
  text-align: right;
  flex: 0 0 auto;
}

.speed-num { font-size: 40px; font-weight: 300; letter-spacing: -2px; line-height: 1; font-variant-numeric: tabular-nums; }
.speed-num small { font-size: 13px; color: var(--muted); letter-spacing: 0; margin-left: 3px; }

/* --- On this day / Wikipedia roulette ---------------------------------- */
.otd-year {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: -0.8px;
  color: var(--muted);
  float: left;
  margin: 1px 10px 0 0;
}
.otd-text { font-size: 12.5px; line-height: 1.55; color: var(--muted); }

/* ===================== WEB ============================================== */

/* --- Search ------------------------------------------------------------ */
.search-form {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border-radius: 9px;
  border: 1px solid var(--widget-border);
  background: var(--tint);
  transition: border-color 0.14s;
}
.search-form:focus-within { border-color: var(--muted); }
.search-form svg { width: 15px; height: 15px; color: var(--muted); flex: 0 0 auto; }
.search-in {
  font: inherit;
  font-size: 14px;
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--fg);
}
.search-in::placeholder { color: var(--faint); }
.search-kbd {
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--widget-border);
  color: var(--faint);
  flex: 0 0 auto;
}

/* --- Shortcuts / bookmarks / link columns ------------------------------ */
.sc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 7px;
}
.sc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-size: 10.5px;
  text-align: center;
  transition: background 0.12s, color 0.12s;
}
.sc:hover { background: var(--tint-2); color: var(--fg); }
.sc-ico {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--tint-2);
  color: var(--fg);
  font-size: 13px;
  font-weight: 700;
}
.sc-ico svg { width: 15px; height: 15px; }

/* Vertical link list (footer columns) */
.link-col { display: flex; flex-direction: column; gap: 1px; }
.link-col a {
  padding: 4px 6px;
  margin-left: -6px;
  border-radius: 5px;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.link-col a:hover { background: var(--tint-2); color: var(--fg); }

/* --- Recent tabs ------------------------------------------------------- */
.tab-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  color: var(--muted);
}
.tab-row + .tab-row { border-top: 1px solid var(--hair); }
.tab-row .read-fav { width: 15px; height: 15px; font-size: 8px; }
.tab-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===================== DEVELOPER ======================================== */

/* --- GitHub contribution grid ----------------------------------------- */
.gh-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-columns: 1fr;
  gap: 2.5px;
}
.gh-grid i {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--tint-2);
}
.gh-grid i.l1 { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.gh-grid i.l2 { background: color-mix(in srgb, var(--accent) 60%, transparent); }
.gh-grid i.l3 { background: var(--accent); }
.gh-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 9px;
  font-size: 9px;
  color: var(--faint);
}
.gh-legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--tint-2); }

/* --- Markdown widget preview pane ------------------------------------- */
.md-split { display: flex; height: 100%; gap: 0; }
.md-src, .md-out { flex: 1; min-width: 0; padding: 12px 14px; overflow: auto; }
.md-src {
  border-right: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: pre-wrap;
  line-height: 1.6;
}
.md-src .k { color: var(--fg); }

/* --- Regex / JSON ----------------------------------------------------- */
.code-box {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  padding: 9px 11px;
  border-radius: 7px;
  background: var(--tint);
  color: var(--muted);
  white-space: pre;
  overflow: auto;
}
.code-box .k  { color: var(--fg); }
.code-box .hl { background: color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 3px; }

/* ===================== RANDOM =========================================== */

/* --- Dice ------------------------------------------------------------- */
.dice-faces { display: flex; gap: 9px; justify-content: center; }
.die {
  width: 42px; height: 42px;
  border-radius: 8px;
  border: 1px solid var(--widget-border);
  background: var(--tint);
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  gap: 2px;
  padding: 6px;
  flex: 0 0 auto;
}
.die i {
  border-radius: 50%;
  background: var(--fg);
  width: 6px; height: 6px;
  place-self: center;
}
.die.rolling { animation: die-roll 0.42s ease; }
@keyframes die-roll {
  0%   { transform: rotate(0) scale(1); }
  40%  { transform: rotate(-16deg) scale(1.1); }
  70%  { transform: rotate(12deg) scale(1.04); }
  100% { transform: rotate(0) scale(1); }
}
.dice-total { color: var(--muted); font-size: 11.5px; }

/* --- Coin flip -------------------------------------------------------- */
.coin-face {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--tint-2);
  border: 1px solid var(--widget-border);
  color: var(--fg);
}
.coin-face.flipping { animation: coin-spin 0.6s ease; }
@keyframes coin-spin {
  0%   { transform: rotateY(0); }
  100% { transform: rotateY(720deg); }
}

/* --- Lucky wheel ------------------------------------------------------ */
.wheel { width: 108px; height: 108px; flex: 0 0 auto; transition: transform 1.6s cubic-bezier(0.15, 0.9, 0.2, 1); }
.wheel-wrap { position: relative; display: grid; place-items: center; }
.wheel-pin {
  position: absolute;
  top: -3px;
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 9px solid var(--fg);
}

/* ===================== PAGE-ONLY WIDGETS ================================ */

/* --- Feature widget: icon + short copy -------------------------------- */
.feat-ico {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--tint-2);
  color: var(--fg);
  margin-bottom: 10px;
}
.feat-ico svg { width: 17px; height: 17px; }
.feat h3 {
  margin: 0 0 5px;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.2px;
}
.feat p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }

/* --- Widget catalog (mirrors the extension's "Add widget" panel) ------- */
.cat-group + .cat-group { margin-top: 13px; }
.cat-head {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
}
.cat-items { display: flex; flex-wrap: wrap; gap: 4px; }
.cat-item {
  padding: 3.5px 9px;
  border-radius: 99px;
  border: 1px solid var(--widget-border);
  background: var(--tint);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.cat-item:hover { background: var(--tint-2); color: var(--fg); border-color: var(--tint-3); }

/* --- Theme swatch widget ---------------------------------------------- */
/* Each swatch overrides the tokens locally, so the mini dashboard inside it
   renders in that preset's colours while the page stays in its own theme. */
.widget.swatch {
  --tint: rgba(0, 0, 0, 0.04);
  --tint-2: rgba(0, 0, 0, 0.07);
  --tint-3: rgba(0, 0, 0, 0.12);
  --hair: rgba(0, 0, 0, 0.08);
  background: var(--sw-bg);
  border-color: var(--sw-border);
  color: var(--sw-fg);
}
.widget.swatch .widget-header {
  color: var(--sw-muted);
  border-color: var(--sw-border);
  background: rgba(0, 0, 0, 0.03);
}
.widget.swatch.on-dark {
  --tint: rgba(255, 255, 255, 0.06);
  --tint-2: rgba(255, 255, 255, 0.10);
  --tint-3: rgba(255, 255, 255, 0.16);
  --hair: rgba(255, 255, 255, 0.10);
}
.widget.swatch.on-dark .widget-header { background: rgba(255, 255, 255, 0.04); }
.widget.swatch .widget-remove { color: var(--sw-muted); }

.sw-card {
  border-radius: 8px;
  border: 1px solid var(--sw-border);
  background: var(--sw-card);
  padding: 12px;
}
.sw-clock {
  font-size: 27px;
  font-weight: 300;
  letter-spacing: -1.2px;
  line-height: 1;
  color: var(--sw-fg);
  font-variant-numeric: tabular-nums;
}
.sw-clock .s { font-size: 15px; color: var(--sw-muted); }
.sw-sub { font-size: 10.5px; color: var(--sw-muted); margin-top: 3px; }
.sw-todos { list-style: none; margin: 10px 0 0; padding: 0; }
.sw-todos li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  padding: 2.5px 0;
  color: var(--sw-fg);
}
.sw-todos .b {
  width: 11px; height: 11px;
  border-radius: 3px;
  border: 1.5px solid var(--sw-border);
  flex: 0 0 auto;
}
.sw-todos li.done .b { background: var(--sw-accent); border-color: var(--sw-accent); }
.sw-todos li.done span:last-child { color: var(--sw-muted); text-decoration: line-through; }
.sw-dots { display: flex; gap: 4px; margin-top: 10px; }
.sw-dots i { width: 11px; height: 11px; border-radius: 50%; }

/* --- Surface-style demo ----------------------------------------------- */
.surf-row { display: flex; gap: 8px; }
.surf {
  flex: 1;
  border-radius: 8px;
  border: 1px solid var(--widget-border);
  padding: 12px 8px;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--muted);
  background: var(--tint);
}
.surf b { display: block; color: var(--fg); font-size: 11.5px; margin-bottom: 2px; }
.surf.glass {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.15));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-color: rgba(255, 255, 255, 0.5);
}
:root[data-theme="dark"] .surf.glass {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  border-color: rgba(255, 255, 255, 0.16);
}
.surf.liquid {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.2) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 6px 14px rgba(0, 0, 0, 0.08);
  border-color: rgba(255, 255, 255, 0.55);
}
:root[data-theme="dark"] .surf.liquid {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.05) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 6px 14px rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.18);
}

/* --- Privacy data-flow diagram --------------------------------------- */
.flow-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.flow-node {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 8px;
  border-radius: 9px;
  border: 1px solid var(--widget-border);
  background: var(--tint);
  text-align: center;
}
.flow-node svg { width: 21px; height: 21px; color: var(--muted); }
.flow-node b { font-size: 12px; font-weight: 600; }
.flow-node small { color: var(--faint); font-size: 9.5px; }
.flow-arrow { color: var(--faint); flex: 0 0 auto; }
.flow-arrow svg { width: 20px; height: 20px; }
.flow-server {
  margin-top: 11px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px dashed var(--tint-3);
  color: var(--faint);
  font-size: 11px;
  text-align: center;
}
.flow-server s { text-decoration-thickness: 1.5px; }

/* --- Privacy points list --------------------------------------------- */
.pp { list-style: none; margin: 0; padding: 0; }
.pp li { display: flex; gap: 11px; padding: 9px 0; }
.pp li + li { border-top: 1px solid var(--hair); }
.pp .pi {
  flex: 0 0 auto;
  width: 27px; height: 27px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--tint-2);
  color: var(--fg);
}
.pp .pi svg { width: 14px; height: 14px; }
.pp b { display: block; font-size: 12.5px; font-weight: 640; margin-bottom: 1px; }
.pp span > span, .pp p { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0; }

/* --- Impressum key/value grid ---------------------------------------- */
.imp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px 22px;
}
.imp-grid p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.65; }

/* --- Keyboard-shortcut list ------------------------------------------ */
.kb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  font-size: 12px;
  color: var(--muted);
}
.kb-row + .kb-row { border-top: 1px solid var(--hair); }
kbd {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2.5px 6px;
  border-radius: 5px;
  border: 1px solid var(--widget-border);
  border-bottom-width: 2px;
  background: var(--tint);
  color: var(--fg);
  white-space: nowrap;
}

/* --- Stat / metric tile ---------------------------------------------- */
.metric { display: flex; align-items: baseline; gap: 7px; }
.metric b { font-size: 30px; font-weight: 300; letter-spacing: -1.4px; }
.metric span { color: var(--muted); font-size: 11.5px; }
