/* Main layout and interface styling for Verbosis 2. */
* { box-sizing: border-box; }
button, input, textarea, select { font: inherit; }
a { color: inherit; }
.app-shell { display: flex; width: 100vw; height: 100vh; background: var(--bg); }
.sidebar { width: 290px; flex: none; display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--line); min-height: 0; }
.brand-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 18px 16px 14px; }
.brand-button { display: flex; gap: 10px; align-items: center; min-width: 0; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; padding: 0; }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; box-shadow: var(--shadow); }
.brand-button span { display: flex; flex-direction: column; line-height: 1.15; }
.brand-button strong { font-size: 16px; letter-spacing: .5px; }
.brand-button small { color: var(--dim); font-size: 10.5px; }
.icon-button, .toolbar-button, .wide-button, .snapshot-button { border: 1px solid var(--line); background: transparent; color: var(--dim); border-radius: 8px; cursor: pointer; }
.icon-button { width: 32px; height: 32px; font-size: 18px; line-height: 1; }
.icon-button:hover, .toolbar-button:hover, .wide-button:hover, .snapshot-button:hover { background: var(--panel-active); color: var(--text); }
.document-list { flex: 1; overflow: auto; padding: 2px 10px 12px; min-height: 130px; }
.document-item { display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 12px; margin-bottom: 3px; cursor: pointer; border-radius: 8px; }
.document-item.active, .document-item:hover { background: var(--panel-active); }
.document-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.document-name { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.document-meta { font-size: 10.5px; color: var(--dim); }
.delete-doc-button { border: 0; background: transparent; color: var(--faint); cursor: pointer; font-size: 16px; border-radius: 6px; width: 22px; height: 22px; }
.delete-doc-button:hover { color: var(--text); background: color-mix(in srgb, var(--panel-active) 70%, transparent); }
.sidebar-card, .sidebar-help { border-top: 1px solid var(--line); padding: 12px 16px; }
.sidebar-card h2, .panel-card h2 { margin: 0 0 9px; font-size: 11px; text-transform: uppercase; letter-spacing: .9px; color: var(--dim); }
.field-label { display: block; margin-bottom: 5px; color: var(--dim); font-size: 11px; }
.select-input { width: 100%; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); padding: 7px 9px; border-radius: 8px; margin-bottom: 8px; }
.wide-button { width: 100%; padding: 7px 9px; margin-top: 6px; text-align: center; font-size: 12px; }
.version-list { display: grid; gap: 5px; max-height: 104px; overflow: auto; }
.snapshot-button { text-align: left; padding: 6px 8px; font-size: 11px; }
.muted { margin: 0; color: var(--dim); font-size: 11px; }
.sidebar-help { font-size: 10.8px; line-height: 1.45; color: var(--dim); }
.sidebar-help p { margin: 0 0 8px; }
.sidebar-help ul { padding-left: 17px; }
.sidebar-help a { display: inline-block; margin-top: 6px; color: var(--accent); text-decoration: none; font-weight: 650; }
.editor-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.toolbar { flex: none; min-height: 58px; display: flex; align-items: center; gap: 14px; padding: 10px 22px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, var(--panel)); }
.title-input { flex: 1; min-width: 150px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15px; font-weight: 650; }
.flash-message { min-width: 100px; color: var(--accent-2); font-size: 12px; opacity: 0; transition: opacity .2s; }
.flash-message.visible { opacity: 1; }
.button-row { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.toolbar-button { padding: 6px 9px; font-size: 12px; }
.work-area { flex: 1; min-height: 0; display: flex; }
.editor-scroll { flex: 1; min-width: 0; overflow: auto; position: relative; }
.editor-wrap { width: 946px; max-width: 100%; margin: 0 auto; padding: 54px 28px 260px; }
.editor-inner { position: relative; width: 100%; padding-left: 58px; }
.syllable-gutter { position: absolute; top: 0; left: 0; width: 56px; height: 100%; }
.syllable-number { position: absolute; left: 0; width: 52px; min-height: 32px; display: flex; align-items: center; justify-content: flex-end; padding-right: 13px; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--accent); pointer-events: none; }
.syllable-number.ok { color: var(--accent-2); font-weight: 700; }
.syllable-number.bad { color: var(--bad); font-weight: 700; }
.poem-text, .text-mirror { width: 100%; padding: 2px 0 0 18px; font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 17px; line-height: 32px; white-space: pre-wrap; overflow-wrap: break-word; }
.poem-text { display: block; min-height: 180px; border: 0; outline: 0; resize: none; background: transparent; color: var(--text); caret-color: var(--caret); overflow: hidden; position: relative; z-index: 1; }
.text-mirror { position: absolute; top: 0; left: 58px; visibility: hidden; pointer-events: none; z-index: 0; width: calc(100% - 58px); }
.right-panel { width: 260px; flex: none; border-left: 1px solid var(--line); background: var(--panel-2); overflow: auto; padding: 14px; }
.panel-card { background: color-mix(in srgb, var(--panel) 70%, transparent); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; box-shadow: var(--shadow); }
.stats-grid { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; margin: 0; font-size: 12px; }
.stats-grid dt { color: var(--dim); }
.stats-grid dd { margin: 0; font-weight: 700; }
.form-summary, .song-summary { white-space: pre-line; font-size: 12px; line-height: 1.55; color: var(--dim); }
.form-summary.passed { color: var(--accent-2); }
.form-summary.needs-work { color: var(--warn); }
.repeated-words { display: flex; flex-wrap: wrap; gap: 6px; color: var(--dim); font-size: 12px; }
.repeated-words span { padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px; }
.status-bar { flex: none; height: 28px; display: flex; align-items: center; padding: 0 18px; border-top: 1px solid var(--line); color: var(--dim); font-size: 11.5px; background: var(--panel); }
.about-dialog { max-width: 420px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); color: var(--text); box-shadow: var(--shadow); }
.about-dialog::backdrop { background: rgba(0,0,0,.35); }
.about-dialog form { display: grid; gap: 10px; text-align: center; }
.about-logo { width: 64px; margin: 0 auto; }
.about-dialog h1 { margin: 0; }
.about-dialog p { margin: 0; color: var(--dim); line-height: 1.45; }
.focus-mode .sidebar, .focus-mode .right-panel, .focus-mode .toolbar, .focus-mode .status-bar { display: none; }
.focus-mode .editor-wrap { padding-top: 80px; }
textarea::placeholder, input::placeholder { color: color-mix(in srgb, var(--dim) 55%, transparent); }
.document-list::-webkit-scrollbar, .editor-scroll::-webkit-scrollbar, .right-panel::-webkit-scrollbar { width: 10px; }
.document-list::-webkit-scrollbar-thumb, .editor-scroll::-webkit-scrollbar-thumb, .right-panel::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--dim) 25%, transparent); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
@media (max-width: 1000px) { .right-panel { display: none; } }
@media (max-width: 760px) { .app-shell { flex-direction: column; } .sidebar { width: 100%; height: auto; max-height: 285px; border-right: 0; border-bottom: 1px solid var(--line); } .toolbar { align-items: flex-start; flex-wrap: wrap; } .work-area { min-height: 0; } .editor-wrap { padding: 34px 16px 180px; } }

