:root {
  color-scheme: dark;
  --panel-bg: #171b20;
  --panel-line: #2c3239;
  --stage-bg: #090b0e;
  --text: #f4f5f6;
  --muted: #9099a4;
  --orange: #ff8a2a;
  --orange-soft: rgba(255, 138, 42, 0.14);
  --green: #77d49b;
  --danger: #ff8d83;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--stage-bg);
}

body,
button,
input,
textarea {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.score-scroller-app {
  display: block;
  width: 100%;
  height: 100dvh;
  min-width: 0;
  background: var(--stage-bg);
  color: var(--text);
}

.score-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.035), transparent 38%),
    var(--stage-bg);
}

.score-viewport {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #4a5058 #101318;
  scrollbar-width: thin;
  touch-action: pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
  outline: none;
}

.score-viewport.is-page-view {
  overflow: hidden;
  background: #fff;
  touch-action: pan-y pinch-zoom;
  -webkit-user-select: none;
  user-select: none;
  scrollbar-width: none;
}

.score-viewport.is-page-view::-webkit-scrollbar {
  display: none;
}

.score-viewport::-webkit-scrollbar {
  width: 10px;
}

.score-viewport::-webkit-scrollbar-track {
  background: #101318;
}

.score-viewport::-webkit-scrollbar-thumb {
  border: 2px solid #101318;
  border-radius: 999px;
  background: #4a5058;
}

.score-viewport:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(255, 138, 42, 0.82);
}

.score-viewport.has-score {
  background: #fff;
}

.score-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(560px, calc(100% - 64px));
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--muted);
}

.score-empty-mark {
  display: grid;
  width: 76px;
  margin: 0 auto 25px;
  gap: 8px;
}

.score-empty-mark span {
  display: block;
  height: 1px;
  background: #555e68;
}

.score-empty-mark span:nth-child(3) {
  position: relative;
  background: var(--orange);
}

.score-empty-mark span:nth-child(3)::after {
  position: absolute;
  top: 50%;
  left: 48px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--orange);
  content: "";
  transform: translateY(-50%);
}

