@font-face {
  font-family: Manrope;
  src: url('/launch/manrope-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: Manrope;
  src: url('/launch/manrope-cyrillic.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

:root {
  --app-ink: #191a30;
  --app-muted: #55566d;
  --app-line: #deddea;
  --app-paper: #f5f4fa;
  --app-lilac: #efecfb;
  --app-accent: #5037a3;
  --app-lime: #e0f68a;
  --app-radius: 12px;
  --page-width: 1480px;
  --page-gutter: 40px;
  --page-inline-size: min(var(--page-width), calc(100% - 2 * var(--page-gutter)));
}

body { background: var(--app-paper); color: var(--app-ink); font: 15px/1.55 Manrope, Arial, sans-serif; }
.app-main, .checkout-shell { width: var(--page-inline-size); margin-inline: auto; }
.app-main { padding-block: 24px 64px; }
@media (max-width: 980px) { :root { --page-gutter: 24px; } }
@media (max-width: 760px) { :root { --page-gutter: max(8px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); } }
h1 { font: 800 clamp(1.75rem, 3vw, 2.35rem)/1.15 Manrope, Arial, sans-serif; letter-spacing: -.045em; }
h2 { font-size: 1.4rem; letter-spacing: -.035em; }
small, .layout-hint { color: var(--app-muted); }
button, input, textarea, select { border-color: var(--app-line); border-radius: 8px; }
button { background: #fff; color: var(--app-ink); font-weight: 700; }
button:hover:not(:disabled) { border-color: #b7aed7; background: #f5f2fd; }
label { font-weight: 750; }
.primary, .primary:hover:not(:disabled) { background: var(--app-ink); color: #fff; }
.primary:hover:not(:disabled) { background: #373457; }
:is(button, input, textarea, select, a, summary):focus-visible {
  outline: 2px solid #6f52ce;
  outline-offset: 3px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; white-space: nowrap; clip-path: inset(50%);
}
.app-header {
  min-height: 62px; gap: 8px 20px; padding-block: 9px;
  padding-inline: max(var(--page-gutter), (100% - var(--page-width)) / 2);
  border: 0; background: #18192c; color: #f7f6fd;
}
.app-header .studio-brand a { color: #e6e2f5; font-size: .86rem; font-weight: 700; }
.app-header .studio-brand .app-wordmark {
  display: inline-flex; align-items: center; gap: 0; color: #fff;
  font-size: 1.33rem; font-weight: 800; letter-spacing: -.07em; text-decoration: none;
}
.app-mark {
  display: inline-flex; width: 27px; height: 27px; margin-right: 8px; align-items: end;
  justify-content: center; gap: 2px; padding: 6px; border-radius: 8px; background: var(--app-lime);
}
.app-mark i { width: 3px; height: 5px; border-radius: 3px; background: var(--app-ink); }
.app-mark i:nth-child(2) { height: 9px; }
.app-mark i:nth-child(3) { height: 14px; }
.app-period { color: var(--app-lime); }
.app-header .account-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-width: 0; }
.app-header .account-nav > button, .app-header .account-menu > summary {
  margin: 0; padding: 6px 10px; border-color: #47465d; background: transparent; color: #f7f6fd;
  font-size: .81rem;
}
.app-header .account-nav > button:hover:not(:disabled), .app-header .account-menu > summary:hover { background: #303046; }

.checkout-page { margin: 0; }
.checkout-page .app-header { display: flex; align-items: center; box-sizing: border-box; }
.checkout-page .app-mark { box-sizing: border-box; }
.checkout-shell { box-sizing: border-box; padding-block: clamp(26px, 6vw, 54px) 44px; }
@media (min-width: 761px) {
  .checkout-shell {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start; gap: 12px clamp(24px, 4vw, 56px);
  }
  .checkout-payment { grid-row: span 2; }
  .checkout-back { justify-self: start; }
}
@media (max-width: 760px) {
  /* The embedded payment form has a minimum width of 288px. */
  .checkout-payment { margin-inline: min(0px, (100% - 288px) / 2); }
}
.checkout-summary { padding: 19px clamp(15px, 4vw, 25px); border: 1px solid var(--app-line); border-radius: 16px; background: var(--app-lilac); }
.checkout-summary h1 { margin: 0 0 12px; }
.checkout-order { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin: 0; font-weight: 750; }
.checkout-order strong { white-space: nowrap; }
.checkout-note, #checkout-status { color: var(--app-muted); }
.checkout-note { margin: 6px 0 0; font-size: .87rem; }
.checkout-payment { margin-block: 16px; min-height: 56px; }
@media (min-width: 761px) {
  .checkout-payment { margin-block: 0; max-width: 536px; }
}
#checkout-widget { min-width: 288px; }
#checkout-status { margin: 0 0 12px; }
#checkout-retry { padding: 9px 14px; border: 1px solid var(--app-line); cursor: pointer; font: inherit; font-weight: 750; }
.checkout-back { color: var(--app-accent); font-weight: 750; text-underline-offset: 3px; }

#auth-panel, #projects-panel { margin: 16px auto; }
#auth-panel { padding: clamp(18px, 5vw, 36px); background: #fff; border: 1px solid var(--app-line); border-radius: 16px; }
.auth-intro { max-width: 54ch; }
.auth-entry { width: 100%; max-width: 540px; min-width: 0; }
@media (min-width: 761px) {
  #auth-panel {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(24px, 4vw, 64px); align-items: start;
  }
}
.library-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.library-heading h1, .library-heading button { margin: 0; }
.library-heading .primary { background: var(--app-lime); color: var(--app-ink); }
.library-heading .primary:hover:not(:disabled) { background: #d2ee77; color: var(--app-ink); }
#projects-status:empty, #status:empty, #contents-status:empty, #bibliography-status:empty, #projects-panel #save-status:empty { display: none; }
#recovery-panel, #auth-panel { border-color: var(--app-line); }
#recovery-list { display: grid; gap: 9px; }
.recent-project {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center;
  gap: clamp(16px, 4vw, 46px); margin: 22px 0 28px; padding: clamp(18px, 4vw, 38px);
  border: 1px solid #dfdcf1; border-radius: 18px; background: linear-gradient(115deg, #fff 15%, #eeebfa 100%);
}
.recent-project-copy h2 { margin: 4px 0 8px; font-size: clamp(1.25rem, 3vw, 2rem); overflow-wrap: anywhere; }
.recent-eyebrow { margin: 0; color: var(--app-accent); font-weight: 750; font-size: .82rem; }
#recent-project-position { margin: 0 0 16px; color: var(--app-muted); font-size: .91rem; }
.recent-project-copy button { margin: 0; }
.recent-project-art {
  display: grid; place-items: center; position: relative; overflow: hidden; aspect-ratio: 16 / 9;
  padding: 12px; border: 1px solid var(--app-line); border-radius: 10px;
  background: #f8f6ff; color: var(--app-muted); font-size: .83rem; text-align: center;
  box-shadow: 0 12px 24px #23203c15;
}
.recent-project-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; }
.recent-project-art img.is-ready { opacity: 1; }
@media (max-width: 570px) {
  .recent-project { grid-template-columns: minmax(0, 1fr); }
  .recent-project-art { grid-row: 1; }
}
.project-toolbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 8px 16px; margin: 18px 0 12px;
}
.project-toolbar p { margin: 0; color: var(--app-muted); font-size: .87rem; }
.project-toolbar input { width: min(100%, 290px); padding: 7px 11px; font-size: .86rem; }
#project-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.project-card {
  position: relative; min-width: 0; padding: 0; border-color: var(--app-line);
  border-radius: 14px; box-shadow: 0 2px 8px #191a3009;
}
.project-card > a { display: block; height: 100%; border-radius: inherit; color: inherit; text-decoration: none; }
.project-card:hover, .project-card:focus-within { border-color: #a99ce2; box-shadow: 0 5px 20px #27214919; }
.project-cover {
  display: grid; place-items: center; position: relative; overflow: hidden; aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--app-line); border-radius: 13px 13px 0 0;
  background: linear-gradient(140deg, #e9e5fb, #f8f6ff 62%); color: var(--app-accent);
}
.project-cover-label {
  padding: 6px 14px; border: 1px solid #b9afd9; border-radius: 7px;
  background: #f9f7fe; font-weight: 750; font-size: .84rem;
}
.project-cover img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  opacity: 0; transition: transform .2s ease;
}
.project-cover img.is-ready { opacity: 1; }
.project-card:hover .project-cover img { transform: scale(1.025); }
.project-card-info { padding: 12px 14px 14px; }
.project-card-info h3 { margin: 0; font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
.project-card-info p { margin: 5px 0 0; color: var(--app-muted); font-size: .78rem; }
.project-quick-view {
  position: absolute; top: 8px; right: 8px; margin: 0; padding: 7px 10px;
  background: #fff; font-size: .77rem; min-height: 34px;
}
.project-delete { min-height: 44px; color: #803040; }
.project-delete:hover:not(:disabled) { color: #803040; border-color: #d7a8b2; background: #fff3f5; }
#delete-draft-dialog { width: min(450px, calc(100vw - 24px)); }
.project-delete-content { overflow: auto; padding: 16px 20px; }
.project-delete-content p { margin: 0; overflow-wrap: anywhere; }
.project-delete-content p + p { margin-top: 8px; }
#delete-draft-name { font-weight: 800; }
#delete-draft-status:empty { display: none; }
#delete-draft-confirm { background: #803040; color: #fff; border-color: #803040; }
#delete-draft-confirm:hover:not(:disabled) { background: #681f2e; }
.project-empty {
  margin: 14px 0; padding: 24px; border: 1px dashed #b9afd9; border-radius: 12px;
  color: var(--app-muted); background: #fcfbfe;
}
#project-preview-dialog { width: min(790px, calc(100vw - 24px)); }
.project-preview-content { overflow: auto; padding: clamp(10px, 3vw, 19px); min-height: 0; }
.project-preview-content img { display: block; width: 100%; border: 1px solid var(--app-line); border-radius: 8px; aspect-ratio: 16 / 9; }
#project-preview-status { margin: 0; color: var(--app-muted); }
#project-preview-status:empty { display: none; }
@media (prefers-reduced-motion: reduce) {
  .project-cover img { transition: none; }
  .project-card:hover .project-cover img { transform: none; }
}
@media (max-width: 900px) { #project-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 570px) { #project-list { grid-template-columns: minmax(0, 1fr); } }
.project-row {
  gap: 8px 16px; padding: 14px 17px; border: 1px solid var(--app-line);
  border-radius: var(--app-radius); background: #fff;
}
.project-row h3 { font-size: 1rem; }
.project-row p { color: var(--app-muted); font-size: .82rem; }
.project-row button { margin: 0; }

.workspace-toolbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px;
}
.project-bar {
  display: flex; flex: 1 1 360px; flex-wrap: wrap; align-items: center; gap: 4px 14px; min-width: 0; margin: 0; max-width: none;
}
#project-name, #project-name-sizer {
  min-width: 0; padding: 5px 8px; border: 1px solid transparent;
  font-size: clamp(1.17rem, 2.3vw, 1.55rem); font-weight: 800; line-height: 1.55; letter-spacing: -.04em;
}
#project-name {
  flex: 1 1 230px; background: transparent; resize: none; overflow: hidden; white-space: pre;
}
#project-name:hover, #project-name:focus { border-color: var(--app-line); background: #fff; }
#project-name-sizer { display: none; }
@media (max-width: 760px) {
  .project-bar { display: grid; flex-basis: 100%; grid-template-columns: minmax(0, 1fr); }
  #project-name, #project-name-sizer {
    grid-area: 1 / 1; white-space: pre-wrap; overflow-wrap: anywhere;
    padding-inline: 0; border-inline-width: 0;
  }
  #project-name { align-self: stretch; }
  /* The hidden copy keeps the editable field tall enough for all wrapped lines. */
  #project-name-sizer { display: block; visibility: hidden; }
}
.save-actions, .workspace-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.save-actions { margin: 0; color: var(--app-muted); font-size: .77rem; }
#save-status { margin: 0; min-height: 0; }
.save-actions button, .workspace-tools > button { margin: 0; padding: 7px 11px; font-size: .83rem; }
.save-actions button { border-color: transparent; background: transparent; }
.work-tabs { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0 20px; border-bottom: 1px solid var(--app-line); }
.work-tabs button {
  margin: 0; padding: 9px 9px 10px; border: 0; border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0; background: transparent; color: var(--app-muted); font-size: .87rem;
}
.work-tabs button[aria-pressed="true"] { color: var(--app-accent); border-bottom-color: var(--app-accent); }
#status { margin: 0 0 12px; color: var(--app-muted); line-height: 1.45; font-size: .84rem; font-weight: 650; }

.app-disclosure { position: relative; margin: 0; }
.app-disclosure > summary {
  display: flex; align-items: center; width: fit-content; gap: 7px; padding: 7px 11px;
  border: 1px solid var(--app-line); border-radius: 8px; background: #fff;
  color: var(--app-ink); font-size: .83rem; font-weight: 760; list-style: none; cursor: pointer;
}
.app-disclosure > summary::-webkit-details-marker { display: none; }
.app-disclosure > summary::after {
  content: ''; display: block; width: 5px; height: 5px; margin: -3px 1px 0 2px;
  transform: rotate(45deg); border: solid currentColor; border-width: 0 1.5px 1.5px 0;
}
.app-disclosure > summary:hover, .app-disclosure[open] > summary { background: var(--app-lilac); }
.export-menu > summary, .export-menu > summary:hover, .export-menu[open] > summary {
  border-color: #c9e378; background: var(--app-lime); color: var(--app-ink);
}
.app-popover {
  position: absolute; z-index: 4; inset: calc(100% + 7px) 0 auto auto; width: max-content;
  min-width: 168px; max-width: min(280px, calc(100vw - 32px)); padding: 6px;
  border: 1px solid var(--app-line); border-radius: 11px; background: #fff; color: var(--app-ink);
  box-shadow: 0 12px 32px #27214924;
}
.app-popover button { display: block; width: 100%; margin: 0; border-color: transparent; text-align: left; padding: 7px 9px; font-size: .82rem; }
.app-popover .layout-hint, .app-popover #account-email { display: block; margin: 6px 8px; color: var(--app-muted); overflow-wrap: anywhere; font-size: .77rem; }

.work-form {
  margin: 12px 0 0; padding: clamp(17px, 3vw, 34px);
  background: #fff; border: 1px solid var(--app-line); border-radius: 16px;
}
.work-form h2 { margin: 0 0 18px; font-size: clamp(1.37rem, 2.5vw, 1.8rem); }
#brief { max-width: none; }
#brief > .materials-column { min-width: 0; }

@media (max-width: 760px) {
  #auth-panel, .work-form, .recent-project, .checkout-summary {
    margin-inline: calc(-1 * var(--page-gutter));
    padding-inline: var(--page-gutter);
    border-inline: 0;
    border-radius: 0;
  }
  .auth-entry { max-width: none; }
}
@media (min-width: 981px) {
  #brief, #appearance-panel {
    display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 12px clamp(24px, 3vw, 48px); align-items: start;
  }
  .materials-parameters { padding-inline-start: clamp(18px, 2.4vw, 36px); border-inline-start: 1px solid var(--app-line); }
  #brief #topic { min-height: 180px; }
  #brief .settings { margin-top: 0; grid-template-columns: minmax(0, 1fr) minmax(88px, .4fr); gap: 0 16px; }
  #brief .settings > :first-child, #appearance-panel h2 { grid-column: 1 / -1; }
}

.generation-progress {
  padding: clamp(20px, 4vw, 36px); border-radius: inherit;
  background: radial-gradient(ellipse at 88% 0%, #3c325a 0%, transparent 55%), #1b1a32;
  color: #fbf9ff;
}
html:has(#generation-wait-dialog[open]) { overflow: hidden; }
#generation-wait-dialog {
  width: min(750px, calc(100vw - 28px));
  max-height: calc(100dvh - 32px);
}
#generation-wait-dialog[open] {
  display: block;
  overflow: auto;
  overscroll-behavior: contain;
  border-color: #5b5078;
  background: #1b1a32;
  box-shadow: 0 24px 84px #12102675;
  animation: generation-dialog-in .18s ease-out;
}
#generation-wait-dialog::backdrop {
  background: #1c193b70;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
@keyframes generation-dialog-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
.generation-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, .47fr); align-items: center; gap: 16px; }
.generation-copy h2 { margin: 0 0 12px; font-size: clamp(1.55rem, 3.8vw, 2.35rem); line-height: 1.12; }
.generation-copy p { margin: 0; }
.generation-current { color: #f3f0ff; font-weight: 750; }
.generation-copy .generation-estimate { min-height: 1.55em; margin-top: 5px; color: #cbc4e4; font-size: .87rem; font-variant-numeric: tabular-nums; }
.generation-art { position: relative; aspect-ratio: 1.5; isolation: isolate; }
.generation-sheet { position: absolute; width: 78%; height: 74%; border: 1px solid #ad9bd780; border-radius: 10px; box-sizing: border-box; }
.generation-sheet-back { inset: 6% auto auto 18%; transform: rotate(12deg); background: #3d3461; }
.generation-sheet-middle { inset: 13% auto auto 8%; transform: rotate(-10deg); background: #5a4d80; }
.generation-sheet-front {
  inset: 13% auto auto 11%; display: grid; grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr .55fr 2.4fr; gap: 10%; padding: 10%;
  background: #eee9ff; border-color: #dcd3f7; box-shadow: 0 8px 22px #14122765;
  animation: generation-sheet-float 3.8s ease-in-out infinite;
}
.generation-sheet-front i { display: block; border-radius: 4px; background: #d2c6ef; }
.generation-sheet-front i:first-child { grid-column: span 2; width: 64%; background: #433665; }
.generation-sheet-front i:nth-child(2) { grid-column: span 2; width: 44%; }
.generation-sheet-front i:last-child { background: var(--app-lime); }
@keyframes generation-sheet-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6%) rotate(1deg); }
}
.generation-steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 7px; margin: 19px 0 0; padding: 0; list-style: none; }
.generation-step { position: relative; min-width: 0; color: #cac3e3; font-size: .78rem; font-weight: 650; }
.generation-step::before { content: ''; display: block; height: 5px; margin-bottom: 7px; border-radius: 9px; background: #6e6389; }
.generation-step[data-complete]::before { background: #baa8ee; }
.generation-step[aria-current="step"] { color: var(--app-lime); }
.generation-step[aria-current="step"]::before { background: var(--app-lime); }
.generation-step[aria-current="step"]::after {
  content: ''; position: absolute; inset: 0 auto auto 0; width: 40%; height: 5px; border-radius: 9px;
  background: linear-gradient(90deg, transparent, #fff9, transparent);
  animation: generation-step-sheen 1.9s ease-in-out infinite;
}
@keyframes generation-step-sheen {
  0% { transform: translateX(0); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateX(150%); opacity: 0; }
}
.generation-request { margin: 21px 0 0; padding-top: 11px; border-top: 1px solid #ffffff29; color: #ded7f4; font-size: .84rem; }
.generation-request summary { width: fit-content; min-height: 24px; }
.generation-request summary:focus-visible { outline-color: #e0f68a; }
.generation-request p { max-height: 8em; overflow: auto; margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .generation-top { grid-template-columns: minmax(0, 1fr) 82px; gap: 8px; }
  .generation-step { font-size: .7rem; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  #generation-wait-dialog[open] { animation: none; }
  .generation-sheet-front { animation: none; }
  .generation-step[aria-current="step"]::after { display: none; }
}
.work-form #topic { min-height: 125px; }
.work-form .brief-examples p { color: var(--app-muted); font-size: .82rem; }
.work-form .brief-examples button { margin-bottom: 2px; padding: 5px 9px; font-size: .79rem; background: #f7f5fc; }
.work-form .settings { margin: 12px 0 14px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(85px, .55fr); }
.work-form select, .work-form input { min-width: 0; }
.work-form .source-panel, .work-form .form-options, .work-form .publishing-options {
  margin: 12px 0 0; padding: 9px 12px; border: 1px solid var(--app-line); border-radius: 9px; background: #f9f8fc;
}
.work-form summary { cursor: pointer; font-weight: 750; }
.work-form summary small { margin-left: 5px; font-weight: 500; }
.work-form .source-format { margin: 6px 0 12px; }
.work-form .source-format summary { font-size: .85rem; }
.work-form .presentation-style-control { margin: 12px 0; padding: 0; border: 0; }
.work-form input[type="checkbox"] { display: inline-block; width: auto; }
.work-form input[type="file"] { max-width: 100%; font-size: .82rem; }
.work-form #generate { margin-top: 4px; }
#source-controls { min-inline-size: 0; }
#source-files { overflow-wrap: anywhere; }
#source-review { margin-top: 14px; padding: 13px; border: 1px solid var(--app-line); border-radius: 9px; background: #fff; }
#source-review > label { margin-top: 0; }
#source-files, #source-privacy { margin: 5px 0 9px; }
.source-review-state, .source-review-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.source-review-state p { margin: 6px 0; font-size: .82rem; }
.source-review-actions button { margin: 3px 0; }
#import-status:empty { display: none; }
.ai-submit {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 13px; margin-top: 16px;
}
.ai-submit > .primary, .work-form .ai-submit > #generate { margin: 0; }
.ai-submit small { max-width: 44ch; }

.slide-workspace { display: grid; grid-template-columns: 181px minmax(0, 1fr); gap: clamp(12px, 2vw, 22px); align-items: start; }
.slide-rail {
  position: sticky; top: 12px; padding: 10px; min-width: 0;
  border: 1px solid var(--app-line); border-radius: var(--app-radius); background: #fff;
}
.rail-heading { display: flex; justify-content: space-between; align-items: center; margin: 0 1px 5px; }
.rail-heading h2 { margin: 0; font-size: .92rem; }
#slide-count { color: var(--app-muted); font-size: .73rem; }
.rail-insert { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 7px; }
.rail-insert button, .rail-insert summary { margin: 0; padding: 6px 8px; font-size: .75rem; }
.insert-palette {
  z-index: 5; left: 0; right: auto; width: 236px; max-height: min(480px, 56vh); overflow: auto;
}
.insert-palette fieldset { margin: 0; padding: 4px 2px 7px; border: 0; }
.insert-palette fieldset + fieldset { border-top: 1px solid var(--app-line); }
.insert-palette legend { padding: 5px 5px 0; font-size: .72rem; font-weight: 750; color: var(--app-muted); }
#contents-status, #bibliography-status { color: var(--app-muted); margin: 6px 2px; font-size: .77rem; }
#slide-overview {
  display: flex; flex-direction: column; gap: 5px; padding: 4px; margin: 0;
  max-height: clamp(220px, calc(100dvh - 263px), 790px); overflow: auto; scrollbar-width: thin;
}
#slide-overview .slide-thumb {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; width: 100%; min-width: 0; margin: 0; padding: 5px;
  border: 1px solid transparent; border-radius: 8px; white-space: normal; text-align: left;
}
#slide-overview .slide-thumb[aria-current="true"] { background: var(--app-lilac); border-color: #a99ce2; }
#slide-overview .slide-thumb:focus-visible { outline-offset: 1px; }
#slide-overview .thumb-frame {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  padding: 0; border: 1px solid var(--app-line); border-radius: 5px; background: #f6f5fa; overflow: hidden;
}
#slide-overview .thumb-frame img { width: 100%; height: 100%; margin: 0; object-fit: contain; border: 0; }
#slide-overview .thumb-number {
  position: absolute; left: 4px; bottom: 4px; min-width: 19px; padding: 1px 3px;
  border-radius: 4px; background: #222138; color: #fff; text-align: center; font-size: .65rem;
}
#slide-overview .thumb-caption { width: 100%; padding: 0 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--app-muted); font-size: .71rem; }
.slide-thumb.excluded-overview .thumb-frame { opacity: .64; }

#cards { display: block; }
.slide-card {
  min-width: 0; padding: clamp(13px, 2vw, 23px); border-color: var(--app-line); border-radius: var(--app-radius);
}
.slide-card .slide-heading { align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.slide-card .slide-heading h3 { font-size: 1.01rem; }
.slide-card .slide-actions { gap: 5px; }
.slide-card .slide-actions > button, .slide-menu > summary { margin: 0; padding: 6px 8px; font-size: .76rem; }
.slide-card .slide-content { grid-template-columns: minmax(0, 1.55fr) minmax(330px, 1fr); align-items: start; gap: clamp(12px, 2vw, 24px); margin-top: 15px; }
.slide-card .preview { min-width: 0; border-radius: 7px; border-color: var(--app-line); background: #f1f0f6; }
.slide-card .preview img { object-fit: contain; min-width: 0; min-height: 0; }
.slide-fields { min-width: 0; }
.slide-fields label { font-size: .82rem; margin-top: 10px; }
.slide-fields label:first-child { margin-top: 0; }
.slide-fields :is(input,select,textarea) { padding: 8px 9px; font-size: .87rem; }
.slide-fields textarea { min-height: 79px; }
.slide-fields .layout-hint { font-size: .75rem; margin-bottom: 6px; }
.preview-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 0; margin-bottom: 6px; }
.preview-meta button { margin: 0; padding: 4px 8px; font-size: .78rem; }
#preview-status { margin: 0; min-height: 0; color: var(--app-muted); font-size: .77rem; }
.preview-meta:has(#preview-status:empty) { display: none; }
.quality-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.quality-heading h3 { margin: 0; font-size: 1rem; }
#quality-panel { margin: 0 0 12px; padding: 12px 16px; background: var(--app-lilac); border-color: var(--app-line); }
#close-quality { min-width: 34px; min-height: 34px; margin: 0; padding: 0; font-size: 1.2rem; }
#quality-status { margin: 5px 0; }
#quality-issues { max-height: min(36vh, 300px); overflow: auto; }
#quality-issues:empty { display: none; }
.slide-card :is(.slide-data, .image-editor, .own-image-editor) { border-color: var(--app-line); }
.slide-card .image-editor { margin-inline: 0; padding-inline: 0; }
.slide-card .data-grid-scroll { max-width: 100%; }
.slide-card .table-header-row { background: var(--app-lilac); }

.slide-inspector { min-width: 0; }
.inspector-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; padding: 3px; border: 1px solid var(--app-line); background: var(--app-paper); border-radius: 9px; }
.inspector-tabs button { flex: 1 1 auto; margin: 0; padding: 7px 8px; border: 1px solid transparent; background: transparent; color: var(--app-muted); min-height: 36px; font-size: .77rem; }
.inspector-tabs button[aria-selected="true"] { background: #fff; color: var(--app-accent); border-color: var(--app-line); box-shadow: 0 1px 2px #191a3010; }
.slide-inspector [role="tabpanel"] { min-width: 0; }
.slide-inspector .slide-data { margin: 0; padding: 0; border: 0; }
.slide-inspector .slide-data h4 { font-size: .94rem; }
.slide-inspector .slide-data .layout-hint { font-size: .79rem; }
.slide-inspector .slide-data button { font-size: .8rem; }
.slide-inspector .data-grid-scroll { margin: 8px 0; }
.slide-inspector .data-editor { font-size: .78rem; }
.slide-inspector .data-editor :is(th, td) { padding: 4px; border-color: var(--app-line); }
.slide-inspector .data-editor td:last-child { width: 1%; }
.slide-inspector .data-editor input { min-width: 66px; padding: 6px; }
.slide-inspector .data-editor textarea { min-width: 90px; min-height: 50px; padding: 5px; }
.slide-inspector .data-editor .data-icon-button { min-width: 30px; min-height: 30px; margin: 0 0 2px; padding: 0; font-size: .95rem; }
.slide-inspector .data-editor th .data-icon-button { margin-inline-start: 4px; }
.data-options { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--app-line); border-radius: 8px; background: var(--app-paper); }
.data-options summary { cursor: pointer; font-size: .84rem; font-weight: 700; }
.data-options .chart-settings { grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr)); gap: 6px 10px; margin-top: 8px; }
.data-options .chart-settings label, .slide-inspector .chart-series label { margin-top: 5px; font-size: .78rem; }
.data-options .chart-settings :is(input:not([type=checkbox]), select), .slide-inspector .chart-series input { padding: 6px 8px; font-size: .82rem; }
.phone-editor-switch { display: none; }
.slide-inspector .image-editor { padding-top: 0; border-top: 0; }
.slide-inspector .image-options { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 8px; }
.slide-inspector .image-option { padding: 8px; overflow-wrap: anywhere; }
.slide-inspector .image-option img { max-height: 120px; }
.image-status:empty, .image-options:empty { display: none; }
.image-settings {
  margin-top: 8px; padding: 8px 10px; border: 1px solid var(--app-line);
  border-radius: 8px; background: #fcfbfe;
}
.image-settings summary { cursor: pointer; font-weight: 750; font-size: .84rem; }
.slide-inspector .own-image-editor { margin-top: 0; }
.slide-inspector .paste-image { padding: 8px 10px; color: var(--app-muted); font-size: .77rem; }
.slide-inspector input[type="file"] { padding: 7px; font-size: .78rem; }
.slide-notes label { margin-top: 7px; font-size: .84rem; }
.slide-notes label :is(input, textarea), .block-fields label :is(input, textarea) { margin-top: 4px; font-weight: 500; }
.slide-notes fieldset { min-width: 0; margin: 14px 0 0; padding: 7px 11px 10px; border: 1px solid var(--app-line); border-radius: 9px; }
.slide-notes legend { padding-inline: 4px; font-size: .86rem; font-weight: 800; }

.block-editor { margin-top: 14px; }
.block-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.block-heading h4 { margin: 0; font-size: .9rem; }
.block-heading small { white-space: nowrap; }
.block-list { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 5px; }
.block-list li { min-width: 0; border: 1px solid var(--app-line); border-radius: 9px; }
.block-toggle {
  width: 100%; min-height: 44px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 8px; margin: 0; padding: 7px 9px; border: 0; text-align: left;
}
.block-toggle[aria-expanded="true"] { background: var(--app-lilac); color: var(--app-accent); border-radius: 8px 8px 0 0; }
.block-toggle::after {
  content: ''; width: 6px; height: 6px; margin-right: 3px; transform: rotate(45deg);
  border: solid currentColor; border-width: 0 1.5px 1.5px 0;
}
.block-toggle[aria-expanded="true"]::after { transform: rotate(225deg); }
.block-ordinal { min-width: 22px; padding: 2px 4px; background: var(--app-paper); border-radius: 4px; color: var(--app-muted); text-align: center; font-size: .75rem; }
.block-summary > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.block-summary > span { color: var(--app-muted); font-size: .75rem; font-weight: 500; }
.block-summary > span:empty { display: none; }
.block-fields { padding: 8px 10px 9px; }
.block-fields label { margin: 0 0 8px; }
.slide-fields .block-fields textarea { min-height: 60px; }
.block-actions, .block-confirmation { display: flex; flex-wrap: wrap; gap: 6px; }
.block-actions button, .block-confirmation button, .block-add { margin: 0; padding: 6px 9px; min-height: 35px; font-size: .78rem; }
.block-actions button:last-child { margin-left: auto; }
.block-confirmation { margin-top: 8px; padding: 8px; background: #fff3f0; border-radius: 7px; }
.block-confirmation p { flex: 1 0 100%; margin: 0; color: #813423; font-size: .82rem; }

dialog:not(#deck-review) { border-color: var(--app-line); border-radius: 16px; color: var(--app-ink); background: #fff; box-shadow: 0 18px 60px #18192c38; }
dialog::backdrop { background: #18192c99; }
.rewrite-actions { background: var(--app-paper); border-color: var(--app-line); }
#deck-review { background: #18192c; }
.deck-review-stage { background: #10101d; }
.deck-review-notes { background: #25263c; }

@media (min-width: 941px) {
  .slide-card .preview { position: sticky; top: 12px; }
}

#brand-presets-dialog {
  width: min(640px, calc(100% - 24px));
  max-height: min(760px, calc(100dvh - 28px));
  border-color: var(--app-line);
  border-radius: 16px;
  background: #fff;
  color: var(--app-ink);
  box-shadow: 0 18px 60px #18192c38;
}

#brand-presets-dialog::backdrop { background: #18192c99; }

.brand-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: none;
  padding: 12px clamp(14px, 4vw, 24px);
  border-bottom: 1px solid var(--app-line);
}

.brand-dialog-heading h2 { margin: 0; line-height: 1.2; overflow-wrap: anywhere; }

#brand-presets-close, .dialog-close {
  flex: 0 0 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  color: var(--app-muted);
  font-size: 1.4rem;
  line-height: 1;
}

.brand-library {
  overflow-y: auto;
  min-height: 0;
  padding: clamp(14px, 4vw, 24px);
  overflow-wrap: anywhere;
}

.brand-library label { margin-top: 0; font-size: .88rem; }
.brand-library :is(input, select, button) { min-width: 0; min-height: 44px; font-size: .85rem; }
.brand-library .brand-actions { margin: 8px 0; align-items: stretch; }
#brand-presets-status { margin: 0 0 12px; color: var(--app-muted); }
#brand-presets-status:empty, .brand-previews:empty { display: none; }

#brand-preset-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  padding: 12px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-paper);
}

#brand-preset-create-form label { grid-column: 1 / -1; margin: 0; }
#brand-preset-create { margin: 0; }
#brand-preset-apply,
#brand-preset-selection[hidden] ~ #brand-preset-create-form #brand-preset-create {
  border: 1px solid #c9e378;
  background: var(--app-lime);
  color: var(--app-ink);
}

#brand-preset-apply:hover:not(:disabled),
#brand-preset-selection[hidden] ~ #brand-preset-create-form #brand-preset-create:hover:not(:disabled) {
  background: #d2ee77;
}

#brand-preset-manage {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--app-line);
  border-radius: 9px;
}

#brand-preset-manage summary { font-size: .87rem; font-weight: 750; }
#brand-preset-rename-form { margin-top: 10px; }

.brand-previews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 225px), 1fr));
  gap: 10px;
  margin: 12px 0;
}

.brand-previews figure { margin: 0; min-width: 0; }
.brand-previews img { display: block; width: 100%; border: 1px solid var(--app-line); border-radius: 7px; }
.brand-previews figcaption { margin-top: 5px; color: var(--app-muted); font-size: .8rem; }

#usage-dialog { width: min(670px, calc(100vw - 24px)); max-height: calc(100dvh - 28px); }
#usage-dialog .usage-content { padding: clamp(13px, 4vw, 21px); }
#generation-purchase { width: min(540px, calc(100vw - 24px)); }
#generation-purchase .usage-content { display: grid; gap: 14px; padding: 16px clamp(14px, 4vw, 22px); }
#generation-purchase p { margin: 0; color: var(--app-muted); }
#generation-purchase-status:empty { display: none; }
#generation-purchase-options { min-width: 0; margin: 0; padding: 0; border: 0; }
#generation-purchase-options legend { margin-bottom: 8px; font-weight: 800; }
#generation-purchase-choices { display: grid; gap: 7px; }
.generation-purchase-choice {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 52px; margin: 0; padding: 8px 12px; border: 1px solid var(--app-line);
  border-radius: 10px; background: #fff; cursor: pointer;
}
.generation-purchase-choice:has(input:checked) { border-color: #8d78ce; background: var(--app-lilac); }
.generation-purchase-choice input { margin: 0; accent-color: var(--app-accent); }
.generation-purchase-choice small { display: block; font-weight: 600; }
.generation-purchase-choice .purchase-price { text-align: right; white-space: nowrap; }
#generation-purchase .monthly-renewal-terms {
  flex: 1 0 100%;
  min-width: 0;
  margin: 0;
  color: var(--app-ink);
  font-size: .88rem;
  line-height: 1.45;
}
#generation-purchase.first-purchase .monthly-renewal-terms { color: var(--purchase-text); }
#generation-purchase-terms { font-size: .82rem; }
#generation-purchase-subscribe, #generation-purchase-pay, #payment-actions .monthly-payment-primary {
  max-width: 100%; min-height: 44px; white-space: normal;
}
#generation-purchase-pay, #generation-purchase .monthly-payment-primary,
#payment-actions .monthly-payment-primary { background: var(--app-lime); color: var(--app-ink); }
#generation-purchase-pay:hover:not(:disabled), #generation-purchase .monthly-payment-primary:hover:not(:disabled),
#payment-actions .monthly-payment-primary:hover:not(:disabled) { background: #d2ee77; }
#generation-purchase-subscribe:focus-visible, #generation-purchase-pay:focus-visible,
#payment-actions .monthly-payment-primary:focus-visible {
  outline: 2px solid var(--app-accent);
  outline-offset: 3px;
}

