:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  background: #111211;
  color: #f2f0e7;
  --muted: #92978d;
  --accent: #d7f77c;
  --line: #30342d;
  --foreground: #f2f0e7;
  --control-line: #6c8050;
  --input-surface: oklch(0.26 0.01 134);
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 800;
  --rhyme-0: oklch(0.8 0.15 130 / 0.48);
  --rhyme-1: oklch(0.8 0.12 230 / 0.48);
  --rhyme-2: oklch(0.8 0.13 55 / 0.48);
  --rhyme-3: oklch(0.8 0.13 330 / 0.48);
  --rhyme-4: oklch(0.8 0.12 185 / 0.48);
  --rhyme-5: oklch(0.8 0.105 290 / 0.48);
}
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}
header {
  padding: calc(12px + env(safe-area-inset-top, 0px)) max(4vw, env(safe-area-inset-right, 0px)) 12px
    max(4vw, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  letter-spacing: 0.14em;
  font-weight: var(--weight-bold);
  color: #f2f0e7;
  text-decoration: none;
}
.brand span {
  font-weight: var(--weight-normal);
  font-size: 0.7rem;
  color: var(--muted);
}
.pilot,
.eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: var(--weight-semibold);
}
footer {
  padding: 25px max(4vw, env(safe-area-inset-right, 0px))
    calc(25px + env(safe-area-inset-bottom, 0px)) max(4vw, env(safe-area-inset-left, 0px));
  color: var(--muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--line);
}
a {
  color: var(--accent);
  touch-action: manipulation;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
p {
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
::selection {
  background: var(--accent);
  color: #182009;
}
.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus-visible {
  left: 16px;
  top: 16px;
  background: #111211;
  padding: 12px 16px;
  min-height: 44px;
}
h1 {
  font-weight: var(--weight-medium);
  letter-spacing: -0.04em;
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1.07;
}
h2 {
  font-size: 1.55rem;
  font-weight: var(--weight-medium);
  letter-spacing: -0.02em;
}
h3 {
  font-size: 1rem;
}
.muted {
  color: var(--muted);
  line-height: 1.6;
}
.small {
  font-size: 0.875rem;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.login {
  max-width: 800px;
  padding: 9vh 7vw 12vh;
}
.login h1 {
  font-size: clamp(4rem, 9vw, 7.5rem);
}
.login > p {
  max-width: 420px;
  line-height: 1.6;
}
.library {
  max-width: 1100px;
  margin: auto;
  padding: 6vh max(4vw, env(safe-area-inset-right, 0px)) 6vh
    max(4vw, env(safe-area-inset-left, 0px));
}
.draft-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 15px;
  margin: 30px 0;
}
.draft-list article {
  padding: 0;
  background: #1b1e19;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.draft-list h2 {
  overflow-wrap: anywhere;
}
.draft-list a {
  text-decoration: none;
  color: inherit;
}
.empty {
  padding: 50px 0;
  color: var(--muted);
}
button,
.button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--control-line);
  background: #22261e;
  color: inherit;
  padding: 11px 16px;
  border-radius: 6px;
  font-size: 0.82rem;
  display: inline-block;
  text-decoration: none;
  min-height: 44px;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  line-height: 1.35;
  transition:
    background-color 150ms ease-out,
    border-color 150ms ease-out,
    color 150ms ease-out,
    transform 150ms ease-out;
}
@media (hover: hover) and (pointer: fine) {
  button:hover:not(:disabled),
  .button:hover {
    background: #32392b;
  }
  .primary:hover:not(:disabled) {
    background: #e4ffa3;
  }
}
button:active:not(:disabled),
.button:active {
  background: #32392b;
  transform: scale(0.96);
}
.primary:active:not(:disabled) {
  background: #e4ffa3;
}
button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: #22261e;
  border-color: var(--line);
}
button[aria-busy='true'] {
  border-color: var(--muted);
  cursor: wait;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #182009;
  font-weight: 650;
}
.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.danger {
  color: #e49c8c;
}
input,
textarea,
select {
  font: inherit;
  color: inherit;
  background: var(--input-surface);
  border: 1px solid var(--control-line);
  border-radius: 5px;
  padding: 10px;
  width: 100%;
  font-size: 16px;
  min-height: 44px;
  touch-action: manipulation;
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: var(--accent);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
input[type='checkbox'] {
  width: auto;
  margin-right: 8px;
  min-height: auto;
}
label {
  display: block;
  font-size: 0.8rem;
  margin: 12px 0;
}
label input,
label select {
  margin-top: 7px;
}
textarea {
  resize: vertical;
}
:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: 2px;
}
.editor-fields {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.editor-fields:disabled {
  opacity: 1;
}
#editor-status {
  margin: 0 0 12px;
  min-height: 1.6em;
}
.studio {
  max-width: 900px;
  margin: auto;
  min-height: 85dvh;
}
.writing {
  padding: 28px 40px 64px;
}
.writing .heading {
  font-size: 0.72rem;
  margin-bottom: 16px;
  align-items: flex-start;
  min-height: 44px;
}
.title {
  font-size: clamp(1.75rem, 5vw, 2.3rem);
  font-weight: var(--weight-medium);
  padding: 10px 14px;
  margin-bottom: 25px;
  line-height: 1.3;
  min-width: 0;
}
.concept {
  line-height: 1.5;
  font-size: 1rem;
  margin-bottom: 20px;
}
.verse {
  padding: 16px;
  min-height: 200px;
  line-height: 1.9;
  font-size: 1.05rem;
  resize: vertical;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 0.75rem;
}
.toolbar a,
.writing .heading a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px;
}
details {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding: 0;
}
summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: #d1d6c8;
  min-height: 44px;
  align-content: center;
  touch-action: manipulation;
  padding: 12px 2px;
}
#context-options label {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  margin: 4px 0;
  padding: 8px 0;
  line-height: 1.5;
  font-size: 0.9rem;
}
#context-options input {
  flex: none;
  margin: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.8;
}
#opening-preview,
#context-preview {
  border: 1px solid #6c8050;
  padding: clamp(16px, 3vw, 24px);
  border-radius: 7px;
  margin-top: 16px;
  background: #191c17;
}
.job {
  border-top: 1px solid var(--line);
  margin: 12px 0 0;
  padding-top: 16px;
}
.result {
  border: 1px solid var(--line);
  background: #20251b;
  padding: clamp(16px, 3vw, 24px);
  margin: 14px 0;
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.result-label {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: var(--weight-semibold);
  margin: 0 0 12px;
  letter-spacing: 0.02em;
}
.result button {
  margin-right: 6px;
}
.warning {
  font-size: 0.75rem;
  color: #dec486;
}
.shortlist-item {
  border-left: 2px solid var(--accent);
  padding: 0 12px;
  margin: 20px 0;
}
#notice {
  font-size: 0.8rem;
  color: var(--accent);
}
#notice,
#error-notice {
  min-height: 1.6em;
  margin: 10px 0;
}
#error-notice {
  color: #e49c8c;
  font-size: 0.85rem;
}
#generation-status {
  min-height: 1.6em;
}
#results {
  min-height: 120px;
}
.empty.compact {
  padding: 20px 0;
  margin: 0;
}
#shortlist {
  min-height: 70px;
}
.job .small {
  font-variant-numeric: tabular-nums;
}
dialog {
  color: var(--foreground);
  background: #1b1e19;
  border: 1px solid #484e41;
  border-radius: 10px;
  padding: 24px;
  width: min(460px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}
dialog::backdrop {
  background: rgb(0 0 0 / 0.7);
}
.dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
@media (max-width: 800px) {
  .studio {
    display: block;
  }
  .writing {
    padding: 25px max(5vw, env(safe-area-inset-right, 0px)) 25px
      max(5vw, env(safe-area-inset-left, 0px));
  }
  .verse {
    min-height: 180px;
  }
  .brand span {
    display: none;
  }
  .heading {
    flex-wrap: wrap;
  }
}
.draft-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.draft-nav a,
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.85rem;
  text-decoration: none;
}
.draft-nav a {
  color: var(--muted);
  padding: 10px 0;
}
.draft-nav a[aria-current='page'] {
  color: var(--foreground);
  border-bottom: 2px solid var(--accent);
}
.context-page {
  max-width: 800px;
  margin: auto;
  padding: 28px max(5vw, env(safe-area-inset-right, 0px)) 64px
    max(5vw, env(safe-area-inset-left, 0px));
}
.context-page h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}
.context-page > p,
.idea-help p {
  max-width: 65ch;
}
.context-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
#context-error {
  color: #e49c8c;
}
#context-notice {
  color: var(--accent);
}
.continuation {
  padding: 16px 0 8px;
  border-top: 1px solid var(--line);
}
.continuation h2 {
  margin: 0 0 16px;
}
.continuation-result pre {
  font-size: 1.05rem;
  line-height: 1.9;
}
.result button[aria-pressed='true'] {
  color: var(--accent);
}
#notice:empty,
#error-notice:empty {
  display: none;
}
.concept-details {
  margin-top: 8px;
  padding: 0;
  border-top: 0;
}
.idea-help,
.trash-action {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
@media (hover: hover) and (pointer: fine) {
  .draft-nav a:hover,
  .back-link:hover {
    color: var(--foreground);
    text-decoration: underline;
  }
}
h1,
h2,
h3,
pre {
  margin-top: 0;
}
button.quiet:disabled {
  background: transparent;
  border-color: transparent;
}
.toolbar a,
.draft-nav a,
.back-link {
  border-radius: 4px;
}
.writing-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 8px 0 16px;
}
#save-shortcut {
  white-space: nowrap;
}
.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 1px 7px;
  margin-left: 6px;
  background: #22261e;
  color: var(--foreground);
  border-radius: 4px;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
