:root {
  --bg: #f7f3ed;
  --card: #ffffff;
  --text: #171717;
  --muted: #6f6a63;
  --border: #e8dfd3;
  --accent: #b88955;
  --accent-dark: #8a623b;
  --soft: #fbf7f1;
  --success: #3b7454;
  --danger: #a34332;
  --shadow: 0 16px 42px rgba(59, 43, 29, 0.055);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #fbf7f1 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Inter", Arial, sans-serif;
  font-size: 15px;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

input,
select,
textarea,
button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.62);
  padding: 26px 20px;
}

.brand {
  display: block;
  margin-bottom: 30px;
  color: var(--text);
  font-family: "Montserrat Alternates", Arial, sans-serif;
  font-weight: 600;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
}

.nav a:hover {
  background: var(--soft);
  color: var(--text);
}

.main {
  width: min(1120px, 100%);
  padding: 30px clamp(18px, 4vw, 42px) 60px;
}

.main-header,
.panel-header,
.project-header,
.form-actions,
.toolbar,
.user-menu,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.main-header {
  margin-bottom: 24px;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: "Montserrat Alternates", Arial, sans-serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.08rem;
  font-weight: 600;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.panel,
.auth-card,
.stat-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.panel {
  margin-bottom: 18px;
  padding: 22px;
}

.narrow {
  max-width: 820px;
}

.stats-grid,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.detail-grid {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
  align-items: start;
}

.stat-card {
  padding: 18px;
}

.stat-card span,
dt {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
}

.stat-card strong {
  font-size: 2rem;
  font-weight: 600;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
  align-items: start;
}

.dashboard-focus {
  min-height: 420px;
}

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

.panel-header.compact {
  align-items: flex-start;
}

.work-list {
  display: grid;
  gap: 10px;
}

.work-item {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.85fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdfa;
  padding: 14px;
}

.work-item h3 {
  margin: 8px 0 4px;
  font-size: 1rem;
  font-weight: 650;
}

.work-item p,
.work-item-meta span,
.work-item-meta small {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.work-item-meta {
  display: grid;
  gap: 3px;
}

.work-item.is-active {
  border-color: rgba(184, 137, 85, 0.36);
}

.work-item.is-warning {
  border-color: rgba(163, 67, 50, 0.24);
  background: rgba(163, 67, 50, 0.035);
}

.work-item.is-done {
  border-color: rgba(59, 116, 84, 0.24);
  background: rgba(59, 116, 84, 0.035);
}

.priority-grid {
  display: grid;
  gap: 10px;
}

.priority-card {
  display: grid;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdfa;
  padding: 13px;
  color: var(--text);
}

.priority-card span,
.priority-card small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.priority-card span {
  font-weight: 650;
  text-transform: uppercase;
}

.priority-card strong {
  color: var(--text);
  font-size: 1.8rem;
  font-weight: 650;
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.72);
  padding: 22px;
}

.empty-state h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.empty-state p {
  margin-bottom: 0;
}

.alert {
  margin-bottom: 16px;
  padding: 13px 15px;
  border-radius: 8px;
  font-weight: 500;
}

.alert.success {
  border: 1px solid rgba(59, 116, 84, 0.22);
  background: rgba(59, 116, 84, 0.09);
  color: var(--success);
}

.alert.error {
  border: 1px solid rgba(163, 67, 50, 0.22);
  background: rgba(163, 67, 50, 0.08);
  color: var(--danger);
}

.alert.warning {
  border: 1px solid rgba(184, 137, 85, 0.28);
  background: rgba(184, 137, 85, 0.1);
  color: var(--accent-dark);
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 600;
}

.button.primary {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: #fff;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.button.ghost {
  background: #fffdfa;
  color: var(--text);
}

.button.danger {
  border-color: rgba(163, 67, 50, 0.34);
  background: rgba(163, 67, 50, 0.08);
  color: var(--danger);
}

.button.danger:hover,
.button.danger:focus-visible {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.toolbar {
  margin: 18px 0;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.toolbar input,
.toolbar select {
  width: auto;
  min-width: 200px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.next-step-pill {
  display: grid;
  min-width: 170px;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdfa;
  padding: 8px 10px;
  color: var(--text);
  line-height: 1.3;
}

.next-step-pill strong {
  font-size: 0.84rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.next-step-pill span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.next-step-pill.is-active {
  border-color: rgba(184, 137, 85, 0.38);
  background: rgba(184, 137, 85, 0.1);
}

.next-step-pill.is-warning {
  border-color: rgba(163, 67, 50, 0.24);
  background: rgba(163, 67, 50, 0.055);
}

.next-step-pill.is-done {
  border-color: rgba(59, 116, 84, 0.24);
  background: rgba(59, 116, 84, 0.06);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid.compact {
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field.full,
.form-actions.full {
  grid-column: 1 / -1;
}

.field span {
  font-weight: 600;
}

.field-help {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdfa;
  color: var(--text);
  outline: none;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(184, 137, 85, 0.12);
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 22px;
}

.auth-card {
  width: min(440px, 100%);
  padding: 28px;
}

.auth-card.wide {
  width: min(680px, 100%);
}

.stack {
  display: grid;
  gap: 14px;
}

.details-list {
  display: grid;
  gap: 13px;
  margin: 0;
}

.response-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.briefing-review {
  display: grid;
  gap: 22px;
}

.response-section {
  display: grid;
  gap: 12px;
}

.response-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 600;
}

.response-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
}

.response-card.is-missing {
  border-color: rgba(163, 67, 50, 0.32);
  background: rgba(163, 67, 50, 0.06);
}

.response-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 600;
}

.response-card p {
  margin-bottom: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

dd {
  margin: 0;
}

.inline-form {
  margin-top: 14px;
}

.project-header-compact {
  margin-bottom: 16px;
}

.project-focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.next-action-card {
  padding: 22px;
}

.next-action-card h2 {
  margin-bottom: 8px;
  font-family: "Montserrat Alternates", Arial, sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.next-action-card p {
  max-width: 680px;
  margin-bottom: 12px;
}

.compact-warning {
  display: inline-flex;
  border: 1px solid rgba(163, 67, 50, 0.18);
  border-radius: 8px;
  background: rgba(163, 67, 50, 0.06);
  padding: 8px 10px;
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 600;
}

.project-summary-card {
  padding: 18px;
}

.summary-status-list {
  display: grid;
  gap: 8px;
}

.summary-status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdfa;
  padding: 9px 10px;
}

.summary-status-item span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.summary-status-item strong {
  color: var(--text);
  font-size: 0.86rem;
  text-align: right;
}

.summary-status-item.is-done {
  border-color: rgba(59, 116, 84, 0.22);
  background: rgba(59, 116, 84, 0.06);
}

.summary-status-item.is-active {
  border-color: rgba(184, 137, 85, 0.35);
  background: rgba(184, 137, 85, 0.1);
}

.project-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.flow-step {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 176px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdfa;
  padding: 12px;
  align-content: start;
}

.flow-step > div {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.flow-step-number {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(184, 137, 85, 0.13);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.flow-step strong,
.operation-card h2 {
  display: block;
  margin-bottom: 4px;
  font-size: 0.96rem;
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.flow-step small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.flow-step p {
  margin: 7px 0;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.flow-step a,
.flow-step .muted {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-top: auto;
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.72);
  padding: 3px 0;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.flow-step.is-done {
  border-color: rgba(59, 116, 84, 0.24);
  background: rgba(59, 116, 84, 0.06);
}

.flow-step.is-active {
  border-color: rgba(184, 137, 85, 0.42);
  background: rgba(184, 137, 85, 0.11);
}

.flow-step.is-blocked {
  border-color: rgba(163, 67, 50, 0.18);
  background: rgba(163, 67, 50, 0.04);
}

.operation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.operation-card {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  overflow: hidden;
}

.operation-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.operation-card-header .badge {
  flex: 0 0 auto;
}

.mini-details {
  display: grid;
  gap: 8px;
  margin: 0;
}

.mini-details div {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 12px;
  align-items: start;
  border-bottom: 1px solid rgba(232, 223, 211, 0.75);
  padding-bottom: 7px;
}

.mini-details dt {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.mini-details dd {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  text-align: right;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.card-actions .button {
  min-height: 38px;
  flex: 0 1 auto;
  white-space: normal;
  text-align: center;
}

.card-actions form {
  margin: 0;
}

.compact-details {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--soft);
  padding: 9px 10px;
}

.compact-details summary,
.project-extra summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 650;
}

.compact-details ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.86rem;
}

.project-extra {
  display: grid;
  gap: 10px;
}

.project-extra details {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdfa;
  padding: 12px 14px;
  scroll-margin-top: 18px;
}

.project-extra details[open] summary {
  margin-bottom: 14px;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.history-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.history-item time {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.history-item strong,
.history-item span {
  display: block;
}

.history-item strong {
  margin-bottom: 3px;
  font-size: 0.92rem;
  font-weight: 650;
}

.history-item span {
  color: var(--muted);
  font-size: 0.8rem;
}

.danger-zone {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 14px;
}

.muted {
  color: var(--muted);
}

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

.choice-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdfa;
  padding: 12px 14px;
  color: var(--muted);
  font-weight: 600;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.choice-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-pill span {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.choice-pill span::after {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
}

.choice-pill:has(input:checked) {
  border-color: rgba(184, 137, 85, 0.45);
  background: rgba(184, 137, 85, 0.12);
  color: var(--accent-dark);
}

.choice-pill:has(input:checked) span::after {
  border-color: var(--accent-dark);
  background: radial-gradient(circle at center, var(--accent-dark) 0 42%, #fff 46%);
}

.strategic-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
  gap: 18px;
  align-items: start;
}

.strategic-form {
  display: grid;
  gap: 16px;
}

.strategic-group,
.side-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdfa;
  padding: 16px;
}

.strategic-group-header,
.side-block-header {
  margin-bottom: 14px;
}

.strategic-group-header h3,
.side-block h3,
.side-block-header h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
  font-weight: 600;
}

.strategic-group-header p,
.side-block-header p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.strategic-side {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
}

.sticky-actions {
  position: sticky;
  bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.94);
  padding: 12px;
  box-shadow: var(--shadow);
}

.readiness-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.readiness-item {
  display: flex;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdfa;
  padding: 13px;
}

.readiness-item span {
  align-self: flex-start;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.readiness-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.readiness-item p {
  margin-bottom: 0;
  font-size: 0.88rem;
}

.readiness-item.is-done {
  border-color: rgba(59, 116, 84, 0.24);
}

.readiness-item.is-done span {
  background: rgba(59, 116, 84, 0.1);
  color: var(--success);
}

.readiness-item.is-pending {
  border-color: rgba(184, 137, 85, 0.3);
}

.readiness-item.is-pending span {
  background: rgba(184, 137, 85, 0.12);
  color: var(--accent-dark);
}

.copy-box {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--soft);
  padding: 16px;
}

.copy-box textarea {
  min-height: 260px;
  background: #fffdfa;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

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

.reference-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--soft);
  padding: 16px;
}

.reference-card h3 {
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 600;
}

.reference-list {
  display: grid;
  gap: 12px;
}

.reference-list span {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 600;
}

.reference-list p {
  margin-bottom: 0;
  color: var(--text);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.prompt-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.32fr);
  gap: 18px;
  align-items: start;
}

.prompt-editor textarea {
  min-height: 680px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.55;
}

.prompt-side {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
}

.prompt-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 22px;
}

.prompt-hero h2 {
  margin-bottom: 8px;
  font-family: "Montserrat Alternates", Arial, sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.12;
}

.prompt-hero p {
  max-width: 680px;
  margin-bottom: 0;
}

.html-generator-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.58fr) minmax(360px, 0.42fr);
  gap: 20px;
  align-items: start;
}

.html-generator-config {
  display: grid;
  gap: 16px;
}

.generator-nav {
  position: sticky;
  top: 12px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.94);
  padding: 10px;
  box-shadow: var(--shadow);
}

.generator-nav a {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.generator-nav a:hover,
.generator-nav a:focus-visible {
  border-color: rgba(184, 137, 85, 0.42);
  background: rgba(184, 137, 85, 0.12);
  color: var(--accent-dark);
}

.generator-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 18px;
  box-shadow: var(--shadow);
  scroll-margin-top: 84px;
}

.generator-card-title {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.generator-card-title > span {
  display: inline-flex;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(184, 137, 85, 0.16);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.generator-card-title h3 {
  margin: 0 0 3px;
  font-size: 0.98rem;
  font-weight: 650;
}

.generator-card-title p {
  margin-bottom: 0;
  font-size: 0.86rem;
}

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

.summary-grid div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdfa;
  padding: 10px;
}

.summary-grid span,
.color-field span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.summary-grid strong {
  display: block;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 14px;
}

.soft-pill {
  position: relative;
  display: inline-flex;
}

.soft-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.soft-pill span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fffdfa;
  padding: 9px 13px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.soft-pill input:checked + span {
  border-color: rgba(184, 137, 85, 0.58);
  background: rgba(184, 137, 85, 0.16);
  color: var(--accent-dark);
  box-shadow: 0 8px 18px rgba(184, 137, 85, 0.12);
}

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

.color-field {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.color-field span {
  grid-column: 1 / -1;
}

.color-field input[type="color"] {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 3px;
}

.check-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.check-card {
  position: relative;
  display: grid;
  min-height: 58px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdfa;
  padding: 11px 12px 11px 40px;
  color: var(--text);
}

.check-card input {
  position: absolute;
  top: 14px;
  left: 13px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent-dark);
}

.check-card span {
  display: grid;
  gap: 2px;
  font-size: 0.86rem;
  font-weight: 650;
}

.check-card small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.check-card:has(input:checked) {
  border-color: rgba(184, 137, 85, 0.58);
  background: rgba(184, 137, 85, 0.12);
}

.copy-source {
  min-height: 220px;
}

.image-list {
  display: grid;
  gap: 9px;
  margin: 12px 0;
}

.image-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.7fr 42px;
  gap: 8px;
  align-items: center;
}

.image-row input:nth-child(4),
.image-row input:nth-child(5) {
  grid-column: span 2;
}

.image-row .icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  color: var(--danger);
  font-size: 1.1rem;
}

.button.dashed {
  border-style: dashed;
  background: transparent;
}

.generator-actions {
  position: sticky;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.94);
  padding: 12px;
  box-shadow: var(--shadow);
}

