/* app.css v0.4.26 */
/* 2026-05-04 */
/* - 広告枠を操作領域から最下部へ移動 */
/* - footer直前の広告コンテナ表示を追加 */
:root {
  --bg-top: #f6efe4;
  --bg-bottom: #d8ecf4;
  --panel: rgba(255, 251, 246, 0.92);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --ink: #1c2430;
  --muted: #5a6778;
  --line: rgba(20, 39, 58, 0.12);
  --accent: #e47b39;
  --accent-strong: #bf5420;
  --accent-soft: #ffd9c2;
  --blue-soft: #d7ebf3;
  --danger: #b94747;
  --success: #2f7a58;
  --white-key: #fffdf9;
  --white-key-border: #d8d2cb;
  --black-key: #1e252d;
  --black-key-active: #e47b39;
  --shadow: 0 14px 30px rgba(28, 36, 48, 0.12);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --white-key-width: 62px;
  --black-key-width: 38px;
  --black-key-offset: 19px;
  --keyboard-height: 113px;
  --white-key-height: var(--keyboard-height);
  --black-key-height: calc(var(--keyboard-height) * 0.6);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: auto;
  margin: 0;
  min-height: 100%;
  font-family: "Avenir Next", "Hiragino Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.75), transparent 34%),
    linear-gradient(135deg, var(--bg-top), var(--bg-bottom));
}

body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.tool-btn,
.secondary-btn,
.note-btn,
.white-key,
.black-key,
.note-card,
.song-item-main,
.song-item-delete {
  touch-action: manipulation;
}

.rotate-guard {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #13293d, #1f4e5f);
  color: white;
  text-align: center;
  z-index: 20;
  padding: 24px;
}

.rotate-guard p {
  margin: 0;
  font-size: clamp(24px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.app-shell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
  padding: 8px 10px calc(8px + var(--safe-bottom));
  padding-left: calc(10px + var(--safe-left));
  padding-right: calc(10px + var(--safe-right));
}

.topbar,
.selected-note-panel,
.sequence-panel,
.controls-panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
}

.topbar {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 8px;
  padding: 8px 10px;
  align-items: center;
}

.title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.title-group h1 {
  margin: 0;
  font-size: clamp(18px, 2vw, 24px);
  white-space: nowrap;
}

.song-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.song-name span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.song-name input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 7px 10px;
}

.toolbar-panel {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
}

.playback-toolbar {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.playback-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
}

.playback-edit-row {
  padding-top: 2px;
}

