/*
 * Additional styles for specific features
 * Tailwind CSS is imported via app/assets/tailwind/application.css
 */

/* Styles pour les séparateurs dans la modale */
.modal-section-divider {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin: 2rem 0;
  padding-top: 2rem;
  position: relative;
}

/* Stash product */
.stash-workspace,
.stash-edit-shell,
.stash-capture-shell,
.stash-bookmarklet-shell {
  display: flex;
  min-height: 0;
  flex: 1;
  width: 100%;
  flex-direction: column;
  gap: 1.25rem;
  padding-block: 0.75rem;
}

.stash-header,
.stash-control-row,
.stash-quick-create,
.stash-form-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.stash-title {
  margin: 0;
  color: var(--app-text-primary);
  font-size: clamp(1.75rem, 2.5vw, 2.75rem);
  font-weight: 650;
  line-height: 1.05;
}

.stash-kicker,
.stash-section-heading,
.stash-form label > span,
.stash-bookmarklet-code > span {
  color: var(--app-text-muted);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-transform: uppercase;
}

.stash-breadcrumb {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: var(--app-text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
}

.stash-breadcrumb a:hover {
  color: var(--app-text-primary);
}

.stash-search {
  min-width: min(100%, 18rem);
  flex: 1 1 18rem;
}

.stash-status-toggle {
  flex: 0 1 auto;
}

.stash-quick-create,
.stash-install-panel,
.stash-form {
  border: 1px solid color-mix(in srgb, var(--app-border-soft) 80%, var(--app-border-strong));
  border-radius: 1.25rem;
  padding: 1rem;
  background: linear-gradient(145deg, color-mix(in srgb, var(--app-surface-2) 94%, transparent), var(--app-surface-1));
  box-shadow: var(--app-shadow-outer);
}

.stash-install-panel {
  gap: 1.4rem;
}

.stash-quick-create {
  display: grid;
  grid-template-columns: minmax(14rem, 0.85fr) minmax(24rem, 2fr);
  align-items: stretch;
  padding: 0.65rem;
}

.stash-inline-form {
  display: flex;
  min-width: min(100%, 18rem);
  gap: 0.5rem;
  align-items: center;
}

.stash-bookmark-form {
  min-width: min(100%, 28rem);
}

.stash-inline-form .input {
  min-width: 0;
  flex: 1 1 10rem;
  min-height: 2.45rem;
  padding-block: 0.5rem;
  font-size: 0.86rem;
}

.stash-inline-form .btn-secondary,
.stash-inline-form .btn-primary-cta {
  min-height: 2.45rem;
  min-width: 0;
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
}

.stash-folder-content {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}

.stash-explorer {
  display: grid;
  min-height: 0;
  flex: 1 1 auto;
  grid-template-columns: minmax(15rem, 0.9fr) minmax(0, 2.4fr);
  gap: 1rem;
}

.stash-folder-panel,
.stash-bookmark-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--app-border-soft) 80%, var(--app-border-strong));
  border-radius: 1.25rem;
  padding: 0.85rem;
  background: linear-gradient(145deg, color-mix(in srgb, var(--app-surface-2) 94%, transparent), var(--app-surface-1));
  box-shadow: var(--app-shadow-outer);
}

.stash-folder-panel {
  overflow: hidden;
}

.stash-bookmark-panel {
  overflow: hidden;
}

.stash-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 1rem;
}

