:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #182033;
  --muted: #68748a;
  --line: #dce3ef;
  --primary: #203a5f;
  --primary-2: #426b9c;
  --accent: #e8f0fb;
  --shadow: 0 18px 45px rgba(23, 43, 77, 0.12);
  --radius: 22px;
}

* { box-sizing: border-box; }

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

.app-shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: 18px;
}

.hero {
  border-radius: 28px;
  padding: 22px;
  min-height: 270px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 20%, rgba(255,255,255,.24), transparent 28%),
    linear-gradient(135deg, #172a48 0%, #274d7f 52%, #6c8eb8 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 105px;
  background:
    linear-gradient(135deg, transparent 0 18%, rgba(255,255,255,.16) 18% 32%, transparent 32%),
    linear-gradient(25deg, rgba(255,255,255,.12) 0 22%, transparent 22%),
    linear-gradient(155deg, transparent 0 45%, rgba(255,255,255,.15) 45% 61%, transparent 61%);
  opacity: .9;
}

.topbar,
.hero-content {
  position: relative;
  z-index: 2;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: .2px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 12px;
}

.home-link {
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.32);
  background: rgba(255,255,255,.12);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 650;
}

.hero-content {
  margin-top: 46px;
  max-width: 760px;
}

.badge {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.22);
  font-size: .9rem;
  margin-bottom: 14px;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(2.2rem, 5vw, 4.3rem);
  line-height: .96;
}

h2 { margin: 0 0 8px; }
p { line-height: 1.55; }

main { padding: 20px 0 40px; }

.card,
.principle-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(23, 43, 77, 0.07);
}

.principle-card {
  padding: 22px;
  margin-bottom: 18px;
  border-left: 6px solid var(--primary-2);
}

.principle-card p { margin-bottom: 0; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(290px, .8fr);
  gap: 18px;
}

.card { padding: 22px; }

.section-title p,
.output-title p {
  margin: 0 0 18px;
  color: var(--muted);
}

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

label {
  display: block;
  font-weight: 700;
  color: #25324a;
  margin-bottom: 14px;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 400;
  color: var(--text);
  background: #fbfcff;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 4px rgba(66, 107, 156, .14);
}

textarea {
  min-height: 260px;
  resize: vertical;
  line-height: 1.5;
  font-weight: 400;
}

select {
  font-weight: 500;
}

input::placeholder,
textarea::placeholder {
  color: #9aa5b5;
  font-weight: 400;
}

.mode-help {
  border: 1px solid #d8e5f7;
  border-radius: 16px;
  padding: 14px 16px;
  background: #f3f7fd;
  margin: 2px 0 16px;
}

.mode-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.mode-help-grid div {
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.mode-help-grid strong {
  display: block;
  color: var(--primary);
  margin-bottom: 5px;
}

.mode-help-grid p {
  margin: 0;
  color: var(--muted);
  font-size: .94rem;
  line-height: 1.45;
}

.options {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: #fbfcff;
  margin-bottom: 16px;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

.checks {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.checks label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  font-weight: 600;
  color: var(--muted);
}

.checks input {
  width: auto;
  margin: 3px 0 0;
}

.actions,
.output-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

button {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

button:hover { transform: translateY(-1px); }

.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 12px 22px rgba(32, 58, 95, .22);
}

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

.small { padding: 9px 14px; }

.help-card ul {
  padding-left: 20px;
  line-height: 1.65;
  color: var(--muted);
}

.note-box {
  background: #f3f7fd;
  border: 1px solid #d8e5f7;
  border-radius: 18px;
  padding: 16px;
  margin-top: 18px;
}

.note-box p { margin-bottom: 0; color: var(--muted); }

.output-card { margin-top: 18px; }
#promptOutput { min-height: 340px; background: #f9fbff; }
.copy-status { min-height: 22px; margin-top: 10px; color: var(--primary-2); font-weight: 700; }

@media (max-width: 820px) {
  .app-shell { padding: 12px; }
  .grid,
  .form-row.two-cols,
  .mode-help-grid { grid-template-columns: 1fr; }
  .topbar,
  .actions,
  .output-title { align-items: flex-start; flex-direction: column; }
  .home-link { align-self: flex-start; }
  .hero { min-height: 310px; }
}

.data-status {
  border: 1px solid var(--line);
  background: #fbfcff;
  color: var(--muted);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-weight: 700;
  font-size: .94rem;
}

.data-status.ok {
  border-color: #b8d8c2;
  background: #f1fbf4;
  color: #28613a;
}

.data-status.warn {
  border-color: #ead7aa;
  background: #fff9ea;
  color: #806018;
}

.name-check-card {
  border: 1px solid #d8e5f7;
  border-radius: 16px;
  padding: 14px 16px;
  background: #f7faff;
  margin: -2px 0 16px;
}

.mini-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.mini-title span {
  color: var(--muted);
  font-size: .92rem;
  font-weight: 700;
}

.name-check-results {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.45;
}

.name-issue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.78);
  border-radius: 12px;
  padding: 9px 10px;
  margin-top: 7px;
}

.name-issue span:first-child {
  color: #9a4f19;
  font-weight: 800;
}

.name-issue strong {
  color: var(--primary);
}

.name-issue small {
  color: var(--muted);
  text-align: right;
}

.ok-text {
  color: #28613a;
  font-weight: 700;
}

code {
  background: rgba(32,58,95,.08);
  padding: 2px 5px;
  border-radius: 6px;
}

@media (max-width: 820px) {
  .mini-title { align-items: flex-start; flex-direction: column; }
  .name-issue { grid-template-columns: 1fr; }
  .name-issue small { text-align: left; }
}

.quick-check-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid #d8e5f7;
  background: #f7faff;
  border-radius: 16px;
  padding: 13px 15px;
  margin: -2px 0 16px;
  cursor: pointer;
}

.quick-check-option input {
  width: auto;
  margin: 4px 0 0;
  flex: 0 0 auto;
}

.quick-check-option span {
  display: grid;
  gap: 2px;
}

.quick-check-option strong {
  color: var(--primary);
}

.quick-check-option small {
  color: var(--muted);
  font-weight: 650;
  line-height: 1.35;
}

.name-issue-full {
  border-color: #c9d9ee;
  background: #fbfdff;
}

.compact-selects {
  margin-bottom: 2px;
}

.scope-hint {
  border: 1px solid var(--line);
  background: #fbfcff;
  color: var(--muted);
  border-radius: 14px;
  padding: 11px 13px;
  margin: -2px 0 16px;
  font-size: .94rem;
  font-weight: 650;
  line-height: 1.4;
}

.scope-hint.ok {
  border-color: #b8d8c2;
  background: #f1fbf4;
  color: #28613a;
}

.scope-hint.warn {
  border-color: #ead7aa;
  background: #fff9ea;
  color: #806018;
}