/* Verbosis 2.1: clearer help text and a visible focus-mode escape hatch. */
.sidebar-help {
  font-size: 12.5px;
  line-height: 1.62;
  color: var(--text);
  overflow: auto;
}
.sidebar-help h2 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text);
}
.sidebar-help h3 {
  margin: 10px 0 4px;
  font-size: 12px;
  color: var(--accent);
}
.sidebar-help p {
  margin: 0 0 10px;
  color: var(--dim);
}
.sidebar-help ul {
  margin: 0;
  padding-left: 18px;
}
.sidebar-help li {
  margin: 4px 0;
}
.sidebar-help code,
.sidebar-help kbd {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 11px;
  color: var(--text);
}
.help-block {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 8px;
}
.support-link {
  display: block;
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-active);
  color: var(--accent) !important;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
}
.focus-exit-button {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 9px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.focus-exit-button:hover {
  background: var(--panel-active);
}
.focus-exit-button[hidden] {
  display: none;
}

/* Verbosis 2.2 release polish: support panel, themed scrollbars and responsive layout. */
.support-card {
  border-top: 1px solid var(--line);
  padding: 14px 16px 16px;
  background: color-mix(in srgb, var(--panel-active) 72%, var(--panel));
}
.support-card h2 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text);
}
.support-card p {
  margin: 0 0 10px;
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.45;
}
.support-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  border: 1px solid color-mix(in srgb, var(--accent-2) 55%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-2) 16%, var(--panel-2));
  color: var(--text) !important;
  text-decoration: none;
  font-weight: 750;
  box-shadow: var(--shadow);
}
.support-button:hover {
  background: color-mix(in srgb, var(--accent-2) 24%, var(--panel-2));
}
.about-support { margin-top: 4px; }