.stash-section-count {
  color: var(--app-text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.stash-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.75rem;
}

.stash-folder-tile {
  cursor: grab;
}

.stash-folder-tile-link {
  display: grid;
  min-height: 3.65rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid color-mix(in srgb, var(--app-border-soft) 78%, var(--app-border-strong));
  border-radius: 1.15rem;
  padding: 0.75rem 0.9rem;
  background: linear-gradient(145deg, color-mix(in srgb, var(--app-surface-2) 92%, transparent), var(--app-surface-1));
  box-shadow: var(--app-shadow-outer-compact);
  color: var(--app-text-secondary);
  font-size: 0.86rem;
  font-weight: 650;
  transition: box-shadow 0.16s ease, color 0.16s ease;
}

.stash-folder-tile-link:hover,
.stash-folder-tile.is-drop-target .stash-folder-tile-link {
  color: var(--app-text-primary);
  box-shadow: var(--app-shadow-hover-compact);
}

.stash-folder-icon {
  color: var(--app-accent);
  font-size: 0.9rem;
}

.stash-bookmark-list {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.45rem;
  overflow-y: auto;
  padding: 0.2rem;
  scrollbar-width: none;
}

.stash-bookmark-list::-webkit-scrollbar {
  display: none;
}

.stash-bookmark-row {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr) auto;
  min-height: 3.15rem;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--app-border-soft);
  border-radius: 1.15rem;
  padding: 0.5rem 0.65rem;
  background: linear-gradient(145deg, color-mix(in srgb, var(--app-surface-2) 92%, transparent), var(--app-surface-1));
  box-shadow: var(--app-shadow-outer-compact);
  cursor: grab;
  transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.stash-bookmark-row:hover,
.stash-bookmark-row.is-drop-target {
  box-shadow: var(--app-shadow-hover-compact);
}

.stash-bookmark-row:active {
  box-shadow: var(--app-shadow-pressed);
}

.stash-bookmark-drag {
  color: var(--app-text-muted);
  font-size: 0.78rem;
  line-height: 1;
}

.stash-bookmark-title {
  display: block;
  color: var(--app-text-primary);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.stash-bookmark-title:hover {
  color: var(--app-accent-strong);
}

.stash-bookmark-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--app-text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
}

.stash-bookmark-note {
  margin-top: 0.35rem;
  color: var(--app-text-secondary);
  font-size: 0.76rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.stash-bookmark-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.stash-action-link,
.stash-danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--app-border-soft) 78%, var(--app-border-strong));
  border-radius: 0.85rem;
  padding: 0.34rem 0.54rem;
  color: var(--app-text-secondary);
  background: linear-gradient(145deg, color-mix(in srgb, var(--app-surface-2) 92%, transparent), var(--app-surface-1));
  box-shadow: var(--app-shadow-outer-compact);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  transition: box-shadow 0.16s ease, color 0.16s ease;
}

.stash-action-link:hover {
  color: var(--app-text-primary);
  box-shadow: var(--app-shadow-hover-compact);
}

.stash-action-link--primary {
  min-width: 4rem;
  color: var(--app-text-primary);
  border-color: color-mix(in srgb, var(--app-accent) 18%, var(--app-border-soft));
  background: linear-gradient(145deg, color-mix(in srgb, var(--app-surface-2) 96%, white 4%), var(--app-surface-1));
  box-shadow: var(--app-shadow-outer);
}

.stash-action-link--primary:hover {
  color: var(--app-accent-strong);
  box-shadow: var(--app-shadow-hover);
}

.stash-danger-button {
  color: var(--app-danger);
}

.stash-empty {
  display: grid;
  min-height: 18rem;
  place-items: center;
  color: color-mix(in srgb, var(--app-text-muted) 82%, transparent);
  font-size: 0.9rem;
  font-weight: 600;
}

.stash-sidebar {
  width: 100%;
}

.stash-sidebar-header,
.stash-folder-tree {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 0.3rem;
}

.stash-folder-tree--main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.15rem;
  scrollbar-width: none;
}

.stash-folder-tree--main::-webkit-scrollbar {
  display: none;
}

.stash-tree-row {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.25rem;
}

