/* Three settings, then the small everyday utilities. */
.desktop-surface { gap: 80px; padding-bottom: 56px; }
.desktop-grid--toys { --utility-size: clamp(160px,16vw,196px); height: auto; grid-template-rows: 132px 132px var(--utility-size); gap: 24px; }
.desktop-card--calendar { grid-column: 3; grid-row: 3; }
.desktop-card--weather { grid-column: 2; grid-row: 3; }
.desktop-card--clock { grid-column: 4; grid-row: 3; }
.desktop-card--calendar,.desktop-card--weather,:root .desktop-card--clock { width: min(100%,var(--utility-size)); justify-self: center; }
.mood-options { gap: 2px; }.mood-options button { flex: 1; min-width: 0; width: auto; height: 44px; }.mood-options i { width: clamp(22px,2.7vw,32px); height: clamp(22px,2.7vw,32px); }
.mood-options [data-mood="mint"] i { background: #16af70; }.mood-options [data-mood="rose"] i { background: #ff3d82; }
:root .desktop-card--clock { display: block; padding: 12px; border-radius: 28px; border: 1px solid #ffffff28; background: linear-gradient(145deg,#303033,#1c1c1e); box-shadow: inset 0 1px #ffffff1a,0 5px 14px #26335112; }
.desktop-card--clock .clock-face { display: grid; place-items: center; width: 100%; height: 100%; padding: 0; margin: 0; border: 0; border-radius: 50%; background: transparent; }
.desktop-card--clock .clock-dial { display: block; width: 100%; height: auto; max-width: none; max-height: none; aspect-ratio: 1; background: #fff; }
.desktop-card--clock .dial-number { font-size: clamp(10px,1.25vw,15px); font-weight: 600; }
:root .desktop-card--calendar { display: flex; flex-direction: column; padding: 12px; border: 1px solid #fff; border-radius: 28px; background: #fff; color: #1d1d1f; box-shadow: 0 5px 14px #2633510b; font-family: -apple-system,BlinkMacSystemFont,sans-serif; }
.calendar-month { height: 26px; min-height: 26px; border: 0; color: #ff3b30; font-size: 12px; font-weight: 600; }
.calendar-month:hover { color: #ff3b30; }
.calendar-table { width: 100%; flex: 1; table-layout: fixed; border-collapse: collapse; text-align: center; font-size: 11px; line-height: 1; }
.calendar-table th { height: 18px; padding: 0; font-size: 9px; font-weight: 500; }
.calendar-table td { padding: 0; height: 20px; }
.calendar-table time { display: inline-grid; place-items: center; width: 20px; height: 20px; font-variant-numeric: tabular-nums; }
.calendar-table :is(th,td):nth-child(n+6) { color: #85858b; }
.calendar-table [aria-current="date"] { color: #fff; background: #ff3b30; border-radius: 50%; }
:root .desktop-card--weather { display: flex; flex-direction: column; position: relative; overflow: hidden; padding: 14px 16px 12px; border: 1px solid #ffffff55; border-radius: 28px; background: radial-gradient(ellipse at 100% 0,#8ed1ff66,transparent 65%),linear-gradient(#2579c2,#79b5e3); color: #fff; box-shadow: inset 0 1px #ffffff22,0 5px 14px #26335112; font-family: -apple-system,BlinkMacSystemFont,sans-serif; }
:root .desktop-card--weather[data-night="true"] { background: radial-gradient(ellipse at 100% 0,#7497d744,transparent 65%),linear-gradient(#172b54,#425d8f); }
.weather-city { height: 28px; min-height: 28px; border: 0; font-size: 15px; font-weight: 500; }
.weather-city:hover { background: transparent; color: #fff; }
.weather-temperature { display: block; margin-top: 3px; font-size: clamp(54px,5vw,72px); font-weight: 250; line-height: 1; letter-spacing: -.07em; }
.weather-status { margin-top: 5px; font-size: 10px; line-height: 1.2; }
@media (min-width: 701px) and (max-width: 1100px) {
  .desktop-surface { gap: 72px; }.desktop-grid--toys { gap: 18px; }
  :root .desktop-card--calendar { padding: 9px; border-radius: 24px; }.calendar-month { font-size: 11px; height: 22px; min-height: 22px; }
  .calendar-table { font-size: 9px; }.calendar-table th { font-size: 8px; height: 16px; }.calendar-table td { height: 16px; }.calendar-table time { width: 16px; height: 16px; }
  :root .desktop-card--weather { padding: 12px; border-radius: 24px; }.weather-city { font-size: 13px; }.weather-temperature { font-size: 54px; }
}
@media (max-width: 700px) {
  .desktop-surface { gap: 56px; padding-bottom: 48px; }
  .desktop-grid--toys { height: auto; grid-template-rows: 220px 96px 112px 164px 140px; gap: 16px 12px; }
  .desktop-card--mood { grid-column: 1 / -1; grid-row: 2; }
  .desktop-card--calendar { grid-column: 1; grid-row: 4; }.desktop-card--weather { grid-column: 1 / -1; grid-row: 5; }
  .desktop-card--clock { grid-column: 2; grid-row: 4; }
  .desktop-card--calendar,.desktop-card--weather,:root .desktop-card--clock { width: 100%; }
  :root .desktop-card--clock { padding: 12px; border-radius: 24px; }.desktop-card--clock .clock-dial { width: min(100%,138px); }.desktop-card--clock .dial-number { font-size: 12px; }
  .mood-options i { width: 28px; height: 28px; }.mood-options { gap: 8px; }.mood-options button { max-width: 44px; }
  :root .desktop-card--calendar { padding: 10px; border-radius: 24px; }.calendar-month { font-size: 11px; height: 22px; min-height: 22px; }
  .calendar-table { font-size: 10px; }.calendar-table th { font-size: 8px; height: 16px; }.calendar-table td { height: 17px; }.calendar-table time { width: 17px; height: 17px; }
  :root .desktop-card--weather { padding: 16px 20px; border-radius: 24px; }.weather-temperature { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); margin: 0; font-size: 68px; }.weather-city { width: 55%; font-size: 16px; }
}

/* SVG provides a fixed coordinate system, independent of button intrinsic sizing. */
.desktop-card--clock .clock-face { position: relative; display: block; min-width: 0; min-height: 0; }
.desktop-card--clock .clock-face > .clock-svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; overflow: visible; fill: none; stroke: none; stroke-width: 0; }
.clock-svg__hour,.clock-svg__minute,.clock-svg__second { transform-origin: 100px 100px; }
.clock-svg__hour { transform: rotate(var(--hour-angle,0deg)); }
.clock-svg__minute { transform: rotate(var(--minute-angle,0deg)); }
.clock-svg__second { transform: rotate(var(--second-angle,0deg)); }
.weather-condition { display: flex; align-items: center; gap: 6px; min-height: 30px; margin-top: 2px; }
.weather-icon { flex: 0 0 30px; width: 30px; height: 30px; overflow: visible; }
.weather-condition .weather-status { margin: 0; font-size: 10px; line-height: 1.2; }
@media (max-width: 700px) { .weather-condition { max-width: 58%; }.weather-icon { flex-basis: 32px; width: 32px; height: 32px; } }

/* Table cells and their date circles share a single, explicitly centred box. */
.calendar-table th, .calendar-table td { text-align: center; vertical-align: middle; }
.calendar-table time {
  display: flex; align-items: center; justify-content: center; margin: 0 auto;
  padding: 0; line-height: 1; letter-spacing: 0; font-family: Arial,sans-serif;
  font-weight: 400; font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.calendar-table [aria-current="date"] { font-weight: 600; }
/* A pointer grab is not keyboard focus. Keyboard navigation keeps its focus ring. */
.desktop-surface .is-pointer-focused:focus, .desktop-surface .is-window-dragging [data-window-handle]:focus { outline: none; }
.sculpture-viewport { touch-action: none; user-select: none; }
/* Keep the weather symbol prominent and the data credit quiet. */
.weather-condition { gap: 8px; min-height: 36px; }
.weather-icon { display: block; flex: 0 0 36px; width: 36px; height: 36px; }
@media (max-width: 700px) {
  .weather-icon { flex-basis: 36px; width: 36px; height: 36px; }
}

@media (min-width: 701px) and (max-width: 1100px) {
  .weather-city { height: 24px; min-height: 24px; }
  .weather-temperature { font-size: 50px; }
  .weather-condition { min-height: 30px; gap: 5px; }
  .weather-icon { flex-basis: 30px; width: 30px; height: 30px; }
}

/* Medium weather widget: current conditions and five days, like a desktop forecast. */
:root .desktop-card--weather, :root .desktop-card--weather[data-night="true"] {
  grid-column: 1 / 3; grid-row: 3; display: grid;
  grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: 12px;
  width: min(100%,380px); height: 180px; align-self: center; justify-self: center;
  padding: 16px; border-radius: 27px; border: 1px solid #828a9a80;
  background: radial-gradient(ellipse at 22% 0,#64708738,transparent 75%),linear-gradient(135deg,#383e49,#2c3039);
  box-shadow: inset 0 1px 1px #ffffff12,0 8px 20px #17202e16;
  color: #fff; font-family: -apple-system,BlinkMacSystemFont,'Helvetica Neue',sans-serif;
}
.weather-overview { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.desktop-card--weather .weather-city { justify-content: flex-start; gap: 4px; width: 100%; height: 20px; min-height: 20px; font-size: 14px; font-weight: 650; letter-spacing: -.02em; }
.desktop-card--weather .weather-city svg { width: 11px; height: 11px; fill: currentColor; stroke: none; }
.desktop-card--weather .weather-temperature { position: static; transform: none; margin: 2px 0 0; font-size: 46px; font-weight: 300; line-height: 1; letter-spacing: -.065em; }
.weather-summary { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: auto; padding-top: 6px; }
.desktop-card--weather .weather-summary .weather-icon { display: block; flex: 0 0 19px; width: 19px; height: 19px; }
.desktop-card--weather .weather-status { margin: 0; font-size: 12px; font-weight: 550; line-height: 1.2; letter-spacing: -.015em; }
.weather-forecast { display: grid; grid-template-rows: repeat(5,minmax(0,1fr)); align-self: stretch; gap: 0; margin: 0; padding: 0; list-style: none; min-width: 0; font-variant-numeric: tabular-nums; }
.weather-day { display: grid; grid-template-columns: 27px minmax(0,1fr) 25px 25px; align-items: center; gap: 3px; min-width: 0; font-size: 12px; font-weight: 650; line-height: 1; }
.weather-day time { letter-spacing: -.025em; }
.weather-day__condition { display: flex; align-items: center; gap: 3px; min-width: 0; }
.weather-day__condition svg { display: block; flex: 0 0 20px; width: 20px; height: 20px; overflow: visible; }
.weather-day__rain { font-size: 10px; font-weight: 650; color: #77dfff; white-space: nowrap; }
.weather-day__low { color: #b1b4bd; text-align: right; }
.weather-day__high { color: #fff; text-align: right; }
@media (max-width: 1100px) {
  .desktop-grid--toys { grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: 240px 96px 112px 180px 180px; height: auto; gap: 20px 16px; }
  .desktop-card--note { grid-column: 1; grid-row: 1; }
  .desktop-card--sculpture { grid-column: 2; grid-row: 1; }
  .desktop-card--mood { grid-column: 1 / -1; grid-row: 2; width: min(100%,380px); justify-self: center; }
  :root .desktop-card--calendar { grid-column: 1; grid-row: 4; width: min(100%,180px); }
  :root .desktop-card--clock { grid-column: 2; grid-row: 4; width: min(100%,180px); }
  :root .desktop-card--weather { grid-column: 1 / -1; grid-row: 5; }
  .sculpture-viewport { inset: -8px -22px; }
}
@media (max-width: 700px) {
  .desktop-grid--toys { grid-template-rows: 220px 96px 112px 164px 180px; gap: 16px 12px; }
  :root .desktop-card--calendar, :root .desktop-card--clock { width: min(100%,164px); }
}
@media (max-width: 420px) {
  :root .desktop-card--weather { padding-inline: 12px; gap: 8px; grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr); }
  .desktop-card--weather .weather-city { font-size: 12px; }
  .desktop-card--weather .weather-temperature { font-size: 42px; }
  .desktop-card--weather .weather-status { font-size: 10px; }
  .weather-day { grid-template-columns: 22px minmax(0,1fr) 21px 21px; gap: 2px; font-size: 10px; }
  .weather-day__condition { gap: 1px; }
  .weather-day__condition svg { flex-basis: 16px; width: 16px; height: 18px; }
  .weather-day__rain { font-size: 8px; }
}

/* One shared preferences panel, with two aligned macOS-style segmented controls. */
:root .desktop-card--preferences {
  grid-column: 4; grid-row: 2; align-self: center; justify-self: center;
  width: 100%; padding: 10px 14px; border-radius: 24px;
  display: grid; grid-template-rows: repeat(2,44px); gap: 4px;
}
.preference-row { display: grid; grid-template-columns: minmax(0,1fr) 104px; align-items: center; gap: 12px; min-width: 0; }
.preference-row + .preference-row { position: relative; }
.preference-row + .preference-row::before { content: ''; position: absolute; inset: -3px 0 auto; height: 1px; background: var(--widget-well); pointer-events: none; }
.preference-label { height: 44px; padding: 0 2px; border: 0; font-size: 12px; font-weight: 550; letter-spacing: -.015em; }
.desktop-card--preferences .control-options { display: flex; gap: 2px; width: 104px; height: 40px; margin: 0; padding: 3px; border-radius: 12px; background: var(--widget-well); box-shadow: inset 0 1px 2px #23304b08; }
.desktop-card--preferences .control-options button { flex: 1; max-width: none; width: auto; height: 34px; border-radius: 9px; background: transparent; color: var(--widget-muted); font-size: 11px; font-weight: 600; }
.desktop-card--preferences .control-options button[aria-pressed="true"] { background: #fff; color: #292c34; box-shadow: 0 1px 4px #18213924,inset 0 0 0 1px #fff8; }
.desktop-card--preferences .control-options svg { width: 17px; height: 17px; }
.desktop-card--preferences .control-options button:hover { color: var(--widget-text); }
.desktop-card--preferences .control-options button:focus-visible { outline-offset: 1px; }
:root[data-theme="dark"] .desktop-card--preferences .control-options button[aria-pressed="true"] { background: #687080; color: #fff; box-shadow: 0 1px 4px #0003,inset 0 1px #ffffff24; }
@media (max-width: 1100px) {
  :root .desktop-card--preferences { grid-column: 1 / -1; grid-row: 3; width: min(100%,380px); padding: 8px 16px; }
}
@media (forced-colors: active) {
  .desktop-card--preferences .control-options { border: 1px solid ButtonText; }
  .desktop-card--preferences .control-options button[aria-pressed="true"] { outline: 2px solid Highlight; }
}

/* Every month fits the square, including six-week months. Preserve table semantics. */
:root .desktop-card--calendar { container-type: inline-size; }
.calendar-table { display: grid; grid-template-rows: 16px minmax(0,1fr); flex: 1 1 0; min-height: 0; font-size: clamp(8px,7cqw,11px); }
.calendar-table thead { display: block; min-height: 0; }
.calendar-table tbody { display: grid; grid-template-rows: repeat(var(--calendar-weeks,6),minmax(0,1fr)); min-height: 0; }
.calendar-table tr { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); min-height: 0; }
.calendar-table thead tr { height: 100%; }
.calendar-table th,.calendar-table td { display: flex; align-items: center; justify-content: center; min-height: 0; height: auto; padding: 0; }
.calendar-table td time { width: auto; height: 100%; max-height: 20px; max-width: 100%; aspect-ratio: 1; margin: 0; flex-shrink: 1; }