details > p:first-of-type {
  margin-top: 8px;
}
#opening-preview pre,
#context-preview pre {
  margin: 16px 0;
}
#opening-preview button,
#context-preview button {
  margin: 4px 4px 4px 0;
}
.result pre {
  margin-bottom: 12px;
}
.result .muted {
  font-size: 0.9rem;
}
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 4px;
}
.result-actions button {
  margin: 0;
}
.choice-button {
  min-width: 112px;
}
.result.has-selection {
  border-color: var(--control-line);
}
.job > button {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
  margin: 0 0 8px;
}
.job > details {
  margin-bottom: 24px;
}
.library-empty {
  margin: 24px 0 32px;
  padding: 32px;
  border: 1px dashed var(--control-line);
  border-radius: 10px;
  max-width: 620px;
}
.library-empty h2 {
  color: var(--foreground);
  margin-bottom: 12px;
}
.library-empty p {
  max-width: 45ch;
  margin: 0 0 24px;
}
.draft-card {
  display: flex;
  flex-direction: column;
  min-height: 176px;
  height: 100%;
  padding: 24px;
  border-radius: 10px;
}
.draft-card h2 {
  font-size: 1.3rem;
  margin-bottom: 12px;
}
.draft-card-action {
  display: flex;
  justify-content: space-between;
  color: var(--accent);
  font-size: 0.875rem;
  margin-top: auto;
  padding-top: 24px;
}
.library-trash {
  margin-bottom: 24px;
}
.library-trash .draft-card-action {
  color: var(--muted);
}
.drafts-page > .heading {
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 20px 24px;
}
.drafts-page > .heading > div {
  min-width: 0;
}
.drafts-page .eyebrow {
  margin: 0 0 12px;
}
.drafts-page h1 {
  margin: 0;
  overflow-wrap: anywhere;
}
.drafts-page > .heading form {
  flex-shrink: 0;
}
.drafts-page .dashboard-actions {
  margin-top: 24px;
}
.drafts-page .primary,
.drafts-page .dashboard-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-right: 14px;
}
.drafts-page .library-empty {
  min-height: 240px;
}
.drafts-page .draft-list {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}
.drafts-page .draft-list article {
  min-width: 0;
}
.drafts-page .draft-card {
  min-height: 212px;
  transition: background-color 150ms ease-out;
}
.drafts-page .draft-card h2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 2.6em;
  line-height: 1.3;
  text-wrap: pretty;
}
.drafts-page .draft-card time {
  font-variant-numeric: tabular-nums;
}
.drafts-page .draft-card:active {
  background: #22261e;
}
.drafts-page .draft-card-action [aria-hidden],
.drafts-page .button [aria-hidden],
.drafts-page .primary [aria-hidden] {
  pointer-events: none;
  user-select: none;
}
.drafts-page .library-trash summary {
  width: fit-content;
  min-width: 44px;
  transition: color 150ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .drafts-page .draft-card,
  .drafts-page .library-trash summary {
    transition: none;
  }
}
.context-artist {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 16px;
  margin: 24px 0;
  min-width: 0;
}
.context-artist legend {
  color: var(--foreground);
  font-size: 0.95rem;
  font-weight: var(--weight-semibold);
  padding: 0 8px;
}
#context-notice:empty,
#context-error:empty,
#context-selection:empty,
#rhyme-status:empty {
  display: none;
}
#rhyme-results > p:not(.muted) {
  padding: 10px 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
