/* Home Workspace V1 page owner. Uses Foundation tokens; no cross-page overrides. */
.view[data-page="workspace"] {
  overflow-y: auto;
  background: var(--ds-color-workspace);
}

.home-workspace {
  width: 100%;
  max-width: 1440px;
  min-height: 100%;
  margin: 0 auto;
  padding: var(--ds-space-9);
  color: var(--ds-color-text-primary);
}

.home-workspace *, .home-workspace *::before, .home-workspace *::after { box-sizing: border-box; }
.home-workspace a { color: inherit; }
.home-header { margin-bottom: var(--ds-space-9); }
.home-header h1 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -.015em; }
.home-header p { margin: var(--ds-space-2) 0 0; color: var(--ds-color-text-secondary); font-size: 14px; line-height: 1.55; }
.home-section-label { display: block; margin-bottom: var(--ds-space-2); color: var(--ds-color-text-secondary); font-size: 13px; font-weight: 500; line-height: 1.4; }

.home-priority-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(340px, 1fr); gap: var(--ds-space-9); align-items: start; }

.home-continue-card,
.home-jobs-card,
.home-project-card {
  border: var(--ds-border-card);
  background: var(--ds-color-surface);
  box-shadow: var(--ds-shadow-card);
}

.home-continue-card { display: grid; grid-template-columns: clamp(220px, 16vw, 280px) minmax(0, 1fr); min-height: 204px; overflow: hidden; border-radius: var(--ds-radius-card-large); }
.home-project-cover { position: relative; overflow: hidden; background: var(--ds-color-surface-secondary); }
.home-project-cover > span { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ds-color-text-tertiary); font-size: 32px; font-weight: 600; }
.home-project-cover img { position: relative; width: 100%; height: 100%; display: block; object-fit: cover; }
.home-continue-cover { min-height: 204px; border-radius: 0; }
.home-continue-content { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: var(--ds-space-9); }
.home-continue-content h2, .home-section-heading h2 { margin: 0; font-size: 20px; line-height: 1.3; letter-spacing: -.01em; }
.home-continue-content > p { margin: var(--ds-space-4) 0 var(--ds-space-7); color: var(--ds-color-text-secondary); font-size: 14px; line-height: 1.55; }
.home-context-line { display: flex; flex-wrap: wrap; gap: var(--ds-space-4) var(--ds-space-7); margin-top: var(--ds-space-4); color: var(--ds-color-text-secondary); font-size: 12px; }
.home-context-line span { display: inline-flex; align-items: center; gap: var(--ds-space-2); }
.home-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-4) var(--ds-space-7); }
.home-card-actions .btn, .home-quick-actions > .btn { min-height: var(--ds-control-height-prominent); padding-inline: var(--ds-control-padding-prominent-x); gap: var(--ds-space-3); text-decoration: none; }
.home-text-link, .home-section-heading > a { color: var(--ds-color-text-secondary); font-size: 13px; font-weight: 500; text-decoration: none; }
.home-text-link:hover, .home-section-heading > a:hover { color: var(--ds-color-text-primary); text-decoration: underline; text-underline-offset: 3px; }

