.domain-tabs {
  display: flex;
  gap: 5px;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 13px;
  background: #e9e8e3;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(216, 91, 53, 0.28);
  outline-offset: 2px;
}

button:active,
.btn:active {
  transform: translateY(1px);
}

.btn.danger,
.btn.ghost.danger {
  color: #8d3b27;
  background: #f7e8e3;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.domain-tabs button {
  border: 0;
  border-radius: 9px;
  padding: 9px 14px;
  white-space: nowrap;
  color: #5b5f58;
  background: transparent;
}

.domain-tabs button.active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 2px 8px rgba(35, 38, 32, 0.08);
}

.v28-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.v28-summary > div {
  padding: 15px;
  border-radius: 14px;
  background: #f5f4f0;
}

.v28-summary b {
  display: block;
  font-size: 23px;
}

.v28-summary span {
  font-size: 11px;
  color: var(--muted);
}

.progress-layout,
.growth-layout,
.tools-layout,
.ai-review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.progress-list,
.growth-list,
.evidence-stack,
.trash-list,
.node-list,
.ai-step-list {
  display: grid;
  gap: 9px;
}

.progress-card,
.growth-card,
.evidence-card,
.trash-card,
.tool-card,
.ai-step {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.progress-card h4,
.growth-card h4,
.tool-card h4,
.ai-step h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.progress-card p,
.growth-card p,
.tool-card p,
.ai-step p {
  margin: 7px 0 0;
  color: #555a53;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-line;
}

.record-result {
  padding: 10px 12px;
  margin-top: 10px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: #fff8f4;
  color: #5b5049;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-line;
}

.project-card-v28 {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.project-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.project-meta-grid div {
  min-width: 0;
  padding: 10px;
  border-radius: 10px;
  background: #f5f4f0;
}

.project-meta-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
}

.project-meta-grid b {
  display: block;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.5;
}

.node-list {
  margin-top: 12px;
}

.node-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fafaf8;
}

.node-row input {
  margin-top: 2px;
  accent-color: var(--accent);
}

.node-row.done span {
  color: var(--muted);
  text-decoration: line-through;
}

.node-row small {
  color: var(--muted);
  font-size: 10px;
}

.project-risk {
  padding: 9px 11px;
  margin-top: 10px;
  border-radius: 10px;
  background: #fff4ed;
  color: #8d4f38;
  font-size: 11px;
  line-height: 1.55;
}

.lifecycle {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f0ec;
  color: #5e625b;
  font-size: 10px;
}

.lifecycle.mature {
  background: #e9f2ec;
  color: var(--green);
}

.lifecycle.expired {
  background: #fff1e9;
  color: #9a472f;
}

.similar-note {
  padding: 9px 11px;
  margin-top: 9px;
  border-radius: 10px;
  background: #fff8f4;
  color: #765446;
  font-size: 11px;
}

.growth-level {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 12px;
}

.growth-level div {
  padding: 9px;
  border-radius: 10px;
  background: #f5f4f0;
}

.growth-level span,
.growth-level b {
  display: block;
}

.growth-level span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
}

.growth-level b {
  font-size: 12px;
}

.prompt-box {
  width: 100%;
  min-height: 180px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  resize: vertical;
  color: var(--ink);
  background: #fafaf8;
  line-height: 1.65;
}

.tool-state {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f0ec;
  color: var(--muted);
  font-size: 10px;
}

.tool-state.ok {
  color: var(--green);
  background: #e9f2ec;
}

.ai-review-status {
  padding: 12px;
  border-radius: 12px;
  background: #f5f4f0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.ai-output {
  min-height: 520px;
  padding: 18px;
  border-radius: 14px;
  color: #e8ebe5;
  background: #20221f;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.75;
}

.ai-question {
  padding: 10px 12px;
  border-radius: 11px;
  background: #fff8f4;
  color: #765446;
  font-size: 12px;
  line-height: 1.6;
}

.trash-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.trash-card h4 {
  margin: 0 0 5px;
  font-size: 13px;
}

.undo-toast-action {
  margin-left: 10px;
  border: 0;
  color: #ffd7c7;
  background: transparent;
  text-decoration: underline;
}

.field small.help {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.home-progress-prompt {
  border-color: #d9c8b8;
  background: #fffaf7;
}

@media (max-width: 980px) {
  .progress-layout,
  .growth-layout,
  .tools-layout,
  .ai-review-layout {
    grid-template-columns: 1fr;
  }

  .v28-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .v28-summary,
  .project-meta-grid,
  .growth-level {
    grid-template-columns: 1fr;
  }

  .domain-tabs {
    width: 100%;
  }

  .domain-tabs button {
    flex: 1;
  }

  .trash-card {
    grid-template-columns: 1fr;
  }

  .ai-output {
    min-height: 360px;
  }
}
