:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1f2430;
  --text: #f5f7fb;
  --muted: #98a2b3;
  --primary: #ff5c8a;
  --primary-2: #ff7aa2;
  --border: rgba(255,255,255,0.08);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  background: linear-gradient(180deg, #0b0d12 0%, #121722 100%);
  color: var(--text);
  overflow: hidden;
}
.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px;
}
.app.compact { max-width: 1180px; }
.app-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.hero {
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex: 0 0 auto;
}
.hero.single-line { align-items: center; }
.hero h1 { font-size: 24px; margin: 2px 0 0; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow {
  color: var(--primary-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
}
.sub, .mini, label, .hint { color: var(--muted); }
.panel {
  background: rgba(23, 26, 33, 0.92);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  backdrop-filter: blur(12px);
}
label {
  display: block;
  margin: 10px 0 6px;
  font-size: 13px;
}
textarea, input, select {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
textarea { resize: vertical; }
.actions, .toolbar-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.actions { margin-top: 12px; }
button {
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.2;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
.primary { background: var(--primary); color: white; }
.secondary { background: #2a3140; color: white; }
.ghost {
  background: transparent;
  color: #c9d2e3;
  border: 1px solid var(--border);
}
.hidden { display: none !important; }
.output-panel.full-width {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  flex: 0 0 auto;
}
.title-row h2 {
  font-size: 18px;
  margin: 0;
}
.toolbar-row {
  align-items: center;
  margin-bottom: 10px;
  flex: 0 0 auto;
}
.content-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}
.char-corner {
  font-size: 11px;
  color: var(--muted);
}
.char-corner.in-content {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  pointer-events: none;
}
.content {
  white-space: pre-wrap;
  background: #0f131b;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  line-height: 1.68;
  overflow: auto;
  font-size: 13px;
}
.shell-main { min-height: 0; }
.shell-content {
  width: 100%;
  height: calc(100vh - 205px);
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 18, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.hidden { display: none; }
.modal-card {
  width: min(680px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #171a21;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
}
.modal-card.large { width: min(860px, 100%); }
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
@media (max-width: 900px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100vh; }
  .hero { flex-direction: column; }
  .shell-content { height: 62vh; }
}
