@import url("/editor.css");
:root {
  --bg: #13131b;
  --panel: #1b1b26;
  --raised: #23232f;
  --line: #30303e;
  --text: #f0edf6;
  --muted: #a4a0b3;
  --accent: #c7a6fc;
  --accent-bg: #342943;
  --gold: #e3be86;
  --bad: #f1999f;
  --good: #9bd4bb;
  --radius: 14px;
  color-scheme: dark;
  font:
    14px/1.5 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
[hidden] {
  display: none !important;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
.button {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 14px;
  background: var(--raised);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover,
.button:hover {
  background: #343340;
  border-color: #595265;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #24182e;
  font-weight: 650;
}
.primary:hover {
  background: #dac5fb;
  border-color: #dac5fb;
}
.danger {
  color: var(--bad);
}
.ghost {
  background: transparent;
}
.icon-button {
  padding: 6px 10px;
  background: transparent;
}
.small {
  padding: 5px 9px;
  font-size: 12px;
}
.muted,
small {
  color: var(--muted);
}
small {
  font-size: 12px;
}
a {
  color: var(--accent);
}
h1,
h2,
h3,
p {
  margin: 0 0 12px;
}
h1 {
  font:
    normal 40px/1.18 Georgia,
    serif;
  letter-spacing: -1px;
}
h2 {
  font-size: 21px;
  line-height: 1.25;
}
h3 {
  font-size: 15px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 15px;
}
input,
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  color: var(--text);
  background: #15151e;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}
textarea {
  resize: vertical;
  line-height: 1.65;
  min-height: 90px;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #c7a6fc18;
}
input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}
input[type="range"] {
  padding: 0;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.row.spread {
  justify-content: space-between;
}
.stack > * + * {
  margin-top: 16px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--accent);
}
.pill {
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 3px 8px;
  color: var(--muted);
  white-space: nowrap;
}
.error {
  color: var(--bad);
  white-space: pre-wrap;
}
.empty {
  text-align: center;
  padding: 64px 22px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty h2 {
  color: var(--text);
  font-family: Georgia, serif;
  font-weight: 400;
}
.empty p {
  max-width: 440px;
  margin: 12px auto 24px;
}
.loading {
  padding: 80px;
  text-align: center;
  color: var(--muted);
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}
.card-title h2,
.card-title h3 {
  margin: 0;
}
.section-gap {
  margin-top: 28px;
}
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-art {
  padding: 10vh 9vw;
  background:
    radial-gradient(ellipse at 30% 10%, #383044, transparent 60%), #1e1c29;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-art h1 {
  font-size: clamp(45px, 5.5vw, 86px);
  margin: 45px 0;
  z-index: 1;
}
.login-art em {
  color: var(--accent);
  font-weight: 400;
}
.login-art p {
  color: #c3bbce;
  z-index: 1;
}
.orbit {
  position: absolute;
  width: 400px;
  height: 400px;
  border: 1px solid #685574;
  border-radius: 50%;
  bottom: -160px;
  right: -40px;
  box-shadow:
    0 0 0 50px #34283b,
    0 0 0 51px #594a64,
    0 0 0 100px #2b2332,
    0 0 0 101px #473b53;
}
.login-form {
  width: min(380px, calc(100% - 40px));
  margin: auto;
}
.login-form h2 {
  font:
    30px Georgia,
    serif;
  margin-top: 22px;
}
.login-form label {
  margin-top: 20px;
}
.login-form button {
  width: 100%;
  justify-content: space-between;
  margin: 12px 0 24px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 230px;
  padding: 30px 18px 18px;
  background: #181820;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  margin: 0 8px 38px;
}
.brand span {
  font:
    31px Georgia,
    serif;
  letter-spacing: -1px;
}
.brand small {
  display: block;
  font: 8px system-ui;
  letter-spacing: 1.8px;
  margin-top: 3px;
  color: var(--muted);
}
.sidebar button,
.sidebar-bottom a {
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 10px 12px;
}
.sidebar button:hover,
.sidebar-bottom a:hover {
  color: var(--text);
  background: var(--raised);
}
.sidebar button.active {
  background: var(--accent-bg);
  color: var(--accent);
}
.library-link {
  margin-bottom: 18px;
}
.nav-project-title {
  margin: 20px 12px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
}
.sidebar-bottom {
  margin-top: auto;
}
.sidebar-bottom a {
  display: flex;
  gap: 10px;
  text-decoration: none;
  font-size: 13px;
}
.sidebar-bottom b {
  margin-left: auto;
  font-size: 10px;
  background: var(--raised);
  border-radius: 20px;
  padding: 0 6px;
}
.account {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 14px;
  font-size: 12px;
}
.account > span {
  flex: 1;
  padding-left: 12px;
}
.account button {
  width: auto;
}
.workspace {
  margin-left: 230px;
  min-height: 100vh;
}
.topbar {
  height: 75px;
  padding: 0 38px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background: #13131bea;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}
#breadcrumb {
  color: var(--muted);
  font-size: 12px;
}
.topbar-right {
  display: flex;
  gap: 16px;
  align-items: center;
}
#save-status {
  color: var(--muted);
  font-size: 11px;
}
.status-pill {
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--good);
  padding: 5px 10px;
  font-size: 10px;
}
#menu-toggle {
  display: none;
}
main {
  padding: 38px;
  max-width: 1680px;
  margin: auto;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.page-heading h1 {
  margin: 6px 0 12px;
}
.page-heading p {
  color: var(--muted);
  max-width: 620px;
}
.page-heading .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.shelf-tools {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 30px 0 20px;
}
.shelf-tools input {
  max-width: 360px;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 24px;
}
.project-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  transition:
    transform 0.2s,
    border-color 0.2s;
  cursor: pointer;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: #665773;
}
.book-cover {
  aspect-ratio: 4/3;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #3b304e, #1b2436);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
}
.book-cover::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -20px;
  top: 40px;
  border: 1px solid #ad90c640;
  border-radius: 50%;
  box-shadow:
    0 0 0 26px #ad90c60a,
    0 0 0 27px #ad90c630,
    0 0 0 54px #ad90c60a;
}
.book-cover::after {
  content: "✧";
  position: absolute;
  right: 45px;
  top: 35px;
  font-size: 55px;
  color: #dcc2aa;
}
.book-cover.has-image::after,
.book-cover.has-image::before {
  display: none;
}
.book-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.book-cover .pill,
.book-cover h2 {
  position: relative;
  z-index: 1;
}
.book-cover .pill {
  align-self: flex-start;
  color: #e3d7ef;
  background: #221b3099;
  border-color: #b497c644;
}
.book-cover h2 {
  font:
    25px Georgia,
    serif;
  max-width: 80%;
  text-shadow: 0 1px 15px #000;
}
.project-card:nth-child(3n + 2) .book-cover {
  background: linear-gradient(135deg, #3d3830, #292e36);
}
.project-card:nth-child(3n) .book-cover {
  background: linear-gradient(135deg, #263c39, #232c3b);
}
.book-info {
  padding: 20px;
}
.book-info p {
  height: 42px;
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
}
.book-info .row {
  font-size: 10px;
  color: var(--muted);
  justify-content: space-between;
}
.welcome-strip {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 25px 30px;
  background: linear-gradient(110deg, #292234, #1c1d2b);
  border: 1px solid #403449;
  border-radius: var(--radius);
}
.welcome-strip .symbol {
  font:
    44px Georgia,
    serif;
  color: var(--accent);
}
.welcome-strip p {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.welcome-strip button {
  margin-left: auto;
  white-space: nowrap;
}
.stats {
  display: flex;
  gap: 12px;
  margin: 25px 0;
}
.stat {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 17px 20px;
}
.stat b {
  display: block;
  font:
    28px Georgia,
    serif;
}
.stat small {
  font-size: 10px;
}
.project-hero {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 30px;
}
.project-hero .book-cover {
  aspect-ratio: 3/4;
  border-radius: 12px;
}
.project-hero h1 {
  margin-top: 15px;
}
.step-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.step-card {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.step-card span {
  color: var(--accent);
  font:
    25px Georgia,
    serif;
}
.step-card h3 {
  margin: 12px 0 5px;
}
.step-card p {
  font-size: 12px;
  color: var(--muted);
  min-height: 54px;
}
.step-card button {
  width: 100%;
  font-size: 12px;
}
.help-text {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.conflict {
  padding: 12px 30px;
  background: #443625;
  display: flex;
  gap: 18px;
  align-items: center;
  color: #ffe0a3;
  font-size: 12px;
}
.readonly {
  padding: 9px 16px;
  background: #28343a;
  color: #b4d0d7;
  border-radius: 9px;
  margin-bottom: 20px;
  font-size: 12px;
}
.progress {
  height: 5px;
  border-radius: 5px;
  background: #393643;
  overflow: hidden;
}
.progress span {
  height: 100%;
  display: block;
  background: var(--accent);
}
dialog {
  color: var(--text);
  background: var(--panel);
  border: 1px solid #51465f;
  border-radius: 18px;
  padding: 0;
  max-height: 90dvh;
  width: min(800px, calc(100vw - 24px));
  box-shadow: 0 30px 100px #0008;
}
dialog::backdrop {
  background: #090910b8;
  backdrop-filter: blur(4px);
}
dialog > header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 2;
}
dialog > header h2 {
  margin: 0;
  font:
    24px Georgia,
    serif;
}
#modal-body {
  padding: 24px;
  overflow-wrap: anywhere;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
  flex-wrap: wrap;
}
.result-text {
  white-space: pre-wrap;
  max-height: 350px;
  overflow: auto;
  padding: 20px;
  background: #15151e;
  border: 1px solid var(--line);
  border-radius: 10px;
  font:
    15px/1.8 Georgia,
    serif;
}
.job-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin: 12px 0;
  background: #181821;
}
.job-card .row {
  justify-content: space-between;
}
.job-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0 6px;
}
.job-card .error {
  color: var(--bad);
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 15px 0;
}
.result-grid img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 9px;
  cursor: pointer;
}
.result-list > div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.result-list p {
  font-size: 13px;
  color: var(--muted);
}
.issue {
  padding: 16px;
  border-left: 3px solid var(--gold);
  background: #24212a;
  margin: 14px 0;
  border-radius: 0 9px 9px 0;
}
.issue p {
  margin: 8px 0;
  font-size: 13px;
}
.questions fieldset {
  border: 0;
  padding: 0;
  margin-bottom: 25px;
}
.questions legend {
  margin-bottom: 10px;
}
.questions .row {
  margin-bottom: 8px;
}
.questions button.chosen {
  background: var(--accent-bg);
  border-color: var(--accent);
}
.lora-list {
  max-height: 320px;
  overflow: auto;
}
.lora-option {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.lora-option .row {
  flex-wrap: nowrap;
  align-items: flex-start;
}
.lora-option label {
  flex: 1;
  margin: 0;
  font-size: 13px;
  color: var(--text);
}
.lora-option p {
  font-size: 11px;
  color: var(--muted);
  margin: 5px 0 0;
}
.lora-option input[type="number"] {
  width: 75px;
}
.lora-option input[type="checkbox"] {
  margin-top: 5px;
}
.member-row,
.history-row,
.comment-row {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.comment-row.resolved {
  opacity: 0.5;
}
.comment-row p {
  white-space: pre-wrap;
  margin: 8px 0;
}
.history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.history-row small {
  display: block;
}
.danger-zone {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
#viewer {
  width: calc(100vw - 40px);
  height: calc(100dvh - 40px);
  max-height: none;
}
#viewer header {
  padding: 12px 18px;
}
#viewer header > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#viewer-position {
  font-size: 12px;
  color: var(--muted);
}
.viewer-stage {
  height: calc(100% - 140px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px;
}
.viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
#viewer-meta {
  padding: 0 20px;
  font-size: 12px;
}
#toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  max-width: 450px;
  background: #373043;
  border: 1px solid #695378;
  border-radius: 12px;
  padding: 14px 20px;
  box-shadow: 0 8px 30px #0005;
  font-size: 13px;
}
.toast.bad {
  border-color: #a65c67;
}
.checkbox-label {
  flex-direction: row;
  align-items: center;
  color: var(--text);
  gap: 10px;
}
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.keyboard {
  font: 10px monospace;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.file-drop {
  border: 1px dashed #685774;
  padding: 22px;
  text-align: center;
  border-radius: 12px;
  background: #241f2b;
}
.file-drop input {
  background: transparent;
  border: 0;
}
.cover-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
@media (min-width: 1600px) {
  main {
    padding: 45px 65px;
  }
  .topbar {
    padding: 0 65px;
  }
}
@media (max-width: 1100px) {
  .sidebar {
    width: 200px;
  }
  .workspace {
    margin-left: 200px;
  }
  main {
    padding: 25px;
  }
  .topbar {
    padding: 0 25px;
  }
  .step-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid3 {
    grid-template-columns: 1fr 1fr;
  }
  .topbar-right {
    gap: 8px;
  }
  .project-hero {
    grid-template-columns: 140px 1fr;
  }
}
@media (max-width: 760px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
    width: 235px;
    box-shadow: 20px 0 50px #0007;
  }
  .sidebar.open {
    transform: none;
  }
  .workspace {
    margin-left: 0;
  }
  #menu-toggle {
    display: inline-flex;
  }
  .topbar {
    padding: 0 14px;
    height: 60px;
  }
  main {
    padding: 22px 16px;
  }
  .topbar-right .status-pill {
    display: none;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  h1 {
    font-size: 32px;
  }
  .grid2,
  .grid3 {
    grid-template-columns: 1fr;
  }
  .welcome-strip {
    padding: 20px;
    gap: 15px;
    flex-wrap: wrap;
  }
  .welcome-strip button {
    margin-left: 0;
  }
  .welcome-strip .symbol {
    display: none;
  }
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .book-cover {
    padding: 14px;
  }
  .book-cover h2 {
    font-size: 20px;
  }
  .book-info {
    padding: 14px;
  }
  .book-info .row {
    gap: 4px;
    font-size: 9px;
  }
  .project-hero {
    grid-template-columns: 100px 1fr;
    gap: 20px;
  }
  .project-hero h1 {
    font-size: 28px;
  }
  .stats {
    flex-wrap: wrap;
  }
  .stat {
    min-width: 40%;
    padding: 12px;
  }
  .step-list {
    grid-template-columns: 1fr 1fr;
  }
  .step-card {
    padding: 15px;
  }
  .login {
    grid-template-columns: 1fr;
  }
  .login-art {
    display: none;
  }
  .login-form {
    margin: 15vh auto;
  }
  .shelf-tools {
    flex-wrap: wrap;
    gap: 10px;
  }
  .shelf-tools input {
    max-width: none;
  }
  .result-grid {
    grid-template-columns: 1fr 1fr;
  }
  #viewer {
    width: calc(100vw - 12px);
    height: calc(100dvh - 12px);
  }
  #viewer header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .viewer-stage {
    height: calc(100% - 180px);
  }
  .conflict {
    padding: 12px;
    flex-wrap: wrap;
  }
  .card {
    padding: 18px;
  }
  #toasts {
    right: 12px;
    left: 12px;
    bottom: 12px;
  }
  .toast {
    max-width: none;
  }
}
