body.left-nav-layout .navbar #keyboardShortcutsRow {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  border-top: 1px solid var(--left-rail-divider);
}
body.left-nav-layout .navbar #keyboardShortcutsRow #windowControlsButton {
  flex: 1; min-width: 0; width: auto; margin: 0; border-top: 0 !important;
  grid-template-columns: var(--left-rail-icon) minmax(0, 1fr) 50px;
  padding-right: 0 !important;
}
body.left-nav-layout .navbar #keyboardShortcutsRow #shortcutsButton {
  flex: 0 0 44px; height: 26px; margin: 0 12px 0 0; padding: 0;
  border: 1px solid #555; border-radius: 6px; background: #303030; color: #e9e9e9;
  font: 600 11px/1 Inter, sans-serif; cursor: pointer;
}
body.left-nav-layout .navbar #keyboardShortcutsRow #shortcutsButton:hover { background: #424242; border-color: #888; }
#shortcutsButton:focus-visible { outline: 2px solid #ddd; outline-offset: 3px; }
#keyboardShortcutsDialog {
  box-sizing: border-box; inset: 0; margin: auto; width: min(820px, calc(100vw - 32px)); max-width: none;
  max-height: calc(100dvh - 32px); padding: 0; overflow: hidden;
  border: 1px solid #484848; border-radius: 18px; background: #1b1b1b; color: #e9e9e9;
  font: 400 14px/1.5 Inter, sans-serif; box-shadow: 0 24px 80px #000b; color-scheme: dark;
}
#keyboardShortcutsDialog[open] { display: flex; flex-direction: column; }
#keyboardShortcutsDialog::backdrop { background: #08080899; }
#keyboardShortcutsDialog * { box-sizing: border-box; }
.shortcut-reference-header { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 14px; padding: 22px 24px 12px; }
.shortcut-reference-eyebrow { font-size: 10px; font-weight: 600; letter-spacing: .12em; color: #aaa; }
#keyboardShortcutsHeading { margin: 5px 0 0; font: 600 23px/1.3 Inter, sans-serif; letter-spacing: -.025em; }
#keyboardShortcutsDialog button { min-height: 36px; padding: 8px 14px; border: 1px solid #555; border-radius: 8px; background: #303030; color: #e9e9e9; font: 600 13px/1.3 Inter, sans-serif; cursor: pointer; }
#keyboardShortcutsDialog button:hover { background: #414141; }
#keyboardShortcutsDialog button:disabled { opacity: .35; cursor: default; }
#keyboardShortcutsDialog :is(button, summary):focus-visible { outline: 2px solid #ddd; outline-offset: 3px; }
#keyboardShortcutsDialog .shortcut-reference-header button { width: 36px; padding: 0; }
#keyboardShortcutsNote { flex: 0 0 auto; margin: 0; padding: 0 24px 8px; color: #bbb; font-size: 13px; line-height: 1.6; }
#keyboardShortcutsState { font-weight: 600; color: #ddd; }
#keyboardShortcutsState[data-enabled="true"] { color: #9edab8; }
.shortcut-reference-hint { flex: 0 0 auto; margin: 0; padding: 0 24px 16px; color: #aaa; font-size: 12px; }
.shortcut-reference-hint strong { color: #ddd; font-weight: 600; }
#keyboardShortcutsEditStatus { flex: 0 0 auto; margin: 0; padding: 0 24px 12px; color: #b8dcc0; font-size: 12px; overflow-wrap: anywhere; }
#keyboardShortcutsEditStatus:empty { display: none; }
#keyboardShortcutsEditStatus[data-error="true"] { color: #ffb4a8; }
#keyboardShortcutsDialog .shortcut-reference-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 24px 22px; scrollbar-width: thin; scrollbar-color: #555 transparent; }
.shortcut-reference-groups { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 28px; }
.shortcut-reference-group { min-width: 0; }
.shortcut-reference-group h3 { margin: 0 0 8px; color: #ccc; font: 600 13px/1.5 Inter, sans-serif; }
.shortcut-reference-group + .shortcut-reference-group { margin-top: 24px; }
.shortcut-reference-groups > .shortcut-reference-group { margin-top: 0; }
.shortcut-reference-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, 42%); align-items: start; gap: 12px; padding: 10px 0; border-bottom: 1px solid #363636; }
#keyboardShortcutsDialog .shortcut-reference-row > kbd { justify-self: end; text-align: right; }
#keyboardShortcutsDialog kbd { display: inline-block; width: fit-content; padding: 4px 7px; border: 1px solid #484848; border-radius: 5px; background: #252525; color: #ccc; font: 500 12px/1.5 Inter, sans-serif; overflow-wrap: anywhere; }
.shortcut-reference-binding { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
#keyboardShortcutsDialog .shortcut-reference-edit { min-width: 0; max-width: 100%; padding: 6px 8px; font-size: 12px; overflow-wrap: anywhere; text-align: left; }
#keyboardShortcutsDialog .shortcut-reference-edit[aria-pressed="true"] { background: #35443b; border-color: #92bba0; color: #d6f1df; }
.shortcut-reference-binding small { flex-basis: 100%; color: #999; font-size: 10px; text-align: right; }
.shortcut-reference-row > span { color: #ccc; font-size: 13px; line-height: 1.55; padding-top: 4px; }
.shortcut-reference-context { margin-top: 24px; padding: 14px 16px; border: 1px solid #444; border-radius: 9px; background: #232323; }
.shortcut-reference-context summary { color: #ccc; font-size: 13px; font-weight: 600; cursor: pointer; }
.shortcut-reference-context[open] summary { margin-bottom: 16px; }
.shortcut-reference-context .shortcut-reference-row { grid-template-columns: minmax(0, 1fr) minmax(130px, 28%); }
.shortcut-reference-footer { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-top: 1px solid #383838; color: #aaa; font-size: 12px; }
.shortcut-reference-actions { display: flex; gap: 8px; }
#keyboardShortcutsReset { background: transparent !important; }
#keyboardShortcutsReset:hover { background: #303030 !important; }
@media (max-width: 620px) {
  #keyboardShortcutsDialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .shortcut-reference-header { padding: 18px 16px 12px; }
  #keyboardShortcutsNote { padding: 0 16px 8px; }
  .shortcut-reference-hint { padding: 0 16px 16px; }
  #keyboardShortcutsEditStatus { padding: 0 16px 12px; }
  #keyboardShortcutsDialog .shortcut-reference-content { padding: 0 16px 18px; }
  .shortcut-reference-groups { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .shortcut-reference-context { padding: 12px; }
  .shortcut-reference-context .shortcut-reference-row { grid-template-columns: minmax(0, 1fr) minmax(100px, 40%); }
  .shortcut-reference-footer { padding: 12px 16px; }
}
@media (max-width: 380px) {
  .shortcut-reference-footer > span { display: none; }
  .shortcut-reference-actions { width: 100%; justify-content: space-between; }
}

/* The settings, reference list, and drawing editor share the same key rows. */
.shortcut-key-instruction { display: block; margin-top: 5px; color: #aaa; font: 400 12px/1.5 Inter, sans-serif; }
.shortcut-key-instruction:empty { display: none; }
.shortcut-sequence { grid-column: 2 / -1; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; color: #aaa; font: 500 12px/1.5 Inter, sans-serif; }
.shortcut-sequence kbd { padding: 7px 10px; border: 1px solid #484848; border-radius: 6px; background: #2b2b2b; color: #e5e5e5; font: 700 14px/1.4 Inter, sans-serif; }
#controlCenterSettingsDialog:has(#ccSettingsKeyboardTab[aria-selected="true"]) { width: min(820px, calc(100vw - 32px)); }
:is(#keyboardShortcutsDialog, #controlCenterSettingsDialog, #snapshotEditorDialog, #replayPreviewDialog) :is(.shortcut-reference-row, .cc-keyboard-row, .snapshot-shortcut-row) {
  display: grid; grid-template-columns: minmax(0, 1fr) 188px 60px; align-items: center;
  gap: 20px; padding: 13px 0; border-bottom: 1px solid #ffffff0a;
}
:is(#keyboardShortcutsDialog, #controlCenterSettingsDialog, #snapshotEditorDialog, #replayPreviewDialog) :is(.shortcut-reference-row, .cc-keyboard-row, .snapshot-shortcut-row) > span {
  padding: 0; color: #ddd; font-size: 16px; line-height: 1.5;
}
.shortcut-reference-binding { display: contents; }
#keyboardShortcutsDialog .shortcut-reference-row > kbd { grid-column: 2 / -1; }
:is(#keyboardShortcutsDialog, #controlCenterSettingsDialog, #snapshotEditorDialog, #replayPreviewDialog) :is(.shortcut-reference-edit, .cc-keyboard-record, .snapshot-shortcut-key) {
  width: 100%; min-height: 50px; padding: 10px; border: 1px solid #484848; border-radius: 12px;
  color: #e5e5e5; background: #2b2b2b; font: 700 14px/1.4 Inter, sans-serif; text-align: center; overflow-wrap: anywhere;
}
:is(#keyboardShortcutsDialog, #controlCenterSettingsDialog, #snapshotEditorDialog, #replayPreviewDialog) :is(.shortcut-reference-edit, .cc-keyboard-record, .snapshot-shortcut-key)[aria-pressed="true"] {
  background: #35443b; border-color: #92bba0; color: #d6f1df;
}
:is(#keyboardShortcutsDialog, #controlCenterSettingsDialog, #snapshotEditorDialog, #replayPreviewDialog) :is(.shortcut-reference-clear, .cc-keyboard-clear, .snapshot-shortcut-clear) {
  min-width: 0; padding: 8px 0; border-color: transparent; background: transparent; color: #bbb; font: 600 15px/1.4 Inter, sans-serif;
}
:is(#keyboardShortcutsDialog, #controlCenterSettingsDialog, #snapshotEditorDialog, #replayPreviewDialog) :is(.shortcut-reference-group h3, .cc-keyboard-group legend, .snapshot-shortcut-group h3) {
  color: #aaa; font: 600 14px/1.5 Inter, sans-serif; margin-bottom: 8px;
}
@media (max-width: 680px) {
  :is(#keyboardShortcutsDialog, #controlCenterSettingsDialog, #snapshotEditorDialog, #replayPreviewDialog) :is(.shortcut-reference-row, .cc-keyboard-row, .snapshot-shortcut-row) {
    grid-template-columns: minmax(0, 1fr) 120px 42px; gap: 9px; padding: 12px 0;
  }
  :is(#keyboardShortcutsDialog, #controlCenterSettingsDialog, #snapshotEditorDialog, #replayPreviewDialog) :is(.shortcut-reference-row, .cc-keyboard-row, .snapshot-shortcut-row) > span { font-size: 13px; }
  :is(#keyboardShortcutsDialog, #controlCenterSettingsDialog, #snapshotEditorDialog, #replayPreviewDialog) :is(.shortcut-reference-edit, .cc-keyboard-record, .snapshot-shortcut-key) { min-height: 44px; padding: 8px 5px; font-size: 12px; }
  :is(#keyboardShortcutsDialog, #controlCenterSettingsDialog, #snapshotEditorDialog, #replayPreviewDialog) :is(.shortcut-reference-clear, .cc-keyboard-clear, .snapshot-shortcut-clear) { font-size: 12px; }
}
@media (max-width: 370px) {
  :is(#keyboardShortcutsDialog, #controlCenterSettingsDialog, #snapshotEditorDialog, #replayPreviewDialog) :is(.shortcut-reference-row, .cc-keyboard-row, .snapshot-shortcut-row) { grid-template-columns: minmax(0, 1fr) 102px 36px; gap: 7px; }
}
