:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #eef3f8;
  --text: #172033;
  --muted: #647084;
  --line: #dce3ec;
  --blue: #1a73e8;
  --red: #ea4335;
  --yellow: #fbbc04;
  --green: #34a853;
  --shadow: 0 18px 45px rgba(23, 32, 51, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 116px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.05);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-shell,
.dashboard-shell,
.app-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.header-shell {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.5vw, 2.15rem);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button {
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 700;
}

.primary-button {
  background: var(--text);
  color: #ffffff;
}

.ghost-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.full-action {
  width: 100%;
  margin-top: 4px;
}

.dashboard-shell {
  padding: 28px 0 38px;
}

.status-strip {
  display: grid;
  grid-template-columns: 0.8fr 1.3fr 1fr;
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.status-strip > div {
  background: var(--surface);
  padding: 16px;
}

.status-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.workspace-grid,
.planning-grid,
.tool-grid,
.checklist-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.workspace-grid {
  grid-template-columns: minmax(320px, 0.95fr) minmax(420px, 1.35fr);
  align-items: start;
}

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

.tool-grid {
  grid-template-columns: 0.9fr 1.2fr 0.9fr;
}

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

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.section-heading.compact {
  margin-bottom: 14px;
}

.accent-bar {
  width: 6px;
  height: 42px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.accent-bar.blue {
  background: var(--blue);
}

.accent-bar.red {
  background: var(--red);
}

.accent-bar.yellow {
  background: var(--yellow);
}

.accent-bar.green {
  background: var(--green);
}

.brief-form,
.copy-grid {
  display: grid;
  gap: 14px;
}

label {
  color: var(--text);
  display: grid;
  gap: 7px;
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.14);
}

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

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.segment {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 700;
}

.segment.active {
  background: var(--text);
  color: #ffffff;
  border-color: var(--text);
}

.objective-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.plan-summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 18px;
  padding: 14px;
}

.badge {
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--line);
}

.badge.blue {
  background: rgba(26, 115, 232, 0.12);
}

.badge.red {
  background: rgba(234, 67, 53, 0.12);
}

.badge.yellow {
  background: rgba(251, 188, 4, 0.22);
}

.badge.green {
  background: rgba(52, 168, 83, 0.14);
}

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

.kpi-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fbfcfe;
}

.kpi-card span,
.budget-output span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.kpi-card label {
  color: var(--muted);
  font-size: 0.82rem;
  min-height: 34px;
}

.kpi-card input {
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 800;
  margin-top: 8px;
  padding: 9px 10px;
}

.kpi-card small {
  color: var(--muted);
  display: block;
  font-size: 0.74rem;
  margin-top: 6px;
}

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

.report-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 18px;
  padding: 28px;
  scroll-margin-top: 116px;
}

.report-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 18px;
}

.report-header h2 {
  font-size: clamp(1.35rem, 2vw, 1.85rem);
}

.report-status {
  background: rgba(26, 115, 232, 0.1);
  border: 1px solid rgba(26, 115, 232, 0.22);
  border-radius: 999px;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 8px 12px;
  white-space: nowrap;
}

.empty-report {
  background: #fbfcfe;
  border: 1px dashed #b9c5d5;
  border-radius: var(--radius);
  color: var(--muted);
  padding: 28px;
}

