:root {
  --bg-app: #e8e4dc;
  --bg-top: #f3f0e8;
  --bg-rail: #2c3338;
  --bg-stage: #c4c0b6;
  --bg-stage-dot: rgba(44, 51, 56, 0.12);
  --ink: #1a1f23;
  --ink-muted: #5c656d;
  --rail-ink: #d7dde2;
  --rail-muted: #8b969e;
  --accent: #0d7a6f;
  --accent-ink: #f4fffc;
  --danger-soft: #b54a3c;
  --line: rgba(26, 31, 35, 0.12);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 8px 24px rgba(26, 31, 35, 0.08);
  --font-ui: "Figtree", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 8px;
  --topbar-h: 52px;
  --statusbar-h: 28px;
  --rail-w: 72px;
  --context-w: 220px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #f7f3ea 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #d9e6e3 0%, transparent 50%),
    var(--bg-app);
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.78em;
  padding: 0.12em 0.4em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.55);
}

.app {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr var(--statusbar-h);
  height: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.75rem 0 0.9rem;
  background: color-mix(in srgb, var(--bg-top) 88%, white);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  min-width: 0;
}

.style-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  justify-content: flex-start;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.swatches {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.palette-swatches {
  padding-left: 0.45rem;
  margin-left: 0.15rem;
  border-left: 1px solid var(--line);
}

.palette-swatches[hidden] {
  display: none !important;
}

.hex-readout {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.65);
  padding: 0.28rem 0.4rem 0.28rem 1.4rem;
  position: relative;
  color: var(--ink);
  min-width: 4.8rem;
  width: 5.6rem;
}

.hex-readout::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  top: 50%;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 3px;
  transform: translateY(-50%);
  background: var(--hex, #e23b2f);
  box-shadow: inset 0 0 0 1px rgba(26, 31, 35, 0.2);
  pointer-events: none;
}

