/* Workspace */

.workspace-page {
  max-width: 1180px;
}

.premium-workspace {
  padding-bottom: 18px;
}

.workspace-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 30px;
  align-items: center;
  margin-bottom: 28px;
}

.workspace-hero h1 {
  max-width: 760px;
  margin: 6px 0 14px;
  color: var(--text);
  font-size: clamp(42px, 5vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.065em;
  font-weight: 900;
}

.workspace-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.workspace-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.workspace-meta-row span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.04);
}

.workspace-progress-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 22px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(47, 49, 146, 0.12), transparent 42%),
    #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.progress-ring {
  --progress: 0;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(closest-side, #ffffff 72%, transparent 73%),
    conic-gradient(var(--accent) calc(var(--progress) * 1%), rgba(16, 24, 40, 0.08) 0);
}

.progress-ring span {
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.workspace-progress-card strong {
  display: block;
  margin: 0 0 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.workspace-progress-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.workspace-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, 0.82fr);
  gap: 22px;
  align-items: start;
  margin-bottom: 22px;
}

.workspace-side-stack {
  display: grid;
  gap: 18px;
}

.workspace-panel {
  padding: 26px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.workspace-primary-panel {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(47, 49, 146, 0.08), transparent 36%),
    #ffffff;
}

.workspace-panel-heading {
  margin-bottom: 22px;
}

.workspace-panel-heading span {
  display: block;
  margin-bottom: 9px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.workspace-panel-heading h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 25px;
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 900;
}

.workspace-panel-heading p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.workspace-checklist {
  display: grid;
  gap: 12px;
  counter-reset: workspaceStep;
}

.workspace-check-item {
  counter-increment: workspaceStep;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(16, 24, 40, 0.09);
}

.workspace-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
}

.workspace-check-item input.workspace-deliverable {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 30px;
  height: 30px;
  margin: 0;
  border-radius: 999px;
  border: 1.5px solid rgba(16, 24, 40, 0.18);
  background: #ffffff;
  transition: background 180ms ease, border-color 180ms ease;
}

.workspace-check-item input.workspace-deliverable:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.workspace-step-content strong::before {
  content: counter(workspaceStep) ". ";
  color: var(--accent);
}

.workspace-check-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 15px;
  letter-spacing: -0.02em;
}

.workspace-check-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.workspace-tip-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent-soft), #ffffff);
  border: 1px solid rgba(47, 49, 146, 0.12);
}

.workspace-tip-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.workspace-tip-card p {
  margin: 0;
  color: #30335f;
  font-size: 13.5px;
  line-height: 1.5;
  font-weight: 700;
}

.ai-workspace-panel {
  background:
    radial-gradient(circle at top right, rgba(47, 49, 146, 0.1), transparent 42%),
    #ffffff;
}

.ai-coach-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background: var(--surface-soft);
  border: 1px solid rgba(16, 24, 40, 0.06);
}

.ai-coach-card p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 700;
}

.ai-coach-card .compass-primary-btn {
  width: 100%;
  min-height: 48px;
}

.workspace-ai-preview {
  margin-top: 14px;
}

.workspace-ai-preview summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
}

.ai-prompt-box {
  width: 100%;
  min-height: 110px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-soft);
  color: var(--text);
  outline: none;
  padding: 14px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}

.application-panel {
  background:
    radial-gradient(circle at top right, rgba(255, 138, 61, 0.08), transparent 40%),
    #ffffff;
}

.application-value-grid {
  display: grid;
  gap: 18px;
}

.application-value-grid strong {
  display: block;
  margin-bottom: 9px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.workspace-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace-chip-row span,
.detail-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.evidence-notes-panel,
.reflection-panel {
  margin-bottom: 18px;
}

.horizontal-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.horizontal-heading h2 {
  margin-bottom: 0;
}

.horizontal-heading p {
  max-width: 440px;
  margin: 0;
}

.evidence-input-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}

.evidence-input-grid label,
.reflection-grid label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.evidence-input-grid input,
.evidence-input-grid textarea,
.reflection-grid textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  color: var(--text);
  outline: none;
  padding: 14px;
  font-size: 14px;
  line-height: 1.5;
}

.evidence-input-grid input {
  min-height: 54px;
}

.evidence-input-grid textarea {
  min-height: 54px;
  resize: vertical;
}

.reflection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.reflection-grid label {
  padding: 16px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 20px;
  background: #ffffff;
}

