:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #172026;
  --muted: #5a6872;
  --line: #d7dee3;
  --accent: #0c6b63;
  --accent-strong: #084d47;
  --warning: #b5561d;
  --soft: #e8f2f0;
  --soft-alt: #f4eadf;
  --shadow: 0 18px 48px rgba(23, 32, 38, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(12, 107, 99, 0.1), transparent 42%),
    linear-gradient(315deg, rgba(181, 86, 29, 0.08), transparent 38%),
    var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

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

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

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(440px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.input-panel,
.output-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.input-panel {
  padding: 20px;
}

.panel-head {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
}

h2 {
  font-size: clamp(22px, 3vw, 30px);
}

h3 {
  font-size: 17px;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

label,
fieldset {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #28343b;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c6d0d7;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 500;
  outline: none;
}

input,
select {
  min-height: 42px;
  padding: 0 11px;
}

select[multiple] {
  min-height: 118px;
  padding: 8px 11px;
}

textarea {
  min-height: 96px;
  resize: vertical;
  padding: 10px 11px;
  line-height: 1.4;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(12, 107, 99, 0.14);
}

label:has(textarea),
fieldset,
.logo-upload,
.logo-preview {
  grid-column: 1 / -1;
}

.field-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.logo-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfc;
}

.logo-preview[hidden] {
  display: none;
}

.logo-preview img {
  max-width: 180px;
  max-height: 84px;
  object-fit: contain;
}

fieldset {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

legend {
  padding: 0 6px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-weight: 700;
}

.check input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.actions,
.tool-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.actions {
  margin-top: 16px;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button.secondary {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

button.secondary:hover {
  background: var(--soft);
}

.output-panel {
  min-height: calc(100vh - 48px);
  overflow: hidden;
}

.output-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}

.proposal-output {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.proposal-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.proposal-card.highlight {
  border-color: rgba(12, 107, 99, 0.3);
  background: var(--soft);
}

.proposal-card.warning {
  border-color: rgba(181, 86, 29, 0.25);
  background: var(--soft-alt);
}

.proposal-brand-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(12, 107, 99, 0.28);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.proposal-brand-card img {
  width: 132px;
  max-height: 86px;
  object-fit: contain;
}

.logo-placeholder {
  min-width: 132px;
  max-width: 180px;
  min-height: 76px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--accent-strong);
  font-weight: 800;
  text-align: center;
}

.metric-row,
.schedule-grid,
.recommendation-grid,
.rate-table,
.schedule-table {
  display: grid;
  gap: 10px;
}

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

.metric {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #ffffff;
}

.metric strong {
  display: block;
  margin-bottom: 5px;
  font-size: 20px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

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

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

.rate-table div,
.schedule-table div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.rate-table span,
.schedule-table span {
  color: var(--muted);
  font-size: 12px;
}

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

.recommendation-grid > div {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8faf9;
}

.schedule-item {
  border-left: 4px solid var(--accent);
  padding: 10px 12px;
  background: #f8faf9;
}

.schedule-item strong {
  display: block;
  margin-bottom: 4px;
}

ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

li {
  color: #2f3d45;
  line-height: 1.45;
}

.script-box {
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #10191d;
  color: #f8fbfb;
  line-height: 1.55;
}

.prompt-box {
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8faf9;
  color: #223039;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

.status-note {
  min-height: 20px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.agreement-card {
  break-inside: avoid;
}

.signature-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 18px 14px;
  margin-top: 12px;
}

.signature-grid div {
  min-height: 58px;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid #73818a;
}

.signature-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 1040px) {
  .workspace {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 18px, 1480px);
    padding: 9px 0;
  }

  .input-panel {
    padding: 14px;
  }

  .form-grid,
  fieldset,
  .metric-row,
  .schedule-grid,
  .recommendation-grid,
  .rate-table,
  .schedule-table {
    grid-template-columns: 1fr;
  }

  .output-toolbar {
    display: grid;
  }

  .proposal-brand-card,
  .logo-preview {
    align-items: flex-start;
    flex-direction: column;
  }

  .tool-buttons button,
  .actions button {
    flex: 1 1 140px;
  }

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

@media print {
  body {
    background: #ffffff;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .workspace {
    display: block;
  }

  .input-panel,
  .tool-buttons {
    display: none;
  }

  .output-panel {
    border: 0;
    box-shadow: none;
  }
}