.main-layout {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ad-container {
  display: grid;
  gap: 4px;
  min-height: 76px;
  margin-top: 12px;
  padding: 6px 8px;
  border: 1px solid rgba(28, 36, 48, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.ad-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.ad-slot {
  width: 100%;
  min-height: 50px;
  overflow: hidden;
}

.site-info {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 18px 4px 8px;
  color: var(--ink);
}

.site-info-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.site-info-nav a {
  color: #23465e;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.site-info-nav a:focus,
.site-info-nav a:hover {
  text-decoration: underline;
}

.info-section {
  display: grid;
  gap: 6px;
  max-width: 920px;
}

.info-section h2 {
  margin: 0;
  font-size: 16px;
}

.info-section p {
  margin: 0;
  color: #344555;
  font-size: 13px;
  line-height: 1.7;
}

.selected-note-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 6px;
}

.export-panel {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 6px;
  display: flex;
}

.sequence-status {
  color: var(--muted);
  font-size: 12px;
}

.edit-mode-badge {
  margin-top: 0;
  align-self: flex-start;
  background: var(--blue-soft);
  color: #23465e;
  border-radius: 999px;
  padding: 2px 5px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.edit-mode-badge.is-editing {
  background: #ffe8b6;
  color: #7a4b00;
  box-shadow: 0 0 0 2px rgba(228, 123, 57, 0.18);
}

.input-toolbar-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px;
  align-items: stretch;
  padding: 6px 6px 0;
  background: linear-gradient(180deg, rgba(247, 250, 252, 0.96), rgba(240, 246, 249, 0.96));
  border: 1px solid rgba(28, 36, 48, 0.06);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
}

.selected-note-inline {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: center;
  justify-items: start;
  min-width: 52px;
  min-height: 28px;
  padding: 4px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 243, 232, 0.98), rgba(249, 251, 253, 0.98));
  border: 1px solid rgba(228, 123, 57, 0.18);
}

.selected-note-inline-name {
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.selected-note-inline-solfege {
  margin-top: 1px;
  font-size: 10px;
  color: var(--muted);
}

.note-input-bar {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  min-width: 0;
  align-items: stretch;
}

.export-outputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.export-output-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 3px;
}

.export-output-header {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
}

.export-output-label {
  font-size: 11px;
  font-weight: 800;
  color: #456277;
  letter-spacing: 0.02em;
  padding-left: 2px;
}

.copy-txt-btn {
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(215, 235, 243, 0.95);
  color: #23465e;
  border: 1px solid rgba(28, 36, 48, 0.08);
  font-size: 10px;
  font-weight: 900;
}

.copy-status {
  min-width: 70px;
  color: var(--success);
  font-size: 10px;
  font-weight: 900;
  opacity: 0;
  transition: opacity 120ms ease;
  white-space: nowrap;
}

.copy-status.is-visible {
  opacity: 1;
}

.export-outputs textarea {
  width: 100%;
  resize: none;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  background: #fffdfa;
  color: var(--ink);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.panel-header h2 {
  margin: 0;
  font-size: 14px;
}

.sequence-panel {
  padding: 6px 8px;
  display: grid;
  gap: 2px;
}

.selection-toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 0;
  margin-bottom: 0;
  align-items: center;
}

.note-list {
  display: flex;
  gap: 8px;
  align-items: stretch;
  overflow-x: auto;
  padding-bottom: 1px;
  touch-action: pan-x;
}

.note-list::-webkit-scrollbar {
  height: 8px;
}

.note-list::-webkit-scrollbar-thumb {
  background: rgba(28, 36, 48, 0.2);
  border-radius: 999px;
}

.measure-group {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  align-items: stretch;
  flex: 0 0 auto;
  padding: 4px 8px;
  border-left: 2px solid rgba(28, 36, 48, 0.22);
  border-right: 2px solid rgba(28, 36, 48, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.38);
}

.measure-label {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.measure-notes {
  display: flex;
  gap: 5px;
  align-items: stretch;
}

.note-card {
  position: relative;
  min-width: 68px;
  padding: 4px 5px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(244, 248, 251, 0.95));
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 2px;
  min-height: 42px;
}

.note-card.is-selected {
  outline: 3px solid rgba(228, 123, 57, 0.58);
  border-color: rgba(228, 123, 57, 0.7);
  background: linear-gradient(180deg, rgba(255, 245, 235, 0.98), rgba(255, 230, 204, 0.98));
  box-shadow: 0 10px 22px rgba(228, 123, 57, 0.18);
}

.note-card.is-insert-before::before,
.note-card.is-insert-after::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff9d58, #d96322);
}

.note-card.is-insert-before::before {
  left: -7px;
}

.note-card.is-insert-after::before {
  right: -7px;
}

.note-card.is-playing {
  background: linear-gradient(180deg, rgba(255, 241, 225, 0.98), rgba(255, 225, 193, 0.98));
}

.note-card.rest {
  background: linear-gradient(180deg, rgba(239, 245, 249, 0.98), rgba(223, 235, 242, 0.98));
}

.note-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 9px;
}

.note-index {
  color: var(--muted);
  font-weight: 700;
}

.note-card-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 18px;
}

