:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --panel: #ffffff;
  --panel-soft: #f3f5f6;
  --text: #191b1d;
  --muted: #60666c;
  --faint: #8b9298;
  --border: #d9dee2;
  --border-strong: #b9c1c7;
  --accent: #125e5d;
  --accent-strong: #0c4746;
  --danger: #b3312c;
  --warning: #9a6500;
  --success: #217448;
  --info: #275da8;
  --shadow: 0 20px 50px rgba(35, 43, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(25, 27, 29, 0.08);
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 760;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--info));
}

.danger-mark {
  background: linear-gradient(135deg, var(--danger), var(--warning));
}

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.topnav a {
  text-decoration: none;
}

main {
  width: min(1080px, calc(100% - 36px));
  margin: 0 auto;
}

.intro {
  display: grid;
  gap: 10px;
  max-width: 780px;
  padding: 62px 0 28px;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(34px, 5.8vw, 58px);
  line-height: 1.04;
  letter-spacing: 0;
}

.lede {
  max-width: 690px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.workspace {
  overflow: hidden;
  margin: 22px 0 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-soft);
}

.tab,
.ghost,
.primary {
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.tab {
  min-height: 42px;
  background: transparent;
  color: var(--muted);
  font-weight: 720;
}

.tab.active {
  border-color: var(--border);
  background: var(--panel);
  color: var(--text);
}

.editor {
  padding: 22px;
}

.editor-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-size: 15px;
  font-weight: 760;
}

#mode-help,
.privacy-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: start;
}

.examples,
.option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

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

.ghost {
  min-height: 36px;
  padding: 0 12px;
  border-color: var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 680;
}

.example-btn {
  white-space: normal;
}

.option {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.25;
  padding: 8px 10px;
  text-align: center;
}

.option.active {
  border-color: var(--accent);
  background: #e9f3f2;
  color: var(--accent-strong);
}

.ghost:hover,
.tab:hover {
  border-color: var(--border-strong);
}

textarea {
  display: block;
  width: 100%;
  min-height: 238px;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  outline: none;
}

.textarea-label {
  margin-top: 16px;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 94, 93, 0.13);
}

.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
}

.input-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 8px;
  color: var(--faint);
  font-size: 12px;
}

.notice {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  padding: 11px 12px;
}

.primary {
  min-width: 142px;
  min-height: 46px;
  padding: 0 22px;
  background: var(--accent);
  color: #fff;
  font-weight: 760;
}

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

.primary:active {
  transform: translateY(1px);
}

.primary:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.status {
  min-height: 0;
  padding: 0 22px;
  color: var(--muted);
  font-size: 14px;
}

.status.visible {
  min-height: 48px;
  padding-bottom: 18px;
}

.status.error {
  color: var(--danger);
}

.results {
  display: none;
  padding: 0 22px 24px;
}

.results.visible {
  display: grid;
  gap: 16px;
}

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

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

.result-card,
.guidance article,
.privacy {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.result-card {
  padding: 18px;
}

.result-card.wide {
  grid-column: 1 / -1;
}

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

.verdict h2 {
  font-size: 20px;
}

.badge {
  flex: none;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.badge.low {
  background: #e8f5ee;
  color: var(--success);
}

.badge.medium {
  background: #fff2d9;
  color: var(--warning);
}

.badge.high {
  background: #ffe8e6;
  color: var(--danger);
}

.badge.critical {
  background: #2b1110;
  color: #fff;
}

.summary {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}

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

.item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--border);
}

.item:first-child {
  border-top: 0;
}

.dot {
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--warning);
}

.dot.danger {
  background: var(--danger);
}

.dot.info {
  background: var(--info);
}

.item-title {
  margin-bottom: 3px;
  font-weight: 760;
}

.item-detail,
.next-steps {
  color: var(--muted);
  line-height: 1.55;
}

.dot.critical {
  background: #2b1110;
}

.result-list,
.plain-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.result-list li,
.plain-list li {
  margin: 6px 0;
}

.copy-block {
  margin: 12px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  font: inherit;
  line-height: 1.55;
  padding: 13px;
}

.feedback {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.feedback h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.guidance {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 34px 0 18px;
}

.guidance article,
.privacy {
  padding: 22px;
}

.guidance h2,
.privacy h2 {
  margin-bottom: 10px;
  font-size: 20px;
}

.guidance p,
.privacy p {
  color: var(--muted);
  line-height: 1.6;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.link-row a {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
}

.privacy {
  margin: 18px 0 50px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px;
  border-top: 1px solid rgba(25, 27, 29, 0.08);
  color: var(--faint);
  font-size: 13px;
}

@media (max-width: 720px) {
  .topbar,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
    justify-content: space-between;
  }

  main {
    width: min(100% - 28px, 1080px);
  }

  .intro {
    padding-top: 38px;
  }

  .editor-head,
  .submit-row,
  .verdict {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    width: 100%;
  }

  .examples,
  .input-meta,
  .result-actions {
    flex-direction: column;
  }

  .option-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .ghost,
  .primary {
    width: 100%;
  }

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