/* Workspace desk (workspace.html, workspace-desk.js): status bar, the briefing column and the right
   column. House tokens (styles.css), house fonts, pieces of the landing drawing as quiet art. */

/* The workspace used to force the system font (theme-lock.css); it reads in the house fonts again. */
body[data-page="workspace-home"] {
  --font-ui: "Inter", "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "IBM Plex Sans", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --ws-ease: cubic-bezier(.22, 1, .36, 1);
  font-family: var(--font-ui);
}
body[data-page="workspace-home"] ::selection { background: rgba(39, 110, 241, .18); }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.ws { max-width: 1320px; margin: 0 auto; padding: 0 24px 72px; color: var(--ma-ink, #15211c); }

/* Pieces of landing-background.svg (1536×1024), cut out with CSS as in policy-atlas.css (.pa-art):
   region at the element's size, soft edges, decorative only. */
.ws-art { display: block; flex: none; background: url("landing-background.svg") no-repeat; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%); }
.ws-art--core { aspect-ratio: 720 / 560; background-size: 213.33% auto; background-position: 68.63% 53.88%; }
.ws-art--votemap { aspect-ratio: 125 / 102; background-size: 1228.8% auto; background-position: 80.44% 45.34%; }
.ws-art--lens { aspect-ratio: 150 / 152; background-size: 1024% auto; background-position: 32.61% 55.96%; }
.ws-art--dossier { aspect-ratio: 140 / 135; background-size: 1097.14% auto; background-position: 40.47% 31.72%; }
.ws-art--trajectory { aspect-ratio: 220 / 172; background-size: 698.18% auto; background-position: 45.97% 77.70%; }
.ws-art--evidence { aspect-ratio: 250 / 185; background-size: 614.40% auto; background-position: 77.76% 77.71%; }
.ws-art--signals { aspect-ratio: 215 / 165; background-size: 714.42% auto; background-position: 90.23% 63.21%; }
/* Small pieces beside block titles in the right column. */
.ws-block-head .ws-art { height: 44px; margin: -12px -4px -10px 0; opacity: .9; }

/* ── Status bar ── */
.ws-bar { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; padding: 6px 2px 22px; margin-bottom: 4px; }
.ws-bar > .ws-art--core { position: absolute; right: 180px; top: 50%; width: 300px; transform: translateY(-52%); opacity: .42; z-index: 0;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 30%, transparent 100%); }
.ws-bar > :not(.ws-art) { position: relative; z-index: 1; }
.ws-title { margin: 0; font-family: var(--font-display); font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -.015em; }
.ws-status { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--ma-ink-muted, #5d6c65); }
.ws-status b { color: var(--ma-ink, #15211c); font-weight: 600; font-variant-numeric: tabular-nums; }
.ws-dot { margin: 0 8px; color: var(--ma-line-strong, rgba(83,103,94,.34)); }
.ws-bar-actions { display: flex; gap: 8px; }

/* ── Layout ── */
.ws-grid { display: grid; grid-template-columns: minmax(0, 1fr) 368px; gap: 24px; align-items: start; }
.ws-main { min-width: 0; }
.ws-rail { display: grid; grid-template-columns: minmax(0, 1fr); border-radius: var(--ma-panel-radius, 16px); background: var(--ma-surface-raised, #fff);
  border: 1px solid var(--ma-line, rgba(83,103,94,.22)); box-shadow: var(--ma-shadow-quiet); overflow: hidden; }

/* ── Right column ── */
.ws-block { padding: 16px 18px 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.ws-block + .ws-block { border-top: 1px solid var(--ma-line, rgba(83,103,94,.22)); }
.ws-block[hidden] { display: none; }
.ws-plenary { background: linear-gradient(180deg, #f5f8ff 0%, var(--ma-surface-raised, #fff) 100%); }
.ws-block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 24px; }
.ws-block-head h2 { margin: 0; font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.ws-head-link, .ws-more { font-size: 13px; color: var(--ma-action-strong, #1859cc); text-decoration: none; }
.ws-head-link:hover, .ws-more:hover { text-decoration: underline; text-underline-offset: 2px; }
.ws-more { justify-self: start; font-weight: 500; }
.ws-more::after { content: " →"; }
.ws-sub { margin: -4px 0 0; font-size: 13px; color: var(--ma-ink-muted, #5d6c65); }
.ws-live { font-weight: 600; color: var(--ma-ink, #15211c); }
.ws-live.is-live { color: var(--ma-civic, #16846f); }
.ws-live.is-live::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 6px 1px 0; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px var(--ma-civic-soft); vertical-align: middle; }
.ws-mini { margin: 2px 0 0; font-size: 12.5px; font-weight: 600; color: var(--ma-ink-muted, #5d6c65); }
.ws-empty { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ma-ink-muted, #5d6c65); }
.ws-faint { margin: 0; font-size: 12.5px; color: var(--ma-ink-muted, #5d6c65); }
.ws-cta { justify-self: start; margin-top: 4px; }

.ws-rows { list-style: none; margin: 0; padding: 0; display: grid; }
.ws-row { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-top: 1px solid var(--ma-line, rgba(83,103,94,.22)); font-size: 13.5px; line-height: 1.42; }
.ws-row:first-child { border-top: 0; padding-top: 2px; }
.ws-row--news { grid-template-columns: minmax(0, 1fr); gap: 2px; }
.ws-row-when { font-family: var(--font-mono); font-size: 11.5px; color: var(--ma-ink-muted, #5d6c65); padding-top: 2px; font-variant-numeric: tabular-nums; }
.ws-row-main { min-width: 0; }
.ws-row-main a { color: var(--ma-ink, #15211c); text-decoration: none; overflow-wrap: anywhere; }
.ws-plenary .ws-row-main a { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.ws-row-main a:hover { color: var(--ma-action-strong, #1859cc); text-decoration: underline; text-underline-offset: 2px; }
.ws-row-meta { font-size: 12px; color: var(--ma-ink-muted, #5d6c65); }
.ws-kind, .ws-src { display: inline-block; margin-right: 6px; padding: 0 5px; border-radius: 4px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; line-height: 1.7; vertical-align: 1px; background: var(--ma-surface-soft, #f2f6f4); color: var(--ma-ink-muted, #5d6c65); }
.ws-kind.is-vote { background: var(--ma-action-soft, rgba(39,110,241,.12)); color: var(--ma-action-strong, #1859cc); }
.ws-src { text-transform: none; letter-spacing: 0; font-family: var(--font-ui); font-size: 11px; }
.ws-src.is-commission { background: rgba(0, 51, 153, .08); color: #003399; }
.ws-src.is-council { background: rgba(10, 61, 98, .09); color: #0a3d62; }
.ws-src.is-parliament { background: rgba(30, 64, 175, .08); color: #1e40af; }
.ws-result { margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ws-result.is-adopted { background: var(--ma-civic-soft); color: var(--ma-civic, #16846f); }
.ws-result.is-rejected { background: var(--ma-surface-soft, #f2f6f4); color: var(--ma-ink, #15211c); }

.ws-days { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ws-day { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; }
.ws-day-date { display: grid; justify-items: center; align-content: start; padding-top: 1px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ma-ink-muted, #5d6c65); }
.ws-day-date b { font-family: var(--font-display); font-size: 19px; line-height: 1.1; letter-spacing: 0; color: var(--ma-ink, #15211c); font-variant-numeric: tabular-nums; }
.ws-day-items { min-width: 0; display: grid; gap: 5px; padding-bottom: 10px; border-bottom: 1px solid var(--ma-line, rgba(83,103,94,.22)); }
.ws-day:last-child .ws-day-items { border-bottom: 0; padding-bottom: 0; }
body[data-page="workspace-home"] .ws-day-item { color: var(--ma-ink, #15211c) !important; }
.ws-day-item { margin: 0; font-size: 13px; line-height: 1.42; overflow-wrap: anywhere; }
.ws-plen summary { cursor: pointer; font-size: 13px; line-height: 1.42; list-style: none; }
.ws-plen summary::-webkit-details-marker { display: none; }
.ws-plen summary::after { content: " ▾"; font-size: 10px; color: var(--ma-ink-muted, #5d6c65); }
.ws-plen[open] summary::after { content: " ▴"; }
.ws-plen ul { margin: 6px 0 2px; padding-left: 16px; display: grid; gap: 3px; font-size: 12.5px; line-height: 1.4; color: #2c3a34; }

.ws-follow { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; }
.ws-follow div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; }
.ws-follow dt { font-size: 12.5px; font-weight: 600; color: var(--ma-ink-muted, #5d6c65); }
.ws-count { font-family: var(--font-mono); font-size: 11px; font-weight: 500; }
.ws-follow dd { margin: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.ws-chip { max-width: 100%; padding: 1px 8px; border-radius: 999px; background: var(--ma-surface-soft, #f2f6f4); font-size: 12px; line-height: 1.6; color: var(--ma-ink, #15211c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-chip--more { color: var(--ma-ink-muted, #5d6c65); }

.ws-skeleton { display: grid; gap: 8px; }
.ws-skeleton span { height: 12px; border-radius: 6px; background: var(--ma-surface-soft, #f2f6f4); animation: ws-pulse 1.4s var(--ws-ease) infinite alternate; }
.ws-skeleton span:nth-child(2) { width: 80%; }
.ws-skeleton span:nth-child(3) { width: 60%; }
@keyframes ws-pulse { from { opacity: 1; } to { opacity: .45; } }

.ws a:focus-visible, .ws button:focus-visible, .ws summary:focus-visible, .ws select:focus-visible { outline: 2px solid var(--ma-action, #276ef1); outline-offset: 2px; border-radius: 4px; }

@media (max-width: 1180px) {
  .ws-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .ws-bar > .ws-art--core { right: 160px; width: 240px; }
}
/* One column: status, plenary, briefing, then the rest of the right column. */
@media (max-width: 980px) {
  .ws { padding: 14px 16px 56px; }
  .ws-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ws-rail { display: contents; }
  .ws-rail > .ws-block { border-radius: var(--ma-panel-radius, 16px); background: var(--ma-surface-raised, #fff); border: 1px solid var(--ma-line, rgba(83,103,94,.22)); box-shadow: var(--ma-shadow-quiet); order: 3; }
  .ws-rail > .ws-plenary { order: 1; background: linear-gradient(180deg, #f5f8ff 0%, var(--ma-surface-raised, #fff) 100%); }
  .ws-main { order: 2; }
  .ws-bar > .ws-art--core { right: -40px; width: 200px; opacity: .3; }
  .ws-title { font-size: 26px; }
}
@media (max-width: 560px) {
  .ws-bar-actions { width: 100%; }
  .ws-bar-actions .control-btn { flex: 1; justify-content: center; }
  .ws-dot { margin: 0 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .ws-skeleton span { animation: none; }
}

/* Items new since the last visit (workspace-desk.js). */
.ws-new { display: inline-block; width: 7px; height: 7px; margin: 0 6px 1px 0; border-radius: 50%; background: var(--ma-action, #276ef1); vertical-align: middle; }
