:root {
  color-scheme: dark;
  --bg: #0c1114;
  --panel: rgba(11, 24, 31, 0.9);
  --panel-border: rgba(150, 220, 211, 0.16);
  --accent: #9ef0d0;
  --accent-strong: #5fd2c3;
  --text: #eef7f5;
  --muted: #9fb4b4;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  --prompter-size: 56px;
  --text-block-width: 800px;
  --prompter-font-family: "Avenir Next", "Segoe UI Variable Display", "Trebuchet MS", sans-serif;
  --prompter-font-weight: 600;
  --prompter-letter-spacing: -0.03em;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--prompter-font-family);
  background:
    radial-gradient(circle at top left, rgba(95, 210, 195, 0.18), transparent 28%),
    radial-gradient(circle at right, rgba(255, 174, 96, 0.14), transparent 24%),
    linear-gradient(160deg, #071014 0%, #102129 52%, #091419 100%);
  color: var(--text);
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  min-height: 100vh;
  padding: 24px;
  align-items: stretch;
  max-width: 1600px;
  margin: 0 auto;
}

.app-shell:fullscreen {
  max-width: none;
  min-height: 100vh;
  height: 100vh;
  padding: 0;
  gap: 0;
  grid-template-rows: minmax(0, 1fr);
  background:
    radial-gradient(circle at top left, rgba(95, 210, 195, 0.18), transparent 28%),
    radial-gradient(circle at right, rgba(255, 174, 96, 0.14), transparent 24%),
    linear-gradient(160deg, #071014 0%, #102129 52%, #091419 100%);
}

.app-shell:fullscreen .controls-panel {
  display: none;
}

.app-shell:fullscreen .prompter-panel {
  height: auto !important;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.app-shell:fullscreen .prompter-header {
  display: none;
}

.app-shell:fullscreen .prompter-frame {
  border: 0;
  border-radius: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.controls-panel {
  display: flex;
  flex-direction: column;
  padding: 28px;
  min-width: 0;
}

.panel-header-wide {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.panel-header h1 {
  margin: 8px 0 12px;
  font-size: clamp(2rem, 3vw, 3.25rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel-copy {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.5;
}

.brand-logo {
  display: block;
  width: min(260px, 48vw);
  height: auto;
  margin: 0 0 16px;
  object-fit: contain;
}

.display-tools {
  display: grid;
  justify-items: end;
  gap: 10px;
  min-width: 220px;
}

.helper-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.controls-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 20px;
}

.editor-column,
.settings-column {
  min-width: 0;
}

.field-label {
  margin-bottom: 10px;
  font-weight: 700;
  display: inline-block;
}

textarea {
  width: 100%;
  min-height: 290px;
  padding: 18px;
  border: 1px solid rgba(158, 240, 208, 0.18);
  border-radius: 22px;
  background: rgba(5, 14, 18, 0.72);
  color: var(--text);
  font: inherit;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}

textarea:focus {
  border-color: rgba(158, 240, 208, 0.55);
  box-shadow: 0 0 0 4px rgba(158, 240, 208, 0.08);
}

.controls-grid {
  display: grid;
  gap: 16px;
}

.control-card {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
}

.control-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-strong);
}

.button-row {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.action-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
}

.action-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
}

.action-button.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #062127;
}

.shortcut-card {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
}

.shortcut-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 800;
}

.shortcut-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.shortcut-copy span {
  display: inline-block;
  margin: 0 8px;
  color: rgba(255, 255, 255, 0.2);
}

kbd {
  display: inline-block;
  min-width: 2ch;
  padding: 3px 8px;
  border: 1px solid rgba(158, 240, 208, 0.18);
  border-radius: 8px;
  background: rgba(5, 14, 18, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.prompter-panel {
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow: hidden;
  position: static;
  height: min(62vh, 760px);
  min-height: 420px;
}

.prompter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 18px;
}

.status-pill {
  margin: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.prompter-frame {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(7, 17, 21, 0.98) 0%, rgba(12, 27, 33, 0.96) 100%);
  border: 1px solid rgba(158, 240, 208, 0.1);
}

.focus-guide {
  display: none;
}

.prompter-output {
  height: 100%;
  min-height: 0;
  width: var(--text-block-width);
  max-width: calc(100% - 48px);
  margin: 0 auto;
  overflow-y: auto;
  padding: 40vh 0;
  font-family: var(--prompter-font-family);
  font-size: var(--prompter-size);
  line-height: 1.45;
  font-weight: var(--prompter-font-weight);
  letter-spacing: var(--prompter-letter-spacing);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-synthesis-weight: none;
  scrollbar-width: none;
  white-space: normal;
}

.prompter-output.mirrored {
  transform: scaleX(-1);
}

.prompter-output::-webkit-scrollbar {
  display: none;
}

.prompter-output p {
  margin: 0 0 1.2em;
}

@media (max-width: 980px) {
  .app-shell {
    min-height: auto;
  }

  .panel-header-wide,
  .controls-layout {
    grid-template-columns: 1fr;
    display: grid;
  }

  .controls-panel {
    padding: 22px;
  }

  .display-tools {
    justify-items: start;
  }

  .prompter-panel {
    height: 55vh;
    min-height: 360px;
  }
}
