@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300;
  src: url("fonts/SpaceGrotesk-300.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  src: url("fonts/SpaceGrotesk-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  src: url("fonts/SpaceGrotesk-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 400;
  src: url("fonts/SpaceMono-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 700;
  src: url("fonts/SpaceMono-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* ==========================================================================
   WALL DISPLAY — STYLE   (geometric · line-work · light & dark · any colour)
   Colours, corner shape, border thickness and font are CSS variables that
   js/core.js rewrites from the Settings screen. The values below are the
   defaults (green, light).
   Widgets are designed at a fixed size in rem (1rem = 16px) and scaled by
   js/layout.js to fit whatever box they are given, so the page works on
   any screen. Safari 12 safe: no aspect-ratio, no flex-gap, no min()/clamp(),
   no double-position gradient stops.
   Fonts: Space Grotesk + Space Mono (SIL Open Font License), in /fonts.
   ========================================================================== */

:root {
  --bg-a: #f2fcf6;
  --bg-b: #c4ecd3;
  --bg-c: #86d3a6;
  --ink: #05301c;
  --muted: #3c6a53;
  --line: #0b4a2d;
  --line-soft: rgba(11, 74, 45, 0.24);
  --grid: rgba(11, 74, 45, 0.08);
  --card: rgba(255, 255, 255, 0.62);
  --card-solid: #f5fff9;
  --cell: rgba(255, 255, 255, 0.56);
  --accent: #00a35c;
  --accent-ink: #ffffff;
  --accent-text: #007a45;
  --accent-soft: rgba(0, 163, 92, 0.16);
  --glow: rgba(0, 163, 92, 0.45);
  --warn: #b4540a;
  --sun: #d98500;
  --shadow: rgba(5, 48, 28, 0.14);
  --scrim: rgba(5, 48, 28, 0.55);
  --dimc: rgba(255, 255, 255, 0.35);
  --radius: 0px;
  --r2: calc(var(--radius) * 0.5);
  --bw: 2px;
  --font: "Space Grotesk", "DIN Alternate", "Avenir Next", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Space Mono", Menlo, "Courier New", monospace;
}

:root[data-theme="dark"] {
  --bg-a: hsl(150,80%,4%); --bg-b: hsl(150,70%,8%); --bg-c: hsl(150,60%,16%);
  --ink: hsl(150,100%,95%); --muted: hsl(150,35%,68%);
  --line: hsl(150,65%,48%); --line-soft: hsla(150,65%,48%,0.28); --grid: hsla(150,65%,48%,0.07);
  --card: hsla(150,80%,5%,0.62); --card-solid: hsl(150,80%,6%); --cell: hsla(150,70%,50%,0.05);
  --accent: hsl(150,100%,59%); --accent-ink: hsl(150,80%,5%); --accent-text: hsl(150,100%,59%);
  --accent-soft: hsla(150,100%,59%,0.16); --glow: hsla(150,100%,59%,0.55);
  --warn: #ffb454; --sun: #ffd24a; --shadow: rgba(0,0,0,0.45); --scrim: rgba(0,10,5,0.72);
  --dimc: rgba(0,0,0,0.35);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
/* iOS will not let you type into a field that has user-select:none */
input, textarea {
  -webkit-user-select: text;
  user-select: text;
}
/* Hide the mouse pointer on a wall display after a few idle seconds (js/main.js) */
html.nocursor, html.nocursor * { cursor: none !important; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
  top: 0; left: 0;
  touch-action: manipulation;
}

body {
  font-family: var(--font);
  font-weight: 500;
  color: var(--ink);
  background-color: var(--bg-b);
  background-image:
    -webkit-repeating-linear-gradient(0deg, var(--grid), var(--grid) 1px, transparent 1px, transparent 2.6rem),
    -webkit-repeating-linear-gradient(90deg, var(--grid), var(--grid) 1px, transparent 1px, transparent 2.6rem),
    -webkit-linear-gradient(top left, var(--bg-a), var(--bg-b) 55%, var(--bg-c));
  background-image:
    repeating-linear-gradient(0deg, var(--grid), var(--grid) 1px, transparent 1px, transparent 2.6rem),
    repeating-linear-gradient(90deg, var(--grid), var(--grid) 1px, transparent 1px, transparent 2.6rem),
    linear-gradient(150deg, var(--bg-a), var(--bg-b) 55%, var(--bg-c));
  -webkit-font-smoothing: antialiased;
}
html[data-grid="off"] body {
  background-image: -webkit-linear-gradient(top left, var(--bg-a), var(--bg-b) 55%, var(--bg-c));
  background-image: linear-gradient(150deg, var(--bg-a), var(--bg-b) 55%, var(--bg-c));
}

button {
  font: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
  touch-action: manipulation;
  cursor: pointer;
}
button[disabled] { cursor: default; }

/* ----------------------------------------------------------------- WALLPAPER */

.wall {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  background: #000;
  visibility: hidden;
}
html.wall-on .wall { visibility: visible; }
.wall .ph { object-fit: cover; }
.wall-dim {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--dimc);
  pointer-events: none;
}

/* ------------------------------------------------------------------- STAGE */

.stage {
  position: fixed;
  z-index: 1;
  top: 0; left: 0; right: 0; bottom: 0;
  top: env(safe-area-inset-top);
  left: env(safe-area-inset-left);
  right: env(safe-area-inset-right);
  bottom: env(safe-area-inset-bottom);
}
.field {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}
.w { position: absolute; }
.w > .wi {
  position: absolute;
  left: 0; top: 0;
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
}

/* Panels: framed boxes with heavier corner brackets */
.panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1rem 1.3rem 1.1rem;
  background: var(--card);
  border: var(--bw) solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0.45rem 0.45rem 0 var(--line-soft);
}
.panel:before, .panel:after,
.tile:before, .tile:after,
.card:before, .card:after {
  content: "";
  position: absolute;
  width: 1.5rem;
  height: 1.5rem;
  border: 0 solid var(--accent);
  pointer-events: none;
  z-index: 3;
}
.panel:before, .tile:before, .card:before { top: 0; left: 0; border-top-width: 0.32rem; border-left-width: 0.32rem; }
.panel:after, .tile:after, .card:after { right: 0; bottom: 0; border-right-width: 0.32rem; border-bottom-width: 0.32rem; }
html[data-shape="round"] .panel:before, html[data-shape="round"] .panel:after,
html[data-shape="round"] .tile:before, html[data-shape="round"] .tile:after,
html[data-shape="round"] .card:before, html[data-shape="round"] .card:after { display: none; }

.ph-head {
  display: flex;
  align-items: center;
  flex: none;
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line-soft);
}
.ph-head h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.ph-head h2:before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.65rem;
  background: var(--accent);
}
.range {
  margin-left: 1rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.status {
  margin-left: auto;
  padding-left: 0.8rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-text);
  text-align: right;
  max-width: 55%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status.err { color: var(--warn); }
.status.err:before { content: "! "; }

.chip {
  margin-left: 0.9rem;
  height: 1.7rem;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--card-solid);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}
.chip:active { background: var(--accent-soft); }

/* ------------------------------------------------------------------- CLOCK */

.clock {
  padding: 0.1rem 0 0 0.3rem;
  min-width: 0;
}
.time {
  display: flex;
  align-items: flex-end;
  font-size: 6.3rem;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.045em;
  white-space: nowrap;
  color: var(--ink);
}
.sfx {
  margin-left: 0.5rem;
  padding-bottom: 0.55rem;
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
}
.sfx .sec { color: var(--muted); }
.sfx .ampm { color: var(--accent-text); }
.date {
  position: relative;
  margin-top: 0.7rem;
  padding-top: 0.75rem;
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.date:before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 5rem;
  height: 0.28rem;
  background: var(--accent);
}
html.wall-on .clock { text-shadow: 0 0 0.9rem var(--bg-a), 0 0 0.25rem var(--bg-a); }

/* -------------------------------------------------------- square icon buttons */

.sq {
  position: relative;
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--line);
  -webkit-clip-path: polygon(20% 0, 100% 0, 100% 80%, 80% 100%, 0 100%, 0 20%);
  clip-path: polygon(20% 0, 100% 0, 100% 80%, 80% 100%, 0 100%, 0 20%);
}
.sq:before {
  content: "";
  position: absolute;
  top: 2px; left: 2px; right: 2px; bottom: 2px;
  background: var(--card-solid);
  -webkit-clip-path: polygon(20% 0, 100% 0, 100% 80%, 80% 100%, 0 100%, 0 20%);
  clip-path: polygon(20% 0, 100% 0, 100% 80%, 80% 100%, 0 100%, 0 20%);
}
.sq svg, .sq span { position: relative; z-index: 1; }
.sq svg { display: block; width: 1.5rem; height: 1.5rem; margin: 0 auto; }
.sq span { display: block; font-family: var(--mono); font-size: 1.15rem; font-weight: 700; line-height: 2.5rem; color: var(--ink); }
.sq .ln, .h-ico .ln { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: square; }
.sq .fl, .h-ico .fl { fill: var(--accent); stroke: none; }
.sq:active:before { background: var(--accent-soft); }

