:root {
  --brief-paper: #ffffff;
  --canvas: #f4f8ff;
  --surface: #ffffff;
  --surface-raised: #f9fbff;
  --surface-inset: #eef5ff;
  --frame-ink: #101114;
  --muted-ink: #616a7b;
  --soft-line: rgba(16, 17, 20, 0.1);
  --hard-line: rgba(0, 100, 224, 0.28);
  --signal-green: #008a63;
  --signal-blue: #0866ff;
  --meta-blue: #0064e0;
  --meta-sky: #0082fb;
  --meta-aqua: #19d4ff;
  --persona-plum: #5b5ce2;
  --note-amber: #b66a00;
  --danger: #b42318;
  --meta-gradient: linear-gradient(135deg, var(--meta-blue), var(--meta-sky) 52%, var(--meta-aqua));
  --shadow: 0 18px 44px rgba(0, 82, 204, 0.1);
  --radius: 8px;
  --unit: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 248, 255, 0.94)),
    linear-gradient(135deg, rgba(0, 100, 224, 0.1), rgba(25, 212, 255, 0.04) 45%, rgba(255, 255, 255, 0));
  color: var(--frame-ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

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

.client-rail {
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 2);
  padding: calc(var(--unit) * 2);
  border-right: 1px solid var(--soft-line);
  background: rgba(244, 248, 255, 0.78);
  backdrop-filter: blur(14px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--meta-gradient);
  color: var(--brief-paper);
  font-weight: 800;
  overflow: hidden;
}

.brand-mark::after {
  position: absolute;
  width: 30px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-right-color: rgba(255, 255, 255, 0.2);
  border-left-color: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  content: "";
  transform: rotate(-18deg);
}

.brand-lockup strong,
.brand-lockup span {
  display: block;
}

.brand-lockup strong {
  font-size: 0.98rem;
  line-height: 1.1;
}

.brand-lockup span {
  margin-top: 2px;
  color: var(--muted-ink);
  font-size: 0.78rem;
}

.search-box,
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.search-box span,
.field span,
.signal-label,
.metric-label,
.column-title span,
.export-label {
  color: var(--muted-ink);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.search-box input,
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--surface-inset);
  color: var(--frame-ink);
  outline: none;
  padding: 10px 11px;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease;
}

.search-box input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus,
.matrix-text:focus,
.editable:focus {
  border-color: rgba(0, 130, 251, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 130, 251, 0.14);
}

.field textarea {
  min-height: 118px;
  resize: vertical;
  line-height: 1.45;
}

.field.tall {
  grid-row: span 2;
}

.field.compact select {
  min-height: 41px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 39px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 14px;
  color: var(--frame-ink);
  font-weight: 750;
  white-space: nowrap;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background-color 120ms ease;
}

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

.button.primary {
  background: var(--meta-gradient);
  color: #fff;
}

.button.secondary {
  border-color: var(--soft-line);
  background: var(--surface);
}

.button.ghost {
  border-color: var(--soft-line);
  background: rgba(255, 255, 255, 0.56);
}

.button.danger {
  border-color: rgba(180, 35, 24, 0.18);
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.button.wide {
  width: 100%;
}

.client-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.client-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  padding: 11px;
  text-align: left;
}

.client-item:hover {
  background: rgba(255, 255, 255, 0.52);
}

.client-item.active {
  border-color: var(--hard-line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.client-item strong,
.client-item span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-item strong {
  font-size: 0.92rem;
}

.client-item span {
  margin-top: 5px;
  color: var(--muted-ink);
  font-size: 0.78rem;
}

.client-badge {
  display: grid;
  min-width: 34px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 130, 251, 0.12);
  color: var(--meta-blue);
  font-size: 0.76rem;
  font-weight: 800;
}

.rail-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 4px;
}

.rail-footer > div {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
  padding: 10px;
}

.metric-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 850;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 2);
  min-width: 0;
  padding: calc(var(--unit) * 2.5);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
}

.client-heading {
  min-width: 0;
}

.client-name-input {
  width: min(560px, 100%);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--frame-ink);
  font-size: clamp(1.65rem, 2.2vw, 2.25rem);
  font-weight: 850;
  letter-spacing: 0;
  outline: none;
  padding: 0;
}

.client-name-input:focus {
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.72);
}

.client-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
  color: var(--muted-ink);
  font-size: 0.85rem;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.brief-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: calc(var(--unit) * 2);
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  padding: calc(var(--unit) * 2);
}

