:root {
  color-scheme: light;
  --bg: #eef2ef;
  --panel: #ffffff;
  --panel-soft: #f7faf8;
  --ink: #17211b;
  --muted: #647067;
  --line: #dbe5df;
  --accent: #0f766e;
  --accent-dark: #0b5d57;
  --amber: #a16207;
  --red: #b42318;
  --green: #067647;
  --blue: #155eef;
  --shadow: 0 24px 70px rgba(23, 33, 27, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 34%),
    radial-gradient(circle at bottom right, rgba(21, 94, 239, 0.09), transparent 32%),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

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

.shell {
  width: min(1560px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
  min-height: calc(100vh - 48px);
}

.brief-panel,
.results-panel,
.detail-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(219, 229, 223, 0.9);
  box-shadow: var(--shadow);
}

.brief-panel {
  border-radius: 8px;
  padding: 22px;
  border-top: 4px solid var(--accent);
}

.results-panel {
  min-width: 0;
  border-radius: 8px;
  padding: 20px;
  overflow: hidden;
  border-top: 4px solid #12201a;
}

.brand,
.topbar,
.actions,
.summary-band,
.name-cell,
.score-pill,
.domain-status,
.risk-pill,
.detail-head,
.domain-row {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  margin-bottom: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 1.45rem;
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.brief-form {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.brief-form > label:first-child {
  grid-column: span 4;
  grid-row: span 3;
}

.brief-form > fieldset:nth-of-type(1) {
  grid-column: span 8;
}

.brief-form > .field-grid {
  grid-column: span 4;
}

.brief-form > fieldset:nth-of-type(2) {
  grid-column: span 4;
}

.brief-form > fieldset:nth-of-type(3) {
  grid-column: span 4;
}

.brief-form > label:nth-of-type(2) {
  grid-column: span 4;
}

.brief-form > fieldset:nth-of-type(4) {
  grid-column: span 4;
}

.brief-form > .actions {
  grid-column: span 4;
  align-self: end;
}

label,
legend {
  color: #27352d;
  font-size: 0.9rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 210px;
  padding: 12px;
  line-height: 1.5;
}

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

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

fieldset {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 250, 248, 0.72);
}

.check-grid,
.chip-grid,
.audience-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.check-grid label,
.chip-grid label,
.audience-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
  line-height: 1.25;
}

.check-grid label:has(input:checked),
.chip-grid label:has(input:checked),
.audience-grid label:has(input:checked) {
  border-color: rgba(15, 118, 110, 0.35);
  background: #f0fdfa;
}

.check-grid input,
.chip-grid input,
.audience-grid input {
  width: auto;
  height: auto;
  margin: 0;
}

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

.wide-option {
  grid-column: 1 / -1;
}

.actions {
  gap: 10px;
  flex-wrap: wrap;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 800;
}

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

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

.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.ghost:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.header-actions,
.project-controls,
.export-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.project-controls select,
.export-controls select {
  width: 130px;
  margin-top: 0;
  background: #fff;
}

.project-controls select {
  width: 180px;
}

.save-status {
  min-height: 20px;
  margin: -6px 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-align: right;
}

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

.notice-band {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 16px;
  border: 1px solid #fedf89;
  border-radius: 8px;
  background: #fffbeb;
  color: #854d0e;
  padding: 12px 14px;
  line-height: 1.45;
}

.notice-band strong {
  flex: 0 0 auto;
}

.summary-band > div {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--panel-soft));
  padding: 16px;
}

.metric {
  display: block;
  color: var(--ink);
  font-size: 1.85rem;
  font-weight: 850;
  line-height: 1;
}

.summary-band span:last-child {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.recommendation-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, #ecfdf3, #f0fdfa);
  padding: 16px;
}

.recommendation-card[hidden] {
  display: none;
}

.recommendation-card h3 {
  margin-bottom: 6px;
}

.recommendation-card .muted {
  margin-bottom: 0;
}

.result-tools {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 10px;
}

