:root {
  --blue: #1f7cff;
  --blue-dark: #102a56;
  --blue-soft: #eef6ff;
  --gold: #f5b942;
  --text: #243044;
  --muted: #64748b;
  --border: #dbe7f5;
  --white: #ffffff;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #eef6ff 0%, #ffffff 45%, #f8fbff 100%);
}

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

.hero {
  text-align: center;
  padding: 24px 0 42px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: var(--white);
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(31, 124, 255, 0.25);
}

.brand-name,
.brand-tagline {
  margin: 0;
  text-align: left;
}

.brand-name {
  color: var(--blue-dark);
  font-weight: 900;
  font-size: 1.1rem;
}

.brand-tagline {
  color: var(--muted);
  font-size: 0.92rem;
}

h1 {
  max-width: 820px;
  margin: 0 auto;
  color: var(--blue-dark);
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.hero-text {
  max-width: 760px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.7;
}

.generator-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 28px;
  align-items: start;
}

.generator-card,
.result-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: 0 22px 60px rgba(16, 42, 86, 0.1);
}

.generator-card {
  padding: 28px;
}

.generator-card h2,
.result-card h2 {
  margin: 0 0 22px;
  color: var(--blue-dark);
  letter-spacing: -0.03em;
}

label {
  display: block;
  margin-bottom: 16px;
  color: var(--blue-dark);
  font-weight: 800;
  font-size: 0.92rem;
}

input,
select {
  width: 100%;
  margin-top: 8px;
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 0 14px;
  color: var(--text);
  background: #fbfdff;
  font: inherit;
}

input:focus,
select:focus {
  outline: 3px solid rgba(31, 124, 255, 0.16);
  border-color: var(--blue);
}

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

button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

#generateButton {
  width: 100%;
  min-height: 50px;
  border-radius: 999px;
  background: var(--blue);
  color: var(--white);
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(31, 124, 255, 0.25);
}

#generateButton:disabled {
  opacity: 0.65;
  cursor: wait;
}

.small-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.result-card {
  min-height: 620px;
  overflow: hidden;
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  padding: 28px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #ffffff, #f8fbff);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#copyButton {
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-weight: 900;
}

#copyButton:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.result-content {
  padding: 28px;
  line-height: 1.7;
}

.result-content.empty {
  color: var(--muted);
}

.result-content h3 {
  color: var(--blue-dark);
  margin: 24px 0 8px;
}

.result-content h3:first-child {
  margin-top: 0;
}

.result-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 22px;
  overflow: hidden;
  border-radius: 16px;
}

.result-content th,
.result-content td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.result-content th {
  background: var(--blue-dark);
  color: var(--white);
}

.result-content tr:nth-child(even) td {
  background: #f8fbff;
}

.notice {
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff8e8;
  border: 1px solid #f8d98b;
}

.error {
  color: var(--danger);
  background: #fff2f0;
  border: 1px solid #ffccc7;
  padding: 14px 16px;
  border-radius: 16px;
}

@media (max-width: 980px) {
  .generator-layout {
    grid-template-columns: 1fr;
  }

  .result-card {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 24px 0;
  }

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

  .generator-card,
  .result-header,
  .result-content {
    padding: 22px;
  }
}
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  max-width: 360px;
}

.result-actions button {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-weight: 900;
  font-size: 0.82rem;
  white-space: nowrap;
}

.result-actions button:hover:not(:disabled) {
  background: #dcecff;
}