.brief-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) minmax(190px, 0.85fr);
  gap: 13px;
}

.generator-panel {
  display: grid;
  align-content: end;
  gap: 10px;
}

.view-switch {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
  padding: 3px;
}

.view-tab {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-ink);
  font-weight: 780;
  padding: 0 13px;
}

.view-tab.active {
  background: var(--meta-gradient);
  color: #fff;
}

.signal-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.signal-card {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  padding: 12px;
}

.signal-card strong {
  display: block;
  margin-top: 7px;
  font-size: 1.35rem;
}

.signal-card.accent {
  border-color: rgba(0, 130, 251, 0.25);
  background: rgba(0, 130, 251, 0.08);
}

.view-panel {
  display: none;
  min-width: 0;
}

.view-panel.active {
  display: block;
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  border: 1px dashed var(--hard-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.46);
  color: var(--muted-ink);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--frame-ink);
  font-size: 1.05rem;
}

.matrix-shell {
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--surface);
}

.matrix-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--soft-line);
  background: var(--surface-raised);
  padding: 12px 14px;
}

.matrix-header strong {
  font-size: 0.96rem;
}

.matrix-header span {
  color: var(--muted-ink);
  font-size: 0.82rem;
}

.matrix-scroll {
  overflow-x: auto;
}

.matrix-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
  table-layout: fixed;
}

.matrix-table th,
.matrix-table td {
  border-bottom: 1px solid var(--soft-line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.matrix-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  color: var(--muted-ink);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.matrix-table tr:last-child td {
  border-bottom: 0;
}

.matrix-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 9px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: normal;
}

.matrix-tag.persona {
  width: 128px;
  background: linear-gradient(135deg, var(--persona-plum), var(--meta-blue));
}

.matrix-tag.pain {
  display: block;
  width: 238px;
  border-radius: 7px;
  background: var(--note-amber);
  padding: 8px 9px;
}

.matrix-select,
.matrix-text {
  width: 100%;
  border: 1px solid var(--soft-line);
  border-radius: 7px;
  background: var(--surface-inset);
  color: var(--frame-ink);
  outline: none;
}

.matrix-select {
  min-height: 34px;
  padding: 6px 8px;
}

.matrix-text {
  min-height: 76px;
  resize: vertical;
  padding: 8px;
  line-height: 1.35;
}

.matrix-table th:nth-child(1),
.matrix-table td:nth-child(1) {
  width: 150px;
}

.matrix-table th:nth-child(2),
.matrix-table td:nth-child(2) {
  width: 270px;
}

.matrix-table th:nth-child(3),
.matrix-table td:nth-child(3) {
  width: 128px;
}

.matrix-table th:nth-child(4),
.matrix-table td:nth-child(4) {
  width: 148px;
}

.matrix-table th:nth-child(5),
.matrix-table td:nth-child(5),
.matrix-table th:nth-child(6),
.matrix-table td:nth-child(6) {
  width: 170px;
}

.matrix-table th:nth-child(7),
.matrix-table td:nth-child(7) {
  width: 146px;
}

.matrix-table th:nth-child(8),
.matrix-table td:nth-child(8) {
  width: 112px;
}

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

.persona-card {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.persona-card header {
  border-bottom: 1px solid var(--soft-line);
  background: linear-gradient(90deg, rgba(115, 87, 184, 0.14), rgba(36, 87, 214, 0.08));
  padding: 13px;
}

.persona-card h3 {
  margin: 0;
  font-size: 1rem;
}

.persona-card .persona-body {
  display: grid;
  gap: 12px;
  padding: 13px;
}

.persona-note {
  display: grid;
  gap: 5px;
}

.persona-note strong {
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.persona-note p {
  margin: 0;
  color: var(--muted-ink);
  line-height: 1.42;
}

.pain-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pain-list li {
  border: 1px solid rgba(181, 106, 19, 0.2);
  border-radius: 7px;
  background: rgba(181, 106, 19, 0.07);
  padding: 9px;
}

.editable {
  min-width: 1ch;
  border-radius: 5px;
  outline: none;
}

.editable:focus {
  background: #fff;
}

.production-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 12px;
}

.production-column {
  min-width: 0;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
  overflow: hidden;
}

.column-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--soft-line);
  background: var(--surface-raised);
  padding: 10px 11px;
}

.column-title strong {
  font-size: 0.9rem;
}

.creative-stack {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
  padding: 10px;
}

.creative-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--soft-line);
  border-left: 4px solid var(--meta-sky);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
}