.note-name {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.note-duration {
  padding: 2px 5px;
  border-radius: 6px;
  background: #eef1f3;
  color: #334454;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.note-mode-indicator {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  color: #8a4a1e;
}

.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.note-btn,
.tool-btn,
.secondary-btn {
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(28, 36, 48, 0.08);
  font-weight: 700;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background-color 120ms ease,
    border-color 120ms ease;
}

.note-btn:active,
.tool-btn:active,
.secondary-btn:active,
.song-item-delete:active {
  transform: translateY(1px) scale(0.985);
}

.tool-btn:disabled,
.secondary-btn:disabled {
  color: rgba(90, 103, 120, 0.45);
  background: rgba(233, 238, 241, 0.74);
  cursor: default;
  transform: none;
  box-shadow: none;
}

.note-btn {
  min-width: 36px;
  flex: 1 1 0;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 4px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 250, 0.96));
  box-shadow: 0 8px 18px rgba(28, 36, 48, 0.07);
}

.note-btn-text {
  font-size: 9px;
  color: var(--muted);
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
}

.note-btn.active {
  background: linear-gradient(180deg, #ffdbc7, #ffc5a1);
  color: #6b320f;
  border-color: rgba(191, 84, 32, 0.34);
  box-shadow: 0 12px 24px rgba(191, 84, 32, 0.16);
}

.note-btn.active .note-btn-text {
  color: #6b320f;
}

.tool-btn.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: white;
}

