@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,600;1,600&display=swap');

:root {
  --bg: #101820;
  --panel: #182630;
  --line: #30414b;
  --text: #f1f4f2;
  --muted: #9aaab0;
  --lime: #c7f36b;
  --orange: #ff986b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at 85% 5%, #263c43 0, transparent 30%), var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
}

.shell { max-width: 760px; margin: auto; padding: 20px 18px 60px; }

header, .brand, .sectionHead, .two {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand { justify-content: flex-start; }

.mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--lime);
  color: #142018;
  border-radius: 13px;
  font-weight: 800;
  font-size: 23px;
}

.brand b { letter-spacing: 2px; }

.brand small {
  display: block;
  font: 9px 'DM Mono';
  color: var(--muted);
  letter-spacing: 1px;
  margin-top: 3px;
}

.panel {
  background: linear-gradient(145deg, #1c2d36, #16242d);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  margin-top: 22px;
  box-shadow: 0 18px 50px #0002;
}

.login { max-width: 480px; margin: 12vh auto; }

.eyebrow {
  font: 10px 'DM Mono';
  letter-spacing: 2px;
  color: var(--lime);
}

h1 {
  font-size: clamp(38px, 9vw, 64px);
  line-height: .98;
  letter-spacing: -2px;
  margin: 12px 0;
}

h1 em {
  font-family: 'Playfair Display';
  color: var(--lime);
}

h2 { font-size: 25px; margin: 5px 0 16px; }

.muted { color: var(--muted); line-height: 1.55; }

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 45px 4px 25px;
}

.orb {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--lime);
  color: #16242d;
  font-size: 48px;
  box-shadow: 0 0 55px #c7f36b35;
}

.sectionHead { margin-bottom: 14px; }

label {
  display: block;
  font-size: 12px;
  color: #c9d4d6;
  margin: 14px 0;
}

input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  background: #0f1a21;
  border: 1px solid #3a4d57;
  border-radius: 12px;
  padding: 14px;
  color: var(--text);
  font: 14px 'DM Sans';
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--lime);
}

.two > * { width: 50%; }

.primary {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--lime);
  color: #142018;
  padding: 15px;
  font-weight: 700;
  font-size: 14px;
  margin-top: 12px;
}

.ghost, .close {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 13px;
  border-radius: 10px;
}

.error { color: #ff9c8b; font-size: 12px; }

.projects { margin-top: 32px; }

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

.project {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #172630;
  border-radius: 14px;
}

.projectInfo { min-width: 0; flex: 1; }
.project b { display: block; overflow-wrap: anywhere; }
.project small { color: var(--muted); }

.projectActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.project button {
  background: #2b3c44;
  color: var(--lime);
  border: 0;
  border-radius: 9px;
  padding: 10px;
  font: 12px 'DM Sans';
}

.project button.subtleAction {
  background: #23343d;
  color: #d6e0e1;
}

.project button.deleteAction {
  background: #40272a;
  color: #ffaaa4;
}

.foot, .tiny {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 25px;
}

.hidden { display: none !important; }

.modal {
  position: fixed;
  inset: 0;
  background: #000b;
  display: grid;
  place-items: end center;
  padding: 12px;
}

.modalCard {
  width: min(100%, 720px);
  max-height: 92vh;
  overflow: auto;
  background: #182630;
  border: 1px solid var(--line);
  border-radius: 22px 22px 12px 12px;
  padding: 22px;
  position: relative;
}

.close { position: absolute; right: 18px; top: 18px; }

.scene {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 9px;
}

.scene p {
  font-size: 13px;
  color: var(--muted);
  white-space: pre-wrap;
}

.sceneHead {
  display: flex;
  justify-content: space-between;
  color: var(--lime);
  font: 10px 'DM Mono';
}

@media (min-width: 600px) {
  .modal { place-items: center; }
  .modalCard { border-radius: 22px; }
  }
  

.modeSwitch {
  display: flex;
  gap: 8px;
  padding: 5px;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #101b22;
}

.modeTab {
  flex: 1;
  border: 0;
  border-radius: 9px;
  padding: 11px 8px;
  background: transparent;
  color: var(--muted);
  font: 600 12px 'DM Sans';
}

.modeTab.active {
  background: var(--lime);
  color: #142018;
}

.sceneListHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
}

.sceneListHead h3 {
  margin: 0;
  font-size: 17px;
}

#breakdownScript:disabled {
  opacity: .65;
}

#breakdownNote {
  line-height: 1.5;
}

.scene {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-top: 12px;
  background: #14232b;
}

.scene label {
  margin: 12px 0;
  font-size: 11px;
  color: #d4dfe0;
}

.scene textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

.scene .sceneVisual {
  border-color: #536d58;
}

.sceneActions {
  display: flex;
  gap: 9px;
  margin-top: 12px;
}

.sceneActions button {
  flex: 1;
  border: 0;
  border-radius: 10px;
  padding: 12px 10px;
  font: 600 12px 'DM Sans';
}

.saveScene {
  background: var(--lime);
  color: #142018;
}

.removeScene {
  background: #40272a;
  color: #ffaaa4;
}

@media (max-width: 420px) {
  .sceneActions {
    flex-direction: column;
  }
}

.scene .draftVisual {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  background: #23343d;
  color: var(--lime);
  font: 600 12px 'DM Sans';
  margin-top: 2px;
}

.characterPanel {
  margin: 18px 0 22px;
  padding: 15px;
  background: #13232b;
  border: 1px solid var(--line);
  border-radius: 15px;
}
.characterPanelHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.characterPanelHead h3 {
  margin: 4px 0 6px;
  font-size: 17px;
}
.characterPanelHead .muted {
  margin: 0;
  font-size: 12px;
}
.characterPanelHead .tiny {
  white-space: nowrap;
  margin: 8px 0 0;
}
.characterAdd, .characterCard {
  margin-top: 13px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #192b34;
}
.characterAdd h4 {
  margin: 0 0 8px;
  font-size: 14px;
}
.characterCardHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--lime);
  font: 11px 'DM Mono';
}
.characterCardHead b {
  color: var(--text);
  font: 600 14px 'DM Sans';
}
.characterPanel .tiny.characterEmpty {
  margin: 12px 0 4px;
}
.sceneCharacterPicker {
  margin: 14px 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #102029;
}
.fieldCaption {
  display: block;
  margin-bottom: 8px;
  color: #d4dfe0;
  font-size: 11px;
}
.characterChoice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 4px 12px 4px 0;
  font-size: 12px;
}
.characterChoice input {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--lime);
}
.characterChoice span {
  color: var(--text);
}