/* Firefox scrollbar support. */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 55%, var(--panel-active)) var(--panel-2);
}

/* WebKit scrollbar support for Chrome, Edge and Safari. */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--panel-2); }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 48%, var(--panel-active));
  border-radius: 999px;
  border: 3px solid var(--panel-2);
}
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent-2) 58%, var(--panel-active));
}

/* Tablet layout: stack right panel below editor instead of hiding it. */
@media (max-width: 1000px) {
  .work-area { flex-direction: column; overflow: hidden; }
  .right-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    max-height: 260px;
    border-left: 0;
    border-top: 1px solid var(--line);
    overflow: auto;
  }
  .panel-card { margin-bottom: 0; }
}

/* Phone layout: keep the app usable on narrow screens. */
@media (max-width: 760px) {
  body { overflow: hidden; }
  .app-shell { height: 100dvh; }
  .sidebar {
    max-height: 42dvh;
    overflow: auto;
  }
  .brand-row { padding: 12px; }
  .document-list { min-height: 72px; max-height: 110px; }
  .sidebar-card, .sidebar-help, .support-card { padding-left: 12px; padding-right: 12px; }
  .toolbar {
    padding: 10px 12px;
    gap: 8px;
  }
  .title-input {
    flex-basis: 100%;
    font-size: 16px;
  }
  .flash-message { min-width: 0; }
  .button-row {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .toolbar-button {
    flex: 0 0 auto;
    min-height: 34px;
  }
  .editor-scroll { min-height: 38dvh; }
  .editor-wrap {
    width: 100%;
    padding: 28px 12px 120px;
  }
  .editor-inner { padding-left: 44px; }
  .syllable-gutter { width: 42px; }
  .syllable-number {
    width: 40px;
    padding-right: 8px;
    font-size: 10px;
  }
  .poem-text, .text-mirror {
    padding-left: 10px;
    font-size: 16px;
    line-height: 30px;
  }
  .text-mirror {
    left: 44px;
    width: calc(100% - 44px);
  }
  .right-panel {
    grid-template-columns: 1fr;
    max-height: 28dvh;
    padding: 10px 12px;
  }
  .status-bar {
    min-height: 30px;
    height: auto;
    flex-wrap: wrap;
    padding: 6px 12px;
    line-height: 1.35;
  }
  .focus-exit-button {
    top: 10px;
    right: 10px;
  }
}

@media (max-width: 480px) {
  .brand-button small { display: none; }
  .sidebar { max-height: 45dvh; }
  .sidebar-help { font-size: 12px; }
  .poem-text, .text-mirror { font-size: 15.5px; }
}

/* Verbosis 2.3.2: welcome screen, help centre dialogs and simplified sidebar. */
.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top, color-mix(in srgb, var(--panel-active) 40%, var(--bg)), var(--bg));
}
.welcome-screen[hidden] { display: none; }
.welcome-card {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--panel-2) 92%, var(--bg));
  box-shadow: var(--shadow);
  padding: 34px;
  text-align: center;
}
.welcome-logo { width: 74px; height: 74px; }
.welcome-card h1 { margin: 12px 0 4px; font-size: clamp(32px, 6vw, 48px); letter-spacing: 1.5px; }
.welcome-intro {
  max-width: 520px;
  margin: 10px auto 22px;
  color: var(--muted);
  line-height: 1.6;
}