.tool-btn.danger {
  background: linear-gradient(180deg, #d96767, var(--danger));
  color: white;
}

.tool-btn.success {
  background: linear-gradient(180deg, #5aa379, var(--success));
  color: white;
}

.tool-btn.small {
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 12px;
  font-size: 11px;
}

.tool-btn.is-active-toggle {
  box-shadow: 0 0 0 3px rgba(228, 123, 57, 0.2);
}

.tool-btn.is-looping {
  background: linear-gradient(180deg, #ffe1ce, #ffbd91);
  color: #6b320f;
  border-color: rgba(191, 84, 32, 0.36);
  box-shadow: 0 0 0 3px rgba(228, 123, 57, 0.18);
}

.tool-btn.is-pressed {
  transform: translateY(2px) scale(0.98);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.14);
}

.tempo-control {
  display: inline-grid;
  grid-template-columns: 28px minmax(62px, auto) 28px;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(28, 36, 48, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  overflow: hidden;
}

.instrument-control {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  gap: 5px;
  padding: 0 6px;
  border: 1px solid rgba(28, 36, 48, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.instrument-label,
.display-pitch-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.instrument-select {
  max-width: 164px;
  min-height: 24px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  outline: none;
}

.display-pitch-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  overflow: hidden;
  border: 1px solid rgba(28, 36, 48, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.display-pitch-label {
  padding: 0 7px;
}

.display-pitch-btn {
  min-height: 28px;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.display-pitch-btn.is-active {
  background: linear-gradient(180deg, #d7ebf3, #bfe0ed);
  color: #23465e;
}

.instrument-help {
  max-width: min(720px, 100%);
  justify-self: end;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  text-align: right;
}

.instrument-help.is-transposing {
  color: #7a4b00;
}

.tempo-btn {
  height: 100%;
  min-height: 28px;
  background: rgba(215, 235, 243, 0.95);
  color: #23465e;
  font-weight: 900;
}

.tempo-btn:disabled {
  color: rgba(35, 70, 94, 0.35);
  background: rgba(233, 238, 241, 0.86);
  cursor: default;
}

.tempo-label {
  padding: 0 6px;
  text-align: center;
  font-size: 10px;
  font-weight: 900;
  color: var(--ink);
  white-space: nowrap;
}

.notation-toggle {
  display: inline-flex;
  min-height: 28px;
  overflow: hidden;
  border: 1px solid rgba(28, 36, 48, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.notation-btn {
  min-height: 28px;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.notation-btn.is-active {
  background: linear-gradient(180deg, #ffdbc7, #ffc5a1);
  color: #6b320f;
}

.save-status {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(215, 235, 243, 0.95);
  color: #23465e;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.save-toast {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 35;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(47, 122, 88, 0.96);
  color: white;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 16px 30px rgba(19, 41, 61, 0.24);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.save-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.keyboard-shell {
  position: sticky;
  bottom: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 0 0 18px 18px;
  padding: 6px 8px calc(8px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(240, 246, 249, 0.98), rgba(233, 242, 247, 0.98));
  z-index: 5;
  box-shadow: inset 0 0 0 1px rgba(28, 36, 48, 0.06);
  border: 1px solid rgba(28, 36, 48, 0.06);
  border-top: 0;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.keyboard-shell::-webkit-scrollbar {
  height: 8px;
}

.keyboard-shell::-webkit-scrollbar-thumb {
  background: rgba(28, 36, 48, 0.2);
  border-radius: 999px;
}

.keyboard {
  position: relative;
  flex: 0 0 auto;
  height: 100%;
  min-height: var(--white-key-height);
}

.keyboard-bed {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(208, 221, 229, 0.22), rgba(255, 255, 255, 0));
}

.white-keys {
  display: flex;
  height: var(--white-key-height);
}

.white-key,
.black-key {
  user-select: none;
}

.white-key {
  position: relative;
  flex: 0 0 var(--white-key-width);
  width: var(--white-key-width);
  height: var(--white-key-height);
  border: 1px solid var(--white-key-border);
  border-radius: 0 0 12px 12px;
  background: linear-gradient(180deg, #ffffff, var(--white-key));
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 7px;
  z-index: 1;
}

.white-key.active {
  background: linear-gradient(180deg, #ffe1ce, #ffc39c);
}

.black-keys {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.black-key {
  position: absolute;
  top: 0;
  width: var(--black-key-width);
  height: var(--black-key-height);
  border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, #3b4652, var(--black-key));
  box-shadow: inset 0 -8px 12px rgba(0, 0, 0, 0.18);
  color: white;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 5px;
  pointer-events: auto;
  z-index: 2;
}

.black-key.active {
  background: linear-gradient(180deg, #f09964, var(--black-key-active));
}

.key-label {
  display: grid;
  gap: 2px;
  justify-items: center;
  max-width: 100%;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.05;
  opacity: 0.94;
  white-space: nowrap;
}

.key-solfege {
  font-size: 10px;
  font-weight: 900;
}

.black-key .key-label {
  gap: 1px;
  font-size: 8px;
}

.black-key .key-solfege {
  font-size: 8px;
}

.empty-state {
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(28, 36, 48, 0.12);
  border-radius: 18px;
  color: var(--muted);
  padding: 10px;
}

.song-modal[hidden] {
  display: none;
}

.song-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.song-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 41, 61, 0.42);
  backdrop-filter: blur(4px);
}

.song-modal-dialog {
  position: relative;
  width: min(720px, 92vw);
  max-height: 78vh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  background: rgba(255, 252, 248, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  box-shadow: 0 18px 48px rgba(14, 28, 40, 0.24);
  padding: 16px;
}

.song-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.song-modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.song-modal-close {
  min-height: 34px;
}

.song-modal-list {
  overflow: auto;
  display: grid;
  gap: 8px;
}

.song-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 251, 0.96));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 12px;
}

.song-item-main {
  text-align: left;
  background: transparent;
  padding: 0;
  min-height: auto;
  border: 0;
}

.song-item-delete {
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 10px;
  background: linear-gradient(180deg, #d96767, var(--danger));
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.song-item-title {
  font-weight: 800;
  font-size: 14px;
}

.song-item-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.song-item-empty {
  padding: 18px;
  border: 2px dashed rgba(28, 36, 48, 0.12);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

body.portrait .rotate-guard {
  display: flex;
}

body.portrait .app-shell {
  display: none;
}

@media (max-width: 1100px) and (orientation: landscape) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .playback-row {
    justify-content: flex-start;
  }

  .playback-toolbar {
    justify-items: start;
  }
}

@media (max-width: 932px) and (orientation: landscape) {
  :root {
    --white-key-width: 52px;
    --black-key-width: 32px;
    --black-key-offset: 16px;
    --keyboard-height: 98px;
    --white-key-height: var(--keyboard-height);
    --black-key-height: calc(var(--keyboard-height) * 0.6);
  }

  .app-shell {
    gap: 6px;
    padding: 6px 8px calc(6px + var(--safe-bottom));
    padding-left: calc(8px + var(--safe-left));
    padding-right: calc(8px + var(--safe-right));
  }

  .topbar,
  .selected-note-panel,
  .sequence-panel,
  .controls-panel {
    border-radius: 18px;
  }

  .topbar,
  .selected-note-panel,
  .sequence-panel,
  .controls-panel,
  .export-panel {
    padding: 6px;
  }

  .title-group h1 {
    font-size: 16px;
  }

  .ad-container {
    min-height: 58px;
    margin-top: 8px;
    padding: 5px 7px;
    border-radius: 12px;
  }

  .ad-slot {
    min-height: 38px;
  }

  .site-info {
    gap: 10px;
    margin-top: 8px;
    padding-top: 12px;
  }

  .site-info-nav a {
    font-size: 11px;
  }

  .info-section h2 {
    font-size: 14px;
  }

  .info-section p {
    font-size: 12px;
    line-height: 1.65;
  }

  .song-name span {
    font-size: 11px;
  }

  .song-name input {
    padding: 6px 8px;
  }

  .input-toolbar-row {
    gap: 4px;
  }

  .selected-note-inline {
    min-width: 52px;
    min-height: 28px;
    padding: 4px;
  }

  .selected-note-inline-name {
    font-size: 14px;
  }

  .selected-note-inline-solfege {
    font-size: 9px;
  }

  .edit-mode-badge {
    font-size: 9px;
    padding: 2px 5px;
  }

  .export-outputs textarea {
    min-height: 38px;
    padding: 5px 7px;
  }

  .export-output-header {
    min-height: 24px;
    gap: 5px;
  }

  .copy-txt-btn {
    min-height: 22px;
    padding: 3px 7px;
    font-size: 9px;
  }

  .copy-status {
    min-width: 64px;
    font-size: 9px;
  }

  .note-card {
    min-width: 64px;
    min-height: 40px;
  }

  .note-btn {
    min-width: 34px;
    min-height: 28px;
    padding: 3px 4px;
  }

  .note-btn-text {
    font-size: 8px;
  }

  .tool-btn,
  .secondary-btn {
    min-height: 28px;
    padding: 5px 7px;
    font-size: 10px;
  }

  .tool-btn.small {
    min-height: 24px;
    padding: 4px 6px;
    font-size: 9px;
  }

  .tempo-control {
    grid-template-columns: 24px minmax(54px, auto) 24px;
    min-height: 24px;
    border-radius: 10px;
  }

  .instrument-control,
  .display-pitch-toggle {
    min-height: 24px;
    border-radius: 10px;
  }

  .instrument-label,
  .display-pitch-label,
  .instrument-select,
  .display-pitch-btn,
  .instrument-help {
    font-size: 9px;
  }

  .instrument-select {
    max-width: 142px;
    min-height: 22px;
  }

  .display-pitch-label {
    padding: 0 5px;
  }

  .display-pitch-btn {
    min-height: 24px;
    padding: 0 6px;
  }

  .instrument-help {
    text-align: left;
    justify-self: start;
  }

  .tempo-btn {
    min-height: 24px;
    font-size: 10px;
  }

  .tempo-label {
    padding: 0 4px;
    font-size: 9px;
  }

  .notation-toggle {
    min-height: 24px;
    border-radius: 10px;
  }

  .notation-btn {
    min-height: 24px;
    padding: 0 6px;
    font-size: 9px;
  }

  .save-status {
    font-size: 9px;
    padding: 4px 6px;
  }

  .keyboard-shell {
    padding: 7px 7px calc(5px + var(--safe-bottom));
    border-radius: 16px;
  }

  .keyboard {
    min-height: var(--white-key-height);
  }
}

@media (orientation: portrait) {
  .rotate-guard {
    display: flex;
  }

  .app-shell {
    display: none;
  }
}
