/* Focused workspace polish: clearer task entry, denser Listing setup, and keyboard-visible controls. */

.gh-container {
  max-width: 1280px;
}

.gh-hero {
  max-width: 760px;
  padding: 52px 0 36px;
  text-align: left;
}

.gh-hero-eyebrow {
  margin-bottom: 12px;
}

.gh-hero h1 {
  max-width: 720px;
  margin-bottom: 14px;
  font-size: clamp(2.25rem, 4.5vw, 3.6rem);
}

.gh-hero p {
  max-width: 680px;
  margin: 0;
  font-size: 16px;
}

.hub-grid {
  gap: 14px;
  padding-bottom: 56px;
}

.hub-module-card {
  min-height: 126px;
  padding: 20px;
  align-items: center;
}

.hub-module-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.hub-module-icon svg {
  width: 27px;
  height: 27px;
}

.hub-module-desc {
  -webkit-line-clamp: 3;
}

.hub-module-card:focus-visible,
.gh-topbar a:focus-visible,
.gh-topbar button:focus-visible,
.topbar a:focus-visible,
.topbar button:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}

/* This selector is more specific than the base focus rule. Restore a system
 * outline in forced-colors mode instead of relying on a suppressed shadow. */
@media (forced-colors: active) {
  .hub-module-card:focus-visible,
  .gh-topbar a:focus-visible,
  .gh-topbar button:focus-visible,
  .topbar a:focus-visible,
  .topbar button:focus-visible {
    outline: 2px solid Highlight;
    outline-offset: 2px;
    box-shadow: none;
  }
}

.gh-topbar-title {
  white-space: nowrap;
}

/* Listing workspace */
.listing-topbar .topbar-left {
  display: grid;
  gap: 2px;
}

.listing-topbar .eyebrow {
  margin-bottom: 0;
}

.listing-topbar .header-right {
  gap: 10px;
  min-width: 0;
}

.listing-topbar .user-name-trigger {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-topbar .status-card-mini {
  gap: 4px;
  min-width: 0;
}

.listing-topbar .status-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.listing-topbar .status-ready,
.listing-topbar .status-warn {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: color-mix(in oklab, var(--success), transparent 88%);
  font-size: 12px;
  white-space: nowrap;
}

.listing-topbar .status-warn {
  background: color-mix(in oklab, var(--danger), transparent 88%);
}

.listing-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 4px 0 18px;
  padding: 0 2px;
}

.listing-intro .hero-copy {
  max-width: 760px;
  margin: 0;
  font-size: 15px;
}

.listing-intro-flow {
  flex: 0 0 auto;
  color: var(--meta);
  font: 500 11px/1.2 var(--font-mono);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

#step-input .panel-header {
  align-items: flex-start;
}

.step1-flow-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0 16px;
  padding: 9px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--surface), transparent 28%);
  color: var(--meta);
  font-size: 12px;
}

.step1-flow-note strong {
  color: var(--fg-2);
  font-weight: 600;
}

.step1-columns {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(380px, 1.04fr);
  gap: 16px;
  align-items: start;
}

.step1-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--surface), transparent 38%);
}

.step1-card-header {
  display: grid;
  gap: 3px;
  margin-bottom: 14px;
}

.step1-card-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.step1-card-header h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.step1-card-helper {
  color: var(--meta);
  font-size: 12px;
  line-height: 1.5;
}

.step1-readiness-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(150px, 0.92fr);
  gap: 10px;
  margin-bottom: 2px;
}

.step1-info-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--bg), transparent 22%);
}

.step1-info-card-title {
  margin-bottom: 7px;
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 600;
}

.step1-info-card-copy {
  color: var(--meta);
  font-size: 11px;
  line-height: 1.65;
}

#step-input > .action-row {
  justify-content: flex-end;
}

/* Generated content should never be covered by a floating action bar. */
#step-generation > .action-row {
  position: static;
  inset: auto;
  width: 100%;
  max-width: none;
  margin: 18px 0 0;
  justify-content: flex-start;
}

/* Keep the build marker at the bottom, aligned just left of the feedback bug. */
body:has(#step-input) #app-version-badge {
  right: 84px;
  bottom: 36px;
}

#step-generation #step3-save-hint {
  flex: 1 1 280px;
  min-width: 220px;
}

/* The optimization center sits beside a 280px workflow rail. Two readable
   columns work better than three narrow, independently scrolling columns. */
#optimization-center-panel .diagnostic-sections-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#optimization-center-panel .diagnostic-section:last-child {
  grid-column: 1 / -1;
}

#optimization-center-panel .diagnostic-metric-hint {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* System management shares one fixed sidebar across many dense admin views. */
.dashboard .main-content {
  width: calc(100% - 260px);
  min-width: 0;
}

.dashboard .view {
  min-width: 0;
  overflow-anchor: none;
}

.dashboard .toolbar-left {
  flex-wrap: wrap;
}

.dashboard .toolbar-right {
  flex: 0 0 auto;
}

.dashboard .table-container {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.dashboard .health-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.step1-action-hint {
  margin-right: auto;
  color: var(--meta);
  font-size: 12px;
}

@media (max-width: 1080px) {
  .listing-topbar .topbar-action {
    padding-inline: 8px;
  }

  .listing-topbar .status-ready,
  .listing-topbar .status-warn {
    display: none;
  }

  .step1-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .gh-hero {
    padding-top: 40px;
  }

  .listing-topbar {
    align-items: flex-start;
  }

  .listing-topbar .header-right,
  .listing-topbar .status-card-mini {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .listing-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  #optimization-center-panel .diagnostic-sections-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 768px) {
  .dashboard .main-content {
    width: calc(100% - 60px);
  }
}

@media (max-width: 640px) {
  .gh-hero h1 {
    font-size: 2.2rem;
  }

  .hub-module-card {
    min-height: 112px;
  }

  .gh-topbar-actions .system-admin-btn {
    display: none;
  }

  .listing-topbar .topbar-action[data-secondary-nav="true"] {
    display: none;
  }

  .listing-topbar .user-name-trigger {
    max-width: 108px;
  }

  .sidebar-inner {
    gap: 14px;
    padding: 16px;
  }

  .diagnostic-overview-card,
  .snapshot-sidebar-section:has(.snapshot-empty) {
    display: none;
  }

  .sidebar-progress {
    padding-top: 12px;
  }

  .step1-readiness-grid {
    grid-template-columns: 1fr;
  }

  #step-input > .action-row {
    align-items: stretch;
    flex-direction: column;
    /* Keep the primary action clear of the persistent feedback control. */
    bottom: 76px;
  }

  /* The sticky action bar must not cover the lower part of the next card. */
  #step-input {
    padding-bottom: 136px;
  }

  .step1-action-hint {
    margin-right: 0;
  }

  #start-batch-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-module-card,
  .hub-module-icon {
    transition: none;
  }
}