.creative-card strong {
  font-size: 0.88rem;
}

.creative-card p {
  margin: 0;
  color: var(--muted-ink);
  font-size: 0.82rem;
  line-height: 1.38;
}

.creative-card .mini-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-chip {
  border-radius: 999px;
  background: var(--surface-inset);
  padding: 4px 7px;
  color: var(--frame-ink);
  font-size: 0.72rem;
  font-weight: 750;
}

.performance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 12px;
  align-items: start;
}

.performance-control,
.diagnosis-table-card {
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--surface);
}

.performance-control .matrix-header,
.diagnosis-table-card .matrix-header {
  border-bottom: 1px solid var(--soft-line);
}

.performance-context {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 13px;
}

.performance-paste {
  padding: 0 13px 13px;
}

.performance-paste textarea {
  min-height: 124px;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: 0.84rem;
}

.performance-control .export-actions {
  border-top: 1px solid var(--soft-line);
  margin: 0;
  padding: 12px 13px;
}

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

.signal-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted-ink);
  font-size: 0.78rem;
  line-height: 1.35;
}

.metric-good {
  border-color: rgba(34, 139, 91, 0.25);
  background: rgba(34, 139, 91, 0.08);
}

.metric-warning {
  border-color: rgba(181, 106, 19, 0.25);
  background: rgba(181, 106, 19, 0.08);
}

.metric-danger {
  border-color: rgba(180, 35, 24, 0.22);
  background: rgba(180, 35, 24, 0.07);
}

.diagnosis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 12px;
  margin-top: 12px;
}

.diagnosis-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.diagnosis-table th,
.diagnosis-table td {
  border-bottom: 1px solid var(--soft-line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.diagnosis-table th {
  background: var(--surface);
  color: var(--muted-ink);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.diagnosis-table td {
  color: var(--frame-ink);
  font-size: 0.86rem;
  line-height: 1.35;
}

.diagnosis-table td:nth-child(1),
.diagnosis-table td:nth-child(2) {
  min-width: 170px;
}

.diagnosis-table tr:last-child td {
  border-bottom: 0;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 5px 9px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.2;
}

.role-tof {
  background: var(--meta-gradient);
}

.role-bof {
  background: var(--signal-green);
}

.role-out {
  background: var(--danger);
}

.action-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.action-card {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 13px;
}

.action-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.05rem;
}

.action-card p {
  margin: 8px 0 0;
  color: var(--muted-ink);
  line-height: 1.45;
}

.action-list {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
  padding-left: 20px;
}

.action-list li {
  padding-left: 4px;
}

.action-list strong,
.action-list span {
  display: block;
}

.action-list strong {
  font-size: 0.9rem;
}

.action-list span {
  margin-top: 4px;
  color: var(--muted-ink);
  font-size: 0.84rem;
  line-height: 1.4;
}

.performance-prompt-card {
  margin-top: 12px;
}

.prompt-pack-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(16, 17, 20, 0.94), rgba(0, 60, 140, 0.94)),
    var(--frame-ink);
  color: var(--brief-paper);
  overflow: hidden;
  padding: 16px;
}

.prompt-pack-hero::after {
  position: absolute;
  right: 22px;
  bottom: -34px;
  width: 280px;
  height: 112px;
  border: 5px solid rgba(25, 212, 255, 0.5);
  border-left-color: rgba(0, 130, 251, 0.9);
  border-right-color: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  content: "";
  pointer-events: none;
  transform: rotate(-16deg);
}

.prompt-pack-hero > * {
  position: relative;
  z-index: 1;
}

.prompt-pack-hero .signal-label {
  color: rgba(251, 251, 247, 0.68);
}

.prompt-pack-hero h2 {
  margin: 5px 0 4px;
  font-size: clamp(1.45rem, 2vw, 2rem);
  letter-spacing: 0;
}

.prompt-pack-hero p {
  max-width: 660px;
  margin: 0;
  color: rgba(251, 251, 247, 0.72);
  line-height: 1.45;
}

.prompt-pack-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.prompt-pack-actions .button.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--brief-paper);
  border-color: rgba(255, 255, 255, 0.18);
}

.prompt-pack-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

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

.prompt-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 13px;
}

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

.prompt-card h3 {
  margin: 7px 0 0;
  font-size: 1.02rem;
}

.prompt-card p {
  margin: 0;
  color: var(--muted-ink);
  font-size: 0.86rem;
  line-height: 1.4;
}