.welcome-tagline { margin: 0 0 22px; color: var(--dim); font-size: 15px; }
.welcome-actions { display: grid; gap: 10px; margin: 0 auto 18px; max-width: 320px; }
.welcome-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}
.welcome-button:hover { background: var(--panel-active); }
.welcome-button.primary { border-color: color-mix(in srgb, var(--accent-2) 55%, var(--line)); background: color-mix(in srgb, var(--accent-2) 18%, var(--panel)); }
.welcome-support { display: inline-block; color: var(--accent-2); font-weight: 800; text-decoration: none; margin-top: 4px; }
.welcome-version { margin: 18px 0 0; color: var(--dim); font-size: 12px; }
.sidebar-actions { padding: 12px 16px; border-top: 1px solid var(--line); }
.app-dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: min(760px, calc(100dvh - 28px));
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-2);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 0;
}
.app-dialog::backdrop { background: rgba(0,0,0,.42); }
.app-dialog form { padding: 18px; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 14px; }
.dialog-header h1 { margin: 0; font-size: 22px; }
.dialog-close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; font-size: 22px; line-height: 1; }
.dialog-content { max-height: 58dvh; overflow: auto; padding-right: 8px; text-align: left; }
.dialog-content section { border-bottom: 1px solid var(--line); padding: 0 0 12px; margin: 0 0 12px; }
.dialog-content section:last-child { border-bottom: 0; }
.dialog-content h2 { margin: 0 0 8px; font-size: 15px; color: var(--accent); }
.dialog-content p, .dialog-content li { color: var(--dim); line-height: 1.6; }
.dialog-content ul { margin: 0; padding-left: 22px; }
.dialog-content code { background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--text); }
.about-dialog { text-align: center; }
.about-dialog form { display: grid; gap: 10px; }

@media (max-width: 760px) {
  .welcome-card { padding: 24px 18px; }
  .sidebar-actions { padding-left: 12px; padding-right: 12px; }
  .app-dialog form { padding: 14px; }
  .dialog-content { max-height: 62dvh; }
}

/* Verbosis 2.3.3 UX release: mobile menu, clearer actions, V branding and snapshot manager. */
.mobile-topbar,
.mobile-menu-backdrop {
  display: none;
}

.brand-logo,
.welcome-logo,
.mobile-logo,
.about-logo {
  border-radius: 14px;
}

.new-verse-button {
  min-width: 68px;
  min-height: 34px;
  border: 1px solid color-mix(in srgb, var(--accent-2) 58%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-2) 22%, var(--panel-2));
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  box-shadow: var(--shadow);
}
.new-verse-button:hover {
  background: color-mix(in srgb, var(--accent-2) 34%, var(--panel-2));
}

.sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.document-list,
.version-list {
  flex: 0 0 auto;
}
.sidebar-card,
.sidebar-actions,
.support-card {
  flex: 0 0 auto;
}
.sidebar .support-card {
  margin-top: auto;
}