/* ----------------------------------------------------------- PHOTO TILE */

.tile {
  display: block;
  padding: 0;
  overflow: hidden;
  border: var(--bw) solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0.45rem 0.45rem 0 var(--line-soft);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}
.tile:active { opacity: 0.85; }

.ph {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  -webkit-transition: opacity 1.2s ease;
  transition: opacity 1.2s ease;
}
.ph.on { opacity: 1; }
.tile .ph { object-fit: cover; }
.tile.fit-contain .ph { object-fit: contain; }

.tile-note {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.4;
  text-align: center;
  color: var(--muted);
}
.tile-badge {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  width: 2rem;
  height: 2rem;
  background: var(--card-solid);
  border: 2px solid var(--line);
  border-radius: var(--r2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.tile-badge svg { width: 1.1rem; height: 1.1rem; fill: var(--ink); }

/* ---------------------------------------------------------------- CALENDAR */

.cal-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr);
  grid-gap: 0.3rem;
}
.cal-dow {
  text-align: center;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.1rem;
}
.cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0.3rem 0.28rem;
  background: var(--cell);
  border: 1px solid var(--line-soft);
  border-radius: var(--r2);
  display: flex;
  flex-direction: column;
}
.cell.past { opacity: 0.5; }
.cell.today {
  background: var(--accent-soft);
  border: 2px solid var(--accent);
  box-shadow: 0 0 1.2rem var(--glow), inset 0 0 0.9rem var(--accent-soft);
}
.cell-top {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 1.7rem;
}
.dn {
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 0.2rem;
  border-radius: calc(var(--radius) * 0.3);
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.7rem;
  text-align: center;
  white-space: nowrap;
}
.dn small { font-size: 0.58rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.cell.today .dn { background: var(--accent); color: var(--accent-ink); }
.more {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--muted);
  padding-right: 0.15rem;
}
.evt {
  flex: none;
  height: 1.3rem;
  margin-top: 0.2rem;
  padding: 0 0.3rem;
  border-left: 0.25rem solid rgba(0, 0, 0, 0.3);
  border-radius: calc(var(--radius) * 0.25);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.3rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.evt.ghost { background: none !important; border-left-color: transparent; }

.cal-note {
  grid-column: 1 / span 7;
  align-self: center;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
}

/* ----------------------------------------------------------------- SPOTIFY */

.spotify { min-height: 0; }

.connect {
  flex: 1;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.connect p {
  margin: 0 0 1.2rem;
  max-width: 20rem;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--muted);
}
.btn-connect {
  position: relative;
  min-width: 15rem;
  height: 4rem;
  padding: 0 2rem;
  background: var(--accent);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  -webkit-clip-path: polygon(1rem 0, 100% 0, 100% calc(100% - 1rem), calc(100% - 1rem) 100%, 0 100%, 0 1rem);
  clip-path: polygon(1rem 0, 100% 0, 100% calc(100% - 1rem), calc(100% - 1rem) 100%, 0 100%, 0 1rem);
}
.btn-connect:active { opacity: 0.8; }
.btn-connect[disabled] { opacity: 0.35; }

.s-off .connect { display: flex; }
.s-off .np,
.s-off .controls,
.s-off .notice,
.s-off .recent { display: none; }

.np {
  flex: none;
  display: flex;
  align-items: center;
  margin-top: 0.1rem;
}
.art {
  position: relative;
  flex: none;
  width: 7.4rem;
  height: 7.4rem;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: var(--r2);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}
.art img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.art-note { font-size: 2.6rem; color: var(--muted); }
.np-text { flex: 1; min-width: 0; margin-left: 1.1rem; }
.title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-wrap: break-word;
}
.artist {
  margin-top: 0.3rem;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.progress { margin-top: 0.75rem; }
.track { position: relative; height: 0.3rem; background: var(--line-soft); }
.track i {
  position: relative;
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  -webkit-transition: width 0.5s linear;
  transition: width 0.5s linear;
}
.track i:after {
  content: "";
  position: absolute;
  right: -0.15rem;
  top: -0.3rem;
  width: 0.3rem;
  height: 0.9rem;
  background: var(--accent);
  box-shadow: 0 0 0.6rem var(--glow);
}
.times {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
}

.controls {
  flex: none;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-top: 0.7rem;
}
.ctl { width: 7rem; margin: 0 0.4rem; text-align: center; }
.ctl span {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.round {
  position: relative;
  display: block;
  margin: 0 auto;
  width: 4.2rem;
  height: 4.2rem;
  background: var(--line);
  -webkit-clip-path: polygon(22% 0, 100% 0, 100% 78%, 78% 100%, 0 100%, 0 22%);
  clip-path: polygon(22% 0, 100% 0, 100% 78%, 78% 100%, 0 100%, 0 22%);
}
.round:before {
  content: "";
  position: absolute;
  top: 2px; left: 2px; right: 2px; bottom: 2px;
  background: var(--card-solid);
  -webkit-clip-path: polygon(22% 0, 100% 0, 100% 78%, 78% 100%, 0 100%, 0 22%);
  clip-path: polygon(22% 0, 100% 0, 100% 78%, 78% 100%, 0 100%, 0 22%);
}
.round svg { position: relative; z-index: 1; width: 1.9rem; height: 1.9rem; fill: var(--ink); display: block; margin: 0 auto; }
.round:active:before { background: var(--accent-soft); }
.round.big {
  width: 5.2rem;
  height: 5.2rem;
  margin-top: -0.5rem;
  background: var(--accent);
  box-shadow: 0 0 1.4rem var(--glow);
}
.round.big:before { display: none; }
.round.big svg { width: 2.4rem; height: 2.4rem; fill: var(--accent-ink); }
.round.big:active { opacity: 0.8; }
.round .i-pause { display: none; }
.is-playing .round .i-play { display: none; }
.is-playing .round .i-pause { display: block; }

.notice {
  flex: none;
  min-height: 1.2rem;
  margin-top: 0.2rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  text-align: center;
  color: var(--warn);
}

.recent {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  margin-top: 0.3rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line-soft);
}
.recent h3 {
  margin: 0 0 0.3rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.recent ul { margin: 0; padding: 0; list-style: none; }
.recent li {
  display: flex;
  align-items: center;
  height: 2.9rem;
  border-bottom: 1px solid var(--line-soft);
}
.recent li:last-child { border-bottom: 0; }
.recent .thumb {
  flex: none;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: calc(var(--radius) * 0.3);
  background: var(--accent-soft);
  object-fit: cover;
}
.recent .rt { flex: 1; min-width: 0; margin-left: 0.8rem; }
.recent .rn {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent .ra {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent .re { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }

/* ----------------------------------------------------------------- WEATHER */

.weather { padding-bottom: 0.9rem; }
.days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.day {
  text-align: center;
  min-width: 0;
  padding: 0 0.2rem;
  border-left: 1px solid var(--line-soft);
}
.day:first-child { border-left: 0; }
.day .dname {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.day.first .dname { color: var(--accent-text); }
.day .icon { height: 3rem; margin: 0.2rem 0; }
.day .icon svg {
  display: block;
  width: 3rem;
  height: 3rem;
  margin: 0 auto;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
.day .icon .s { stroke: var(--sun); }
.day .icon .a { stroke: var(--accent); }
.day .icon .c { fill: var(--card-solid); }
.day .hi { font-size: 1.6rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.day .lo { font-family: var(--mono); font-size: 1rem; color: var(--muted); line-height: 1.25; }
.day .desc {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------------- NOTES */

.notes-list { flex: 1; min-height: 0; overflow: hidden; margin: 0; padding: 0; list-style: none; }
.nrow { display: flex; align-items: center; min-height: 2.4rem; border-bottom: 1px solid var(--line-soft); }
.chk {
  position: relative;
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  margin-right: 0.8rem;
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) * 0.25);
  background: var(--card-solid);
}
.chk:before { content: ""; position: absolute; left: -0.7rem; right: -0.7rem; top: -0.7rem; bottom: -0.7rem; }  /* bigger tap area */
.done .chk { background: var(--accent); border-color: var(--accent); }
.done .chk:after {
  content: "";
  position: absolute;
  left: 0.38rem; top: 0.05rem;
  width: 0.4rem; height: 0.8rem;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
}
.nt {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}
.done .nt { text-decoration: line-through; color: var(--muted); }
.nmore .nt { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.notes-empty { font-family: var(--mono); font-size: 0.82rem; line-height: 1.4; color: var(--muted); padding: 0.4rem 0; }
.notes-empty b { color: var(--ink); }

/* ---------------------------------------------------------------- THE DOCK */

.dock {
  position: absolute;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dock-right  { top: 0; bottom: 0; right: 0; width: 58px; flex-direction: column; }
.dock-left   { top: 0; bottom: 0; left: 0;  width: 58px; flex-direction: column; }
.dock-top    { left: 0; right: 0; top: 0;    height: 58px; flex-direction: row; }
.dock-bottom { left: 0; right: 0; bottom: 0; height: 58px; flex-direction: row; }
.dock-sm.dock-right, .dock-sm.dock-left { width: 48px; }
.dock-sm.dock-top, .dock-sm.dock-bottom { height: 48px; }
.dock-sm .sq { width: 2.2rem; height: 2.2rem; }
.dock-sm .sq span { line-height: 2.2rem; }
.dk { flex: none; margin: 0.28rem 0.18rem; text-align: center; }
.dk .sq { margin: 0 auto; }
.dk i {
  display: block;
  margin-top: 0.2rem;
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
@media (max-height: 540px) { .dock-right .dk i, .dock-left .dk i { display: none; } }
@media (max-width: 540px)  { .dock-top .dk i, .dock-bottom .dk i { display: none; } }

/* ---------------------------------------------------- MOVE & RESIZE MODE */

html.editing .w > .wi { pointer-events: none; }
.ecov {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 30;
  border: 2px dashed var(--accent);
  background: var(--accent-soft);
  cursor: move;
  touch-action: none;
}
.elabel {
  position: absolute;
  left: 0.5rem; top: 0.4rem;
  padding: 0.2rem 0.5rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.rz {
  position: absolute;
  right: 0; bottom: 0;
  width: 44px; height: 44px;
  background: var(--accent);
  -webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  cursor: nwse-resize;
}
.editbar {
  position: fixed;
  left: 50%;
  bottom: 0.8rem;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  z-index: 70;
  display: none;
  align-items: center;
  padding: 0.5rem 0.8rem;
  background: var(--card-solid);
  border: var(--bw) solid var(--line);
  border-radius: var(--r2);
  box-shadow: 0.35rem 0.35rem 0 var(--line-soft);
  white-space: nowrap;
}
.editbar.open { display: flex; }
.eb-hint { margin-right: 0.8rem; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.editbar .btn { margin: 0 0 0 0.5rem; height: 2.4rem; padding: 0 1rem; }
@media (max-width: 700px) { .eb-hint { display: none; } }

/* --------------------------------------------------------------- OVERLAYS */

.show {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: #000;
  visibility: hidden;
  opacity: 0;
  -webkit-transform: scale(0.12);
  transform: scale(0.12);
  -webkit-transition: -webkit-transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease, visibility 0s linear 0.5s;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease, visibility 0s linear 0.5s;
}
.show.open {
  visibility: visible;
  opacity: 1;
  -webkit-transform: scale(1);
  transform: scale(1);
  -webkit-transition-delay: 0s;
  transition-delay: 0s;
}
.show .ph { object-fit: contain; }
.show.fit-cover .ph { object-fit: cover; }
.show-hint {
  position: absolute;
  left: 50%;
  bottom: 1.2rem;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  padding: 0.5rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
}
.show.open .show-hint {
  -webkit-animation: hint 4s ease forwards;
  animation: hint 4s ease forwards;
}
@-webkit-keyframes hint { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hint { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

.overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--scrim);
  visibility: hidden;
  opacity: 0;
  -webkit-transition: opacity 0.25s ease, visibility 0s linear 0.25s;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.overlay.open {
  visibility: visible;
  opacity: 1;
  -webkit-transition-delay: 0s;
  transition-delay: 0s;
}
.card {
  position: relative;
  width: 56rem;
  max-width: 96%;
  max-height: 94%;
  overflow: hidden;
  padding: 1.5rem 2rem 1.2rem;
  border: var(--bw) solid var(--line);
  border-radius: var(--radius);
  background: var(--card-solid);
  box-shadow: 0.6rem 0.6rem 0 var(--line-soft);
}
.card h2 { margin: 0 0 1rem; font-size: 1.7rem; font-weight: 300; letter-spacing: -0.01em; }
.card-close {
  margin-top: 1rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.help-scroll { max-height: 62vh; }
.help-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-column-gap: 1.6rem;
  grid-row-gap: 0.65rem;
}
.help-list li { display: flex; align-items: flex-start; }
.help-list p { margin: 0 0 0 0.8rem; font-size: 0.86rem; line-height: 1.3; color: var(--muted); font-weight: 500; }
.help-list b { display: block; font-size: 1rem; color: var(--ink); }
.h-ico {
  flex: none;
  width: 2.4rem;
  height: 2.4rem;
  border: 2px solid var(--line);
  border-radius: var(--r2);
  background: var(--card-solid);
  display: flex;
  align-items: center;
  justify-content: center;
}
.h-ico svg { width: 1.3rem; height: 1.3rem; fill: var(--ink); }
.h-ico.t { font-family: var(--mono); font-size: 0.95rem; font-weight: 700; color: var(--ink); }
.h-ico.warn { color: var(--card-solid); background: var(--warn); border-color: var(--warn); }

/* ----------------------------------------------------- shared form controls */

.grow { flex: 1; }
.row { display: flex; flex-wrap: wrap; align-items: center; margin: 0.3rem 0 0.2rem; }
.row .btn { margin-bottom: 0.5rem; }
.row input[type="text"] { flex: 1; margin: 0 0.6rem 0.5rem 0; }

.btn {
  flex: none;
  height: 3rem;
  margin: 0 0.6rem 0 0;
  padding: 0 1.3rem;
  border: 2px solid var(--line);
  border-radius: var(--r2);
  background: var(--card-solid);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.btn:active { background: var(--accent-soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:active { opacity: 0.8; }
.btn.quiet { border-color: var(--line-soft); color: var(--muted); }
.btn[disabled] { opacity: 0.4; }

input[type="text"], input[type="number"], textarea {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0 0.8rem;
  height: 3rem;
  border: 2px solid var(--line);
  border-radius: var(--r2);
  background: var(--card-solid);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1.1rem;           /* 16px+ stops iOS zooming into the field */
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}
textarea { height: auto; padding: 0.6rem 0.8rem; line-height: 1.35; resize: none; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

input[type="range"] {
  display: block;
  width: 100%;
  height: 2.2rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--line-soft); border: 0; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.1rem;
  height: 1.7rem;
  margin-top: -0.72rem;
  background: var(--accent);
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) * 0.2);
}
input[type="range"]::-moz-range-track { height: 4px; background: var(--line-soft); border: 0; }
input[type="range"]::-moz-range-thumb { width: 0.9rem; height: 1.5rem; background: var(--accent); border: 2px solid var(--line); border-radius: 0; }
input.hue::-webkit-slider-runnable-track {
  height: 8px;
  background: -webkit-linear-gradient(left, hsl(0,80%,55%), hsl(60,80%,50%), hsl(120,70%,45%), hsl(180,70%,45%), hsl(240,80%,60%), hsl(300,70%,55%), hsl(360,80%,55%));
  background: linear-gradient(90deg, hsl(0,80%,55%), hsl(60,80%,50%), hsl(120,70%,45%), hsl(180,70%,45%), hsl(240,80%,60%), hsl(300,70%,55%), hsl(360,80%,55%));
}
input.hue::-webkit-slider-thumb { margin-top: -0.58rem; }
input.hue::-moz-range-track { height: 8px; background: linear-gradient(90deg, hsl(0,80%,55%), hsl(60,80%,50%), hsl(120,70%,45%), hsl(180,70%,45%), hsl(240,80%,60%), hsl(300,70%,55%), hsl(360,80%,55%)); }

.rng { display: flex; align-items: center; }
.rng input { flex: 1; }
.rng output { flex: none; width: 4.5rem; text-align: right; font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }

.seg { display: flex; flex-wrap: wrap; margin: 0.15rem 0 0.2rem; }
.seg button {
  height: 2.6rem;
  padding: 0 1.1rem;
  margin: 0 0 0.3rem -2px;
  border: 2px solid var(--line);
  background: var(--card-solid);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}
.seg button:first-child { margin-left: 0; border-radius: var(--r2) 0 0 var(--r2); }
.seg button:last-child { border-radius: 0 var(--r2) var(--r2) 0; }
.seg button:only-child { border-radius: var(--r2); }
.seg button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); position: relative; z-index: 1; }

/* ---------------------------------------------------------------- SETTINGS */

.set-card {
  width: 56rem;
  height: 44rem;
  display: flex;
  flex-direction: column;
  padding: 1.2rem 1.6rem 1rem;
}
.set-card h2 { margin: 0; }
.set-head { flex: none; display: flex; align-items: baseline; padding-bottom: 0.5rem; }
.set-head span { margin-left: auto; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.tabs {
  flex: none;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--line-soft);
}
.tab {
  flex: none;
  height: 2.8rem;
  padding: 0 1.1rem;
  border-bottom: 3px solid transparent;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.set-body { flex: 1; min-height: 0; margin-right: -0.6rem; padding-right: 0.6rem; }
.pane { display: none; }
.pane.on { display: block; }
.set-sec { padding: 0.9rem 0 0.4rem; border-bottom: 1px solid var(--line-soft); }
.pane .set-sec:last-child { border-bottom: 0; }
.set-sec h3 {
  margin: 0 0 0.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.hint { margin: 0 0 0.6rem; font-size: 0.85rem; line-height: 1.35; color: var(--muted); }
.hint.inline { margin: 0 0 0.5rem 0.4rem; }
.hint.ok, .current.ok { color: var(--accent-text); }
.hint.bad, .current.bad { color: var(--warn); }
.set-card label {
  display: block;
  margin: 0.6rem 0 0.2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.swatches { display: flex; flex-wrap: wrap; }
.swb {
  width: 2.6rem;
  height: 2.6rem;
  margin: 0 0.5rem 0.5rem 0;
  border: 2px solid var(--card-solid);
  border-radius: var(--r2);
  box-shadow: 0 0 0 1px var(--line-soft);
}
.swb.on { box-shadow: 0 0 0 3px var(--ink); }

.togs { display: flex; flex-wrap: wrap; }
.tog {
  height: 2.6rem;
  margin: 0 0.5rem 0.5rem 0;
  padding: 0 1rem;
  border: 2px solid var(--line-soft);
  border-radius: var(--r2);
  background: var(--card-solid);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}
.tog.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tog.on:before { content: "\2713\00a0"; }

.steps { margin: 0; padding-left: 1.4rem; }
.steps li { margin-bottom: 1rem; font-size: 0.9rem; line-height: 1.45; color: var(--ink); }
.steps a { color: var(--accent-text); font-weight: 700; text-decoration: underline; }
.steps .mono-box { margin: 0.5rem 0; }
.steps input { margin-top: 0.5rem; }

.results { margin-bottom: 0.4rem; }
.results button {
  display: block;
  width: 100%;
  margin-top: -2px;
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--line-soft);
  background: var(--card-solid);
  text-align: left;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.results button small { font-family: var(--mono); font-size: 0.74rem; font-weight: 400; color: var(--muted); margin-left: 0.5rem; }
.results button:active { background: var(--accent-soft); }
.results .none { font-family: var(--mono); font-size: 0.82rem; color: var(--warn); }
.current { font-family: var(--mono); font-size: 0.82rem; line-height: 1.4; color: var(--muted); margin-bottom: 0.4rem; }
.current b { color: var(--ink); }
.mono-box {
  padding: 0.7rem 0.8rem;
  border: 2px dashed var(--line);
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--ink);
  word-wrap: break-word;
  -webkit-user-select: text;
  user-select: text;
}

.thumbs { display: flex; flex-wrap: wrap; margin: 0 -0.2rem 0.5rem; }
.th { position: relative; width: 4.6rem; height: 4.6rem; margin: 0.2rem; }
.th .pick {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border: 2px solid var(--line);
  background-size: cover;
  background-position: center;
}
.th.on .pick { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent); }
.th .del {
  position: absolute;
  right: 0; top: 0;
  width: 1.9rem;
  height: 1.9rem;
  background: var(--warn);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1.8rem;
  text-align: center;
}

.set-foot {
  flex: none;
  display: flex;
  align-items: center;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line-soft);
}
.set-foot .hint { margin: 0; color: var(--warn); }
.set-foot .btn { margin: 0 0 0 0.6rem; }

/* ---------------------------------------------------------------- NOTES EDITOR */

.ned-card {
  width: 62rem;
  height: 38rem;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.4rem 1.1rem;
}
.ned-head { flex: none; display: flex; align-items: center; margin-bottom: 0.8rem; }
.ned-head h2 { margin: 0; }
.ned-head .btn { margin: 0 0 0 0.6rem; }
.ned-body { flex: 1; min-height: 0; display: flex; }
.ned-list {
  flex: none;
  width: 17rem;
  margin-right: 1rem;
  border: 1px solid var(--line-soft);
}
.ned-row { display: flex; align-items: center; padding: 0.3rem 0.7rem; border-bottom: 1px solid var(--line-soft); }
.ned-row.on { background: var(--accent-soft); box-shadow: inset 0.25rem 0 0 var(--accent); }
.ned-title {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}
.ned-row.done .ned-title { text-decoration: line-through; color: var(--muted); }
.ned-empty { padding: 1rem; font-family: var(--mono); font-size: 0.82rem; color: var(--muted); }
.ned-text { flex: 1; min-width: 0; height: auto; padding: 0.9rem; font-size: 1.1rem; line-height: 1.5; }

/* ----------------------------------------------------------- SHAPE VARIANTS */

html[data-shape="square"] .sq, html[data-shape="square"] .sq:before,
html[data-shape="square"] .round, html[data-shape="square"] .round:before,
html[data-shape="square"] .btn-connect {
  -webkit-clip-path: none;
  clip-path: none;
}
html[data-shape="round"] .sq, html[data-shape="round"] .sq:before {
  -webkit-clip-path: none;
  clip-path: none;
  border-radius: 32%;
}
html[data-shape="round"] .round, html[data-shape="round"] .round:before {
  -webkit-clip-path: none;
  clip-path: none;
  border-radius: 50%;
}
html[data-shape="round"] .btn-connect {
  -webkit-clip-path: none;
  clip-path: none;
  border-radius: 2rem;
}
html[data-shape="round"] .rz { border-radius: 0 0 var(--radius) 0; }

/* ---------------------------------------------------------- SMALL SCREENS */

@media (max-width: 760px), (max-height: 560px) {
  .card { padding: 1rem 1.1rem 0.9rem; }
  .card h2 { font-size: 1.35rem; margin-bottom: 0.6rem; }
  .help-list { grid-template-columns: 1fr; }
  .set-card { height: auto; max-height: 96%; }
  .ned-card { height: auto; max-height: 96%; }
}
@media (max-width: 700px) {
  .ned-body { flex-direction: column; }
  .ned-list { width: auto; height: 7.5rem; margin: 0 0 0.7rem; }
  .ned-text { min-height: 9rem; }
  .set-head span { display: none; }
}

/* Touch devices: the on-screen keyboard covers the lower half, so pin forms to the top. */
@media (hover: none) {
  .overlay.noteed, .overlay.settings { align-items: flex-start; padding-top: 0.6rem; }
}