.html-prompt-preview {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
}

.dark-preview {
  background: #211b2f;
  border-color: rgba(255, 255, 255, 0.08);
}

.dark-preview h2,
.dark-preview .field span {
  color: #fff;
}

.dark-preview .eyebrow {
  color: #f2c0dc;
}

.dark-preview input,
.dark-preview select {
  background: #fff;
}

.dark-preview textarea {
  min-height: 720px;
  border-color: rgba(255, 255, 255, 0.12);
  background: #171324;
  color: #f8f1ff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.84rem;
  line-height: 1.62;
}

.warning-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.warning-list article {
  border: 1px solid rgba(163, 67, 50, 0.18);
  border-radius: 8px;
  background: rgba(163, 67, 50, 0.06);
  padding: 11px 12px;
}

.warning-list strong {
  display: block;
  margin-bottom: 4px;
  color: var(--danger);
  font-size: 0.86rem;
}

.warning-list p,
.success-note {
  margin-bottom: 0;
  font-size: 0.84rem;
}

.success-note {
  border: 1px solid rgba(59, 116, 84, 0.2);
  border-radius: 8px;
  background: rgba(59, 116, 84, 0.08);
  color: var(--success);
  padding: 11px 12px;
}

.design-system-preview {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdfa;
  padding: 14px;
}