.version-list {
  max-height: 220px;
  padding-right: 2px;
}
.snapshot-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 8px;
  display: grid;
  gap: 6px;
}
.snapshot-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
}
.snapshot-preview {
  font-size: 11px;
  line-height: 1.35;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.snapshot-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.snapshot-actions button {
  flex: 1 1 auto;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 700;
}
.snapshot-actions button:hover {
  background: var(--panel-active);
}

.help-centre-grid section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  padding: 12px;
}
.help-centre-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.help-centre-grid section {
  margin: 0;
}

@media (max-width: 760px) {
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 12px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    position: relative;
    z-index: 950;
  }
  .mobile-logo {
    width: 30px;
    height: 30px;
  }
  .mobile-menu-button,
  .mobile-help-button {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-2);
    color: var(--text);
    min-height: 34px;
    cursor: pointer;
    font-weight: 800;
  }
  .mobile-menu-button {
    width: 42px;
    font-size: 20px;
  }
  /* 2.3.4.1.1-safe: keep the duplicate mobile Help button in the DOM so existing
     JavaScript bindings are untouched, but hide it visually. Help remains available
     from the main menu, preserving the stable 2.3.4.1 menu behaviour. */
  .mobile-help-button {
    display: none;
  }
  .mobile-menu-backdrop {
    display: block;
    position: fixed;
    inset: 52px 0 0 0;
    z-index: 850;
    border: 0;
    background: rgba(0,0,0,.35);
  }
  .mobile-menu-backdrop[hidden] {
    display: none;
  }
  .app-shell {
    height: calc(100dvh - 52px);
    flex-direction: row;
    overflow: hidden;
  }
  .sidebar {
    position: fixed;
    top: 52px;
    left: 0;
    bottom: 0;
    width: min(86vw, 340px);
    height: auto;
    max-height: none;
    z-index: 900;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    transform: translateX(-104%);
    transition: transform .22s ease;
    box-shadow: var(--shadow);
  }
  body.mobile-menu-open .sidebar {
    transform: translateX(0);
  }
  .editor-pane {
    width: 100%;
  }
  .toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
  }
  .work-area {
    flex: 1;
    overflow: hidden;
  }
  .editor-scroll {
    min-height: 0;
    height: 100%;
  }
  .right-panel {
    display: none;
  }
  .document-list {
    min-height: 86px;
    max-height: 22dvh;
  }
  .version-list {
    max-height: 26dvh;
  }
  .support-card {
    margin-top: 0;
  }
  .help-centre-grid {
    grid-template-columns: 1fr;
  }
  .dialog-content {
    max-height: 58dvh;
  }
  .welcome-card {
    max-height: calc(100dvh - 36px);
    overflow: auto;
  }
}