.home-continue-empty { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--ds-space-7); padding: var(--ds-space-9); }
.home-continue-empty h2 { margin: 0; font-size: 20px; }
.home-continue-empty p { margin: var(--ds-space-2) 0 0; color: var(--ds-color-text-secondary); font-size: 14px; }
.home-script-dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--ds-space-5); min-height: 270px; padding: var(--ds-space-9); text-align: center; outline: 2px dashed var(--ds-color-border-strong); outline-offset: -16px; transition: outline-color 150ms ease, box-shadow 150ms ease; }
.home-script-dropzone.is-dragover { outline-color: var(--ds-color-accent); box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--ds-color-accent) 14%, transparent), var(--ds-shadow-card); }
.home-script-dropzone-copy h2 { margin: 0; font-size: 22px; }
.home-script-dropzone-copy p { margin: var(--ds-space-3) 0 var(--ds-space-2); color: var(--ds-color-text-secondary); font-size: 15px; }
.home-script-dropzone-copy small { color: var(--ds-color-text-tertiary); font-size: 12px; }
.home-script-dropzone .home-card-actions { justify-content: center; }
.home-script-dropzone .home-drop-status { min-height: 20px; margin: 0; color: var(--ds-color-text-secondary); font-size: 13px; }
.home-script-dropzone button:focus-visible { outline: 0; box-shadow: var(--ds-focus-ring); }
.home-quick { margin-top: var(--ds-space-10); }
.home-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--ds-space-7); margin-bottom: var(--ds-space-6); }
.home-section-heading h2 { font-size: 20px; font-weight: 650; }
.home-section-heading p { margin: var(--ds-space-1) 0 0; color: var(--ds-color-text-secondary); font-size: 13px; line-height: 1.4; }
.home-quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ds-space-7); align-items: stretch; }
.home-quick-actions > .btn { min-height: calc(var(--ds-control-height-prominent) + var(--ds-space-8)); justify-content: center; }
.home-quick-link { min-height: calc(var(--ds-control-height-prominent) + var(--ds-space-8)); display: flex; align-items: center; gap: var(--ds-space-4); padding: var(--ds-space-4) var(--ds-space-7); border: var(--ds-border-control); border-radius: var(--ds-radius-control); background: var(--ds-color-surface); text-decoration: none; transition: background-color var(--motion-duration-control) var(--motion-ease-standard), border-color var(--motion-duration-control) var(--motion-ease-standard), box-shadow var(--motion-duration-control) var(--motion-ease-standard); }
.home-quick-link:hover { border-color: var(--ds-color-border-strong); background: var(--ds-color-hover-neutral); }
.home-quick-link span { min-width: 0; display: grid; }
.home-quick-link strong { font-size: 14px; font-weight: 550; }
.home-quick-link small { color: var(--ds-color-text-tertiary); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }

.home-jobs-card { min-width: 0; border-radius: var(--ds-radius-card-large); padding: var(--ds-space-9); }
.home-job-summary { display: flex; flex-wrap: wrap; gap: var(--ds-space-3); margin-bottom: var(--ds-space-6); }
.home-job-summary span { padding: var(--ds-space-2) var(--ds-space-4); border-radius: var(--ds-radius-pill); color: var(--ds-color-text-secondary); background: var(--ds-color-surface-secondary); font-size: 12px; }
.home-job-summary .has-error { color: var(--ds-color-danger); }
.home-job-list { display: grid; gap: var(--ds-space-2); }
.home-job-row { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: var(--ds-space-4); align-items: center; min-height: 54px; padding: var(--ds-space-3) 0; border-top: var(--ds-border-separator); }
.home-job-row > i { width: 6px; height: 6px; border-radius: var(--ds-radius-pill); background: var(--ds-color-text-disabled); }
.home-job-running > i { background: var(--ds-color-accent); }
.home-job-failed > i { background: var(--ds-color-danger); }
.home-job-row > div:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.home-job-row > div:nth-child(2) span { overflow: hidden; color: var(--ds-color-text-tertiary); font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.home-job-row > div:nth-child(2) strong { overflow: hidden; font-size: 13px; font-weight: 550; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.home-job-row > div:last-child { display: grid; justify-items: end; gap: 2px; }
.home-job-row > div:last-child b { font-size: 11px; font-weight: 600; }
.home-job-row > div:last-child span { color: var(--ds-color-text-tertiary); font-size: 11px; font-variant-numeric: tabular-nums; }

.home-recent { margin-top: var(--ds-space-10); }
.home-recent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ds-space-7); }
.home-project-card { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--ds-radius-card); box-shadow: none; transition: background-color var(--motion-duration-control) var(--motion-ease-standard), border-color var(--motion-duration-control) var(--motion-ease-standard), box-shadow var(--motion-duration-control) var(--motion-ease-standard); }
.home-project-card:hover { border-color: var(--ds-color-border-strong); box-shadow: var(--ds-shadow-card); }
.home-project-card .home-project-cover { min-height: 0; aspect-ratio: 16 / 9; }
.home-project-card .home-project-cover > span { font-size: 24px; }
.home-project-body { min-width: 0; display: flex; flex: 1; flex-direction: column; padding: var(--ds-space-7); }
.home-project-body > span { color: var(--ds-color-text-tertiary); font-size: 12px; line-height: 1.35; }
.home-project-body h3 { overflow: hidden; margin: var(--ds-space-2) 0; font-size: 15px; font-weight: 600; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.home-project-body small { color: var(--ds-color-text-tertiary); font-size: 12px; }
.home-project-body > div { display: flex; align-items: center; gap: var(--ds-space-5); margin-top: auto; padding-top: var(--ds-space-4); }
.home-project-body a { color: var(--ds-color-text-secondary); font-size: 12px; font-weight: 500; text-decoration: none; }
.home-project-body .home-project-open { color: var(--ds-color-accent-pressed); }
.home-project-body a:hover { text-decoration: underline; text-underline-offset: 3px; }

.home-resources { margin-top: var(--ds-space-10); }
.home-resources nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-space-7); }
.home-resources nav > a { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; padding: var(--ds-space-4); border-radius: var(--ds-radius-control); background: var(--ds-color-surface-secondary); text-decoration: none; transition: background-color var(--motion-duration-control) var(--motion-ease-standard); }
.home-resources nav > a:hover { background: var(--ds-color-hover-neutral); }
.home-resources nav > a span { min-width: 0; display: grid; }
.home-resources nav > a strong { font-size: 13px; font-weight: 550; }
.home-resources nav > a small { overflow: hidden; color: var(--ds-color-text-tertiary); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.home-local-state { min-height: 116px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: var(--ds-space-7); border-radius: var(--ds-radius-control); color: var(--ds-color-text-secondary); background: var(--ds-color-surface-secondary); }
.home-local-state strong { color: var(--ds-color-text-primary); font-size: 14px; }
.home-local-state span { margin-top: var(--ds-space-1); font-size: 12px; }
.home-local-state a { margin-top: var(--ds-space-4); color: var(--ds-color-accent-pressed); font-size: 12px; font-weight: 600; }

.home-loading-line { width: 190px; height: 22px; border-radius: var(--ds-radius-control); background: var(--ds-color-surface-secondary); }
.home-loading-line.short { width: 290px; height: 12px; margin-top: var(--ds-space-3); }
.home-loading-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(340px, 1fr); gap: var(--ds-space-9); }
.home-loading-grid > div { min-height: 280px; border: var(--ds-border-card); border-radius: var(--ds-radius-card-large); background: var(--ds-color-surface); }

.home-workspace a:focus-visible { outline: 0; box-shadow: var(--ds-focus-ring); }

@media (max-width: 1500px) {
  .home-workspace { padding: var(--ds-space-8); }
  .home-priority-grid { grid-template-columns: minmax(0, 1.55fr) minmax(320px, .9fr); gap: var(--ds-space-7); }
  .home-continue-card { grid-template-columns: 220px minmax(0, 1fr); }
  .home-continue-empty { grid-template-columns: minmax(0, 1fr) auto; }
  .home-continue-content { padding: var(--ds-space-7); }
}

@media (min-width: 2000px) {
  .home-recent-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .home-priority-grid, .home-loading-grid { grid-template-columns: 1fr; }
  .home-jobs-card { min-height: 0; }
  .home-recent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .home-workspace { padding: var(--ds-space-7); }
  .home-continue-card { grid-template-columns: 1fr; }
  .home-continue-cover { min-height: 168px; max-height: 220px; }
  .home-continue-empty { grid-template-columns: 1fr; }
  .home-continue-empty .btn { justify-self: start; }
  .home-quick-actions, .home-recent-grid, .home-resources nav { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .home-quick-link, .home-project-card, .home-resources nav > a { transition-duration: var(--motion-duration-instant); }
}