.stash-root-link,
.stash-tree-link {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 0.85rem;
  padding: 0.4rem 0.5rem;
  color: var(--app-text-secondary);
  font-size: 0.76rem;
  font-weight: 650;
  transition: color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.stash-tree-link {
  padding-left: calc(0.35rem + var(--stash-depth, 0) * 0.72rem);
}

.stash-tree-rename-input {
  width: 100%;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--app-accent) 28%, var(--app-border-soft));
  border-radius: 0.85rem;
  padding: 0.36rem 0.5rem;
  color: var(--app-text-primary);
  background: color-mix(in srgb, var(--app-surface-3) 72%, var(--app-surface-1));
  box-shadow: var(--app-shadow-inset);
  font-size: 0.76rem;
  font-weight: 650;
}

.stash-tree-rename-input:focus {
  outline: none;
  box-shadow: var(--app-shadow-inset), var(--app-focus-ring);
}

.stash-tree-toggle {
  display: inline-flex;
  width: 1.35rem;
  height: 1.35rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.65rem;
  color: var(--app-text-muted);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
}

.stash-tree-toggle:hover:not(:disabled) {
  color: var(--app-text-primary);
  background: color-mix(in srgb, var(--app-surface-2) 78%, transparent);
}

.stash-tree-toggle:disabled {
  cursor: default;
  opacity: 0.35;
}

.stash-tree-menu {
  position: relative;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.stash-tree-row:hover .stash-tree-menu,
.stash-tree-row:focus-within .stash-tree-menu,
.stash-tree-menu[open] {
  opacity: 1;
}

.stash-tree-menu summary {
  display: inline-flex;
  width: 1.65rem;
  height: 1.55rem;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--app-border-soft) 78%, var(--app-border-strong));
  border-radius: 0.75rem;
  color: var(--app-text-muted);
  background: linear-gradient(145deg, color-mix(in srgb, var(--app-surface-2) 92%, transparent), var(--app-surface-1));
  box-shadow: var(--app-shadow-outer-compact);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}

.stash-tree-menu summary::-webkit-details-marker {
  display: none;
}

.stash-tree-menu summary:hover,
.stash-tree-menu summary:focus-visible {
  color: var(--app-text-primary);
  box-shadow: var(--app-shadow-hover-compact);
}

.stash-tree-menu-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 20;
  display: flex;
  min-width: 8rem;
  flex-direction: column;
  gap: 0.25rem;
  border: 1px solid var(--app-border-soft);
  border-radius: 1rem;
  padding: 0.35rem;
  background: linear-gradient(145deg, color-mix(in srgb, var(--app-surface-2) 94%, white 6%), var(--app-surface-1));
  box-shadow: var(--app-shadow-outer-strong);
}

.stash-tree-menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  border: 0;
  border-radius: 0.75rem;
  padding: 0.45rem 0.65rem;
  color: var(--app-text-secondary);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 700;
  text-align: left;
}

.stash-tree-menu-item:hover,
.stash-tree-menu-item:focus-visible {
  color: var(--app-text-primary);
  background: color-mix(in srgb, var(--app-surface-2) 78%, transparent);
}

.stash-tree-menu-item--danger {
  color: var(--app-danger);
}

.stash-tree-menu-form {
  display: flex;
}

.stash-root-link:hover,
.stash-tree-link:hover,
.stash-root-link.is-active,
.stash-tree-row.is-active .stash-tree-link {
  color: var(--app-text-primary);
  background: color-mix(in srgb, var(--app-surface-2) 78%, transparent);
  box-shadow: var(--app-shadow-hover-compact);
}

.stash-tree-row.is-active .stash-tree-link {
  border-color: color-mix(in srgb, var(--app-accent) 20%, var(--app-border-soft));
}

.stash-tree-caret {
  color: var(--app-text-muted);
}

.stash-tree-children.hidden {
  display: none;
}

.stash-tree-row,
.stash-folder-tile,
.stash-bookmark-row {
  cursor: grab;
}

.stash-tree-row.is-drop-target .stash-tree-link {
  color: var(--app-text-primary);
  background: color-mix(in srgb, var(--app-accent) 12%, var(--app-surface-2));
  box-shadow: var(--app-shadow-hover-compact), var(--app-focus-ring);
}

