:root {
  --yellow: #f6b900;
  --yellow-dark: #d79f00;
  --ink: #172235;
  --muted: #697586;
  --panel: #ffffff;
  --line: #e5e9f0;
  --soft: #fff7d8;
  --success: #087443;
  --danger: #b42318;
  --shadow: 0 18px 55px rgba(23, 34, 53, 0.11);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(246,185,0,.22), transparent 34%),
    linear-gradient(180deg, #fffdf7 0%, #f5f7fa 58%, #edf1f6 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, textarea { font: inherit; }

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

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 20px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--yellow);
  color: #111;
  font-size: 30px;
  font-weight: 900;
  box-shadow: 0 10px 25px rgba(246,185,0,.32);
}

h1 {
  margin: 0;
  font-size: clamp(31px, 5vw, 49px);
  line-height: 1;
  letter-spacing: -1.8px;
}

.subtitle {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.privacy-badge {
  padding: 11px 15px;
  border: 1px solid rgba(246,185,0,.52);
  border-radius: 999px;
  background: var(--soft);
  color: #624b00;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.model-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 0 0 16px;
  padding: 15px 18px;
  border: 1px solid rgba(246,185,0,.42);
  border-radius: 18px;
  background: rgba(255,249,224,.86);
}

.model-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.model-info strong { font-size: 14px; }
.model-info span { color: var(--muted); font-size: 12px; }

.progress-wrap {
  width: min(390px, 46%);
}

.progress-track {
  overflow: hidden;
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(23,34,53,.12);
}

.progress-bar {
  width: 2%;
  height: 100%;
  border-radius: inherit;
  background: var(--yellow);
  transition: width .2s ease;
}

#progressText {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

.editor-card {
  overflow: hidden;
  border: 1px solid rgba(229,233,240,.98);
  border-radius: 24px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
}

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

.label {
  font-size: 14px;
  font-weight: 900;
}

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

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

.engine-badge {
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef1f5;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.engine-badge.ai {
  background: #e7f8ef;
  color: var(--success);
}

.engine-badge.basic {
  background: var(--soft);
  color: #6a5000;
}

textarea {
  width: 100%;
  min-height: 225px;
  resize: vertical;
  border: 0;
  outline: 0;
  padding: 23px;
  color: var(--ink);
  background: transparent;
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.65;
}

textarea::placeholder { color: #a1aab6; }

.text-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.ghost-btn, .primary-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  transition: transform .15s ease, opacity .15s ease;
}

.ghost-btn {
  background: #f0f3f7;
  color: var(--ink);
}

.ghost-btn.danger { color: var(--danger); }

.primary-btn {
  background: var(--yellow);
  color: #111;
  box-shadow: 0 8px 18px rgba(246,185,0,.25);
}

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

.ghost-btn:hover, .primary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.flow-arrow {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  margin: 12px auto;
  border-radius: 50%;
  background: var(--yellow);
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(246,185,0,.25);
}

.result-card { border-color: rgba(246,185,0,.43); }

.output {
  min-height: 190px;
  padding: 23px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.65;
}

.output.empty { color: #9aa3af; }

.copy-message {
  min-height: 24px;
  padding: 0 23px 15px;
  color: var(--success);
  font-size: 12px;
  font-weight: 900;
}

.note-card {
  margin-top: 17px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255,255,255,.72);
}

.note-card strong { font-size: 13px; }
.note-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

footer {
  padding: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 740px) {
  .app-shell { padding-top: 27px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .privacy-badge { white-space: normal; }
  .model-panel { align-items: stretch; flex-direction: column; }
  .progress-wrap { width: 100%; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; flex-wrap: wrap; }
  .primary-btn { margin-left: auto; }
  .text-meta { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
