:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-strong: #f9fafb;
  --text: #18202a;
  --muted: #657184;
  --line: #dce2e8;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --accent: #b42318;
  --warning: #b7791f;
  --ink: #26313d;
  --shadow: 0 18px 50px rgba(24, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  padding: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
  gap: 20px;
  max-width: 1480px;
  margin: 0 auto;
}

.panel,
.output-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.input-panel {
  border-radius: 8px;
  padding: 20px;
  align-self: start;
}

.output-panel {
  border-radius: 8px;
  min-height: calc(100vh - 48px);
  padding: 20px;
}

.brand-row,
.output-toolbar,
.actions,
.card-head,
.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-row {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
  color: var(--ink);
}

h1 {
  font-size: 24px;
  line-height: 1.12;
}

h2 {
  font-size: 22px;
  line-height: 1.18;
}

h3 {
  font-size: 18px;
  line-height: 1.25;
}

.briefing-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

textarea {
  resize: vertical;
  min-height: 72px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.primary-button,
.secondary-button,
.ghost-button,
.copy-button {
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  flex: 1;
  background: var(--primary);
  color: white;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button,
.ghost-button,
.copy-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.secondary-button:hover,
.ghost-button:hover,
.copy-button:hover {
  border-color: #aab5c2;
  background: var(--panel-strong);
}

.output-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -20px -20px 18px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.empty-state {
  display: grid;
  min-height: 360px;
  place-items: center;
  border: 1px dashed #bcc7d4;
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.empty-state p {
  max-width: 520px;
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

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

.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.card-head {
  padding: 16px;
  background: var(--panel-strong);
  border-bottom: 1px solid var(--line);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #e8f3f1;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.tag.warning {
  background: #fff4db;
  color: var(--warning);
}

.tag.accent {
  background: #fee4e2;
  color: var(--accent);
}

.card-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.output-block {
  display: grid;
  gap: 6px;
}

.output-block strong {
  color: var(--ink);
  font-size: 13px;
}

.output-block p,
.output-block pre {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}

.output-block pre {
  white-space: pre-wrap;
  border-radius: 6px;
  background: #111827;
  color: #f8fafc;
  padding: 14px;
  overflow-wrap: anywhere;
}

.score-row {
  align-items: stretch;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.score {
  display: grid;
  min-width: 120px;
  place-items: center;
  border-radius: 6px;
  background: #ecfdf3;
  color: #027a48;
  font-size: 22px;
  font-weight: 900;
}

.score small {
  display: block;
  color: #067647;
  font-size: 11px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: calc(100vw - 40px);
  border-radius: 6px;
  background: #18202a;
  color: white;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-weight: 800;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

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

@media (max-width: 980px) {
  .app-shell {
    padding: 12px;
  }

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

  .output-panel {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .two-columns,
  .brand-row,
  .output-toolbar,
  .actions,
  .card-head,
  .score-row {
    align-items: stretch;
    flex-direction: column;
  }

  .two-columns {
    display: grid;
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 20px;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .copy-button {
    width: 100%;
  }
}