.prompt-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(0, 130, 251, 0.1);
  color: var(--meta-blue);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  text-transform: uppercase;
}

.prompt-card-text {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--surface-inset);
  color: var(--frame-ink);
  font-size: 0.84rem;
  line-height: 1.45;
  outline: none;
  padding: 11px;
  resize: vertical;
}

.export-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 12px;
}

.export-card {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 13px;
}

.export-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.export-textarea {
  width: 100%;
  min-height: 430px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--surface-inset);
  color: var(--frame-ink);
  line-height: 1.5;
  outline: none;
  padding: 12px;
  resize: vertical;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.summary-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.summary-list li {
  display: grid;
  gap: 5px;
  border-bottom: 1px solid var(--soft-line);
  padding-bottom: 10px;
}

.summary-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.summary-list strong {
  font-size: 0.86rem;
}

.summary-list span {
  color: var(--muted-ink);
  font-size: 0.82rem;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 36px));
  border-radius: var(--radius);
  background: var(--frame-ink);
  color: #fff;
  opacity: 0;
  padding: 11px 13px;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Meta-inspired product shell */
body {
  background:
    linear-gradient(180deg, #ffffff 0%, #f7faff 34%, #ffffff 100%),
    radial-gradient(circle at 54% -12%, rgba(8, 102, 255, 0.16), transparent 42%);
}

.app-shell {
  display: block;
  min-height: 100vh;
}

.client-rail {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(220px, 320px) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  border-right: 0;
  border-bottom: 1px solid rgba(8, 102, 255, 0.12);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

.brand-lockup {
  min-width: 210px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: transparent;
}

.brand-mark::after {
  width: 34px;
  height: 17px;
  border-width: 3px;
}

.search-box {
  gap: 5px;
}

.search-box span {
  display: none;
}

.search-box input,
.field input,
.field textarea,
.field select,
.matrix-select,
.matrix-text,
.prompt-card-text,
.export-textarea {
  border-color: rgba(8, 102, 255, 0.12);
  border-radius: 14px;
  background: #f3f8ff;
}

.search-box input {
  min-height: 44px;
  padding-inline: 16px;
}

.button {
  min-height: 42px;
  border-radius: 999px;
  padding-inline: 18px;
}

.button.primary {
  box-shadow: 0 10px 26px rgba(8, 102, 255, 0.22);
}

.client-list {
  flex: initial;
  flex-direction: row;
  gap: 8px;
  min-height: auto;
  overflow-x: auto;
  padding: 2px;
}

.client-item {
  grid-template-columns: minmax(0, 1fr) auto;
  width: 220px;
  min-width: 220px;
  border-color: rgba(8, 102, 255, 0.08);
  border-radius: 18px;
  background: #f6faff;
  padding: 10px 12px;
}

.client-item:hover {
  background: #eef6ff;
}

.client-item.active {
  border-color: rgba(8, 102, 255, 0.38);
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(8, 102, 255, 0.12);
}

.client-badge {
  background: linear-gradient(135deg, rgba(8, 102, 255, 0.14), rgba(25, 212, 255, 0.16));
}

.rail-footer {
  grid-template-columns: repeat(2, 72px);
  gap: 6px;
}

.rail-footer > div {
  border-color: rgba(8, 102, 255, 0.1);
  border-radius: 16px;
  background: #f6faff;
  padding: 8px;
}

.metric-value {
  font-size: 1rem;
}

.metric-label {
  font-size: 0.62rem;
}

.workspace {
  max-width: 1420px;
  margin: 0 auto;
  gap: 18px;
  padding: 28px 32px 40px;
}

.topbar {
  position: relative;
  align-items: end;
  min-height: 164px;
  overflow: hidden;
  border: 1px solid rgba(8, 102, 255, 0.12);
  border-radius: 28px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.94), rgba(239, 247, 255, 0.94) 58%, rgba(220, 244, 255, 0.92)),
    #ffffff;
  box-shadow: 0 24px 70px rgba(8, 102, 255, 0.12);
  padding: 26px;
}

