:root {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #15202b;
  background: #f3f4f5;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
.hidden, [hidden] { display: none !important; }
.topbar { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; color: #fff; background: #101820; }
.topbar h1 { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.brand { font-size: 21px; font-weight: 900; letter-spacing: -1px; }
.brand span { color: #ee6233; }
.shell { width: min(1800px, calc(100% - 40px)); margin: 18px auto 0; }
.workspace-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.editor-panel { display: flex; min-width: 0; flex-direction: column; background: #fff; border: 1px solid #d5dbe0; border-radius: 9px; }
.panel-heading { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #e2e6e9; }
.panel-heading h2 { margin: 0; font-size: 15px; font-weight: 650; }
.actions { display: flex; gap: 7px; }
.button { min-height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: 6px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.button-primary { background: #e85d2a; color: #fff; }
.button-primary:hover:not(:disabled) { background: #cc4d20; }
.button-dark { color: #fff; background: #15202b; }
.button-dark:hover:not(:disabled) { background: #2a3b4c; }
.button-secondary { background: #fff; border-color: #ccd4db; color: #263440; }
.button-secondary:hover:not(:disabled) { background: #f3f5f6; }
.button:disabled { opacity: .4; cursor: default; }
textarea { width: 100%; height: calc(100dvh - 208px); min-height: 360px; padding: 18px; border: 0; outline: 0; resize: vertical; background: #fff; color: #15202b; font-family: Consolas, "Liberation Mono", monospace; font-size: 13px; line-height: 1.7; tab-size: 2; }
textarea::placeholder { color: #8a949d; }
textarea:focus { box-shadow: inset 0 0 0 2px #e85d2a55; }
.output-panel textarea { background: #fcfdfb; }
.panel-footer { min-height: 40px; display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-top: 1px solid #e2e6e9; color: #76828d; font-size: 11px; }
#input-key { margin-left: auto; }
#output-status[data-tone="good"] { color: #287354; }
#output-status[data-tone="bad"] { color: #b34f31; }
#output-count { margin-left: auto; }
.utility-menu { position: relative; font-size: 12px; }
.utility-menu summary { list-style: none; padding: 7px 9px; border-radius: 5px; }
.utility-menu summary::-webkit-details-marker { display: none; }
.utility-menu summary::after { content: " ▾"; font-size: 10px; opacity: .7; }
.utility-menu summary:hover { background: #ffffff16; }
.menu-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 5; min-width: 200px; padding: 10px; border: 1px solid #d5dbe0; border-radius: 8px; box-shadow: 0 8px 24px #10182020; color: #263440; background: #fff; }
.menu-button, .menu-panel a { display: block; width: 100%; border: 0; border-radius: 4px; padding: 9px; text-align: left; font-size: 12px; color: #263440; background: transparent; text-decoration: none; }
.menu-button:hover, .menu-panel a:hover { background: #f1f3f5; }
.transpose-menu { color: #263440; }
.transpose-menu summary:hover { background: #f0f3f5; }
.transpose-panel { top: auto; bottom: calc(100% + 8px); display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; min-width: 240px; padding: 14px; }
.transpose-panel select { min-width: 0; height: 34px; padding: 0 8px; border: 1px solid #ccd4db; border-radius: 5px; color: #15202b; background: #fff; font-size: 12px; }
.transpose-panel .button, .key-suggestions { grid-column: 1 / -1; }
.transpose-controls { display: flex; align-items: center; gap: 2px; color: #344250; }
.step-button { width: 30px; height: 28px; border: 1px solid #dce1e6; border-radius: 5px; background: #f7f8f9; font-size: 18px; line-height: 1; color: #344250; }
.step-button:disabled { opacity: .35; cursor: default; }
.step-button:hover:not(:disabled) { background: #e9edf0; }
#transpose-label { min-width: 108px; text-align: center; font-variant-numeric: tabular-nums; }
.key-suggestions { display: flex; gap: 6px; flex-wrap: wrap; }
.key-suggestion { padding: 5px 8px; border: 1px solid #e1e5e9; border-radius: 4px; color: #5c6873; background: #fafbfc; font-size: 11px; }
.message { margin: 12px 0 0; padding: 10px 13px; background: #fff2e6; border-radius: 6px; color: #864128; font-size: 12px; line-height: 1.5; }
.footer { width: min(1800px, calc(100% - 40px)); display: flex; justify-content: space-between; gap: 12px; margin: 12px auto; color: #8a949d; font-size: 10px; }
.startup-notice { margin: 0; padding: 12px 24px; background: #fff0c2; color: #5f4214; font-size: 13px; }
button:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid #e85d2a; outline-offset: 3px; }
@media (max-width: 700px) {
  .topbar { padding: 0 14px; height: 46px; }
  .shell { width: calc(100% - 20px); margin-top: 10px; }
  .workspace-grid { grid-template-columns: 1fr; gap: 12px; }
  .panel-heading { min-height: 60px; padding: 10px 12px; }
  .panel-heading h2 { font-size: 13px; }
  .button { padding: 0 10px; font-size: 11px; }
  textarea { height: 37dvh; min-height: 220px; padding: 14px; }
  .footer { width: calc(100% - 20px); }
}
