@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');
:root {
  color-scheme: dark;
  --bg: #141223;
  --panel: #201b31;
  --raised: #29223c;
  --field: #181527;
  --line: #433753;
  --text: #fbf4ed;
  --muted: #c8bdd7;
  --accent: #b6efdb;
  --accent-ink: #162b27;
  --gold: #f9d5a0;
  --rose: #ffb2b3;
  --display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
}
*, ::before, ::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(ellipse at 68% -8%, #372343 0%, transparent 45rem), var(--bg);
  font: 400 16px/1.5 var(--body);
}
body { padding-bottom: env(safe-area-inset-bottom); }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, .file-button, summary { touch-action: manipulation; }
select { appearance: none; padding-right: 2.25rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23c8bdd7' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; }
.frame { width: min(100% - 2.5rem, 1180px); margin-inline: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, .file-button {
  min-height: 44px;
  padding: .55rem .9rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--raised);
  cursor: pointer;
}
button, .file-button { font-weight: 600; }
button:hover, .file-button:hover { background: #3b2c50; border-color: #827095; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible, .file-button:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.primary:hover { background: #d4f6e9; border-color: #d4f6e9; }
.secondary { border-color: #679f91; color: var(--accent); }
.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.danger { color: var(--rose); }
.topbar { border-bottom: 1px solid var(--line); background: #181526; }
.topbar-inner, .topbar-tools, .project-control { display: flex; gap: .7rem; align-items: center; }
.topbar-inner { min-height: 78px; justify-content: space-between; padding-block: .7rem; }
.topbar-tools { justify-content: flex-end; flex-wrap: wrap; }
.project-control { min-width: 0; color: var(--muted); font-size: .9rem; }
.project-control select { max-width: min(31vw, 280px); color: var(--text); font-size: 1rem; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font: 700 1.9rem/1 var(--display);
  letter-spacing: -.055em;
}
.brand:hover { color: var(--accent); }
.brand-mark { width: 40px; height: 40px; flex: none; object-fit: contain; border-radius: 9px; }
.brand-wordmark { transform: translateY(2px); }
main { padding-block: 1.35rem 2rem; }
.notice { margin: 0 0 1rem; border: 1px solid var(--line); padding: .65rem .85rem; border-radius: 8px; background: var(--panel); color: var(--muted); }
.notice[data-error="true"] { color: var(--rose); }
h1, h2 { font: 600 clamp(1.38rem, 2.4vw, 1.8rem)/1.1 var(--display); margin: 0; letter-spacing: -.035em; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.6rem, 6.5vw, 5.1rem); font-weight: 700; line-height: .98; letter-spacing: -.055em; }
p { margin: .6rem 0 0; }
.welcome { padding-block: clamp(1rem, 5vw, 4rem); }
.welcome > p, .starter p { color: var(--muted); }
.saved-projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: .65rem;
  margin: 1.35rem 0 0;
  padding: 0;
  list-style: none;
}
.saved-project {
  position: relative;
  display: grid;
  gap: .1rem;
  width: 100%;
  height: 100%;
  padding: .85rem 2.5rem .85rem .95rem;
  text-align: left;
  background: var(--panel);
  overflow-wrap: anywhere;
}
.saved-project::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: calc(50% - 5px);
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  transform: rotate(45deg);
}
.saved-project-date { color: var(--muted); font-size: .875rem; font-weight: 400; }
.saved-project-kind { color: var(--accent); font-size: .875rem; font-weight: 400; }
.progress-summary { display: grid; min-width: 0; gap: .4rem; font-weight: 400; }
.saved-project .progress-summary { margin-top: .65rem; }
.progress-ready { font-weight: 600; font-size: .95rem; }
.progress-details { color: var(--muted); font-size: .875rem; }
.progress-track { display: flex; width: 100%; height: 8px; border-radius: 6px; overflow: hidden; background: #443650; }
.progress-segment { display: block; height: 100%; }
.progress-segment[data-status="In progress"] { background: #947bb8; }
.progress-segment[data-status="Needs revision"] { background: var(--gold); }
.progress-segment[data-status="Ready for export"] { background: var(--accent); }
.project-progress { display: flex; align-items: center; gap: 1rem; padding: .9rem 1rem; margin-top: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.progress-heading { font-weight: 600; font-size: 1rem; }
.project-progress .progress-summary { flex: 1; grid-template-columns: auto minmax(60px, 1fr) auto; align-items: center; gap: 1rem; }
.starter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; margin-top: 1.5rem; }
.starter { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); }
.blank-starter { grid-column: 1 / -1; flex-direction: row; }
.blank-starter .starter-art { width: min(30%, 220px); height: auto; min-height: 180px; flex: none; }
.blank-starter .starter-content { justify-content: center; }
.starter-art {
  display: grid;
  place-items: center;
  width: 100%;
  height: clamp(150px, 23vw, 245px);
  object-fit: cover;
  background: radial-gradient(ellipse at 60% 110%, #65547e, transparent 72%), #27203c;
}
.sample-starter .starter-art { height: auto; aspect-ratio: 16 / 10; }
.blank-starter .starter-art {
  background-image: repeating-linear-gradient(0deg, transparent 0 31px, #d2b8e01e 31px 32px), repeating-linear-gradient(90deg, transparent 0 31px, #d2b8e01e 31px 32px), radial-gradient(ellipse at 63% 92%, #6a527e, transparent 74%);
}
.blank-sheets {
  position: relative;
  width: 112px;
  height: 80px;
  border: 1px solid #dbd5fc89;
  border-radius: 8px;
  background: #55456c;
  transform: translate(7px, 6px) rotate(10deg);
}
.blank-sheets::before {
  content: "";
  position: absolute;
  inset: -12px 12px 8px -12px;
  border: 1px solid #b6efdbac;
  border-radius: 8px;
  background: linear-gradient(135deg, #6c8e91, #443755 68%);
  transform: rotate(-18deg);
}
.starter-content { display: flex; flex-direction: column; align-items: flex-start; gap: .7rem; flex: 1; padding: 1.2rem; }
.starter-content p { margin: 0 0 .4rem; flex: 1; }
.project-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: end;
  min-height: 265px;
  border: 1px solid #68547d;
  border-radius: 20px;
  background: radial-gradient(ellipse at 73% 125%, #8b5272, transparent 64%), #251c37;
}
.project-hero img { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.project-hero::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(84deg, #16122ae8, #1c142788 57%, transparent), linear-gradient(0deg, #151124bd, transparent 73%); }
.hero-content { padding: clamp(1.15rem, 4vw, 2.4rem); }
.hero-content h1 { max-width: 20ch; text-shadow: 0 2px 15px #241b3b; }
.hero-content > p { max-width: 60ch; color: #f1e4f6; overflow-wrap: anywhere; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1rem; }
.hero-actions button { background: #221a35df; border-color: #827095; }
.save-status { color: var(--muted); font-size: .88rem; }
.save-status[data-error="true"] { color: var(--rose); }
.workspace-controls {
  display: flex;
  gap: .5rem 1rem;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  margin-block: 1.15rem;
}
#section-nav, .download-controls, .section-actions { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
#section-nav button { background: transparent; border-color: transparent; color: var(--muted); }
#section-nav button[aria-current="page"] { color: var(--accent); background: #25352f; border-color: #4b7164; }
#section-nav button:hover { color: var(--text); border-color: var(--line); }
.project-panel { border: 1px solid var(--line); border-radius: 16px; padding: clamp(.85rem, 2.5vw, 1.5rem); background: #1c182c; }
.section-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.section-summary { margin-top: .32rem; color: var(--muted); font-size: .9rem; }
.project-search { display: grid; gap: .35rem; margin-bottom: 1.1rem; }
.project-search > label { color: var(--muted); font-weight: 600; font-size: .9rem; }
.search-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; width: min(100%, 660px); }
.search-controls input { flex: 1 1 240px; width: 100%; min-width: 0; min-height: 44px; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--field); font-size: 1rem; }
.search-result-group h3 { margin: 0 0 .7rem; font: 600 1.15rem/1.3 var(--display); }
.search-result-group + .search-result-group { margin-top: 1.5rem; }
.scene-view-controls { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.scene-view-controls button[aria-pressed="true"] { color: var(--accent); border-color: #4b7164; background: #25352f; }
.storyboard-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); }
.storyboard-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.storyboard-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; padding: .75rem; }
.storyboard-number { font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }
.storyboard-card > img, .storyboard-placeholder { display: block; width: 100%; aspect-ratio: 3/2; object-fit: contain; background: var(--field); }
.storyboard-placeholder { display: grid; place-items: center; color: var(--muted); }
.storyboard-content { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: .8rem; padding: 1rem; }
.storyboard-content h3 { margin: 0; font: 600 1.2rem/1.25 var(--display); overflow-wrap: anywhere; }
.storyboard-story { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1rem; line-height: 1.65; }
.storyboard-story.is-empty, .storyboard-characters, .storyboard-notes { color: var(--muted); }
.storyboard-characters { margin: 0; font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.storyboard-notes { width: 100%; font-size: .9rem; }
.storyboard-notes p { white-space: pre-wrap; overflow-wrap: anywhere; }
.storyboard-content > button { margin-top: auto; }
.entries-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.asset-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  text-align: left;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  border-radius: 12px;
  background: var(--panel);
}
.asset-card img, .card-placeholder { display: block; width: 100%; aspect-ratio: 3/2; object-fit: cover; background: #2d2344; }
.card-placeholder { background: radial-gradient(ellipse at 72% 80%, #6a4968, transparent 72%), repeating-linear-gradient(135deg, #d9b6df14 0 1px, transparent 1px 16px), #2d2344; }
.card-content { display: grid; gap: .48rem; padding: .75rem .85rem .9rem; }
.card-name { font-size: 1.05rem; overflow-wrap: anywhere; }
.status-tag { width: fit-content; padding: .16rem .5rem; border-radius: 5px; color: #ebd9fa; background: #3a2b50; font-size: .875rem; }
[data-status="Needs revision"] { color: #ffe2c3; background-color: #493440; }
[data-status="Ready for export"] { color: #c6f7df; background-color: #293f38; }
.card-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .89rem; line-height: 1.4; font-weight: 400; color: var(--muted); }
.empty-state { border: 1px dashed var(--line); border-radius: 12px; padding: clamp(1.25rem, 4vw, 2.5rem); color: var(--muted); text-align: center; }
.empty-state p { margin: 0; }
.check-row { display: flex; gap: .72rem; min-height: 45px; align-items: center; padding: .6rem 0; border-top: 1px solid var(--line); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 19px; height: 19px; flex: none; }
.workspace-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .7rem; align-items: start; margin-top: 1.2rem; color: var(--muted); font-size: .9rem; }
.workspace-footer details { flex: 1 1 250px; }
.workspace-footer summary { cursor: pointer; padding-block: .55rem; }
.workspace-footer p { max-width: 72ch; margin-top: 0; }
dialog {
  border: 1px solid #75628a;
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
  width: min(calc(100% - 1.5rem), 560px);
  max-height: 92dvh;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
dialog::backdrop { background: #100d20c9; }
.entry-dialog { width: min(calc(100% - 1.5rem), 780px); }
.help-dialog { width: min(calc(100% - 1.5rem), 720px); }
.help-dialog .dialog-heading { position: sticky; top: -.1rem; z-index: 2; padding-block: .4rem; background: var(--panel); }
.help-intro { color: var(--muted); }
.help-section { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.help-section h3 { margin: 0; font: 600 1.15rem/1.3 var(--display); }
.help-section p, .help-downloads { font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.help-downloads { margin-block: .7rem; }
.help-downloads dt { font-weight: 600; color: var(--accent); }
.help-downloads dd { margin: .2rem 0 .8rem; }
.dialog-content { padding: clamp(.95rem, 3vw, 1.5rem); }
.dialog-heading, .dialog-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem; }
.dialog-heading { margin-bottom: .8rem; }
.entry-dialog .dialog-heading { position: sticky; top: -.1rem; z-index: 2; padding-block: .4rem; background: var(--panel); }
.cloud-list { display: grid; gap: .75rem; margin-block: 1rem; }
.cloud-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .8rem; border: 1px solid var(--line); border-radius: 10px; }
.cloud-row > div { flex: 1 1 100%; min-width: 0; overflow-wrap: anywhere; }
.cloud-row p { color: var(--muted); font-size: .875rem; }
#cloud-current-name { font-weight: 600; overflow-wrap: anywhere; }
#cloud-status[data-error="true"] { color: var(--rose); }
a { color: var(--accent); }
@media (max-width: 1050px) {
  .topbar-inner { flex-direction: column; align-items: flex-start; }
  .topbar-tools { width: 100%; justify-content: flex-start; }
  .project-control { flex: 1 1 100%; }
  .project-control select { max-width: none; flex: 1; }
}
.dialog-actions { margin-top: 1rem; }
.dialog-actions p { margin: 0; }
.field { display: grid; gap: .32rem; margin: .7rem 0; color: var(--muted); font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #5c4d71;
  border-radius: 8px;
  padding: .6rem .7rem;
  background: var(--field);
  color: var(--text);
  font: 400 1rem/1.5 var(--body);
}
.field textarea { min-height: 82px; resize: vertical; }
.field input[type="color"] { max-width: 96px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .45rem .7rem; }
legend { color: var(--muted); }
.choice { display: flex; min-height: 44px; align-items: center; gap: .55rem; }
.banner-preview, .view-preview { background: radial-gradient(ellipse at 70% 115%, #74537d, transparent 72%), var(--field); border: 1px solid var(--line); overflow: hidden; border-radius: 8px; }
.banner-preview { aspect-ratio: 3 / 1; }
.banner-preview img, .view-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.views { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-block: 1rem; }
.view { min-width: 0; padding: .58rem; border: 1px solid var(--line); border-radius: 10px; }
.view h3 { margin: 0 0 .4rem; font-size: .96rem; }
.view-preview { display: grid; place-items: center; aspect-ratio: 3/2; text-align: center; color: var(--muted); }
.view-preview img { object-fit: contain; }
.image-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .45rem; }
.file-button { position: relative; display: inline-flex; align-items: center; }
.file-button input { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; }
.field-message { margin: .35rem 0 0; color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.field-message:empty { display: none; }
@media (max-width: 670px) {
  .frame { width: calc(100% - 1.35rem); }
  .topbar-inner { align-items: flex-start; flex-direction: column; gap: .75rem; }
  .topbar-tools { justify-content: flex-start; width: 100%; }
  .project-control { flex-basis: 100%; }
  .project-control select { flex: 1; max-width: unset; }
  .project-progress { align-items: stretch; flex-direction: column; gap: .5rem; }
  .project-progress .progress-summary { grid-template-columns: 1fr; gap: .45rem; }
  .starter-grid { grid-template-columns: 1fr; }
  .blank-starter { flex-direction: column; }
  .blank-starter .starter-art { width: 100%; height: 150px; min-height: 150px; }
  .project-hero { min-height: 225px; }
  .workspace-controls { margin-block: .75rem; }
  #section-nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-block: .25rem; }
  #section-nav button { white-space: nowrap; flex: none; }
  #section-nav button { padding-inline: .53rem; font-size: .92rem; }
}
@media (max-width: 370px) {
  .views { grid-template-columns: 1fr; }
}

@media (display-mode: standalone) {
  #install-andara { display: none; }
}
.project-palette { margin-bottom: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.palette-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .65rem; }
.palette-heading h3 { font: 600 1.25rem/1.2 var(--display); margin: 0; }
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 165px), 1fr)); gap: .65rem; }
.palette-card { min-width: 0; padding: .65rem; background: var(--field); border: 1px solid var(--line); border-radius: 8px; }
.palette-card input[type="color"] { width: 100%; min-height: 52px; padding: .18rem; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: pointer; }
.palette-card .field { font-size: .88rem; margin-block: .45rem; }
.palette-card button { padding-inline: .25rem; }
.palette-card [aria-invalid="true"] { border-color: var(--rose); }