.score-empty-kicker {
  margin: 0 0 12px;
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.score-empty h2 {
  margin: 0;
  color: #e6e9ec;
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  font-weight: 650;
  line-height: 1.22;
}

.score-empty > p:last-child {
  max-width: 500px;
  margin: 14px auto 0;
  font-size: 0.92rem;
  line-height: 1.65;
}

.quick-steps {
  display: grid;
  max-width: 560px;
  margin: 24px auto 0;
  padding: 0;
  gap: 9px;
  list-style: none;
  text-align: left;
}

.quick-steps li {
  display: grid;
  grid-template-columns: 102px minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #929ba5;
  font-size: 0.8rem;
  line-height: 1.45;
}

.quick-steps strong {
  color: #e9ebed;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.score-pages {
  width: min(calc(100% - 44px), 1240px);
  min-height: 100%;
  margin: 0 auto;
  padding: 22px 0 max(50vh, 112px);
  background: #fff;
}

.score-viewport.is-page-view .score-pages {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.score-viewport.is-page-view .score-page {
  display: none;
  flex: 0 0 auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.36);
}

.score-viewport.is-page-view .score-page.is-page-visible {
  display: block;
}

.score-page {
  position: relative;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.score-page + .score-page {
  box-shadow:
    0 -1px 0 rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.score-pages.is-trim-zero .score-page + .score-page {
  box-shadow:
    inset 0 1px 0 #000,
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.score-page-media {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  transform: translateY(calc(-1 * var(--trim-top, 0%)));
  transform-origin: 50% 0;
}

.score-page-annotations {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  mix-blend-mode: darken;
}

.score-page-marks {
  position: absolute;
  z-index: 3;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.score-page-mark,
.mark-cursor {
  display: grid;
  place-items: center;
  border: 2px solid #ef4d32;
  border-radius: 50%;
  background: #a6ff3b;
  color: #ef4d32;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.26);
}

.score-page-mark {
  position: absolute;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 0.78rem;
  transform: translate(-50%, -50%);
}

.is-annotating .score-page-mark.is-jump-trigger {
  pointer-events: auto;
  cursor: pointer;
}

.score-page-mark.has-timing-offset {
  border-color: #ff8a2a;
  background: #303840;
  color: #fff;
}

.score-page-mark .mark-offset-label {
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  min-width: 27px;
  padding: 2px 4px;
  border-radius: 4px;
  background: #ff8a2a;
  color: #1e1209;
  font-size: 0.55rem;
  font-weight: 950;
  line-height: 1;
  transform: translateX(-50%);
}

.mark-cursor {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 14;
  width: 52px;
  height: 52px;
  padding: 0;
  cursor: grab;
  touch-action: none;
  transform: translate(-50%, -50%);
  user-select: none;
}

.mark-cursor:active {
  cursor: grabbing;
}

.mark-cursor[hidden] {
  display: none;
}

.mark-transport {
  position: absolute;
  top: 50%;
  right: max(10px, env(safe-area-inset-right));
  z-index: 11;
  display: grid;
  width: 72px;
  gap: 6px;
  transform: translateY(-50%);
}

.mark-transport[hidden] {
  display: none;
}

.mark-transport button {
  min-height: 48px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 5px;
  background: rgba(20, 24, 29, 0.58);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.mark-transport button:disabled {
  opacity: 0.34;
  cursor: default;
}

.mark-transport button.is-active {
  border-color: #a6ff3b;
  background: rgba(166, 255, 59, 0.72);
  color: #17200f;
}

.is-annotating .score-page-annotations {
  pointer-events: auto;
  cursor: crosshair;
  touch-action: none;
}

.is-annotating .score-viewport {
  touch-action: none;
}

.is-annotating.is-marking .score-page-annotations {
  pointer-events: none;
}

.is-annotating.is-marking .score-viewport {
  touch-action: pan-y pinch-zoom;
}

.is-annotating .bottom-controls {
  opacity: 0;
  pointer-events: none;
}

.score-page.is-pending::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 2px solid #d9dde1;
  border-top-color: #727b85;
  border-radius: 50%;
  content: "";
  animation: spin 0.8s linear infinite;
}

.score-page.is-error::after {
  position: absolute;
  top: 50%;
  left: 50%;
  color: #7c838a;
  content: "PAGE COULD NOT RENDER";
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  transform: translate(-50%, -50%);
}

.score-position {
  position: absolute;
  top: 16px;
  right: 84px;
  bottom: auto;
  z-index: 4;
  display: flex;
  gap: 12px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(12, 15, 19, 0.82);
  box-shadow: 0 7px 24px rgba(0, 0, 0, 0.28);
  color: #d9dde1;
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.memo-button {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 16px;
  z-index: 10;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 1px solid rgba(255, 146, 57, 0.86);
  border-radius: 50%;
  background: rgba(255, 126, 34, 0.82);
  box-shadow: 0 7px 24px rgba(0, 0, 0, 0.28);
  color: #1b1008;
  cursor: pointer;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  backdrop-filter: blur(8px);
}

.memo-button[hidden] {
  display: none;
}

.memo-button:hover,
.memo-button:focus-visible {
  background: #ff8a2a;
  outline: 2px solid rgba(255, 255, 255, 0.84);
  outline-offset: 2px;
}

.is-annotating .memo-button {
  opacity: 0;
  pointer-events: none;
}

.stage-status {
  position: absolute;
  top: 16px;
  left: 18px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.stage-status .load-status {
  margin: 0;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 7px;
  background: rgba(12, 15, 19, 0.82);
  box-shadow: 0 7px 24px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(8px);
}

.bottom-controls {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 8;
  display: grid;
  width: min(940px, calc(100% - 24px));
  grid-template-columns: 1.08fr 1.08fr 0.92fr repeat(3, minmax(0, 0.88fr)) 0.9fr;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: translateX(-50%);
  transition: opacity 160ms ease, transform 160ms ease;
}

.bottom-controls.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
}

.annotation-toolbar {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  z-index: 12;
  display: flex;
  max-width: calc(100% - 116px);
  gap: 5px;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  background: rgba(13, 16, 20, 0.88);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.34);
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
  scrollbar-width: none;
}

.annotation-toolbar[hidden] {
  display: none;
}

.annotation-toolbar::-webkit-scrollbar {
  display: none;
}

.annotation-tool {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 0 10px;
  border: 1px solid #46505a;
  border-radius: 6px;
  background: #20262c;
  color: #e7eaed;
  cursor: pointer;
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.05em;
}

.annotation-tool.is-active {
  border-color: var(--orange);
  background: rgba(255, 138, 42, 0.26);
  color: #ffb272;
}

.annotation-tool.danger {
  color: var(--danger);
}

.annotation-tool.annotation-done {
  border-color: var(--orange);
  background: var(--orange);
  color: #1e1209;
}

.annotation-tool.annotation-close {
  min-width: 36px;
  padding: 0 9px;
  border-color: #69737d;
  color: #f0f2f4;
  font-size: 1.05rem;
  line-height: 1;
}

.mark-confirm-dialog {
  width: min(300px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #f3f4f5;
}

.mark-confirm-dialog::backdrop {
  background: rgba(5, 7, 9, 0.52);
}

.mark-confirm-card {
  padding: 20px;
  border: 1px solid #3b444e;
  border-radius: 12px;
  background: #171b20;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.52);
}

.mark-confirm-card p {
  margin: 0 0 18px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.09em;
}

.mark-confirm-card > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mark-confirm-card button,
.mark-confirm-card a {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid #46505a;
  border-radius: 7px;
  background: #20262c;
  color: #eef0f2;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
}

.mark-confirm-card #markConfirmYes {
  border-color: #a6ff3b;
  background: #a6ff3b;
  color: #ef4d32;
}

.download-confirm-card > span {
  display: block;
  margin: -7px 0 18px;
  overflow-wrap: anywhere;
  color: #aeb6be;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 750;
  line-height: 1.45;
}

.download-confirm-card #downloadConfirmButton {
  border-color: var(--orange);
  background: var(--orange);
  color: #1e1209;
}

.mark-timing-card .mark-timing-summary {
  display: block;
  margin: -7px 0 14px;
  color: #ff9e4f;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.mark-timing-card .mark-timing-stepper {
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  gap: 8px;
}

.mark-timing-stepper label {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 5px;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid #46505a;
  border-radius: 7px;
  background: #0f1317;
}

.mark-timing-stepper input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  text-align: center;
  font: inherit;
  font-weight: 900;
}

.mark-timing-stepper small,
.mark-timing-help {
  color: #8f99a3;
  font-size: 0.58rem;
  font-weight: 850;
}

.mark-timing-help {
  display: block;
  margin: 9px 0 16px;
  text-align: center;
  letter-spacing: 0.06em;
}

.mark-timing-card .mark-timing-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mark-timing-card #markTimingApply {
  border-color: var(--orange);
  background: var(--orange);
  color: #1e1209;
}

.file-input {
  position: fixed;
  inline-size: 1px;
  block-size: 1px;
  inset: auto auto 0 0;
  opacity: 0;
  pointer-events: none;
}

.bottom-controls .dock-button {
  min-height: 48px;
  min-width: 0;
  padding: 0 8px;
}

.bottom-controls .view-mode-button.is-active {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: #fff;
}

.bottom-controls .dock-open {
  border-color: rgba(255, 138, 42, 0.72);
  background: #ff8a2a;
  color: #1e1209;
}

.bottom-controls .dock-open:hover:not(:disabled) {
  border-color: rgba(255, 155, 74, 0.82);
  background: #ff9b4a;
}

.score-position span + span {
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.control-panel {
  position: relative;
  z-index: 10;
  grid-area: panel;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  border-left: 1px solid var(--panel-line);
  background: var(--panel-bg);
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.24);
  scrollbar-width: none;
}

.panel-left .control-panel {
  border-right: 1px solid var(--panel-line);
  border-left: 0;
  box-shadow: 16px 0 40px rgba(0, 0, 0, 0.24);
}

.control-panel::-webkit-scrollbar {
  display: none;
}

.panel-heading {
  padding: 17px 13px 13px;
  border-bottom: 1px solid var(--panel-line);
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #aab1b8;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 20px;
  place-items: center;
  border-radius: 4px;
  background: var(--orange);
  color: #1b1109;
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-decoration: none;
  pointer-events: auto;
  touch-action: manipulation;
}

.brand-mark:hover,
.brand-mark:focus-visible {
  filter: brightness(1.08);
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.panel-heading h1 {
  margin: 13px 0 6px;
  color: #fff;
  font-size: 0.98rem;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.load-status {
  min-height: 15px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.load-status.is-ready {
  color: var(--green);
}

.load-status.is-error {
  color: var(--danger);
}

.panel-section {
  padding: 12px 13px;
  border-bottom: 1px solid var(--panel-line);
}

.file-section {
  padding-top: 15px;
  padding-bottom: 11px;
}

.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-label,
.section-value {
  color: #aab1b8;
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.section-value {
  color: #f2f3f4;
  letter-spacing: 0.04em;
}

.button {
  display: flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #3a424b;
  border-radius: 7px;
  background: #20262c;
  color: #f6f7f8;
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 820;
  letter-spacing: 0.07em;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
}

.button:hover:not(:disabled) {
  border-color: #59636e;
  background: #293139;
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button:focus-visible,
.trim-button:focus-visible,
.choice-button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.button:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button.primary {
  min-height: 40px;
  border-color: var(--orange);
  background: var(--orange);
  color: #1e1209;
}

.button.primary:hover:not(:disabled) {
  border-color: #ff9b4a;
  background: #ff9b4a;
}

.trim-note {
  margin: 8px 0 0;
  color: #737d87;
  font-size: 0.56rem;
  font-weight: 720;
  letter-spacing: 0.07em;
  line-height: 1.4;
  text-align: center;
}

.trim-note {
  letter-spacing: 0;
  text-transform: none;
}

.time-inputs {
  display: grid;
  grid-template-columns: 1fr 12px 1fr;
  align-items: end;
  gap: 5px;
}

.time-inputs label {
  display: grid;
  gap: 4px;
}

.time-inputs label span {
  color: #78828c;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: center;
}

.time-inputs input {
  width: 100%;
  height: 39px;
  border: 1px solid #39414a;
  border-radius: 7px;
  background: #101419;
  color: #fff;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: center;
}

.time-inputs input::-webkit-inner-spin-button,
.time-inputs input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.time-divider {
  padding-bottom: 10px;
  color: #66717b;
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
}

.trim-options {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.choice-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.choice-button {
  min-height: 38px;
  border: 1px solid #38414a;
  border-radius: 6px;
  background: #101419;
  color: #aab2ba;
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.choice-button:hover,
.choice-button.is-active {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: #ffab66;
}

.trim-button {
  height: 38px;
  border: 1px solid #38414a;
  border-radius: 6px;
  background: #101419;
  color: #aab2ba;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
}

.trim-button:hover {
  border-color: #59636e;
  color: #fff;
}

.trim-button.is-active {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: #ffab66;
}

.transport-section {
  display: grid;
  gap: 7px;
}

.button.transport {
  min-height: 44px;
  border-color: #f3f4f5;
  background: #f3f4f5;
  color: #13171b;
}

.button.transport:hover:not(:disabled) {
  border-color: #fff;
  background: #fff;
}

.button.transport .play-icon {
  fill: currentColor;
  stroke: none;
}

.button.transport .pause-icon {
  display: none;
}

.button.transport.is-playing .play-icon {
  display: none;
}

.button.transport.is-playing .pause-icon {
  display: block;
}

.button.secondary {
  background: transparent;
}

.bottom-controls .button.transport,
.bottom-controls .button.transport:hover:not(:disabled) {
  border-color: rgba(243, 244, 245, 0.68);
  background: #f3f4f5;
}

.bottom-controls .button.secondary,
.bottom-controls .button.secondary:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.28);
  background: #14181c;
}

.bottom-controls .view-mode-button.is-active,
.bottom-controls .view-mode-button.is-active:hover:not(:disabled) {
  border-color: rgba(255, 138, 42, 0.82);
  background: #ff8a2a;
  color: #1e1209;
}

.button.utility {
  min-height: 38px;
  justify-content: flex-start;
  padding: 0 11px;
  background: transparent;
  color: #c5cbd1;
  font-size: 0.6rem;
}

.exit-fullscreen-icon {
  display: none;
}

.is-fullscreen .enter-fullscreen-icon {
  display: none;
}

.is-fullscreen .exit-fullscreen-icon {
  display: block;
}

.panel-footer {
  position: relative;
  margin-top: auto;
  padding: 12px 13px 14px;
  color: #737c86;
  font-size: 0.57rem;
  line-height: 1.45;
}

.panel-footer p {
  margin: 0;
}

.shortcut-note {
  margin-top: 4px !important;
  font-size: 0.51rem;
  font-weight: 750;
  letter-spacing: 0.07em;
}

.version {
  position: absolute;
  right: 13px;
  bottom: 14px;
  color: #535c65;
  font-size: 0.52rem;
}

.loading-shield {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  background: rgba(9, 11, 14, 0.86);
  color: #e5e7e9;
  text-align: center;
  backdrop-filter: blur(5px);
}

.loading-shield[hidden] {
  display: none;
}

.settings-dialog {
  width: min(520px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #3a424a;
  border-radius: 12px;
  background: #171b20;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62);
  color: var(--text);
}

.settings-dialog::backdrop {
  background: rgba(4, 6, 8, 0.78);
  backdrop-filter: blur(4px);
}

.settings-card {
  max-height: calc(100dvh - 34px);
  overflow: auto;
  scrollbar-color: #4a5058 #171b20;
  scrollbar-width: thin;
}

.settings-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 18px 15px;
  border-bottom: 1px solid var(--panel-line);
  background: rgba(23, 27, 32, 0.96);
  backdrop-filter: blur(8px);
}

.settings-header p,
.settings-header h2 {
  margin: 0;
}

.settings-header p {
  margin-bottom: 5px;
  color: var(--orange);
  font-size: 0.57rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.settings-header h2 {
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.settings-close {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #3b434c;
  border-radius: 8px;
  background: #20262c;
  color: #f3f4f5;
  cursor: pointer;
}

.settings-close:hover {
  border-color: #606a74;
  background: #2a3138;
}

.settings-close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.settings-body {
  display: grid;
  gap: 1px;
  padding: 14px;
  background: var(--panel-line);
}

.settings-block {
  padding: 15px;
  background: #171b20;
}

.settings-block:first-child {
  border-radius: 8px 8px 0 0;
}

.settings-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
  border-radius: 0 0 8px 8px;
}

.settings-actions .button.utility {
  justify-content: center;
  min-height: 42px;
}

.android-app-download {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px;
  background: #171b20;
}

.android-app-download[hidden] {
  display: none;
}

.android-app-download strong {
  color: #ff8a2a;
  font-size: 0.66rem;
  letter-spacing: 0.09em;
}

.android-app-download p {
  margin: 5px 0 0;
  color: #a5adb5;
  font-size: 0.67rem;
  line-height: 1.5;
}

.android-app-download .button.utility {
  min-height: 42px;
  padding-inline: 16px;
  white-space: nowrap;
}

.settings-privacy {
  margin: 9px 4px 3px;
  color: #7d8791;
  font-size: 0.62rem;
  line-height: 1.5;
  text-align: center;
}

.cloud-field > span {
  color: #88929c;
  font-size: 0.57rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.cloud-field input,
.cloud-field textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid #39414a;
  border-radius: 7px;
  background: #101419;
  color: #fff;
  padding: 8px 10px;
  font-size: 0.72rem;
}

.cloud-field textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.45;
}

.button.compact {
  width: auto;
  min-height: 38px;
  padding: 0 12px;
}

.score-cloud-list {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

.score-cloud-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid #303841;
  border-radius: 7px;
  background: #11161b;
}

.score-cloud-item strong {
  display: block;
  overflow: hidden;
  color: #eef0f2;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-cloud-item span {
  display: block;
  margin-top: 2px;
  color: #858f99;
  font-size: 0.58rem;
}

.score-cloud-item button,
.score-cloud-conflict button {
  min-height: 30px;
  border: 1px solid #3b444e;
  border-radius: 5px;
  background: #20272e;
  color: #e5e8eb;
  cursor: pointer;
  font-size: 0.55rem;
  font-weight: 800;
}

.score-cloud-item button {
  padding: 0 8px;
}

.score-cloud-item .danger {
  color: var(--danger);
}

.score-cloud-block {
  display: grid;
  gap: 10px;
}

.score-cloud-note,
.score-cloud-guidance,
.score-cloud-message,
.score-cloud-empty {
  margin: 0;
  color: #8d97a1;
  font-size: 0.64rem;
  line-height: 1.48;
}

.score-cloud-guidance {
  color: #c2c8ce;
}

.score-cloud-sign-in {
  margin-top: 10px;
  text-decoration: none;
}

.cloud-field {
  display: grid;
  gap: 5px;
  margin-top: 9px;
}

.score-cloud-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  margin-top: 10px;
}

.score-cloud-actions .button {
  padding: 0 12px;
}

.score-cloud-message.is-success,
#scoreCloudState.is-signed-in {
  color: var(--green);
}

.score-cloud-message.is-error,
.score-cloud-message.is-warning {
  color: var(--danger);
}

#scoreCloudState.is-dirty {
  color: #ffb36f;
}

.score-cloud-item.is-current {
  border-color: rgba(255, 138, 42, 0.72);
}

.score-cloud-item-info {
  min-width: 0;
}

.score-cloud-conflict {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 138, 42, 0.55);
  border-radius: 7px;
  background: rgba(255, 138, 42, 0.08);
}

.score-cloud-conflict strong,
.score-cloud-conflict p {
  margin: 0;
  font-size: 0.61rem;
}

.score-cloud-conflict p {
  margin-top: 4px;
  color: #aab2ba;
}

.score-cloud-conflict > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 8px;
}

.score-cloud-my-link {
  display: inline-block;
  margin-top: 10px;
  color: #ffab66;
  font-size: 0.62rem;
  font-weight: 800;
}

.score-file-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
}

.score-file-name-row > span {
  color: #98a1aa;
  font-size: 0.66rem;
  font-weight: 750;
}

.score-note-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 10px;
}