@media (hover: hover) and (pointer: fine) {
  .draft-card:hover {
    background: #22261e;
  }
  summary:hover {
    color: var(--foreground);
  }
}
@media (pointer: coarse) {
  #save-shortcut {
    display: none;
  }
}
@media (max-width: 480px) {
  .draft-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .library-empty {
    padding: 24px 20px;
  }
  .writing .heading {
    flex-wrap: nowrap;
    gap: 8px;
  }
  .writing .heading a {
    padding-left: 0;
  }
  .draft-nav {
    gap: 8px 16px;
  }
  .result-actions button {
    flex: 1 1 auto;
  }
  #opening-preview button,
  #context-preview button {
    width: 100%;
    margin-right: 0;
  }
  .context-page {
    padding-bottom: 32px;
  }
}
@media (prefers-reduced-motion: reduce) {
  button,
  .button {
    transition: none;
  }
  button:active:not(:disabled),
  .button:active {
    transform: none;
  }
}

.action-error {
  color: #e49c8c;
  font-size: 0.875rem;
}

.writing-methods {
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 24px 0;
}
.writing-methods legend {
  padding: 0;
  margin-bottom: 10px;
  font-size: 0.8rem;
}
.writing-method-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.writing-method {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
}
.writing-method input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 3px 0 0;
  padding: 0;
  accent-color: var(--accent);
}
.writing-method:has(input:checked) {
  border-color: var(--accent);
  background: #22261e;
}
.writing-method:has(input:focus-visible) {
  outline: 2px solid var(--foreground);
  outline-offset: 3px;
}
.writing-method-title,
.writing-method-description {
  display: block;
}
.writing-method-title {
  font-size: 0.875rem;
  font-weight: var(--weight-semibold);
}
.writing-method-description {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}
.writing-method:has(input:disabled) {
  cursor: not-allowed;
}
@media (hover: hover) and (pointer: fine) {
  .writing-method:hover:not(:has(input:disabled)) {
    background: #22261e;
    border-color: var(--control-line);
  }
  .writing-method:hover:has(input:checked) {
    border-color: var(--accent);
  }
}
.playground-canvas {
  padding: 20px;
  border: 1px solid var(--control-line);
  border-radius: 12px;
  background: var(--input-surface);
}
.playground-canvas .verse {
  background: transparent;
  border: 0;
  padding: 12px 0;
  min-height: 200px;
  margin: 0;
}
.playground-directions {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.prompt-chips button {
  border-radius: 24px;
  min-height: 44px;
  font-size: 0.875rem;
}
.prompt-chips button[aria-pressed='true'] {
  border-color: var(--accent);
  color: var(--accent);
}
#custom-direction-panel {
  margin-top: 16px;
}
#custom-concept {
  min-height: 80px;
}
.playground-submit {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 20px;
}
.dashboard-actions {
  display: flex;
  gap: 12px;
  margin: 20px 0;
}
#rhyme-search {
  max-width: 560px;
}
@media (max-width: 500px) {
  .writing-method-options {
    grid-template-columns: 1fr;
  }
  .playground-canvas {
    padding: 16px;
  }
  .playground-submit {
    flex-direction: column;
    align-items: stretch;
  }
}