.design-system-preview strong {
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 700;
}

.design-system-preview p {
  margin-bottom: 0;
  font-size: 0.84rem;
}

.design-system-preview ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.field-note {
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.version-list {
  display: grid;
  gap: 10px;
}

.version-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdfa;
  padding: 10px 12px;
  color: var(--text);
}

.version-list a:hover,
.version-list a.is-active {
  border-color: rgba(184, 137, 85, 0.45);
  background: rgba(184, 137, 85, 0.12);
}

.version-list strong {
  display: block;
  color: var(--accent-dark);
  font-size: 0.9rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.version-list small,
.version-list em,
.version-list b {
  font-size: 0.76rem;
}

.version-list small {
  color: var(--muted);
}

.version-row-main,
.version-row-meta {
  display: flex;
  gap: 7px;
}

.version-row-main {
  min-width: 0;
  flex-direction: column;
}

.version-row-meta {
  flex-wrap: wrap;
  align-items: center;
}

.version-list em,
.status-dot {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  font-style: normal;
  font-weight: 650;
}

.version-list em {
  background: rgba(184, 137, 85, 0.12);
  color: var(--accent-dark);
}

.status-dot.is-pending {
  background: var(--soft);
  color: var(--muted);
}

.status-dot.is-active {
  background: rgba(184, 137, 85, 0.14);
  color: var(--accent-dark);
}

.status-dot.is-done {
  background: rgba(59, 116, 84, 0.1);
  color: var(--success);
}

.mini-flow {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.mini-flow.wide {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.mini-flow span {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdfa;
  padding: 10px 12px;
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 600;
}

@media (max-width: 900px) {
  .app-shell,
  .detail-grid,
  .strategic-layout,
  .prompt-layout,
  .html-generator-layout,
  .project-focus-grid {
    grid-template-columns: 1fr;
  }

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

  .strategic-side,
  .prompt-side,
  .html-prompt-preview,
  .generator-nav,
  .sticky-actions {
    position: static;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .stats-grid,
  .priority-grid,
  .readiness-list,
  .choice-list,
  .mini-flow.wide,
  .reference-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prompt-hero {
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .main-header,
  .panel-header,
  .project-header,
  .form-actions,
  .user-menu {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-grid,
  .form-grid,
  .readiness-list,
  .choice-list,
  .mini-flow.wide,
  .response-grid,
    .reference-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid,
  .color-grid,
  .check-card-grid,
  .image-row,
  .project-flow,
  .operation-grid,
  .dashboard-grid,
  .work-item,
  .history-item {
    grid-template-columns: 1fr;
  }

  .image-row input:nth-child(4),
  .image-row input:nth-child(5) {
    grid-column: auto;
  }

  .generator-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .flow-step {
    min-height: auto;
  }

  .operation-card {
    min-height: auto;
  }

  .card-actions,
  .card-actions form,
  .card-actions .button {
    width: 100%;
  }

  .toolbar input,
  .toolbar select,
  .button {
    width: 100%;
  }
}

/* Visual system refresh */
:root {
  --bg: #f1ede6;
  --card: #fffdf9;
  --text: #242019;
  --muted: #6f675d;
  --border: #d8d0c4;
  --accent: #b88955;
  --accent-dark: #7d5835;
  --soft: #ebe4da;
  --success: #2f7757;
  --danger: #a34332;
  --shadow: none;
  --surface-quiet: #f8f4ee;
  --surface-strong: #2d2721;
  --focus-ring: rgba(184, 137, 85, 0.22);
}

body {
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a {
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.app-shell {
  grid-template-columns: 238px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  border-right-color: var(--border);
  background: #f8f4ee;
  padding: 30px 22px;
}

.brand {
  margin-bottom: 34px;
  color: var(--text);
  font-size: 0.98rem;
  letter-spacing: 0;
}

.nav {
  gap: 4px;
}

.nav a {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 11px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 560;
}

.nav a:hover,
.nav a:focus-visible {
  border-color: var(--border);
  background: #fffdf9;
  color: var(--text);
}

.main {
  width: min(1240px, 100%);
  padding: 34px clamp(22px, 4vw, 56px) 72px;
}

.main-header {
  align-items: flex-start;
  margin-bottom: 28px;
}

.main-header h1 {
  max-width: 980px;
}

.user-menu {
  align-self: flex-start;
  color: var(--muted);
  font-size: 0.86rem;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--accent-dark);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(1.9rem, 3.2vw, 3.15rem);
  font-weight: 600;
  line-height: 1.08;
}

h2 {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

p {
  color: var(--muted);
}

.panel,
.auth-card,
.stat-card,
.operation-card {
  border-color: var(--border);
  border-radius: 6px;
  background: var(--card);
  box-shadow: none;
}

.panel {
  margin-bottom: 22px;
  padding: 24px;
}

.panel-header {
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-header p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.stats-grid,
.detail-grid {
  gap: 12px;
}

.stat-card {
  padding: 18px 18px 16px;
  background: #fffdf9;
}

.stat-card span,
dt,
th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.stat-card strong {
  color: var(--text);
  font-size: 2.05rem;
  font-weight: 650;
  letter-spacing: 0;
}

.dashboard-grid,
.project-focus-grid,
.operation-grid,
.strategic-layout,
.prompt-layout,
.html-generator-layout {
  gap: 20px;
}

.dashboard-focus {
  min-height: 0;
}

.work-list,
.priority-grid,
.version-list,
.project-extra,
.stack {
  gap: 12px;
}

.work-item,
.priority-card,
.summary-status-item,
.flow-step,
.reference-card,
.strategic-group,
.side-block,
.copy-box,
.generator-card,
.compact-details,
.project-extra details,
.version-list a,
.empty-state {
  border-color: var(--border);
  border-radius: 6px;
  background: #fffdf9;
  box-shadow: none;
}

.work-item {
  grid-template-columns: minmax(0, 1.08fr) minmax(220px, 0.92fr) auto;
  padding: 13px 14px;
}

.work-item h3 {
  font-size: 0.98rem;
  font-weight: 650;
}

.work-item.is-active,
.flow-step.is-active,
.summary-status-item.is-active,
.next-step-pill.is-active {
  border-color: rgba(184, 137, 85, 0.42);
  background: #fbf4ec;
}

.work-item.is-warning,
.flow-step.is-blocked,
.next-step-pill.is-warning {
  border-color: rgba(163, 67, 50, 0.28);
  background: #fbefec;
}

.work-item.is-done,
.flow-step.is-done,
.summary-status-item.is-done,
.next-step-pill.is-done {
  border-color: rgba(47, 119, 87, 0.28);
  background: #eef7f1;
}

.priority-card {
  padding: 14px;
}

.priority-card strong {
  font-size: 2rem;
  font-weight: 650;
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fffdf9;
}

table {
  min-width: 760px;
}

th,
td {
  border-bottom-color: var(--border);
  padding: 11px 12px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #faf6ef;
}

.badge {
  border-color: var(--border);
  border-radius: 999px;
  background: #f3ede4;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.button {
  min-height: 38px;
  border-radius: 6px;
  padding: 0 13px;
  font-size: 0.88rem;
  font-weight: 700;
}

.button.primary {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: #fff;
}

.button.primary:hover,
.button.primary:focus-visible {
  border-color: #68482b;
  background: #68482b;
}

.button.ghost {
  background: #fffdf9;
}

.button.ghost:hover,
.button.ghost:focus-visible {
  border-color: var(--accent);
  background: #fbf4ec;
}

input,
select,
textarea {
  border-color: var(--border);
  border-radius: 6px;
  background: #fffdf9;
  font-size: 0.92rem;
}

input,
select {
  min-height: 40px;
}

textarea {
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.toolbar {
  gap: 10px;
  margin: 16px 0;
}

.toolbar input,
.toolbar select {
  min-width: 220px;
}

.form-grid {
  gap: 15px;
}

.field {
  gap: 7px;
}

.field span {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 650;
}

.field-help {
  font-size: 0.82rem;
}

.alert {
  border-radius: 6px;
  padding: 12px 14px;
}

.auth-page {
  background: var(--bg);
}

.auth-card {
  width: min(430px, 100%);
  padding: 30px;
}

.auth-card h1 {
  margin-bottom: 22px;
  font-size: clamp(2rem, 5vw, 2.8rem);
}

.project-header.panel,
.prompt-hero {
  padding: 24px;
}

.project-header h2,
.next-action-card h2,
.prompt-hero h2 {
  font-family: "Montserrat Alternates", Arial, sans-serif;
  font-weight: 600;
}

.next-action-card {
  padding: 26px;
}

.next-action-card h2 {
  font-size: clamp(1.55rem, 2.6vw, 2.2rem);
}

.project-flow {
  gap: 10px;
}

.flow-step {
  min-height: 168px;
  padding: 13px;
}

.flow-step-number,
.generator-card-title > span {
  border-radius: 6px;
  background: #efe4d6;
  color: var(--accent-dark);
}

.operation-card {
  min-height: 248px;
}

.mini-details div {
  border-bottom-color: var(--border);
}

.choice-pill,
.soft-pill span,
.check-card,
.next-step-pill {
  border-radius: 999px;
  background: #fffdf9;
}

.choice-pill {
  padding: 10px 13px;
}

.choice-pill:has(input:checked),
.soft-pill input:checked + span,
.check-card:has(input:checked) {
  border-color: rgba(184, 137, 85, 0.55);
  background: #f5eadc;
  color: var(--accent-dark);
  box-shadow: none;
}

.check-card {
  border-radius: 6px;
}

.strategic-group,
.side-block,
.copy-box,
.generator-card {
  padding: 18px;
}

.strategic-group-header h3,
.side-block h3,
.side-block-header h3,
.generator-card-title h3 {
  font-size: 0.98rem;
  font-weight: 700;
}

.sticky-actions,
.generator-nav,
.generator-actions {
  border-color: var(--border);
  border-radius: 6px;
  background: rgba(255, 253, 249, 0.96);
  box-shadow: none;
}

.dark-preview {
  background: var(--surface-strong);
}

.dark-preview textarea {
  background: #221d18;
}

.copy-box textarea,
.prompt-editor textarea,
.dark-preview textarea {
  border-radius: 6px;
}

.version-list a:hover,
.version-list a.is-active {
  border-color: rgba(184, 137, 85, 0.55);
  background: #f5eadc;
}

.status-dot,
.version-list em {
  min-height: 22px;
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    min-height: auto;
  }

  .main {
    padding-top: 24px;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 14px;
  }

  .main {
    padding-inline: 16px;
  }

  .panel,
  .auth-card,
  .project-header.panel,
  .prompt-hero {
    padding: 18px;
  }

  .table-wrap {
    margin-inline: -2px;
  }
}

/* Focused table polish */
.table-wrap table {
  min-width: 980px;
}

.table-wrap td.actions {
  display: table-cell;
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.table-wrap td.actions a {
  display: inline-flex;
  margin-left: 14px;
  color: var(--accent-dark);
  font-weight: 650;
}

.table-wrap td.actions a:first-child {
  margin-left: 0;
}

.table-wrap th:last-child,
.table-wrap td:last-child {
  padding-right: 16px;
}

.table-wrap td {
  overflow-wrap: normal;
}

.table-wrap td:first-child,
.table-wrap td:nth-child(2) {
  overflow-wrap: anywhere;
}

.next-step-pill {
  width: min(190px, 100%);
  min-width: 150px;
  border-radius: 28px;
  padding: 9px 13px;
}

.next-step-pill strong {
  line-height: 1.18;
}

@media (max-width: 900px) {
  .table-wrap table {
    min-width: 920px;
  }
}