/* Verbosis 2.3.4 simplification release. */
.new-verse-button {
  min-width: 78px;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  background: var(--panel-2);
  color: var(--text);
  font-weight: 800;
  box-shadow: none;
}
.new-verse-button:hover,
.new-verse-button:focus-visible {
  background: color-mix(in srgb, var(--accent) 16%, var(--panel-2));
  border-color: var(--accent);
  outline: none;
}
.compact-card {
  display: grid;
  gap: 6px;
}
.primary-action {
  background: color-mix(in srgb, var(--accent-2) 18%, var(--panel-2));
  border-color: color-mix(in srgb, var(--accent-2) 55%, var(--line));
  color: var(--text);
  font-weight: 800;
}
.snapshot-manager-list {
  max-height: 330px;
  margin-top: 12px;
  padding-right: 4px;
}
.dialog-lead {
  margin: 0 0 12px;
  color: var(--dim);
  line-height: 1.55;
}
.confirm-dialog {
  width: min(440px, calc(100vw - 28px));
}
.confirm-dialog form {
  padding: 18px;
}
.confirm-message {
  color: var(--dim);
  line-height: 1.55;
  margin: 0 0 16px;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.confirm-actions .wide-button {
  width: auto;
  min-width: 110px;
}
.danger-button {
  background: color-mix(in srgb, var(--bad) 18%, var(--panel-2));
  border-color: color-mix(in srgb, var(--bad) 55%, var(--line));
  color: var(--text);
  font-weight: 850;
}
.danger-button:hover {
  background: color-mix(in srgb, var(--bad) 28%, var(--panel-2));
}
@media (max-width: 760px) {
  .confirm-actions {
    flex-direction: column-reverse;
  }
  .confirm-actions .wide-button {
    width: 100%;
  }
}

/* Verbosis 2.3.4.1 sidebar refinement release. */
.sidebar {
  height: 100vh;
  max-height: none;
  overflow: hidden;
}
.brand-row,
.sidebar-card,
.support-card {
  flex: 0 0 auto;
}
.document-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sidebar .support-card {
  margin-top: 0;
}
.sidebar-card {
  padding-top: 14px;
  padding-bottom: 14px;
}
.toolbar-button#helpBtn {
  font-weight: 750;
}
@media (max-width: 760px) {
  .sidebar {
    height: calc(100dvh - 52px);
    max-height: none;
    display: flex;
  }
  .document-list {
    min-height: 160px;
    max-height: none;
  }
  .sidebar-card {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .support-card {
    padding-top: 12px;
    padding-bottom: 12px;
  }
}


/* 2.3.4.1.5: simple sidebar Focus Mode control. */
.mode-note {
  margin: 0 0 10px;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.4;
}
.sidebar-action-button {
  width: 100%;
  background: var(--button-bg, var(--panel-2));
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-align: center;
}
.sidebar-action-button:hover,
.sidebar-action-button:focus-visible {
  border-color: var(--accent);
  outline: none;
}


/* 2.3.4.1.5: mobile is already minimal, so hide the Focus Mode control there.
   Desktop keeps Focus Mode unchanged. */
@media (max-width: 760px) {
  .sidebar-card {
    display: none;
  }
}

/* Verbosis 2.3.5.2: File menu dropdown refinement. */
.app-menu-row { align-items: center; }
.menu-group { position: relative; }
.menu-summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; user-select: none; }
.menu-summary::-webkit-details-marker { display: none; }
.menu-summary::after { content: "▾"; font-size: 10px; color: var(--dim); }
.menu-group[open] .menu-summary { background: var(--panel-active); color: var(--text); }
.menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 80;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.menu-panel hr { border: 0; border-top: 1px solid var(--line); margin: 6px 2px; }
.menu-item {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12px;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--panel-active); outline: none; }
.document-list-highlight { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: -2px; }
@media (max-width: 760px) {
  .menu-panel { left: 0; right: auto; min-width: 210px; }
}

/* Verbosis 2.3.5.3: mobile File menu popover fix.
   The File menu was opening inside the mobile toolbar area and being clipped.
   On small screens, dropdown panels now overlay the page and scroll if needed. */
@media (max-width: 760px) {
  .toolbar,
  .app-menu-row,
  .menu-group {
    overflow: visible;
  }

  .menu-panel {
    position: fixed;
    top: 64px;
    left: 12px;
    right: 12px;
    z-index: 1200;
    width: auto;
    min-width: 0;
    max-height: calc(100dvh - 88px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}


/* Verbosis 2.3.5.7: toolbar controls and optional syllable gutter. */
.menu-separator {
  align-self: stretch;
  width: 1px;
  min-height: 24px;
  background: var(--line);
  margin: 0 6px;
}
.syllables-hidden .syllable-gutter { display: none; }
.syllables-hidden .editor-inner { padding-left: 0; }
.syllables-hidden .text-mirror { left: 0; width: 100%; }
@media (max-width: 760px) {
  .menu-separator { flex: 0 0 100%; width: 100%; height: 1px; min-height: 1px; margin: 3px 0; }
  .syllables-hidden .editor-inner { padding-left: 0; }
  .syllables-hidden .text-mirror { left: 0; width: 100%; }
}