.hex-readout:hover,
.hex-readout:focus {
  background: #fff;
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.color-picker-wrap {
  position: relative;
  width: 1.55rem;
  height: 1.55rem;
  flex-shrink: 0;
  border-radius: 999px;
  border: 2px solid rgba(26, 31, 35, 0.2);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  cursor: pointer;
}

.color-picker-wrap input[type="color"] {
  position: absolute;
  inset: -40%;
  width: 180%;
  height: 180%;
  padding: 0;
  border: none;
  cursor: pointer;
  background: none;
}

.swatch {
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border-radius: 999px;
  border: 2px solid rgba(26, 31, 35, 0.2);
  background: var(--sw);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.swatch.is-active {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: rgba(26, 31, 35, 0.45);
}

.stroke-control {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.stroke-control input[type="range"] {
  width: 72px;
  accent-color: var(--accent);
}

.opacity-control .stroke-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.opacity-control input[type="range"] {
  width: 64px;
}

.stroke-val {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  min-width: 1.1rem;
}

.mode-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 6px;
  padding: 0.28rem 0.55rem;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.mode-btn:hover {
  background: #fff;
  color: var(--ink);
}

.mode-btn.is-active {
  background: color-mix(in srgb, var(--accent) 18%, #fff);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}

.chroma-key {
  pointer-events: none;
}

.chroma-control {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.chroma-control input[type="range"] {
  width: 72px;
  accent-color: var(--accent);
}

.chroma-control span:last-child {
  font-family: var(--font-mono);
  min-width: 1.5rem;
}

.export-cluster {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.15rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--line);
}

.export-format select {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.65);
  padding: 0.32rem 0.3rem;
}

.export-quality {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-muted);
}

.export-quality[hidden] {
  display: none !important;
}

.export-quality input[type="range"] {
  width: 64px;
  accent-color: var(--accent);
}

.resize-dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  background: #f7f4ec;
  color: var(--ink);
  box-shadow: 0 16px 40px rgba(26, 31, 35, 0.2);
  max-width: 22rem;
}

.resize-dialog::backdrop {
  background: rgba(26, 31, 35, 0.35);
}

.resize-dialog form {
  margin: 0;
  padding: 1.1rem 1.2rem 1rem;
}

.resize-dialog h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.dialog-note {
  margin: 0 0 0.9rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.resize-fields {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.resize-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.resize-fields input[type="number"] {
  font: inherit;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.lock-aspect {
  flex-direction: row !important;
  align-items: center;
  gap: 0.45rem !important;
  font-weight: 600;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.preset-row .btn {
  font-size: 0.78rem;
  padding: 0.28rem 0.5rem;
}

.new-fill {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 1rem;
  padding: 0.55rem 0.7rem 0.65rem;
  display: grid;
  gap: 0.35rem;
}

.new-fill legend {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0 0.25rem;
}

.new-fill label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.new-fill-custom input[type="color"] {
  width: 2rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

.text-editor {
  position: absolute;
  z-index: 4;
  margin: 0;
  padding: 0.1em 0.15em;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  font-family: var(--font-ui), "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-weight: 700;
  line-height: 1.25;
  resize: both;
  min-height: 1.4em;
  box-shadow: 0 6px 20px rgba(26, 31, 35, 0.18);
  outline: none;
}

.emoji-wrap {
  position: relative;
}

.emoji-picker {
  position: fixed;
  z-index: 40;
  width: 17.5rem;
  padding: 0.4rem;
  border-radius: 10px;
  background: #f7f4ec;
  border: 1px solid var(--line);
  box-shadow: 0 14px 32px rgba(26, 31, 35, 0.18);
}

.emoji-picker[hidden] {
  display: none !important;
}

.emoji-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-bottom: 0.35rem;
}

.emoji-tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.emoji-tab:hover {
  color: var(--ink);
  background: #fff;
}

.emoji-tab.is-active {
  background: color-mix(in srgb, var(--accent) 18%, #fff);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.15rem;
  max-height: 13.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
}

.emoji-cell {
  border: none;
  background: transparent;
  border-radius: 6px;
  padding: 0.28rem 0;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.emoji-cell:hover {
  background: rgba(13, 122, 111, 0.12);
}

.btn-glyph {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
  fill: currentColor;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.2rem;
  max-height: 13.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
}

.icon-cell {
  border: none;
  background: transparent;
  border-radius: 6px;
  padding: 0.4rem;
  cursor: pointer;
  color: var(--ink);
  display: grid;
  place-items: center;
}

.icon-cell svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
}

.icon-cell:hover {
  background: rgba(13, 122, 111, 0.12);
  color: var(--accent);
}


.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.back-home {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-decoration: none;
  white-space: nowrap;
  padding-right: 0.55rem;
  margin-right: 0.15rem;
  border-right: 1px solid var(--line);
}

.back-home:hover {
  color: var(--accent);
  text-decoration: underline;
}

.brand-mark {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), #1a9b8c 55%, #245b6e);
  box-shadow: 0 0 0 2px rgba(13, 122, 111, 0.2);
}

.brand-name {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
  border-radius: 6px;
  padding: 0.38rem 0.65rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}

.btn-icon {
  min-width: 2rem;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
  font-size: 1rem;
  line-height: 1;
}

.btn:hover:not(:disabled) {
  background: #fff;
  border-color: color-mix(in srgb, var(--ink) 22%, transparent);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 70%, #000);
  color: var(--accent-ink);
}

.btn-primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 88%, #000);
  border-color: color-mix(in srgb, var(--accent) 55%, #000);
}

.workspace {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr var(--context-w);
  min-height: 0;
  overflow: visible;
}

.context-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.85rem 0.75rem;
  background: color-mix(in srgb, var(--bg-top) 92%, #e4e0d6);
  border-left: 1px solid var(--line);
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.context-head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}

.context-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.context-hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--ink-muted);
}

.context-section {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.context-section[hidden] {
  display: none !important;
}

.context-section-title {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.context-note {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--ink-muted);
}

.context-field {
  display: grid;
  grid-template-columns: 3.4rem 1fr 2.4rem;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.context-field[hidden] {
  display: none !important;
}

.context-field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.context-label {
  font-weight: 700;
}

.context-val {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-align: right;
}

.context-text-look {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.context-text-look .context-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.context-text-look .mode-btn {
  font-size: 0.72rem;
  padding: 0.28rem 0.35rem;
}

.context-order-row {
  display: grid;
  grid-template-columns: 1fr auto auto 1fr;
  gap: 0.3rem;
}

.context-order-row .mode-btn {
  min-width: 0;
}

.context-order-row .mode-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.context-textarea {
  width: 100%;
  min-height: 5.5rem;
  resize: vertical;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  padding: 0.5rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  box-sizing: border-box;
}

.context-textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 1px;
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.context-textarea:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.context-action {
  width: 100%;
  justify-content: center;
}

.chroma-key-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chroma-key-row .chroma-key {
  width: 1.35rem;
  height: 1.35rem;
}

.tool-rail {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  padding: 0.55rem 0.4rem;
  background: linear-gradient(180deg, #343c42 0%, var(--bg-rail) 40%, #242a2e 100%);
  color: var(--rail-ink);
  border-right: 1px solid #1a1f23;
  position: relative;
  z-index: 6;
}

.tool-rail-spacer {
  flex: 1;
  min-height: 0.5rem;
}

.tool-rail-divider {
  height: 1px;
  margin: 0.35rem 0.45rem;
  background: rgba(255, 255, 255, 0.1);
}

.tool-group {
  position: relative;
}

.tool-group-trigger {
  position: relative;
  width: 100%;
}

.tool-caret {
  position: absolute;
  right: 0;
  top: 0;
  width: 1.2rem;
  height: 1.15rem;
  border: none;
  opacity: 0.85;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.tool-caret::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid var(--rail-muted);
}

.tool-group.is-open .tool-caret::before,
.tool-group.has-active .tool-caret::before {
  border-top-color: #c9f3ec;
}

.btn.is-active {
  background: color-mix(in srgb, var(--accent) 22%, #fff);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
}

.style-bar.color-locked .swatches,
.style-bar.color-locked .color-picker-wrap,
.style-bar.color-locked #hex-readout {
  opacity: 0.55;
}

.chroma-key {
  cursor: pointer;
  border: none;
  padding: 0;
}


.tool-flyout {
  position: absolute;
  left: calc(100% + 0.45rem);
  top: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 10.5rem;
  padding: 0.35rem;
  border-radius: 10px;
  background: #2a3136;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.tool-flyout-up {
  top: auto;
  bottom: 0;
}

.tool-flyout[hidden] {
  display: none !important;
}

.tool-flyout-sep {
  height: 1px;
  margin: 0.2rem 0.35rem;
  background: rgba(255, 255, 255, 0.1);
}

.tool-flyout-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.42rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--rail-ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
}

.tool-flyout-btn .tool-icon {
  width: 1.1rem;
  text-align: center;
}

.tool-flyout-btn kbd {
  margin-left: auto;
  font-size: 0.65rem;
  padding: 0.08em 0.35em;
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25);
  color: var(--rail-muted);
}

.tool-flyout-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.tool-flyout-btn.is-active {
  background: rgba(13, 122, 111, 0.4);
  border-color: rgba(90, 210, 196, 0.3);
}

.tool-flyout-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.image-ops {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.45rem 0.2rem;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--rail-ink);
}

.tool-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.tool-btn.is-active {
  background: rgba(13, 122, 111, 0.35);
  border-color: rgba(90, 210, 196, 0.35);
}

.tool-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.tool-icon {
  font-size: 0.95rem;
  line-height: 1.2;
  font-family: var(--font-mono);
}

.tool-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--rail-muted);
}

.tool-btn.is-active .tool-label {
  color: #c9f3ec;
}

.stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background-color: var(--bg-stage);
  background-image: radial-gradient(var(--bg-stage-dot) 1px, transparent 1px);
  background-size: 18px 18px;
  cursor: grab;
}

.stage.is-panning {
  cursor: grabbing;
}

.stage.has-image {
  cursor: default;
}

.stage.has-image[data-cursor="grab"] {
  cursor: grab;
}

.stage.has-image[data-cursor="grabbing"] {
  cursor: grabbing;
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 2rem;
  text-align: center;
  pointer-events: none;
}

.empty-state .btn,
.empty-state .empty-actions {
  pointer-events: auto;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.stage.has-image .empty-state {
  display: none;
}

.empty-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.empty-hint {
  margin: 0 0 0.5rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
  max-width: 28rem;
  line-height: 1.45;
}

.stage.is-dragover::after {
  content: "Drop to open";
  position: absolute;
  inset: 12px;
  display: grid;
  place-items: center;
  border: 2px dashed var(--accent);
  border-radius: 12px;
  background: rgba(243, 240, 232, 0.82);
  color: var(--accent);
  font-weight: 700;
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 5;
}

.statusbar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
  background: color-mix(in srgb, var(--bg-top) 92%, #ddd);
  border-top: 1px solid var(--line);
}

.status-zoom {
  font: inherit;
  color: inherit;
  border: none;
  background: transparent;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  cursor: pointer;
}

.status-zoom:hover:not(:disabled) {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
}

.status-zoom:disabled {
  opacity: 0.5;
  cursor: default;
}

.status-sep {
  opacity: 0.45;
}

.status-spacer {
  flex: 1;
}

.status-help {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  color: inherit;
  border: none;
  background: transparent;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  cursor: pointer;
}

.status-help:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
}

.status-help kbd {
  font: inherit;
  font-weight: 600;
  padding: 0.05rem 0.28rem;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.shortcuts-help {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(52rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
}

.shortcuts-help::backdrop {
  background: rgba(26, 31, 35, 0.4);
}

.shortcuts-help-panel {
  background: #f7f4ec;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(26, 31, 35, 0.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2rem);
}

.shortcuts-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem 0.65rem;
  border-bottom: 1px solid var(--line);
}

.shortcuts-help-head h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.shortcuts-help-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  padding: 0.9rem 1rem 0.35rem;
  overflow: auto;
}

.shortcuts-section-title {
  margin: 0 0 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.shortcuts-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.shortcuts-row {
  display: grid;
  grid-template-columns: minmax(6.5rem, auto) 1fr;
  gap: 0.55rem 0.75rem;
  align-items: center;
}

.shortcuts-row dt {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.shortcuts-row dd {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
}

.shortcuts-row kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.12rem 0.32rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(26, 31, 35, 0.06);
}

.shortcuts-help-foot {
  margin: 0;
  padding: 0.55rem 1rem 0.85rem;
  font-size: 0.75rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--line);
}

.shortcuts-help-foot kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.05rem 0.28rem;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: #fff;
}

@media (max-width: 720px) {
  .shortcuts-help-body {
    grid-template-columns: 1fr;
  }
}