.stash-tree-row.is-auto-expanding .stash-tree-link {
  color: var(--app-accent-strong);
  box-shadow: var(--app-focus-ring);
}

.stash-tree-row.is-drop-target .board-sidebar-count {
  display: none;
}

.stash-tree-row.is-drop-target .stash-tree-link::after {
  content: "Drop";
  justify-self: end;
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  color: var(--app-accent-strong);
  background: color-mix(in srgb, var(--app-accent) 14%, transparent);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stash-folder-content.is-drop-target,
.stash-bookmark-panel.is-drop-target {
  border-radius: 1.25rem;
  box-shadow: var(--app-focus-ring);
}

.stash-tree-row.is-dragging,
.stash-folder-tile.is-dragging,
.stash-bookmark-row.is-dragging {
  opacity: 0.48;
}

.stash-form {
  max-width: 52rem;
  width: 100%;
}

.stash-form label,
.stash-bookmarklet-code {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.4rem;
}

.stash-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.stash-bookmarklet-button {
  position: relative;
  display: inline-flex;
  min-width: 8rem;
  width: fit-content;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--app-accent) 26%, var(--app-border-soft));
  border-radius: 1.15rem;
  padding: 0.85rem 1.2rem;
  color: var(--app-text-primary);
  background: linear-gradient(145deg, color-mix(in srgb, var(--app-surface-2) 96%, white 4%), var(--app-surface-1));
  box-shadow: var(--app-shadow-outer);
  font-weight: 750;
}