.idea-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
}
.idea-row + .idea-row {
  border-top: 1px solid var(--line);
}
.result .idea-row pre {
  flex: 1;
  min-width: 0;
  margin: 9px 0;
}
.result .idea-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
}
.idea-dialog {
  max-height: calc(100dvh - 48px);
  overflow: auto;
}
.idea-dialog h2 {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.header-account {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}
.account-dropdown {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
}
.account-dropdown > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
}
.account-dropdown > summary::-webkit-details-marker {
  display: none;
}
.account-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--input-surface);
  color: var(--accent);
  font-size: 0.8rem;
}
.account-label {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
}
.account-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: min(300px, 90vw);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #1b1e19;
  box-shadow: 0 8px 24px #0006;
}
.account-panel p {
  margin: 0;
}
.account-panel .account-email {
  margin: 2px 0 12px;
  overflow-wrap: anywhere;
}
.account-panel a,
.account-panel button {
  display: flex;
  align-items: center;
  min-height: 44px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
}
.account-panel form {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 8px;
}
.account-dropdown summary:focus-visible,
.account-panel a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.account-dropdown summary:active,
.account-panel a:active {
  background: var(--input-surface);
}
.settings-drafts {
  list-style: none;
  padding: 0;
}
.settings-drafts a {
  display: block;
  padding: 14px 0;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
}
@media (hover: hover) and (pointer: fine) {
  .account-dropdown summary:hover,
  .account-panel a:hover {
    background: var(--input-surface);
  }
}
@media (max-width: 640px) {
  .account-label,
  .header-account .pilot {
    display: none;
  }
  .header-account {
    gap: 8px;
  }
}

#song-import {
  margin-block: 32px 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
#song-import label {
  display: block;
  font-weight: var(--weight-semibold);
}
#song-files {
  display: block;
  width: 100%;
  min-height: 44px;
  font-size: 16px;
}
#song-files::file-selector-button {
  min-height: 44px;
  padding: 8px 12px;
  margin-right: 12px;
  border: 1px solid var(--control-line);
  border-radius: 6px;
  background: var(--input-surface);
  color: var(--foreground);
  cursor: pointer;
}
#song-files[aria-invalid='true'] {
  outline: 2px solid #ffb4a8;
  outline-offset: 4px;
}
#song-file-error:not(:empty) {
  color: #ffb4a8;
}
.song-list {
  padding-left: 20px;
  max-height: 320px;
  overflow-y: auto;
  overflow-wrap: anywhere;
}
.song-list li {
  padding: 8px 0;
}