#generation-purchase.first-purchase {
  --purchase-text: #fbf8ff;
  --purchase-muted: #ded3ed;
  --purchase-line: #75658e;
  --purchase-pad: clamp(15px, 5vw, 30px);
  width: min(565px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  border: 1px solid var(--purchase-line);
  border-radius: 21px;
  background: radial-gradient(ellipse at 88% 0%, #473265, transparent 65%), #28203f;
  color: var(--purchase-text);
  box-shadow: 0 22px 65px #150c255e;
}
#generation-purchase.first-purchase::backdrop {
  background: #160f25ab;
  backdrop-filter: blur(4px);
}
#generation-purchase.first-purchase .brand-dialog-heading {
  border: 0;
  padding: var(--purchase-pad) calc(var(--purchase-pad) + 48px) 0 var(--purchase-pad);
}
#generation-purchase.first-purchase #generation-purchase-trial {
  margin: 0 0 6px;
  color: #e5d8fb;
  font-weight: 750;
  font-size: .85rem;
}
#generation-purchase.first-purchase h2 {
  margin: 0;
  font-size: clamp(1.38rem, 5.3vw, 2.02rem);
  line-height: 1.12;
  letter-spacing: -.045em;
}
#generation-purchase.first-purchase .usage-content {
  gap: 13px;
  padding: 15px var(--purchase-pad) 0;
}
#generation-purchase.first-purchase p,
#generation-purchase.first-purchase .first-purchase-request span {
  color: var(--purchase-muted);
}
#generation-purchase.first-purchase .first-purchase-request,
#generation-purchase.first-purchase .first-purchase-plan {
  display: grid;
  gap: 3px;
  border: 1px solid var(--purchase-line);
  border-radius: 11px;
  padding: 10px 13px;
  background: #33284c;
}
#generation-purchase.first-purchase .first-purchase-request {
  overflow-wrap: anywhere;
}
#generation-purchase.first-purchase .first-purchase-request span { font-size: .83rem; }
#generation-purchase.first-purchase .first-purchase-request strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
#generation-purchase.first-purchase .first-purchase-plan {
  gap: 9px;
  background: #302447;
  border-color: #907cac;
}
#generation-purchase.first-purchase .first-purchase-plan-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}
#generation-purchase.first-purchase .first-purchase-plan h3 {
  margin: 0;
  font-size: 1.19rem;
}
#generation-purchase.first-purchase .first-purchase-plan-top strong {
  color: var(--purchase-text);
  font-size: clamp(1.36rem, 5vw, 1.8rem);
  line-height: 1.2;
  white-space: nowrap;
}
#generation-purchase.first-purchase .first-purchase-plan-top span { font-size: .83rem; }
#generation-purchase.first-purchase .first-purchase-plan ul {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
#generation-purchase.first-purchase .first-purchase-plan li {
  border-radius: 6px;
  padding: 4px 8px;
  font-size: .81rem;
  background: #46385e;
}
#generation-purchase.first-purchase #generation-purchase-choices {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
#generation-purchase.first-purchase .generation-purchase-choice {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 8px;
  color: var(--purchase-text);
  background: #33284c;
  border-color: var(--purchase-line);
}
#generation-purchase.first-purchase .generation-purchase-choice:has(input:checked) {
  border-color: #c7b1e7;
  background: #51406b;
}
#generation-purchase.first-purchase .generation-purchase-choice:has(input:focus-visible) {
  outline: 2px solid #e9dcff;
  outline-offset: 2px;
}
#generation-purchase.first-purchase .generation-purchase-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
#generation-purchase.first-purchase .generation-purchase-choice .purchase-price { text-align: left; }
#generation-purchase.first-purchase .generation-purchase-choice small { color: var(--purchase-muted); }
#generation-purchase.first-purchase .rewrite-actions {
  gap: 8px 10px;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 14px var(--purchase-pad) var(--purchase-pad);
}
#generation-purchase.first-purchase #generation-purchase-close,
#generation-purchase.first-purchase #generation-purchase-all {
  background: #32274b;
  color: var(--purchase-text);
  border-color: var(--purchase-line);
}
#generation-purchase.first-purchase #generation-purchase-close:hover:not(:disabled),
#generation-purchase.first-purchase #generation-purchase-all:hover:not(:disabled) { background: #51406b; }
#generation-purchase.first-purchase #generation-purchase-subscribe:focus-visible,
#generation-purchase.first-purchase #generation-purchase-pay:focus-visible { outline-color: var(--app-lime); }
#generation-purchase.first-purchase #generation-purchase-close {
  position: absolute;
  inset: var(--purchase-pad) var(--purchase-pad) auto auto;
  width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 1.45rem;
  line-height: 1;
}
#generation-purchase.first-purchase #generation-purchase-pay,
#generation-purchase.first-purchase #generation-purchase-all { min-height: 44px; }
#generation-purchase.first-purchase #generation-purchase-return { flex: 1 0 100%; font-size: .83rem; }
#generation-purchase.first-purchase #generation-purchase-terms a { color: #e9dcff; }
#generation-purchase.first-purchase #generation-purchase-status { color: var(--purchase-text); }
@media (max-width: 480px) {
  #generation-purchase-subscribe, #generation-purchase-pay { width: 100%; }
}