.score-note-actions .button {
  min-height: 42px;
}

.loading-shield p {
  margin: 0;
  font-size: 0.67rem;
  font-weight: 820;
  letter-spacing: 0.12em;
}

.loading-spinner {
  width: 30px;
  height: 30px;
  margin: 0 auto;
  border: 2px solid #3b434b;
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-height: 690px) {
  .panel-heading {
    padding-top: 13px;
    padding-bottom: 10px;
  }

  .panel-heading h1 {
    margin-top: 9px;
  }

  .panel-section {
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .control-panel .button.transport {
    min-height: 38px;
  }

  .panel-footer {
    padding-top: 8px;
    padding-bottom: 9px;
  }

  .version {
    bottom: 9px;
  }
}

@media (max-width: 760px) {
  .score-scroller-app {
    min-width: 0;
  }

  .score-pages {
    width: calc(100% - 24px);
    padding-top: 12px;
  }

  .score-viewport.is-page-view .score-pages {
    width: 100%;
    padding: 0;
    gap: 5px;
  }

  .score-position {
    right: 70px;
    top: 10px;
  }

  .memo-button {
    top: max(8px, env(safe-area-inset-top));
    right: 8px;
    width: 48px;
    height: 48px;
    font-size: 0.53rem;
  }

  .stage-status {
    top: 10px;
    left: 10px;
  }

  .annotation-toolbar {
    top: auto;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    display: grid;
    width: auto;
    max-width: none;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    transform: none;
  }

  .annotation-tool {
    width: 100%;
    min-width: 0;
    padding: 0 5px;
    white-space: nowrap;
  }
}

@media (max-width: 560px) {
  .settings-actions {
    grid-template-columns: 1fr;
  }

  .android-app-download {
    grid-template-columns: 1fr;
  }

  .bottom-controls {
    width: calc(100% - 12px);
    gap: 4px;
    padding: 0;
  }

  .bottom-controls .dock-button {
    min-height: 44px;
    gap: 4px;
    padding: 0 3px;
    font-size: 0.54rem;
    letter-spacing: 0.035em;
  }

  .bottom-controls .dock-button svg {
    display: none;
  }

  .quick-steps li {
    grid-template-columns: 1fr;
    gap: 4px;
    text-align: center;
  }

  .score-cloud-actions,
  .score-cloud-conflict > div {
    grid-template-columns: 1fr;
  }

}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }

  .bottom-controls {
    transition: none;
  }
}