/* Invitation-only launch */
.marketing-page {
  --launch-background: #f2f0e7;
  --launch-ink: #111211;
  --launch-muted: #555a4f;
  --launch-line: #c8c9bb;
  color-scheme: light;
  background: var(--launch-background);
  color: var(--launch-ink);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.marketing-page > header,
.marketing-page > footer,
.launch {
  width: 100%;
  max-width: 1600px;
  margin-inline: auto;
  padding-inline: max(5vw, env(safe-area-inset-left), env(safe-area-inset-right));
}
.marketing-page > header {
  border: 0;
  padding-block: calc(28px + env(safe-area-inset-top)) 0;
  min-height: 72px;
}
.launch-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--launch-ink);
  text-decoration: none;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.06em;
}
.launch {
  flex: 1;
  display: grid;
  align-items: center;
}
.launch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: 10%;
  padding-block: clamp(24px, 5svh, 64px);
}
.launch-sleeve {
  width: min(100%, 530px, calc(100svh - 240px));
  background: var(--accent);
  border: 1px solid #b6c08f;
  aspect-ratio: 1;
  max-width: 530px;
  transform: rotate(-5deg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  user-select: none;
}
.launch-sleeve-head,
.launch-micro,
.launch-note,
.launch-footer {
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 500;
}
.launch-sleeve-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 10px;
}
.launch-record {
  width: 74%;
  aspect-ratio: 1;
  border-radius: 50%;
  margin: 16px auto;
  background: repeating-radial-gradient(circle, var(--launch-ink) 0 3px, #292d26 3px 4px);
  display: grid;
  place-items: center;
}
.launch-record-label {
  width: 37%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--launch-background);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.05em;
}
.launch-record-label small {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0;
  margin-top: 8px;
}
.launch-sleeve-bottom {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
}
.launch-sleeve-bottom strong {
  font-size: clamp(20px, 2.5vw, 36px);
  line-height: 1;
  letter-spacing: -0.05em;
}
.launch-symbols {
  font-size: 20px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.launch-copy {
  display: grid;
  gap: 26px;
  justify-items: start;
  min-width: 0;
}
.launch-copy p,
.launch-copy h1 {
  margin: 0;
}
.launch h1 {
  font-size: clamp(48px, 6.1vw, 88px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.065em;
}
.launch-lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--launch-muted);
  max-width: 42ch;
}
.launch-cta {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  min-height: 56px;
  min-width: min(250px, 100%);
  padding: 15px 22px;
  border: 1px solid transparent;
  border-radius: 0;
  background: var(--launch-ink);
  color: var(--launch-background);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color 150ms ease-out,
    transform 150ms ease-out;
}
.launch-cta span {
  font-size: 24px;
  line-height: 1;
}
.launch-note {
  color: var(--launch-muted);
  font-size: 12px;
}
.launch-link {
  color: var(--launch-muted);
  font-size: 14px;
  min-height: 44px;
  align-content: center;
  text-underline-offset: 4px;
}
.launch-form {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  margin: 0;
}
.launch-form label {
  color: var(--launch-ink);
  font-size: 14px;
}
.launch-form input[type='email'] {
  color: var(--launch-ink);
  background: var(--launch-background);
  border: 1px solid var(--launch-muted);
  border-radius: 0;
  padding: 14px;
}
.launch-form input[aria-invalid='true'] {
  border-color: #a12216;
}
.launch-form .launch-note {
  letter-spacing: 0;
  text-transform: none;
}
.launch-error {
  color: #a12216;
  font-size: 14px;
}
.marketing-page :focus-visible {
  outline: 2px solid var(--launch-ink);
  outline-offset: 4px;
}
.marketing-page > footer {
  color: var(--launch-muted);
  border: 0;
  padding-bottom: calc(25px + env(safe-area-inset-bottom));
}
.launch-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--launch-line);
  padding-top: 18px;
}
@media (hover: hover) and (pointer: fine) {
  .launch-cta:hover,
  .launch-cta:hover:not(:disabled) {
    background: #30342d;
  }
}
.launch-cta:active,
.launch-cta:active:not(:disabled) {
  background: #30342d;
  transform: scale(0.97);
}
@media (min-width: 751px) and (max-height: 800px) {
  .launch-copy {
    gap: clamp(12px, 2svh, 22px);
  }
  .launch h1 {
    font-size: clamp(48px, min(6.1vw, 9svh), 88px);
  }
}
@media (min-width: 751px) and (max-height: 700px) {
  .launch-grid {
    padding-block: 24px;
  }
  .launch-sleeve {
    padding: 16px;
  }
  .launch-record {
    margin-block: 10px;
  }
  .launch-sleeve-bottom strong {
    font-size: 24px;
  }
}
@media (max-width: 750px) {
  .marketing-page > header,
  .marketing-page > footer,
  .launch {
    padding-inline: max(24px, env(safe-area-inset-left), env(safe-area-inset-right));
  }
  .marketing-page > header {
    padding-top: calc(16px + env(safe-area-inset-top));
  }
  .launch {
    display: block;
  }
  .launch-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 60px;
    padding-block: 45px 65px;
  }
  .launch-sleeve {
    max-width: 420px;
    width: 90%;
    margin-inline: auto;
  }
  .launch h1 {
    font-size: clamp(48px, 13vw, 65px);
  }
  .launch-copy {
    gap: 22px;
  }
  .launch-lead {
    font-size: 16px;
  }
  .launch-footer {
    font-size: 10px;
    align-items: start;
  }
  .launch-footer > span:first-child {
    max-width: 25ch;
  }
}