.usage-overview {
  padding: clamp(12px, 3vw, 18px); border: 1px solid var(--app-line);
  border-radius: var(--app-radius); background: var(--app-paper);
}
.usage-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px,100%),1fr)); gap: 10px; }
.usage-overview h3 { margin: 0 0 7px; font-size: .91rem; }
.usage-edits { background: var(--app-lilac); }
.usage-edits p:not(.usage-balance) { margin: 7px 0 10px; font-size: .83rem; color: var(--app-muted); }
#usage-buy-edits { margin: 0; }
.rewrite-balances { margin: 12px 0 7px; border-radius: 10px; background: var(--app-lilac); padding: 3px 12px; }
.rewrite-balances > div { display: flex; justify-content: space-between; gap: 6px 12px; padding: 7px 0; }
.rewrite-balances > div + div { border-top: 1px solid var(--app-line); }
.rewrite-balances dd { margin: 0; text-align: right; font-weight: 750; }
.usage-balance {
  margin: 0; font-size: clamp(1.28rem, 4.4vw, 1.7rem); font-weight: 800;
  line-height: 1.2; letter-spacing: -.045em;
}
#usage-rules, #usage-pending, #usage-status { margin: 8px 0 0; font-size: .85rem; color: var(--app-muted); }
#usage-breakdown { margin: 12px 0 0; }
#usage-breakdown > div {
  display: flex; justify-content: space-between; align-items: start; gap: 6px 12px;
  padding: 8px 0; border-top: 1px solid var(--app-line);
}
#usage-breakdown > div:last-child { padding-bottom: 0; }
#usage-breakdown dt { font-size: .85rem; font-weight: 750; }
#usage-breakdown dt small { display: block; font-weight: 500; }
#usage-breakdown dd { margin: 0; font-weight: 800; }
.usage-pricing {
  display: inline-flex; margin: 12px 0 4px; padding: 7px 11px; border: 1px solid #c9e378; border-radius: 8px;
  color: var(--app-ink); background: var(--app-lime); text-decoration: none; font-weight: 750; font-size: .86rem;
}
.usage-pricing:hover { background: #d2ee77; }
.usage-section { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--app-line); border-radius: 9px; }
.usage-section summary { color: var(--app-ink); font-size: .88rem; font-weight: 750; }
.usage-section p { color: var(--app-muted); font-size: .83rem; }
.usage-section #payment-actions { margin-bottom: 0; container: billing-actions / inline-size; }
#payment-actions button { margin: 0; }
#payment-actions > p { flex: 1 0 100%; margin: 0; }
#payment-actions .monthly-renewal-terms { min-width: 0; }
.billing-subscription-plans {
  display: grid; flex: 1 0 100%; min-width: 0; gap: 8px;
  grid-template-columns: minmax(0, 1fr);
}
.billing-subscription-plans button {
  display: grid; align-content: start; gap: 4px; min-width: 0;
  padding: 10px 12px; text-align: left;
}
.billing-subscription-plans button > * { white-space: nowrap; }
.billing-subscription-plans button span { font-weight: 500; }
@container billing-actions (min-width: 540px) {
  .billing-subscription-plans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.usage-history { list-style: none; margin: 6px 0 0; padding: 0; }
.usage-history li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start;
  padding: 9px 0; gap: 4px 8px; border-bottom: 1px solid var(--app-line); overflow-wrap: anywhere;
}
.usage-history li strong, .usage-outcome span { display: block; font-size: .85rem; }
.usage-history li p { margin: 2px 0 0; }
.usage-outcome { text-align: right; }
.usage-history-error { grid-column: 1 / -1; color: #8a3c2a; }
.usage-history li button { justify-self: start; margin: 0; padding: 5px 8px; font-size: .8rem; }
#usage-history-note { display: block; margin-top: 8px; }
:is(#usage-rules, #usage-summary, #usage-breakdown, #usage-status, #usage-history, #usage-history-status, #payment-status):empty { display: none; }

@media (max-width: 480px) {
  .app-header .account-nav { position: relative; width: 100%; }
  .account-menu { position: static; }
  .account-menu > .app-popover { max-width: 100%; }
  #brand-preset-create-form { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 940px) {
  .slide-workspace { grid-template-columns: 157px minmax(0, 1fr); }
  .slide-card .slide-content { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 690px) {
  .app-main { padding-top: 15px; }
  .app-header { row-gap: 8px; }
  .app-header .studio-brand { gap: 5px 12px; }
  .workspace-toolbar { gap: 10px; }
  .app-header .account-nav, #workspace-tools {
    display: grid; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch;
  }
  .app-header .account-nav > button, .app-header .account-menu > summary,
  #workspace-tools > button, #export-menu > summary { padding-inline: 4px; }
  .app-header .account-menu > summary, #export-menu > summary {
    width: 100%; height: 100%; justify-content: center;
  }
  .save-actions > button { margin-inline-start: auto; }
  #workspace-tools { position: relative; }
  #export-menu { position: static; }
  #export-menu > .app-popover { max-width: 100%; }
  .work-tabs { justify-content: space-between; gap: 5px; margin-bottom: 12px; }
  .work-tabs > button { padding-inline: 0; }
  .slide-workspace { grid-template-columns: minmax(0, 1fr); }
  .slide-rail, .slide-card {
    margin-inline: calc(-1 * var(--page-gutter));
    padding-inline: var(--page-gutter);
    border-inline: 0;
    border-radius: 0;
  }
  .slide-rail { position: static; }
  .rail-heading { float: left; gap: 10px; min-height: 32px; margin-inline: 0; }
  .rail-insert { justify-content: end; }
  #insert-menu .insert-palette { left: auto; right: 0; }
  #slide-overview { clear: both; flex-direction: row; max-height: none; padding-inline: 0; }
  #slide-overview .slide-thumb { width: 103px; }
  #slide-overview .slide-thumb:focus-visible { outline-offset: -2px; }
  .slide-card .slide-heading { align-items: flex-start; }
  .slide-card .slide-actions { width: 100%; }
  .slide-heading .slide-actions { position: relative; }
  .slide-menu { position: static; }
  .slide-menu > .app-popover { max-width: 100%; }
  .slide-card .slide-actions > button, .slide-menu > summary { min-height: 34px; }
  .slide-card .slide-content { margin-top: 10px; }
  .phone-editor-switch {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
    margin-bottom: 10px; padding: 3px; border: 1px solid var(--app-line); border-radius: 10px; background: var(--app-paper);
  }
  .phone-editor-switch button { min-height: 36px; margin: 0; padding: 5px 8px; background: transparent; border-color: transparent; }
  .phone-editor-switch button[aria-pressed="true"] { background: #fff; border-color: var(--app-line); color: var(--app-accent); }
  #editor[data-phone-panel="slide"] :is(.slide-inspector, .slide-card > .slide-data, .slide-card > .image-editor) { display: none; }
  #editor[data-phone-panel="edit"] .slide-card .preview { display: none; }
  .work-form .settings { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
