/* The widgets' own layouts, ported from their SwiftUI views. Every widget is a fixed-size slot,
   112pt tall: header on the top line, keys on the bottom one. */

.notchet .slot.stack { display: flex; flex-direction: column; gap: 8px; }
.notchet .keys { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.notchet .grow { flex: 1; }
.notchet .lbl.accent { color: var(--accent); }
.notchet .lbl .light { margin-left: auto; }

/* Timer */
.notchet .time { font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.notchet .time.urgent { color: var(--urgent); }

/* Metronome */
.notchet .metro-top { display: flex; flex-direction: column; gap: 5px; }
.notchet .tempo { display: flex; align-items: baseline; gap: 6px; }
.notchet .bpm { font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.notchet .unit { font: 600 10px/13px var(--mono); letter-spacing: 1.2px; color: var(--t2); }
.notchet .pads { display: flex; gap: 4px; }
.notchet .pad { width: var(--side); height: var(--side); border-radius: 4px; background: var(--unlit); display: grid; place-items: center; font: 600 9px/1 var(--mono); color: var(--t2); }
.notchet .pad.down { box-shadow: inset 0 0 0 1px var(--accent); }
.notchet .pad.lit { background: color-mix(in srgb, var(--accent) 75%, transparent); color: #000; }
.notchet .pad.down.lit { background: var(--accent); }
.notchet .sig, .notchet .agents { padding: 0; border: 0; background: none; cursor: pointer; font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0; color: var(--accent); }
.notchet .slot.metro-small { align-items: center; justify-content: space-between; gap: 4px; }
.notchet .metro-mid { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* Keep Awake */
.notchet .slot.awake-w { display: flex; flex-direction: column; }
.notchet .awake-body { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.notchet .agents { color: var(--t2); }
.notchet .agents.on { color: var(--accent); }
.notchet .status { font-weight: 600; line-height: 1.2; text-transform: uppercase; white-space: nowrap; font-variant-numeric: tabular-nums; }
.notchet .status.accent { color: var(--accent); }
.notchet .status.muted { color: var(--t2); }
.notchet .status.infinity, .notchet .key.infinity { font-family: -apple-system, system-ui, sans-serif; font-weight: 700; }
/* SF Symbol infinity at 12pt bold is ~18.5pt wide; the text glyph needs a larger size to match. */
.notchet .key.infinity { font-size: 20px; }
.notchet .detail { font: 600 10px/13px var(--mono); text-transform: uppercase; letter-spacing: 1.2px; color: var(--t2); white-space: nowrap; overflow: hidden; }

/* Clock (Seconds bar): date and day progress, the time a title gap below, the minute meter at the bottom */
.notchet .slot.clock-w { display: flex; flex-direction: column; }
.notchet .clock-w .clock-time { margin-top: 12px; font: 500 32px/1.2 var(--mono); white-space: nowrap; font-variant-numeric: tabular-nums; }
.notchet .clock-bottom { margin-top: auto; display: flex; align-items: center; gap: 6px; }
.notchet .clock-bottom .meter { flex: 1; }
.notchet .secs { font: 600 11px/1 var(--mono); color: var(--t2); font-variant-numeric: tabular-nums; }

/* Agents */
.notchet .slot.agents-w { display: flex; flex-direction: column; }
.notchet .sessions { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; min-height: 0; overflow: hidden; }
.notchet .session { display: flex; flex-direction: column; gap: 2px; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font-family: var(--mono); }
.notchet .session .line { display: flex; align-items: center; gap: 6px; width: 100%; }
.notchet .narrow-rows .session .line { gap: 4px; }
.notchet .sq { flex: none; width: 6px; height: 6px; border-radius: 1.5px; background: var(--unlit); }
.notchet .sq.working, .notchet .sq.done { background: var(--accent); }
.notchet .sq.approve { background: var(--urgent); }
.notchet .sq.off { background: var(--unlit); }
.notchet .session .name { font-weight: 600; line-height: 1.2; color: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.notchet .session .state { flex: none; font: 600 10px/13px var(--mono); letter-spacing: 1.2px; color: var(--t2); }
.notchet .session .state.urgent { color: var(--urgent); }
.notchet .session .state.accent { color: var(--accent); }
.notchet .session .step { padding-left: 12px; font: 500 10px/1.2 var(--mono); color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notchet .session:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* Usage and System: rows of level meters */
.notchet .slot.usage-w { display: flex; flex-direction: column; }
/* 1.4: the body starts a title gap below; 1U rows sit 10pt apart at the top, 2U rows share the rest. */
.notchet .usage-w .rows { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.notchet .usage-w .rows.spread { flex: 1; gap: 0; justify-content: space-between; }
.notchet .urow { display: flex; flex-direction: column; gap: 1px; }
.notchet .uline { display: flex; align-items: center; gap: 6px; }
.notchet .uline .meter { flex: 1; }
.notchet .l { flex: none; font: 600 10px/13px var(--mono); text-transform: uppercase; letter-spacing: 1.2px; color: var(--t2); white-space: nowrap; }
.notchet .l.accent, .notchet .lbl i.today { color: var(--accent); }
.notchet .pct, .notchet .num { flex: none; text-align: right; font: 600 12px/15px var(--mono); color: var(--t1); font-variant-numeric: tabular-nums; }
.notchet .pct { width: 36px; }
.notchet .num.urgent { color: var(--urgent); }
.notchet .udetail { padding-left: 40px; overflow: hidden; }
.notchet .mdetail { padding-left: 32px; overflow: hidden; }

/* Calendar */
.notchet .slot.cal-w { display: flex; flex-direction: column; }
.notchet .cal-body { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; min-height: 0; }
.notchet .cal-small .cal-body { gap: 3px; }
.notchet .ev-next { display: flex; align-items: center; gap: 8px; }
.notchet .ev-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.notchet .ev-title { font-weight: 600; line-height: 1.2; color: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notchet .ev-when { font: 600 10px/1.2 var(--mono); text-transform: uppercase; letter-spacing: 1.2px; color: var(--t2); white-space: nowrap; overflow: hidden; }
.notchet .ev-when.accent { color: var(--accent); }
.notchet .ev-rows { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.notchet .ev-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.notchet .ev-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; }
.notchet .ev-time { flex: none; font: 600 10px/1.2 var(--mono); color: var(--t2); }
.notchet .ev-name { font: 500 11px/1.2 var(--mono); color: var(--t1); overflow: hidden; text-overflow: ellipsis; }

/* Music */
.notchet .slot.music-w { display: flex; flex-direction: column; align-items: center; }
.notchet .slot.music-w.music-wide { flex-direction: row; align-items: flex-start; gap: 10px; }
.notchet .cover {
  flex: none; width: var(--side); height: var(--side); border-radius: 6px;
  background:
    radial-gradient(circle at 70% 30%, color-mix(in srgb, var(--a) 85%, transparent) 0 18%, transparent 19%),
    linear-gradient(160deg, var(--a), var(--b) 70%);
  transition: opacity .2s;
}
.notchet .cover.paused { opacity: .6; }
.notchet .music-w .title { margin-top: 6px; max-width: 100%; font: 600 10px/13px var(--mono); text-transform: uppercase; letter-spacing: 1.2px; color: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notchet .music-w .music-keys { justify-content: center; }
.notchet .music-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; height: 112px; }
.notchet .music-info .title.wide { margin: 0; font: 600 13px/1.2 var(--mono); text-transform: none; letter-spacing: 0; }
.notchet .music-info .l { overflow: hidden; text-overflow: ellipsis; }
.notchet .pos { font: 500 11px/13px var(--mono); color: var(--t2); }
.notchet .music-info .keys { justify-content: flex-start; }

/* MetronomeWidget wide: Spacer(minLength: 4) above the keys, not the stack's 8. */
.notchet .slot.metro-wide { gap: 4px; }

/* Agent marks (AgentInlineMark) and Usage's agent keys */
.notchet .mark { display: inline-grid; place-items: center; }
.notchet .mark-slot { flex: none; width: 14px; display: grid; place-items: center start; }
.notchet .agent-keys { display: flex; gap: 6px; margin-left: auto; }
.notchet .agent-key { min-width: 18px; height: 13px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; filter: saturate(0); opacity: .45; }
.notchet .agent-key.on { filter: none; opacity: 1; }
.notchet .agent-key:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.notchet .today-body { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.notchet .tokens-today { font-weight: 500; line-height: 1.2; color: var(--t1); font-variant-numeric: tabular-nums; }

/* World Clock: names in heavy white capitals, LED times; rows 10pt apart below a title gap */
.notchet .slot.wc-w { display: flex; flex-direction: column; }
.notchet .wc-rows { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.notchet .wc-row { display: flex; align-items: center; gap: 8px; }
.notchet .city { font: 800 14px/17px -apple-system, system-ui, sans-serif; color: var(--t1); white-space: nowrap; }
.notchet .led .lit { fill: var(--accent); }
.notchet .led .unlit { fill: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Custom widgets (Markets, Ticker): header, then parts 5pt apart a title gap below */
.notchet .slot.cw-w { display: flex; flex-direction: column; }
.notchet .up { color: #3ee07a; }
.notchet .down { color: #ff4d2e; }
.notchet .lbl i.up { color: #3ee07a; }
.notchet .lbl i.down { color: #ff4d2e; }
.notchet .mrows { margin-top: 12px; display: flex; flex-direction: column; gap: 2.5px; }
.notchet .mrow { display: flex; align-items: baseline; gap: 4px; }
.notchet .mlabel { font: 500 13px/15.5px var(--mono); color: var(--t1); white-space: nowrap; }
.notchet .mright { font: 500 12px/15.5px var(--mono); white-space: nowrap; font-variant-numeric: tabular-nums; }
.notchet .tbody { margin-top: 12px; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 5px; }
.notchet .tprice { font-weight: 600; line-height: 1.2; color: var(--t1); font-variant-numeric: tabular-nums; }
.notchet .tchange { font: 500 11px/13px var(--mono); white-space: nowrap; }
.notchet .tchart { position: relative; flex: 1; min-height: 8px; cursor: ns-resize; }
.notchet .tchart svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.notchet .wc-time { display: flex; }
.notchet .led { display: block; }
.notchet .tchart { margin-bottom: 4px; }   /* the view's Spacer(minLength: 4) under the parts */

/* Custom widget parts: value, meter, keys a title gap below the header, 5pt apart */
.notchet .cw-body { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; min-height: 0; }
.notchet .cw-w > .keys { margin-top: auto; }
.notchet .pvalue { font-weight: 600; line-height: 1.2; color: var(--t1); font-variant-numeric: tabular-nums; white-space: nowrap; }
.notchet .lbl i.muted { color: var(--t2); }
.notchet .field { height: 22px; padding: 0 8px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .06); background: var(--key); color: var(--t1); font: 500 11px var(--mono); }
.notchet .field::placeholder { color: var(--t2); }
.notchet .field:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.notchet .trows { display: flex; flex-direction: column; gap: 2px; }
.notchet .trow { display: flex; align-items: center; gap: 6px; }
.notchet .check { flex: none; width: 13px; height: 13px; padding: 0; border-radius: 50%; border: 1.5px solid var(--t2); background: none; cursor: pointer; }
.notchet .trow.done .check { border-color: var(--accent); background: var(--accent); }
.notchet .ttext { font: 500 13px/15.5px var(--mono); color: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notchet .trow.done .ttext { color: var(--t2); text-decoration: line-through; }

/* Usage History: a week of stacked bars */
.notchet .hdays { margin-top: 12px; flex: 1; min-height: 0; display: flex; gap: 5px; }
.notchet .hdays.wide { gap: 8px; }
.notchet .day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 0; }
.notchet .bar { flex: 1; width: 100%; border-radius: 2px; background: var(--unlit); display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.notchet .bar.today { box-shadow: inset 0 0 0 1px var(--accent); }
.notchet .bar span { display: block; flex: none; }
.notchet .day .d { font: 600 10px/13px var(--mono); color: var(--t2); }
.notchet .day .d.accent { color: var(--accent); }