.stash-bookmarklet-button .sidebar-action-shortcut {
  padding-inline: 0.5rem;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.stash-install-nav,
.stash-install-lead {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stash-install-lead {
  margin-bottom: 0.75rem;
}

.stash-install-lead p {
  color: var(--app-text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
}

.stash-bookmarklet-code textarea {
  border-radius: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  resize: vertical;
}

.stash-instructions {
  display: flex;
  max-width: 60rem;
  flex-direction: column;
  gap: 0.65rem;
  color: var(--app-text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
}

.stash-instructions h2 {
  color: var(--app-text-primary);
  font-size: 1rem;
  font-weight: 750;
}

.stash-search-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  align-items: flex-start;
  justify-content: center;
  padding: min(18vh, 8rem) 1rem 1rem;
  background: var(--app-backdrop);
  backdrop-filter: blur(18px);
}

.stash-search-dialog-panel {
  width: min(42rem, 100%);
}

.stash-search-dialog-form {
  width: 100%;
}

.stash-search-dialog-input {
  width: 100%;
  min-height: 3.75rem;
  font-size: 1.05rem;
}

.stash-unlock-form {
  display: grid;
  width: min(28rem, 100%);
  gap: 0.9rem;
  text-align: center;
}

.stash-unlock-form p {
  color: var(--app-text-secondary);
  font-size: 0.92rem;
  font-weight: 650;
}

@media (max-width: 760px) {
  .stash-title {
    font-size: 1.55rem;
  }

  .stash-quick-create,
  .stash-explorer,
  .stash-bookmark-row {
    grid-template-columns: 1fr;
  }

  .stash-inline-form {
    flex-direction: column;
  }

  .stash-bookmark-drag {
    display: none;
  }

  .stash-bookmark-actions {
    justify-content: flex-start;
  }

  .stash-form-grid {
    grid-template-columns: 1fr;
  }
}

.modal-section-divider::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.8);
}

/* Personnalisation du champ de texte Lexxy */
lexxy-editor {
  min-height: 200px;
  padding: 1.5rem;
  line-height: 1.6;
}


/* Animation pour la disparition des notifications flash */
.flash-fade-out {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

/* Focus ring for keyboard navigation on note cards */
.card:focus,
.card-hover:focus {
  outline: none;
  box-shadow: none;
}

.dark .card:focus,
.dark .card-hover:focus {
  box-shadow: none;
}

/* Styles pour les notifications flash avec cursor pointer */
.flash-notification {
  cursor: pointer;
  transition: all 0.2s ease;
}

.flash-notification:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


/* Piano product */
.piano-workspace {
  display: flex;
  min-height: 0;
  flex: 1;
  width: 100%;
  flex-direction: column;
  gap: 1.25rem;
}

.piano-header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.piano-header > div:first-child {
  min-width: min(100%, 18rem);
  flex: 1 1 20rem;
}

.piano-title {
  margin: 0;
  color: var(--app-text-primary);
  font-size: clamp(1.75rem, 2.5vw, 2.75rem);
  font-weight: 650;
  line-height: 1.05;
}

.piano-status {
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
  border: 1px solid color-mix(in srgb, var(--app-border-strong) 80%, transparent);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  color: var(--app-text-secondary);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

.piano-toolbar,
.piano-meta-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.piano-control-group,
.piano-meta-panel > div {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid color-mix(in srgb, var(--app-border-strong) 70%, transparent);
  border-radius: 0.75rem;
  padding: 0.5rem;
  background: color-mix(in srgb, var(--app-surface-2) 88%, transparent);
}

.piano-recording-controls {
  flex-wrap: wrap;
}

.piano-chip,
.piano-readout {
  min-width: 3rem;
  border: 1px solid color-mix(in srgb, var(--app-border-strong) 80%, transparent);
  border-radius: 999px;
  padding: 0.55rem 0.75rem;
  color: var(--app-text-primary);
  background: transparent;
  font-size: 0.85rem;
  font-weight: 650;
  text-align: center;
}

.piano-chip {
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}

.piano-chip:hover,
.piano-chip.is-active {
  border-color: color-mix(in srgb, var(--app-accent) 70%, var(--app-border-strong));
  background: color-mix(in srgb, var(--app-accent) 14%, transparent);
}

.piano-chip:active {
  transform: translateY(1px);
}

.piano-meta-label {
  color: var(--app-text-secondary);
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
}

.piano-meta-panel strong {
  color: var(--app-text-primary);
  font-size: 0.9rem;
}

.piano-key-help {
  color: var(--app-text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
}

.piano-scroll-shell {
  min-height: 22rem;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid color-mix(in srgb, var(--app-border-strong) 70%, transparent);
  border-radius: 1rem;
  padding: 1rem;
  background: color-mix(in srgb, var(--app-surface-2) 92%, transparent);
}

.piano-keyboard {
  --white-key-count: 36;
  --piano-white-key-width: 3.25rem;
  position: relative;
  display: flex;
  width: calc(var(--white-key-count) * var(--piano-white-key-width));
  min-width: 100%;
  height: 20rem;
  align-items: stretch;
  touch-action: none;
  user-select: none;
}

.piano-key {
  appearance: none;
  border: 0;
  cursor: pointer;
  touch-action: none;
}

.piano-key--white {
  position: relative;
  z-index: 1;
  display: flex;
  width: var(--piano-white-key-width);
  flex: 0 0 var(--piano-white-key-width);
  align-items: flex-end;
  justify-content: center;
  border: 1px solid #cfd4df;
  border-radius: 0 0 0.55rem 0.55rem;
  padding-bottom: 0.65rem;
  background: linear-gradient(180deg, #ffffff 0%, #eef1f6 100%);
  color: #4b5367;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: inset 0 -0.45rem 0.8rem rgba(32, 38, 52, 0.08);
}

.piano-key--black {
  position: absolute;
  z-index: 2;
  top: 0;
  width: 2.1rem;
  height: 12.5rem;
  border-radius: 0 0 0.45rem 0.45rem;
  background: linear-gradient(180deg, #252a35 0%, #05070a 100%);
  box-shadow: 0 0.55rem 1rem rgba(0, 0, 0, 0.26);
}

.piano-key--white.is-pressed {
  background: linear-gradient(180deg, #dcecff 0%, #b9d6ff 100%);
  box-shadow: inset 0 0.35rem 1rem rgba(33, 86, 154, 0.2);
  transform: translateY(2px);
}

.piano-key--black.is-pressed {
  background: linear-gradient(180deg, #43526b 0%, #172034 100%);
  transform: translateY(2px);
}

.piano-key span {
  pointer-events: none;
}

.piano-recording-controls .is-recording {
  background: color-mix(in srgb, #d9254a 72%, var(--app-accent));
}

@media (max-width: 720px) {
  .piano-header {
    flex-direction: column;
  }

  .piano-status {
    width: 100%;
  }

  .piano-control-group,
  .piano-meta-panel > div {
    width: 100%;
    justify-content: center;
  }

  .piano-scroll-shell {
    min-height: 18rem;
    margin-inline: -1rem;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .piano-keyboard {
    --piano-white-key-width: 2.75rem;
    height: 16rem;
  }

  .piano-key--black {
    width: 1.8rem;
    height: 10rem;
  }
}


.piano-sidebar-library {
  width: 100%;
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
}

.piano-sidebar-library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 0.15rem;
}

.piano-sidebar-count {
  min-width: 1.65rem;
  border-radius: 999px;
  padding: 0.18rem 0.45rem;
  background: color-mix(in srgb, var(--app-accent) 12%, transparent);
  color: var(--app-text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.piano-sidebar-records {
  display: flex;
  max-height: min(34rem, calc(100vh - 20rem));
  min-height: 0;
  flex-direction: column;
  gap: 0.45rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.15rem;
}

.piano-record-item {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--app-border-strong) 72%, transparent);
  border-radius: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: color-mix(in srgb, var(--app-surface-2) 82%, transparent);
  color: var(--app-text-primary);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.piano-record-item:hover,
.piano-record-item.is-loaded {
  border-color: color-mix(in srgb, var(--app-accent) 70%, var(--app-border-strong));
  background: color-mix(in srgb, var(--app-accent) 14%, var(--app-surface-2));
}

.piano-record-item:active {
  transform: translateY(1px);
}

.piano-record-item-title,
.piano-record-item-meta {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.piano-record-item-title {
  font-size: 0.84rem;
  font-weight: 700;
}

.piano-record-item-meta,
.piano-sidebar-empty {
  color: var(--app-text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
}

.piano-sidebar-empty {
  margin: 0;
  padding: 0.65rem 0.25rem;
  text-align: center;
}

.piano-loaded-state {
  max-width: min(100%, 22rem);
  flex: 1 1 14rem;
}

.piano-loaded-state strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* Hub home */
.hub-home-shell {
  display: flex;
  min-height: calc(100vh - 12rem);
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
}

.hub-product-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.hub-product-link {
  display: inline-flex;
  min-width: 9.5rem;
  min-height: 4.5rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border: 1px solid color-mix(in srgb, var(--app-border-strong) 62%, transparent);
  border-radius: 1rem;
  padding: 0.9rem 1.2rem;
  color: var(--app-text-primary);
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.hub-product-link:hover,
.hub-product-link:focus-visible {
  border-color: color-mix(in srgb, var(--app-accent) 56%, var(--app-border-strong));
  background: color-mix(in srgb, var(--app-surface-2) 72%, transparent);
  box-shadow: var(--app-shadow-hover-compact);
  outline: none;
}

.hub-product-link:active {
  transform: translateY(1px);
  box-shadow: var(--app-shadow-pressed-compact);
}

.hub-product-name {
  font-size: 1rem;
  font-weight: 720;
  line-height: 1.15;
}

.hub-product-meta {
  color: var(--app-text-secondary);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .hub-home-shell {
    min-height: calc(100vh - 9rem);
    align-items: flex-start;
    padding-top: 18vh;
  }

  .hub-product-links {
    width: 100%;
  }

  .hub-product-link {
    width: min(100%, 16rem);
  }
}

