:root {
  --ink:#0f172a;
  --muted:#64748b;
  --blue:#e9501c;
  --line:#e2e8f0;
  --bg:#f8fafc;
  --white:#fff;
  --pale:#fff1eb;
  font-family:Arial,"Noto Sans","PingFang SC","Microsoft YaHei",sans-serif;
  color:var(--ink);
  background:var(--bg);
  font-size:14px;
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
}
button,input,textarea,select {
  font:inherit;
}
button,a,label.upload {
  touch-action:manipulation;
}
button {
  border:1px solid var(--line);
  border-radius:7px;
  background:white;
  padding:9px 13px;
  cursor:pointer;
  color:var(--ink);
  font-weight:500;
}
button:hover {
  background:#fff4ef;
  border-color:#e9501c;
}
button:disabled {
  opacity:.5;
  cursor:wait;
}
.primary {
  background:var(--blue);
  color:white;
  border-color:var(--blue);
}
.primary:hover {
  background:#c83e13;
  color:white;
}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible {
  outline:3px solid #ea5120;
  outline-offset:2px;
}
[hidden] {
  display:none!important;
}
header {
  height:74px;
  border-bottom:1px solid var(--line);
  background:white;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 32px;
}
header>div {
  display:flex;
  gap:10px;
}
.brand {
  display:flex;
  gap:12px;
  align-items:center;
  text-decoration:none;
  color:var(--ink);
  font:700 21px Arial,"PingFang SC",sans-serif;
}
.brand small {
  font:12px "PingFang SC",sans-serif;
  color:var(--muted);
  border-left:1px solid var(--line);
  padding-left:12px;
}
.mark {
  width:44px;
  height:44px;
  flex:none;
  object-fit:contain;
}
#empty {
  max-width:1180px;
  margin:90px auto;
  display:grid;
  grid-template-columns:1.15fr 1fr;
  align-items:center;
  padding:30px;
  gap:80px;
}
.eyebrow {
  font-size:11px;
  letter-spacing:2px;
  color:var(--muted);
}
h1 {
  font-size:46px;
  line-height:1.4;
  letter-spacing:-1.5px;
  font-weight:600;
  margin:22px 0;
}
p {
  line-height:1.9;
}
.intro>p {
  font-size:16px;
  color:var(--muted);
  margin-bottom:32px;
}
.empty-stack {
  position:relative;
  width:300px;
  margin:auto;
}
.paper {
  position:relative;
  background:white;
  border:1px solid var(--line);
  padding:30px;
  width:300px;
  height:430px;
  border-radius:9px;
  box-shadow:0 22px 55px #243c6115;
  transform:rotate(3deg);
}
.paper.back {
  position:absolute;
  transform:rotate(-6deg);
  top:4px;
  left:-10px;
  background:#ffebe1;
}
.paper span {
  font-size:11px;
  color:var(--blue);
}
.paper h2 {
  font-size:21px;
  line-height:1.6;
  margin-top:30px;
}
.placeholder-art {
  height:120px;
  background:#fff1eb;
  border-radius:8px;
  color:#d78f72;
  font-size:76px;
  text-align:center;
}
.paper p {
  font-size:12px;
  color:var(--muted);
}
.projectbar {
  padding:22px 28px 18px;
  background:#fff;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
}
.projectbar > div:first-child {
  flex:1;
  min-width:0;
}
.projectbar .eyebrow {
  display:block;
}
.projectbar input {
  font-size:22px;
  font-weight:600;
  border:0;
  padding:6px 0;
  width:100%;
  max-width:100%;
  background:transparent;
}
.project-actions {
  display:flex;
  align-items:center;
  gap:10px;
  flex-shrink:0;
}
#saved {
  font-size:12px;
  color:var(--muted);
}
.steps {
  display:flex;
  align-items:center;
  border-bottom:1px solid var(--line);
  background:white;
  padding:0 28px;
  gap:28px;
  overflow-x:auto;
}
#projectMode {
  margin-left:auto;
  flex-shrink:0;
  border-bottom-color:transparent;
  color:#e9501c;
}
.steps>span {
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:14px 0;
  color:var(--muted);
  font-size:13px;
  border-bottom:3px solid transparent;
  white-space:nowrap;
}
.steps .active {
  color:var(--blue);
  border-color:var(--blue);
  font-weight:600;
}
.step-index {
  display:inline-grid;
  place-items:center;
  min-width:22px;
  height:22px;
  padding:0 6px;
  border-radius:6px;
  background:#f1f5f9;
  color:var(--ink);
  font-size:12px;
  font-weight:700;
  font-family:ui-monospace,monospace;
}
.steps .active .step-index {
  background:var(--blue);
  color:#fff;
}
#notice {
  padding:12px 28px;
  background:#fff4ef;
  color:#795344;
  font-size:13px;
  min-height:42px;
}
#notice.error {
  background:#fff0e9;
  color:#994b30;
}
.studio {
  --pages-width:200px;
  --editor-width:320px;
  display:grid;
  grid-template-columns:var(--pages-width) 8px minmax(240px,1fr) 8px var(--editor-width);
  min-height:calc(100vh - 250px);
}
.studio.is-resizing {
  cursor:col-resize;
  user-select:none;
}
.pane-resize {
  cursor:col-resize;
  touch-action:none;
  position:relative;
}
.pane-resize::before {
  content:'';
  position:absolute;
  top:0;
  bottom:0;
  left:50%;
  width:1px;
  background:var(--line);
}
.pane-resize:hover::before,
.pane-resize:focus-visible::before {
  width:3px;
  margin-left:-1px;
  background:#e9501c;
}
.pages,.editor {
  background:#fff;
  padding:22px 18px;
  min-width:0;
}
.editor {
  padding:22px;
}
.section-label {
  font-size:13px;
  font-weight:600;
  margin-bottom:18px;
  display:flex;
  justify-content:space-between;
}
.section-label span {
  color:var(--muted);
  font-size:11px;
  font-weight:400;
}
#characterLinks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.page-item {
  width:100%;
  display:flex;
  text-align:left;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:8px;
}
.page-item.selected {
  background:#fff4ef;
  border-color:var(--blue);
}
.thumb {
  width:42px;
  height:68px;
  background:#f1f5f9;
  object-fit:contain;
  flex-shrink:0;
}
.page-item strong {
  font-size:12px;
  display:block;
  font-weight:500;
  line-height:1.5;
}
.page-item small {
  font-size:10px;
  color:var(--muted);
  display:block;
  margin-top:4px;
}
.preview {
  padding:20px 32px;
  background:#f1f5f9;
  display:flex;
  flex-direction:column;
  align-items:center;
  min-width:0;
}
.preview-toolbar,.preview-bottom {
  width:100%;
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:11px;
  color:var(--muted);
  gap:12px;
}
.preview-toolbar {
  margin-bottom:20px;
}
#canvas {
  width:min(100%,340px);
  aspect-ratio:9/16;
  box-shadow:0 8px 35px #263b5718;
  background:#f8fafc;
  border:1px solid #e2e8f0;
}
#canvas img {
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
}
.preview-bottom {
  margin-top:20px;
  flex-wrap:wrap;
}
.preview-bottom a {
  color:var(--blue);
}
#video {
  width:100%;
  max-width:340px;
  margin-top:20px;
}
label {
  display:block;
  font-size:12px;
  color:#475569;
  margin-bottom:15px;
}
input:not([type=range]),textarea,select {
  display:block;
  width:100%;
  margin-top:6px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#ffffff;
  color:var(--ink);
}
textarea {
  resize:vertical;
  line-height:1.7;
}
input[type=range] {
  display:block;
  width:100%;
  accent-color:var(--blue);
  margin-top:12px;
}
.hint {
  font-size:11px;
  color:var(--muted);
  line-height:1.7;
  margin:0 0 16px;
}
.row {
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:14px;
}
.row.align-end {
  align-items:flex-end;
}
.row>label {
  width:50%;
  margin:0;
}
.row button {
  font-size:12px;
  padding:8px;
}
.wide {
  width:100%;
}
hr {
  border:0;
  border-top:1px solid var(--line);
  margin:24px 0;
}
.upload {
  cursor:pointer;
  text-align:center;
  border:1px dashed #cbd5e1;
  border-radius:6px;
  padding:12px;
  color:var(--blue);
}
audio {
  width:100%;
  height:36px;
  margin-bottom:16px;
}
dialog {
  border:1px solid var(--line);
  border-radius:12px;
  padding:26px;
  width:min(600px,94vw);
  max-height:90vh;
  box-shadow:0 24px 100px #0f172a30;
}
dialog::backdrop {
  background:#0f172a66;
  backdrop-filter:blur(3px);
}
.dialog-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:18px;
}
.dialog-header h2 {
  margin:0;
  font-size:22px;
}
.history-item {
  display:block;
  width:100%;
  text-align:left;
  margin-bottom:10px;
  padding:16px;
}
.history-item small {
  display:block;
  margin-top:8px;
  color:var(--muted);
}
#toast {
  position:fixed;
  bottom:24px;
  left:50%;
  transform:translateX(-50%);
  padding:14px 24px;
  background:var(--ink);
  color:white;
  border-radius:8px;
  box-shadow:0 4px 22px #0f172a40;
  z-index:99;
  max-width:90vw;
}
.overflow-message {
  padding:30px;
  color:#994b30;
  line-height:1.8;
}
@media(min-width:1500px) {
  .studio {
    --pages-width:240px;
    --editor-width:360px;
  }
  #canvas {
    width:380px;
  }
}
@media(max-width:1000px) {
  .studio {
    --pages-width:160px;
    --editor-width:260px;
  }
  .preview {
    padding:20px 16px;
  }
  .project-actions {
    flex-wrap:wrap;
    justify-content:flex-end;
  }
}
@media(max-width:760px) {
  header {
    padding:0 16px;
  }
  .brand small {
    display:none;
  }
  #empty {
    margin:30px auto;
    grid-template-columns:1fr;
    gap:40px;
  }
  h1 {
    font-size:34px;
  }
  .empty-stack {
    display:none;
  }
  .projectbar {
    padding:18px;
    display:block;
  }
  .projectbar input {
    width:100%;
  }
  .project-actions {
    margin-top:10px;
  }
  .steps {
    gap:18px;
    padding:0 16px;
  }
  .steps>span {
    font-size:12px;
  }
  .studio {
    grid-template-columns:1fr;
  }
  .pane-resize {
    display:none;
  }
  .pages {
    padding:15px;
    overflow-x:auto;
  }
  #pageList {
    display:flex;
    gap:8px;
  }
  .page-item {
    min-width:145px;
    width:145px;
  }
  .pages>.wide {
    width:auto;
  }
  .preview {
    padding:20px;
  }
  .editor {
    border-left:0;
  }
  #canvas {
    width:290px;
  }
  #notice {
    padding:12px 18px;
  }
}
@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior:auto!important;
  }
}
.check-option{display:flex;align-items:center;gap:8px;line-height:1.5}.check-option input[type=checkbox]{display:inline-block;width:auto;margin:0;padding:0;accent-color:var(--blue)}
.auth-loading main,.auth-loading #workspace,.auth-loading .header-actions,.needs-login #workspace {
  display:none!important;
}
.login-panel {
  max-width:420px;
  margin:9vh auto;
  padding:32px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
}
.login-panel[hidden] {
  display:none;
}
.login-panel h1 {
  font-size:26px;
}
.login-panel form {
  display:grid;
  gap:14px;
}
.login-panel button {
  width:100%;
}
.header-actions {
  align-items:center;
}
.provider-switch {
  display:flex;
  align-items:center;
  gap:9px;
  margin:0;
  color:var(--muted);
  white-space:nowrap;
}
.provider-switch select {
  width:auto;
  min-width:160px;
  margin:0;
  padding:8px 36px 8px 10px;
}
.reference-panel {
  padding:20px 28px;
  background:#f8fafc;
  border-bottom:1px solid var(--line);
}
.reference-heading {
  display:flex;
  justify-content:space-between;
  align-items:start;
  gap:16px;
}
.reference-heading h2 {
  font-size:17px;
  margin:0 0 6px;
}
.reference-heading .row {
  flex-shrink:0;
}
.reference-list {
  display:flex;
  flex-wrap:nowrap;
  gap:12px;
  margin:12px 0 4px;
  overflow-x:auto;
  scroll-snap-type:x proximity;
  padding-bottom:10px;
}
.reference-card {
  display:grid;
  grid-template-columns:112px 1fr;
  align-items:stretch;
  gap:12px;
  flex:0 0 330px;
  scroll-snap-align:start;
  padding:12px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:9px;
  min-width:0;
}
.reference-visual {
  position:relative;
  width:112px;
  min-height:0;
  height:auto;
  align-self:stretch;
  background:#f1f5f9;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  color:var(--muted);
  font-size:11px;
  overflow:hidden;
  border-radius:8px;
}
.reference-visual img {
  width:100%;
  height:100%;
  object-fit:contain;
}
.reference-info {
  min-width:0;
}
.reference-info input,.reference-info textarea {
  margin:6px 0;
  padding:7px;
  font-size:12px;
}
.reference-info input {
  margin-top:0;
}
.reference-info .row {
  margin:0;
}
.reference-info .row button {
  font-size:11px;
}
.reference-panel>.hint {
  margin:0;
}
#pageLinks {
  padding:12px;
  border:1px solid var(--line);
  border-radius:8px;
  margin:0 0 15px;
  background:#f8fafc;
}
#pageLinks .check-option {
  margin-bottom:0;
}
#pageLinks .field-inline {
  align-items:start;
  margin-bottom:0;
}
#pageLinks .field-inline > div {
  flex:1 1 0;
  min-width:0;
}
#pageLinks .section-label {
  margin-bottom:6px;
}
@media(max-width:760px) {
  .header-actions {
    gap:5px;
  }
  .provider-switch {
    font-size:0;
  }
  .provider-switch select {
    min-width:105px;
    font-size:11px;
  }
  .reference-panel {
    padding:16px;
  }
  .reference-heading {
    display:block;
  }
  .reference-heading .row {
    margin-top:10px;
  }
}