.empty-report strong {
  color: var(--text);
  display: block;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.empty-report p {
  margin-bottom: 0;
  max-width: 820px;
}

.generated-report {
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr;
}

.is-hidden {
  display: none !important;
}

.report-card {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  scroll-margin-top: 116px;
}

.executive-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.executive-card p {
  color: var(--text);
  font-size: 1.04rem;
  font-weight: 600;
  line-height: 1.75;
  margin-bottom: 0;
}

.report-card-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.strategy-grid,
.detail-grid,
.ad-variation-grid,
.kpi-target-grid {
  display: grid;
  gap: 14px;
}

.strategy-grid {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.detail-grid {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.ad-variation-grid {
  grid-template-columns: repeat(3, minmax(230px, 1fr));
}

.kpi-target-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.strategy-grid > div,
.detail-grid > div,
.kpi-target-grid > div,
.ad-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.strategy-grid strong,
.detail-grid strong {
  display: block;
  margin-bottom: 8px;
}

.strategy-grid p,
.detail-grid p,
.ad-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
  margin-bottom: 0;
}

.detail-grid ul {
  color: var(--muted);
  margin: 0;
  padding-left: 18px;
}

.detail-grid li + li {
  margin-top: 6px;
}

.ad-label {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.ad-card strong {
  display: block;
  margin-bottom: 8px;
}

.ad-card .badge {
  display: inline-block;
  margin-top: 12px;
}

.report-budget {
  grid-template-columns: 1fr;
}

.kpi-target-grid span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.kpi-target-grid strong {
  display: block;
  font-size: 1rem;
  line-height: 1.45;
}

.launch-plan {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  position: relative;
}

.launch-plan > div {
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  min-height: 0;
  padding: 15px;
}

.launch-plan strong,
.launch-plan span {
  display: block;
}

.launch-plan strong {
  margin-bottom: 8px;
}

.launch-plan span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

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

.report-list li {
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 600;
  line-height: 1.6;
  padding: 12px;
}

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

.workflow-list div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  background: #fbfcfe;
}

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

.workflow-list span {
  color: var(--muted);
  margin-top: 4px;
  font-size: 0.88rem;
}

.tag-builder {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tag-builder span {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.full-label {
  margin-top: 10px;
}

.keyword-entry {
  margin-bottom: 14px;
}

.inline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.keyword-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-chip {
  align-items: center;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  color: var(--text);
  display: inline-flex;
  font-size: 0.88rem;
  font-weight: 700;
  gap: 8px;
  max-width: 100%;
  min-height: 38px;
  padding: 7px 8px 7px 10px;
}

.keyword-chip span {
  overflow-wrap: anywhere;
}

.remove-keyword {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.76rem;
  font-weight: 800;
  height: 24px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 24px;
}

.remove-keyword:hover,
.remove-keyword:focus {
  background: rgba(234, 67, 53, 0.1);
  border-color: rgba(234, 67, 53, 0.35);
  color: var(--red);
}

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

.idea-list li {
  border-left: 4px solid var(--yellow);
  background: #fbfcfe;
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text);
  font-weight: 700;
}

.budget-output {
  display: grid;
  gap: 10px;
}

.budget-output > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  background: #fbfcfe;
}

.budget-output strong {
  color: var(--green);
  font-size: 1.1rem;
}

.checklist {
  display: grid;
  gap: 10px;
}

.checklist label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfcfe;
  font-weight: 600;
}

.checklist input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--green);
  flex: 0 0 auto;
}

.reporting-panel {
  margin-top: 18px;
}

.reporting-table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-row {
  display: grid;
  grid-template-columns: 0.55fr 1.6fr 0.7fr;
  gap: 1px;
  background: var(--line);
}

.table-row span {
  background: #ffffff;
  padding: 13px;
  min-width: 0;
}

.table-head span {
  background: var(--text);
  color: #ffffff;
  font-weight: 700;
}

.app-footer {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0 0 28px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  background: var(--text);
  color: #ffffff;
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-weight: 700;
}

@media (max-width: 980px) {
  .workspace-grid,
  .planning-grid,
  .tool-grid,
  .checklist-grid,
  .status-strip {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    overflow-x: auto;
  }

  .generated-report,
  .strategy-grid,
  .detail-grid,
  .ad-variation-grid,
  .kpi-target-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .header-shell {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 0;
  }

  .header-actions {
    width: 100%;
  }

  .primary-button,
  .ghost-button {
    flex: 1 1 140px;
  }

  .dashboard-shell {
    padding-top: 18px;
  }

  .field-grid,
  .segmented-control,
  .kpi-grid,
  .inline-control,
  .table-row {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 16px;
  }

  .report-shell {
    padding: 16px;
    scroll-margin-top: 160px;
  }

  .report-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-status {
    white-space: normal;
  }

  .empty-report {
    padding: 18px;
  }

  .report-card {
    padding: 16px;
    scroll-margin-top: 160px;
  }
}