.reflection-grid label strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.reflection-grid label span {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
  font-weight: 600;
}

.reflection-grid textarea {
  min-height: 90px;
  resize: vertical;
}

.workspace-bottom-bar {
  position: sticky;
  bottom: 18px;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin-top: 22px;
  padding: 14px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--border);
  box-shadow: 0 18px 45px rgba(16, 24, 40, 0.10);
  backdrop-filter: blur(16px);
}

.workspace-save-status {
  justify-self: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

/* Workspace polish fixes */

.workspace-main-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
}

.workspace-panel {
  padding: 22px;
}

.workspace-check-item {
  min-height: 72px;
  padding: 14px 16px;
}

.workspace-check-item p {
  max-width: 520px;
}

.ai-coach-card {
  padding: 16px;
}

.ai-coach-card p {
  font-weight: 600;
}

.application-value-grid {
  gap: 14px;
}

.evidence-notes-panel {
  padding: 22px;
}

.evidence-input-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.evidence-input-grid textarea {
  height: 74px;
  min-height: 74px;
  resize: vertical;
}

.reflection-panel {
  padding: 22px;
}

.reflection-grid textarea {
  min-height: 82px;
}

.workspace-bottom-bar {
  margin-top: 14px;
}

@media (min-width: 981px) {
  .evidence-notes-panel,
  .reflection-panel {
    max-width: 1120px;
  }
}

/* Workspace alignment and copy polish */

.evidence-notes-panel,
.reflection-panel {
  width: 100%;
  max-width: 1120px;
}

.horizontal-heading {
  min-height: 58px;
  align-items: flex-start;
}

.evidence-input-grid,
.reflection-grid {
  align-items: stretch;
}

.evidence-input-grid label,
.reflection-grid label {
  height: 100%;
}

.evidence-input-grid input,
.evidence-input-grid textarea,
.reflection-grid textarea {
  font-weight: 600;
}

.reflection-grid label span {
  font-weight: 500;
}

.workspace-panel-heading p,
.horizontal-heading p {
  color: var(--muted);
  font-weight: 500;
}

.workspace-chip-row span,
.detail-chip {
  white-space: nowrap;
}

/* Workspace premium refinement pass */

.workspace-page {
  animation: workspaceFadeIn 220ms ease both;
}

@keyframes workspaceFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.workspace-panel {
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.workspace-panel:hover {
  border-color: rgba(47, 49, 146, 0.14);
  box-shadow: 0 20px 52px rgba(16, 24, 40, 0.085);
}

.workspace-check-item {
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.workspace-check-item:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 49, 146, 0.18);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.055);
}

.workspace-check-item:has(input:checked) {
  background: linear-gradient(180deg, #ffffff 0%, #f4f5ff 100%);
  border-color: rgba(47, 49, 146, 0.24);
}

.workspace-check-item:has(input:checked) strong {
  color: var(--accent);
}

.workspace-meta-row span {
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.workspace-meta-row span:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.07);
}

.progress-ring {
  transition: background 220ms ease;
}

.ai-coach-card {
  background:
    radial-gradient(circle at top right, rgba(47, 49, 146, 0.08), transparent 42%),
    #f7f8fb;
}

.ai-coach-card p {
  color: #30335f;
}

.application-panel .workspace-chip-row:empty::after {
  content: "Open a project to see signals.";
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.evidence-input-grid input:focus,
.evidence-input-grid textarea:focus,
.reflection-grid textarea:focus,
.ai-prompt-box:focus {
  border-color: rgba(47, 49, 146, 0.42);
  box-shadow: 0 0 0 4px rgba(47, 49, 146, 0.08);
}

.reflection-grid label {
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.reflection-grid label:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 49, 146, 0.16);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.05);
}

.workspace-save-status {
  opacity: 0.82;
}

#workspace-save-status.saved {
  color: #0f766e;
}

#workspace-save-status.saving {
  color: #6b7280;
}

#workspace-save-status.unsaved {
  color: #b45309;
}

#save-workspace-btn {
  min-width: 150px;
}

/* Fix Proof of Work field alignment */

.evidence-input-grid {
  align-items: start;
}

.evidence-input-grid label {
  display: grid;
  grid-template-rows: auto 74px;
  gap: 8px;
  height: auto;
}

.evidence-input-grid input,
.evidence-input-grid textarea {
  height: 74px;
  min-height: 74px;
  max-height: 74px;
  resize: none;
}