/* Shared visual language with the public site. */
button, .upload { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:40px; font-weight:600; }
button:focus, a:focus, input:focus, textarea:focus, select:focus, label.upload:focus { outline:none; box-shadow:none; }
.keyboard-navigation button:focus-visible, .keyboard-navigation a:focus-visible, .keyboard-navigation input:focus-visible, .keyboard-navigation textarea:focus-visible, .keyboard-navigation select:focus-visible, .keyboard-navigation label.upload:focus-within { outline:3px solid #ea5120; outline-offset:2px; }
input:not([type=range]):focus, textarea:focus, select:focus { border-color:var(--line); }
button:disabled { cursor:not-allowed; }
button:not(.primary):hover { background:#fff4ef; border-color:#e9501c; }
.primary:hover { background:#c83e13; border-color:#c83e13; }
.lucide { display:inline-block; width:17px; height:17px; flex:none; vertical-align:middle; stroke-width:2; }
header .mark { width:44px; height:44px; }
.header-link{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:9px 13px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--ink);text-decoration:none;font-weight:600;white-space:nowrap;touch-action:manipulation}.header-link:hover{background:#fff4ef;border-color:#e9501c;color:var(--ink)}
.eyebrow { color:#e9501c; font-family:ui-monospace,monospace; font-weight:600; }
#empty { background-image:radial-gradient(#dce1e7 1px, transparent 1px); background-size:24px 24px; }
.paper.back { background:#ffebe1; }
.upload { width:100%; }
#download { display:inline-flex; align-items:center; gap:6px; }
#download[hidden] { display:none; }
input[type=checkbox], input[type=range] { accent-color:#e9501c; }
input::placeholder, textarea::placeholder { color:#94a3b8; opacity:1; }
select {
  cursor:pointer;
  appearance:none;
  -webkit-appearance:none;
  padding-right:36px;
  background-color:#fff;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
  background-size:14px;
}
@media(max-width:760px) { header { height:auto; min-height:74px; gap:12px; flex-wrap:wrap; padding-top:12px; padding-bottom:12px; } header .header-actions { flex-wrap:wrap; justify-content:flex-end; } }

.reference-kind {
  position:absolute;
  top:6px;
  left:6px;
  z-index:1;
  max-width:calc(100% - 12px);
  margin:0;
  padding:2px 6px;
  border-radius:999px;
  background:#fff1eb;
  color:#c83e13;
  font-size:11px;
  font-weight:700;
  line-height:1.3;
  pointer-events:none;
}
.reference-status {
  position:absolute;
  bottom:6px;
  left:6px;
  z-index:1;
  max-width:calc(100% - 38px);
  margin:0;
  padding:2px 6px;
  border-radius:999px;
  background:#fff;
  box-shadow:0 1px 3px #0f172a22;
  color:var(--muted);
  font-size:11px;
  font-weight:700;
  line-height:1.3;
  pointer-events:none;
}
.reference-status.status-running { color:#e9501c; }
.reference-status.status-failed { color:#b42318; }
#notice.is-loading::before,
#primaryAction.is-loading::before,
#newForm.is-loading button[type="submit"]::before,
.page-item small.is-loading::before,
.reference-status.status-running::before,
.thumb-generating::before {
  content:"";
  display:inline-block;
  width:12px;
  height:12px;
  margin-right:7px;
  vertical-align:-2px;
  border:2px solid currentColor;
  border-right-color:transparent;
  border-radius:50%;
  animation:workbench-spin .8s linear infinite;
}
#primaryAction.is-loading::before,
#newForm.is-loading button[type="submit"]::before { color:inherit; }
.thumb-generating { display:grid; place-items:center; border-radius:4px; background:#fff4ef; color:#e9501c; }
.thumb-generating::before { width:16px; height:16px; margin:0; }
@keyframes workbench-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  #notice.is-loading::before,
  #primaryAction.is-loading::before,
  #newForm.is-loading button[type="submit"]::before,
  .page-item small.is-loading::before,
  .reference-status.status-running::before,
  .thumb-generating::before { animation:none; }
}
.reference-zoom {
  position:absolute;
  inset:0;
  display:flex;
  width:100%;
  height:100%;
  min-height:0;
  padding:0;
  border:0;
  border-radius:8px;
  background:transparent;
}
.reference-zoom img {
  display:block;
  width:100%;
  height:100%;
  min-height:0;
  object-fit:contain;
}
.reference-zoom .lucide {
  position:absolute;
  right:6px;
  bottom:6px;
  width:16px;
  height:16px;
  padding:5px;
  box-sizing:content-box;
  background:#fff;
  border-radius:6px;
  box-shadow:0 1px 4px #0f172a22;
  opacity:0;
}
.reference-zoom:hover .lucide,
.reference-zoom:focus-visible .lucide { opacity:1; }
button.reference-zoom:hover { background:#f8fafc; border-color:transparent; }
button.danger { color:#b42318; border-color:#f3c1bc; background:#fff; }
button.danger:hover { color:#b42318; border-color:#b42318; background:#fff1f0; }
button.redraw { color:#e9501c; border-color:#f3c4b4; background:#fff; }
button.redraw:hover { color:#c83e13; border-color:#e9501c; background:#fff4ef; }
button.quiet { color:#64748b; border-color:#e2e8f0; background:#fff; }
button.quiet:hover { color:#0f172a; border-color:#cbd5e1; background:#f8fafc; }
#videoDialog[open] { width:min(420px, 94vw); }
#videoDialog video {
  display:block;
  width:100%;
  max-width:none;
  max-height:80vh;
  margin:0;
  background:#0f172a;
  border-radius:8px;
}
.thumb-slot { display:block; width:42px; height:68px; flex-shrink:0; }
.thumb-loading {
  border-radius:4px;
  background:linear-gradient(90deg,#f1f5f9 25%,#e2e8f0 50%,#f1f5f9 75%);
  background-size:200% 100%;
  animation:thumb-shimmer 1.1s linear infinite;
}
.thumb-slot .thumb { width:100%; height:100%; }
@keyframes thumb-shimmer {
  from { background-position:100% 0; }
  to { background-position:-100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .thumb-loading { animation:none; }
}
#imageDialog[open] { width:min(960px, 94vw); }
#imageDialogPicture {
  display:block;
  width:100%;
  max-height:80vh;
  object-fit:contain;
  background:#f1f5f9;
  border-radius:8px;
}
.editor-card {
  margin-bottom:14px;
  padding:14px;
  background:#f8fafc;
  border:1px solid var(--line);
  border-radius:10px;
}
.editor-card:last-child { margin-bottom:0; }
.editor-card .section-label { margin-bottom:12px; }
.section-title { display:inline-flex; align-items:center; gap:6px; font-weight:600; }
.section-title .lucide { width:15px; height:15px; color:#e9501c; }
.editor-card > label:last-child,
.editor-card .hint:last-child,
.editor-card .row:last-child { margin-bottom:0; }
.editor label:not(.check-option):not(.upload) {
  display:grid;
  grid-template-columns:max-content minmax(0,1fr);
  align-items:center;
  column-gap:10px;
  margin-bottom:10px;
}
.editor label:not(.check-option):not(.upload):has(textarea) {
  align-items:start;
}
.editor label:not(.check-option):not(.upload) :is(input,textarea,select) {
  width:100%;
  min-width:0;
  margin-top:0;
}
.editor .field-inline {
  align-items:end;
  gap:10px;
}
.editor .field-inline > label:not(.check-option):not(.upload) {
  flex:1 1 0;
  width:auto;
  min-width:0;
  margin:0;
  grid-template-columns:minmax(0,1fr);
  row-gap:6px;
}
.editor .motion-fields {
  align-items:center;
  flex-wrap:wrap;
}
.editor .motion-fields > label:not(.check-option):not(.upload) {
  flex:1 1 200px;
  min-width:min(100%, 200px);
  grid-template-columns:max-content minmax(0,1fr);
  column-gap:8px;
  row-gap:0;
}
.editor label:has(textarea) textarea {
  margin-top:0;
}
.music-cards { display:flex; align-items:flex-start; gap:8px; margin-bottom:12px; }
.music-card { position:relative; flex:1; min-width:0; aspect-ratio:1; }
button.music-card-select { position:relative; display:block; width:100%; height:100%; min-height:0; padding:0; overflow:hidden; text-align:center; border:1px solid var(--line); border-radius:8px; background:#fff; cursor:pointer; }
button.music-card-select:hover, button.music-card-select:focus-visible { border-color:var(--blue); background:#fff; }
.music-card.is-selected button.music-card-select { border-color:var(--blue); background:#eef4ff; }
.music-card-select img, .music-card-mark { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; background:#e5e7eb; }
.music-card-mark { display:grid; place-items:center; color:#64748b; background:#f1f5f9; }
.music-card-mark .lucide { width:16px; height:16px; }
.music-card-none { width:14px; height:2px; border-radius:99px; background:currentColor; }
.music-card-name { position:absolute; z-index:1; right:0; bottom:0; left:0; padding:8px 3px 3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; background:linear-gradient(#0000,#0f172acc); color:#fff; font-weight:600; font-size:9px; line-height:1.15; }
#customMusic[hidden] { display:none; }
#customMusic .hint:last-child { margin-bottom:0; }
#customMusicName { word-break:break-all; }
button.music-card-play { position:absolute; top:3px; right:3px; z-index:2; display:grid; place-items:center; width:16px; height:16px; min-height:0; padding:0; border:0; border-radius:50%; color:#fff; background:#172a46cc; line-height:0; }
button.music-card-play:hover, button.music-card-play:focus-visible { color:#fff; background:#172a46; border-color:transparent; }
button.music-card-play.is-playing { background:#e9501c; }
button.music-card-play.is-playing:hover, button.music-card-play.is-playing:focus-visible { color:#fff; background:#c83e13; border-color:transparent; }
.music-card-glyph { display:block; width:0; height:0; border-style:solid; border-width:3px 0 3px 5px; border-color:transparent transparent transparent currentColor; pointer-events:none; }
button.music-card-play.is-playing .music-card-glyph { width:6px; height:6px; border:0; background:linear-gradient(currentColor,currentColor) left center / 1.5px 6px no-repeat, linear-gradient(currentColor,currentColor) right center / 1.5px 6px no-repeat; }
.workbench-language { position:relative; z-index:25; }
.workbench-language summary {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:48px;
  min-height:40px;
  padding:0;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  cursor:pointer;
  list-style:none;
}
.workbench-language summary::-webkit-details-marker { display:none; }
.workbench-language > div {
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  z-index:10;
  width:48px;
  padding:4px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:8px;
  box-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}
.workbench-language button {
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:40px;
  padding:0;
  border:0;
  border-radius:4px;
  background:transparent;
}
.workbench-language button:hover,
.workbench-language button[aria-current=true] { background:#f1f5f9; border-color:transparent; }
.workbench-language summary:focus { outline:none; }
.keyboard-navigation .workbench-language summary:focus-visible { outline:3px solid #ea5120; outline-offset:2px; }
body.needs-login header .header-actions,
body.auth-loading header .header-actions { display:flex !important; }
body.needs-login #historyButton,
body.auth-loading #historyButton,
body.auth-loading #newButton { display:none !important; }
.template-previews {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
  margin-bottom:12px;
}
.template-previews article {
  min-width:0;
  padding:8px;
  border:2px solid transparent;
  border-radius:12px;
  font-size:13px;
  cursor:pointer;
}
.template-previews article.is-selected { border-color:#e9501c; }
.template-previews article:focus-visible { outline:3px solid #ea5120; outline-offset:2px; }
.template-previews img {
  display:block;
  width:100%;
  max-height:220px;
  margin-top:8px;
  object-fit:contain;
  background:#f4f2ef;
  border-radius:10px;
}
.button-row { display:flex; gap:8px; }
#newDialog[open] {
  display:flex;
  flex-direction:column;
  width:min(760px, 94vw);
  max-height:90vh;
  padding:0;
  overflow:hidden;
}
#newForm {
  display:flex;
  flex-direction:column;
  width:100%;
  max-height:90vh;
  min-height:0;
  overflow:hidden;
}
#newDialog .dialog-header { flex:none; margin:0; padding:22px 26px 0; }
#newForm .dialog-body {
  flex:1 1 auto;
  min-height:0;
  padding:18px 26px 8px;
  overflow:auto;
}
#newForm .dialog-footer {
  flex:none;
  padding:14px 26px 18px;
  border-top:1px solid var(--line);
  background:#fff;
}
#newForm .create-options { display:flex; gap:12px; margin-bottom:15px; }
#newForm .create-options > label {
  display:flex;
  flex:1 1 0;
  flex-direction:column;
  align-items:stretch;
  gap:6px;
  min-width:0;
  margin-bottom:0;
}
#newForm label {
  display:grid;
  grid-template-columns:max-content minmax(0, 1fr);
  align-items:center;
  column-gap:12px;
}
#newForm label:has(textarea) { align-items:start; }
#newForm label input,
#newForm label select,
#newForm label textarea { width:100%; min-width:0; margin-top:0; }