.result-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.review-warning {
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff8e8;
  border: 1px solid #f8d98b;
  color: var(--blue-dark);
  margin-bottom: 22px;
  line-height: 1.6;
}

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

  .hero,
  .generator-card,
  .result-actions,
  .brand,
  #generateButton,
  .small-note {
    display: none !important;
  }

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

  .generator-layout {
    display: block;
  }

  .result-card {
    box-shadow: none;
    border: none;
    min-height: auto;
  }

  .result-header {
    border-bottom: 2px solid #102a56;
    padding: 0 0 16px;
    background: #ffffff !important;
  }

  .result-content {
    padding: 20px 0 0;
  }

  .result-content table {
    page-break-inside: avoid;
  }

  .result-content th {
    background: #102a56 !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .notice,
  .review-warning {
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

@media (max-width: 720px) {
  .result-header {
    flex-direction: column;
  }

  .result-actions {
    justify-content: flex-start;
    max-width: none;
  }
}
.refinement-bar {
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: #f8fbff;
}

.refinement-bar.hidden {
  display: none;
}

.refinement-bar p {
  margin: 0 0 12px;
  color: var(--blue-dark);
  font-weight: 900;
}

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

.refinement-actions button {
  padding: 10px 14px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--blue-dark);
  border: 1px solid var(--border);
  font-weight: 900;
  font-size: 0.84rem;
  box-shadow: 0 8px 18px rgba(16, 42, 86, 0.06);
}

.refinement-actions button:hover:not(:disabled) {
  background: var(--blue-soft);
  border-color: var(--blue);
}

.refinement-actions button:disabled {
  opacity: 0.55;
  cursor: wait;
}

@media print {
  .refinement-bar {
    display: none !important;
  }
}

@media (max-width: 560px) {
  .refinement-bar {
    padding: 18px 22px;
  }

  .refinement-actions {
    flex-direction: column;
  }

  .refinement-actions button {
    width: 100%;
  }
}
.history-card {
  margin-top: 28px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: 0 22px 60px rgba(16, 42, 86, 0.1);
  overflow: hidden;
}

.history-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  padding: 28px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #ffffff, #f8fbff);
}

.history-header h2 {
  margin: 0;
  color: var(--blue-dark);
  letter-spacing: -0.03em;
}

#clearHistoryButton {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-weight: 900;
  white-space: nowrap;
}

#clearHistoryButton:hover:not(:disabled) {
  background: #dcecff;
}

#clearHistoryButton:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.history-list {
  padding: 18px;
}

.history-list.empty {
  padding: 28px;
  color: var(--muted);
  line-height: 1.6;
}

.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  margin-bottom: 12px;
}

.history-item:last-child {
  margin-bottom: 0;
}

.history-item-main h3 {
  margin: 0 0 6px;
  color: var(--blue-dark);
  font-size: 1rem;
}

.history-item-main p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.history-item-main span {
  color: var(--muted);
  font-size: 0.82rem;
}

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

.history-actions button {
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-weight: 900;
  font-size: 0.82rem;
}

.history-actions button:hover {
  background: #dcecff;
}

.history-actions button[data-action="delete"] {
  background: #fff2f0;
  color: #b42318;
}

.history-actions button[data-action="delete"]:hover {
  background: #ffe1dd;
}

@media print {
  .history-card {
    display: none !important;
  }
}

@media (max-width: 720px) {
  .history-header,
  .history-item {
    grid-template-columns: 1fr;
  }

  .history-header {
    flex-direction: column;
  }

  .history-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .history-card {
    border-radius: 18px;
  }

  .history-header,
  .history-list {
    padding: 22px;
  }

  .history-item {
    padding: 16px;
  }

  .history-actions {
    flex-direction: column;
  }

  .history-actions button {
    width: 100%;
  }

  #clearHistoryButton {
    width: 100%;
  }
}
.feedback-box {
  padding: 24px 28px 28px;
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.feedback-box.hidden,
.feedback-comment-wrap.hidden {
  display: none;
}

.feedback-header h3 {
  margin: 0;
  color: var(--blue-dark);
  letter-spacing: -0.02em;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.feedback-actions button,
#submitFeedbackButton {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-weight: 900;
  font-size: 0.9rem;
}

.feedback-actions button:hover,
#submitFeedbackButton:hover {
  background: #dcecff;
}

.feedback-actions button.selected {
  background: var(--blue);
  color: #ffffff;
}

.feedback-comment-wrap {
  margin-top: 18px;
}

.feedback-comment-wrap label {
  display: block;
  color: var(--blue-dark);
  font-weight: 900;
}

.feedback-comment-wrap textarea {
  width: 100%;
  margin-top: 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 14px;
  font: inherit;
  color: var(--text);
  background: #fbfdff;
  resize: vertical;
}

.feedback-comment-wrap textarea:focus {
  outline: 3px solid rgba(31, 124, 255, 0.16);
  border-color: var(--blue);
}

#submitFeedbackButton {
  margin-top: 12px;
  background: var(--blue);
  color: #ffffff;
}

.feedback-message {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.feedback-message.success {
  color: #067647;
  font-weight: 800;
}

@media print {
  .feedback-box {
    display: none !important;
  }
}

@media (max-width: 560px) {
  .feedback-box {
    padding: 22px;
  }

  .feedback-actions {
    flex-direction: column;
  }

  .feedback-actions button,
  #submitFeedbackButton {
    width: 100%;
  }
}