.filter-summary {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.result-tools label {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 12px;
}

.result-tools input {
  width: auto;
  height: auto;
  margin: 0;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

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

th {
  background: #f3f7f5;
  color: #526158;
  font-size: 0.78rem;
  text-transform: uppercase;
}

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

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: #f8fbfa;
}

.empty {
  height: 220px;
  color: var(--muted);
  text-align: center;
}

.name-cell {
  gap: 9px;
  font-weight: 850;
}

.favorite {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  min-height: 31px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.favorite.active {
  border-color: rgba(161, 98, 7, 0.3);
  background: #fffbeb;
  color: var(--amber);
}

.score-pill,
.risk-pill,
.domain-status {
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 850;
}

.score-pill {
  background: #ecfdf3;
  color: var(--green);
}

.domain-status.available {
  background: #ecfdf3;
  color: var(--green);
}

.domain-status.mixed {
  background: #eff8ff;
  color: var(--blue);
}

.domain-status.taken {
  background: #fef3f2;
  color: var(--red);
}

.risk-pill.low {
  background: #ecfdf3;
  color: var(--green);
}

.risk-pill.medium {
  background: #fffaeb;
  color: var(--amber);
}

.risk-pill.high {
  background: #fef3f2;
  color: var(--red);
}

.select-button {
  min-height: 34px;
  padding: 0 10px;
}

.detail-panel {
  border-radius: 8px;
  padding: 20px;
  box-shadow: none;
  background: #fff;
}

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

.detail-head {
  justify-content: space-between;
  gap: 12px;
}

.tagline {
  color: var(--muted);
  font-weight: 700;
}

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

.platform-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.platform-section h4,
.brand-risk-section h4,
.purchase-plan h4,
.research-section h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.brand-risk-section,
.purchase-plan,
.research-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.purchase-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.purchase-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, auto);
  gap: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 10px;
}

.purchase-row:hover,
.domain-row:hover,
.platform-row:hover,
.research-link-card:hover {
  border-color: rgba(15, 118, 110, 0.34);
  background: #f0fdfa;
}

.purchase-row div {
  display: grid;
  gap: 3px;
}

.purchase-row div:last-of-type {
  text-align: right;
}

.purchase-row span,
.purchase-row small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.purchase-row small {
  grid-column: 1 / -1;
}

.mini-note {
  margin-bottom: 0;
  font-size: 0.86rem;
}

.compact-notes {
  margin-top: 10px;
}

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

.research-link-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.research-link {
  display: grid;
  gap: 3px;
  color: var(--ink);
  text-decoration: none;
}

.research-link-card:hover {
  border-color: rgba(15, 118, 110, 0.35);
  background: #f0fdfa;
}

.research-link span {
  color: var(--muted);
  font-size: 0.86rem;
}

.research-result {
  display: inline-block;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 850;
}

.research-result.pending,
.research-result.manual,
.research-result.info {
  background: #fffaeb;
  color: var(--amber);
}

.research-result.clear {
  background: #ecfdf3;
  color: var(--green);
}

.research-result.review {
  background: #eff8ff;
  color: var(--blue);
}

.research-result.unknown {
  background: #fef3f2;
  color: var(--red);
}

.research-button {
  width: fit-content;
  margin-top: 10px;
}

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

.platform-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.platform-row small {
  color: var(--muted);
  line-height: 1.45;
}

.platform-pill {
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 850;
}

.platform-pill.ready {
  background: #ecfdf3;
  color: var(--green);
}

.platform-pill.review {
  background: #eff8ff;
  color: var(--blue);
}

.platform-pill.risk {
  background: #fef3f2;
  color: var(--red);
}

.domain-row {
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-soft);
}

.domain-row strong {
  overflow-wrap: anywhere;
}

.notes {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.quote-box {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.variant-box {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.variant-box button {
  width: fit-content;
}

.quote-button {
  width: fit-content;
}

.success-text {
  color: var(--green);
}

.error-text {
  color: var(--amber);
}

@media (max-width: 1100px) {
  .workspace,
  .content-grid,
  .brief-form {
    grid-template-columns: 1fr;
  }

  .brief-form > label:first-child,
  .brief-form > fieldset:nth-of-type(1),
  .brief-form > .field-grid,
  .brief-form > fieldset:nth-of-type(2),
  .brief-form > fieldset:nth-of-type(3),
  .brief-form > label:nth-of-type(2),
  .brief-form > fieldset:nth-of-type(4),
  .brief-form > .actions {
    grid-column: 1;
  }

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

  .domain-list,
  .purchase-list,
  .research-list,
  .platform-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .shell {
    width: 100%;
    padding: 12px;
  }

  .workspace {
    min-height: auto;
  }

  .topbar,
  .brand {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
  }

  .header-actions,
  .project-controls,
  .export-controls {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .project-controls select,
  .project-controls button,
  .export-controls select,
  .export-controls button {
    width: 100%;
    flex: 1;
  }

  .save-status {
    text-align: left;
  }

  .notice-band {
    flex-direction: column;
  }

  .summary-band,
  .check-grid,
  .chip-grid,
  .audience-grid,
  .domain-list,
  .purchase-list,
  .research-list,
  .platform-list {
    grid-template-columns: 1fr;
  }

  .recommendation-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-tools {
    gap: 8px;
    align-items: stretch;
    flex-direction: column;
    justify-content: stretch;
  }

  .result-tools label {
    width: 100%;
  }

  .platform-row {
    grid-template-columns: 1fr;
  }

  .brief-panel,
  .results-panel {
    padding: 16px;
  }
}