.topbar::after {
  position: absolute;
  right: -56px;
  top: 18px;
  width: 440px;
  height: 150px;
  border: 9px solid rgba(8, 102, 255, 0.22);
  border-left-color: rgba(8, 102, 255, 0.55);
  border-right-color: rgba(25, 212, 255, 0.34);
  border-radius: 999px;
  content: "";
  pointer-events: none;
  transform: rotate(-15deg);
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.client-name-input {
  width: min(780px, 100%);
  font-size: clamp(2.15rem, 4vw, 4.2rem);
  line-height: 0.95;
}

.client-meta {
  margin-top: 12px;
  font-size: 0.95rem;
}

.top-actions .button {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
}

.brief-band,
.matrix-shell,
.persona-card,
.production-column,
.performance-control,
.diagnosis-table-card,
.action-card,
.export-card,
.prompt-card,
.signal-card {
  border-color: rgba(8, 102, 255, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

.brief-band {
  grid-template-columns: minmax(0, 1fr) 240px;
  padding: 18px;
}

.view-switch {
  width: fit-content;
  border: 1px solid rgba(8, 102, 255, 0.12);
  border-radius: 999px;
  background: #edf6ff;
  padding: 5px;
}

.view-tab {
  min-height: 40px;
  border-radius: 999px;
  padding: 0 18px;
}

.signal-strip,
.prompt-pack-stats,
.performance-scoreboard {
  gap: 12px;
}

.signal-card {
  padding: 16px;
}

.signal-card strong {
  font-size: 1.7rem;
}

.matrix-header,
.column-title {
  border-bottom-color: rgba(8, 102, 255, 0.1);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.matrix-table th,
.diagnosis-table th {
  background: #ffffff;
}

.matrix-table th,
.matrix-table td,
.diagnosis-table th,
.diagnosis-table td {
  border-bottom-color: rgba(8, 102, 255, 0.1);
}

.prompt-pack-hero {
  min-height: 190px;
  border-radius: 28px;
  background:
    linear-gradient(125deg, #0866ff 0%, #0082fb 48%, #19d4ff 100%),
    #0866ff;
  box-shadow: 0 24px 70px rgba(8, 102, 255, 0.22);
  padding: 24px;
}

.prompt-pack-hero::after {
  right: 28px;
  bottom: -44px;
  width: 390px;
  height: 148px;
  border-color: rgba(255, 255, 255, 0.42);
  border-left-color: rgba(255, 255, 255, 0.86);
  border-right-color: rgba(255, 255, 255, 0.18);
}

.prompt-pack-hero h2 {
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.95;
}

.prompt-pack-actions .button.primary {
  background: #ffffff;
  color: var(--meta-blue);
  box-shadow: 0 16px 34px rgba(0, 40, 110, 0.16);
}

.prompt-pack-actions .button.secondary {
  background: rgba(255, 255, 255, 0.16);
}

.prompt-card {
  padding: 18px;
}

.prompt-chip {
  border-radius: 999px;
  background: #eaf4ff;
}

body:not([data-view="brief"]) .brief-band,
body:not([data-view="mapa"]) .signal-strip {
  display: none;
}

.home-focus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.46fr);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 300px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(8, 102, 255, 0.12);
  border-radius: 30px;
  background:
    linear-gradient(130deg, #0866ff 0%, #0082fb 52%, #19d4ff 100%),
    #0866ff;
  color: #fff;
  box-shadow: 0 26px 78px rgba(8, 102, 255, 0.24);
  padding: 28px;
}

.home-focus::after {
  position: absolute;
  right: -42px;
  bottom: -54px;
  width: 440px;
  height: 158px;
  border: 10px solid rgba(255, 255, 255, 0.4);
  border-left-color: rgba(255, 255, 255, 0.88);
  border-right-color: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  content: "";
  pointer-events: none;
  transform: rotate(-14deg);
}

.home-focus > * {
  position: relative;
  z-index: 1;
}

.home-focus .signal-label {
  color: rgba(255, 255, 255, 0.7);
}

.home-focus h2 {
  max-width: 760px;
  margin: 7px 0 8px;
  font-size: clamp(2rem, 3.6vw, 4rem);
  line-height: 0.95;
}

.home-focus p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1.05rem;
  line-height: 1.45;
}

.home-focus .button.primary {
  background: #fff;
  color: var(--meta-blue);
  box-shadow: 0 18px 42px rgba(0, 43, 102, 0.18);
}

.home-focus .button.secondary {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.home-truths,
.home-focus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.home-truths span {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 7px 10px;
}

.home-output-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--frame-ink);
  box-shadow: 0 18px 44px rgba(0, 43, 102, 0.14);
  padding: 18px;
}

.home-output-card .signal-label {
  color: var(--meta-blue);
}

.home-output-card strong {
  font-size: 1.35rem;
  line-height: 1.1;
}

.home-output-card > p {
  margin: 0;
  color: var(--muted-ink);
  line-height: 1.45;
}

.home-preview-list {
  display: grid;
  gap: 8px;
}

.home-preview-list article {
  border: 1px solid rgba(8, 102, 255, 0.1);
  border-radius: 16px;
  background: #f7fbff;
  padding: 11px;
}

.home-preview-list span,
.home-preview-list small {
  display: block;
  color: var(--muted-ink);
  font-size: 0.76rem;
  font-weight: 800;
}

.home-preview-list p {
  margin: 6px 0;
  color: var(--frame-ink);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.32;
}

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

.home-step {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  min-height: 260px;
  border: 1px solid rgba(8, 102, 255, 0.1);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  padding: 18px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.88) inset;
}

.home-step-number {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 16px;
  background: #eef6ff;
  color: var(--meta-blue);
  font-weight: 900;
}

.home-step h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.home-step p {
  margin: 0;
  color: var(--muted-ink);
  line-height: 1.48;
}

.home-step-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.home-step-footer span {
  color: var(--muted-ink);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.home-step-good {
  border-color: rgba(0, 130, 251, 0.16);
}

.home-step-warning {
  border-color: rgba(182, 106, 0, 0.24);
  background: linear-gradient(180deg, #fff, #fffaf3);
}

.home-step-beta {
  border-color: rgba(97, 106, 123, 0.18);
  background: linear-gradient(180deg, #fff, #f7f9fc);
}

.brief-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(8, 102, 255, 0.1);
  border-radius: 26px;
  background: #fff;
  padding: 20px;
}

.brief-guide h2 {
  margin: 6px 0;
  font-size: clamp(1.5rem, 2.5vw, 2.6rem);
}

.brief-guide p {
  max-width: 640px;
  margin: 0;
  color: var(--muted-ink);
  line-height: 1.45;
}

.beta-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(97, 106, 123, 0.16);
  border-radius: 26px;
  background: linear-gradient(180deg, #ffffff, #f7f9fc);
  margin-bottom: 12px;
  padding: 20px;
}

.beta-note h2 {
  margin: 6px 0;
  font-size: clamp(1.45rem, 2.4vw, 2.45rem);
}

.beta-note p {
  max-width: 820px;
  margin: 0;
  color: var(--muted-ink);
  line-height: 1.45;
}

.brief-guide-actions {
  display: flex;
  gap: 8px;
}

@media (max-width: 1100px) {
  .app-shell {
    display: block;
  }

  .client-rail {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .brand-lockup {
    min-width: 0;
  }

  .brief-band,
  .export-layout,
  .performance-grid,
  .diagnosis-grid {
    grid-template-columns: 1fr;
  }

  .generator-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
  }

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

  .performance-context {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .prompt-library-grid {
    grid-template-columns: 1fr;
  }

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

  .home-focus {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .client-rail {
    position: relative;
    max-height: none;
    display: grid;
    gap: 10px;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--soft-line);
  }

  .client-list {
    display: grid;
    grid-auto-columns: minmax(190px, 1fr);
    grid-auto-flow: column;
    overflow-x: auto;
  }

  .rail-footer {
    display: none;
  }

  .workspace {
    padding: 14px;
  }

  .topbar,
  .prompt-pack-hero,
  .brief-guide,
  .beta-note,
  .prompt-card header {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px 92px;
    gap: 8px;
  }

  .topbar {
    min-height: 0;
    border-radius: 22px;
    padding: 18px;
  }

  .topbar::after {
    right: -130px;
    top: -18px;
    width: 290px;
    height: 96px;
    border-width: 7px;
  }

  .client-name-input {
    font-size: 2rem;
    line-height: 1;
  }

  .top-actions .button {
    min-height: 42px;
    padding-inline: 10px;
  }

  .brief-grid,
  .generator-panel,
  .signal-strip,
  .personas-grid,
  .performance-context,
  .performance-scoreboard,
  .prompt-pack-stats,
  .production-board {
    grid-template-columns: 1fr;
  }

  .home-focus {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 20px;
  }

  .prompt-pack-actions,
  .prompt-pack-actions .button,
  .brief-guide-actions,
  .brief-guide-actions .button,
  .home-focus-actions,
  .home-focus-actions .button,
  .prompt-card header .button {
    width: 100%;
  }

  .home-flow {
    grid-template-columns: 1fr;
  }

  .home-step {
    min-height: 0;
  }

  .view-switch {
    width: 100%;
    overflow-x: auto;
  }

  .view-tab {
    flex: 1 0 auto;
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.9rem;
  }
}