.punchline-result .idea-row {
  flex-wrap: wrap;
}
.punchline-result .idea-row pre {
  flex-basis: calc(100% - 56px);
}
.punchline-result .idea-row > button:not(.idea-info) {
  order: 3;
  width: 100%;
}
#punchline-panel {
  margin-block: 20px;
}

#protected-lines {
  min-width: 0;
  margin: 0 0 20px;
  padding: 12px 20px 20px;
  border: 1px solid var(--control-line);
  border-radius: 12px;
}
#protected-lines legend {
  padding: 0 6px;
  font-size: 0.875rem;
  font-weight: var(--weight-medium);
}
#protected-lines p {
  margin: 0 0 12px;
}
#protected-lines #protection-status {
  margin: 12px 0 0;
}
#protection-status:empty {
  display: none;
}
#line-choices {
  display: grid;
  gap: 4px;
}
.protected-line {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  touch-action: manipulation;
}
.protected-line:has(input:checked) {
  background: var(--input-surface);
  border-color: var(--control-line);
}
.protected-line:has(input:focus-visible) {
  outline: 2px solid var(--foreground);
  outline-offset: 2px;
}
@media (hover: hover) and (pointer: fine) {
  .protected-line:hover {
    background: var(--input-surface);
  }
}
.protected-line input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}
.protected-line span {
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.result li {
  padding-block: 0.5rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.result ins {
  text-decoration: none;
  background: var(--surface);
}

.alternative h4 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}
.alternative pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.alternative-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.alternative-actions button {
  min-height: 44px;
}
.alternative-actions [aria-pressed='true'] {
  border-color: currentColor;
  background: var(--input-surface);
}
.alternative details {
  margin-top: 0.75rem;
}
.alternative form {
  display: grid;
  gap: 0.75rem;
  padding-top: 0.75rem;
}
.alternative form label {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  min-height: 44px;
}
.alternative form label:has(textarea) {
  display: grid;
}
.alternative textarea {
  width: 100%;
  font-size: 16px;
}

/* Writing studio: one document, with assistance alongside it on wide screens. */
.writing-studio {
  isolation: isolate;
  max-width: 1200px;
  margin: 32px auto 64px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: clip;
}
.draft-pane,
.assistance-pane {
  min-width: 0;
  padding: 28px;
}
.studio-back {
  display: inline-block;
  font-size: 0.8rem;
  margin-bottom: 24px;
  text-decoration: none;
}
#draft-title {
  font-size: 30px;
  line-height: 1.25;
  margin: 0 0 24px;
  min-height: 76px;
  position: relative;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.title-loading #title-text {
  visibility: hidden;
}
.title-loading::before {
  pointer-events: none;
  content: '';
  position: absolute;
  top: 5px;
  left: 0;
  width: min(80%, 320px);
  height: 32px;
  border-radius: 6px;
  background: var(--line);
}
.title-loading::after {
  pointer-events: none;
  content: '';
  position: absolute;
  inset: 5px 0 auto;
  width: 80%;
  max-width: 320px;
  height: 32px;
  background: linear-gradient(100deg, transparent, rgba(242, 240, 231, 0.12), transparent);
  animation: title-shimmer 1.3s ease-in-out infinite;
}
@keyframes title-shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}
.line-editor {
  position: relative;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #171917;
}
.draft-text-label {
  font-size: 14px;
  font-weight: var(--weight-medium);
}
#draft-text-hint {
  margin: 6px 0 16px;
  max-width: 45ch;
}
.line-editor:focus-within {
  border-color: var(--control-line);
}
.line-editor:has(textarea:focus-visible) {
  outline: 2px solid var(--foreground);
  outline-offset: 2px;
}
.writing-studio ::selection {
  background: #f2f0e733;
  color: var(--foreground);
}
.line-editor textarea {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  resize: none;
  overflow: hidden;
  min-width: 0;
  width: calc(100% - 88px);
  padding: 12px;
  margin: 0;
  min-height: 320px;
  line-height: 44px;
  font-size: 16px;
  font-family: inherit;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  outline: none;
}
#line-measure {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
  top: 0;
  left: 88px;
  padding: 0 12px;
  line-height: 44px;
  font-size: 16px;
  font-family: inherit;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
}
.line-gutter {
  flex: 0 0 88px;
  padding-top: 12px;
  background: var(--input-surface);
  box-shadow: inset -1px 0 var(--line);
  min-width: 0;
}
.gutter-row {
  display: flex;
  align-items: flex-start;
}
.gutter-row button {
  min-height: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
}
.gutter-row .line-number {
  width: 44px;
  flex: 0 0 44px;
  font-variant-numeric: tabular-nums;
}
.gutter-row .line-lock {
  width: 44px;
  flex: 0 0 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.line-lock svg {
  pointer-events: none;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gutter-row[data-locked='true'] .line-lock {
  color: var(--accent);
}
.gutter-row.selected {
  background: #d7f77c16;
}
.gutter-row button:focus-visible {
  outline-offset: -3px;
}
.mobile-number {
  display: none;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  user-select: none;
}
.draft-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
.draft-meta a {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-underline-offset: 4px;
}
.draft-meta button {
  font-size: 12px;
}
.assistance-pane {
  background: #191b18;
  border-left: 1px solid var(--line);
}
.assistance-heading {
  margin: 0 0 24px;
  font-size: 18px;
}
.studio-instructions summary {
  min-height: 44px;
  padding-block: 11px;
  cursor: pointer;
  font-size: 14px;
}
.studio-instructions[open] summary {
  margin-bottom: 12px;
}
#concept-hint {
  margin: 6px 0 12px;
}
.assistance-pane label {
  font-size: 13px;
  font-weight: var(--weight-medium);
}
.assistance-pane label .muted {
  font-weight: var(--weight-normal);
}
.assistance-pane textarea {
  font-size: 16px;
  min-height: 110px;
  resize: vertical;
}
.studio-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 22px 0;
}
.studio-settings select {
  width: 100%;
  font-size: 16px;
}
.credit-summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.credit-summary p {
  margin: 0;
}
#credit-info {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  padding: 0;
}
#credit-info span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: var(--weight-semibold);
  line-height: 1;
}
#credit-info[aria-expanded='true'] {
  color: var(--foreground);
}
.credit-details {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 100%;
  width: min(100%, 320px);
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #1b1e19;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px #0006;
}
#credit-warning {
  color: #e49c8c;
  margin: 0 0 12px;
}
#credit-warning:empty {
  margin: 0;
}
#generate {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  gap: 12px;
  padding-right: 14px;
}
#generate [aria-hidden] {
  flex-shrink: 0;
  pointer-events: none;
}
.punchline-status {
  font-size: 13px;
  border-left: 2px solid var(--accent);
  padding: 8px 12px;
  margin-top: 20px;
  overflow-wrap: anywhere;
}
#notice:empty,
#error-notice:empty {
  display: none;
}
#generation-status {
  min-height: 1.6em;
  margin: 12px 0 0;
}
#results {
  margin-top: 28px;
  min-height: 240px;
  scroll-margin-top: 24px;
}
.studio-empty {
  min-height: 240px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.studio-empty h2 {
  font-size: 18px;
  margin: 0 0 12px;
}
.studio-empty p {
  margin: 0;
  max-width: 34ch;
}
.studio-result {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.result-navigation {
  display: flex;
  align-items: center;
  gap: 8px;
}
.result-navigation span {
  margin-right: auto;
  font-variant-numeric: tabular-nums;
}
.result-navigation button {
  min-width: 44px;
  min-height: 44px;
  padding: 4px;
}
.studio-result h2 {
  font-size: 18px;
}
.suggested-lyrics {
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.9;
}
.preserved-ending {
  color: var(--accent);
  border-left: 2px solid var(--accent);
  padding-left: 12px;
  white-space: pre-wrap;
}
.result-actions,
.result-feedback {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.result-feedback button {
  font-size: 12px;
  background: transparent;
  color: var(--muted);
}
.result-feedback button[aria-pressed='true'] {
  color: var(--accent);
  border-color: var(--accent);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.dialog-heading h2 {
  margin: 0;
}
#rhyme-dialog,
#accept-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: 80dvh;
  overflow: auto;
}
.accept-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  min-height: 44px;
  font-weight: var(--weight-normal);
  cursor: pointer;
  touch-action: manipulation;
}
.accept-line span {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.accept-line:has(input:focus-visible) {
  outline: 2px solid var(--foreground);
  outline-offset: 2px;
}
.accept-line input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}
@media (max-width: 760px) {
  .writing-studio {
    display: block;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .draft-pane,
  .assistance-pane {
    padding: 23px max(18px, env(safe-area-inset-right, 0px)) 23px
      max(18px, env(safe-area-inset-left, 0px));
  }
  .assistance-pane {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  #draft-title {
    font-size: 25px;
    min-height: 64px;
    margin-bottom: 16px;
  }
  .studio-back {
    margin-bottom: 16px;
  }
  .line-gutter {
    flex-basis: 44px;
    padding-top: 12px;
  }
  .gutter-row .line-number {
    display: none;
  }
  .gutter-row .line-lock {
    width: 44px;
    flex-basis: 44px;
  }
  .mobile-number {
    display: inline;
    font-size: 10px;
  }
  .line-lock svg {
    width: 12px;
    height: 12px;
  }
  .line-editor textarea {
    width: calc(100% - 44px);
    padding: 12px 10px;
  }
  #line-measure {
    left: 44px;
    padding: 0 10px;
  }
  .header-account {
    gap: 8px;
  }
  header .brand span {
    display: none;
  }
  #open-rhymes {
    white-space: nowrap;
    font-size: 13px;
    padding: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .title-loading::after {
    animation: none;
    display: none;
  }
}

@media (min-width: 761px) and (max-width: 1264px) {
  .writing-studio {
    margin-inline: 32px;
  }
}

/* The textarea and its noninteractive rhyme layer share exact text metrics. */
.writing-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.writing-toolbar button {
  min-height: 44px;
  padding: 8px 10px;
  font-size: 13px;
}
.writing-toolbar button[aria-pressed='true'],
.writing-toolbar button[aria-expanded='true'] {
  color: var(--accent);
  background: var(--input-surface);
}
.syllable-heading {
  margin-left: auto;
  padding-left: 8px;
  font-size: 11px;
}
.lyric-surface {
  position: relative;
  flex: 1;
  min-width: 0;
}
.line-editor .lyric-surface textarea {
  position: relative;
  width: 100%;
  display: block;
  caret-color: var(--foreground);
}
#rhyme-overlay {
  position: absolute;
  inset: 0;
  padding: 12px;
  pointer-events: none;
  user-select: none;
  color: transparent;
  font-family: inherit;
  font-size: 16px;
  line-height: 44px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
}
.rhyme-color {
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.rhyme-0 {
  background: var(--rhyme-0);
}
.rhyme-1 {
  background: var(--rhyme-1);
}
.rhyme-2 {
  background: var(--rhyme-2);
}
.rhyme-3 {
  background: var(--rhyme-3);
}
.rhyme-4 {
  background: var(--rhyme-4);
}
.rhyme-5 {
  background: var(--rhyme-5);
}
.flow-mark {
  position: relative;
}
.flow-mark::before {
  content: attr(data-beat);
  position: absolute;
  top: -17px;
  left: 0;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  line-height: 14px;
  color: var(--accent);
}
.syllable-gutter {
  flex: 0 0 36px;
  padding-top: 12px;
  color: var(--muted);
  background: var(--input-surface);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.syllable-count {
  line-height: 44px;
}
#analysis-status {
  font-size: 12px;
  margin: 10px 0;
  min-height: 3.2em;
}
.flow-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.flow-panel h2 {
  margin: 0;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.flow-panel p {
  font-size: 12px;
}
.flow-heading-row,
.flow-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#close-flow,
#close-rhymes {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}
#flow-help {
  margin: 4px 0 12px;
}
.flow-cycle {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  user-select: none;
}
.flow-cycle span:not(:first-child) {
  position: relative;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.flow-cycle span:nth-child(n + 3)::before {
  content: '→';
  position: absolute;
  right: calc(100% + 3px);
  width: 10px;
}
#flow-words,
.rhyme-matches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 12px;
}
.flow-word,
.rhyme-match {
  min-height: 44px;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 8px 12px;
  font-size: 14px;
}
.flow-word[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--input-surface);
  color: var(--foreground);
}
.flow-word {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 44px;
}
.flow-word-label {
  min-width: 0;
}
.flow-word-beat {
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.flow-word[aria-pressed='true'] .flow-word-beat {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--input-surface);
}
#flow-words {
  min-height: 44px;
  margin-block: 16px;
}
#flow-words.flow-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-height: 72px;
  font-size: 13px;
}
.flow-empty span {
  color: var(--muted);
  font-size: 12px;
}
.flow-footer {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  flex-wrap: wrap;
}
#flow-summary {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.flow-panel .flow-note {
  margin: 8px 0 0;
}
#clear-flow {
  font-size: 12px;
  margin-left: auto;
  padding-inline: 8px;
}
#rhyme-search button[type='submit'] {
  margin-top: 16px;
}
#rhyme-status {
  min-height: 3.2em;
  margin-block: 20px 12px;
  font-variant-numeric: tabular-nums;
}
#rhyme-results {
  min-height: 96px;
}
#rhyme-dialog .dialog-heading {
  position: sticky;
  top: -24px;
  padding-block: 12px;
  background: inherit;
  isolation: isolate;
}
.rhyme-group h3 {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}
.rhyme-match {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.rhyme-syllables {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.rhyme-matches > span {
  padding: 6px 10px;
  background: var(--input-surface);
  border-radius: 6px;
}
@media (max-width: 760px) {
  #rhyme-overlay {
    padding: 12px 10px;
  }
  .syllable-heading {
    width: 100%;
    text-align: right;
  }
  .writing-toolbar button {
    padding-inline: 8px;
  }
}

.guitar-fields {
  display: grid;
  gap: 0.5rem;
}

.guitar-easy {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.guitar-easy input {
  width: auto;
}

.guitar-sheet {
  margin-block: 1rem;
  padding: 0.75rem;
  border: 1px solid currentColor;
  border-radius: 0.5rem;
}

.guitar-chart {
  display: grid;
  gap: 0.25rem;
  margin-block: 0.75rem;
  overflow-wrap: anywhere;
}

.guitar-chart p {
  margin: 0;
}

.guitar-chart .guitar-section {
  font-weight: 700;
  margin-block-start: 0.75rem;
}

.guitar-chart .guitar-chord {
  display: block;
  font-family: monospace;
}
