body.tablet-editor {
  --tablet-rail-width: min(340px, 88vw);
  --tablet-tool-width: min(310px, 88vw);
  min-height: 100dvh;
  overflow: hidden;
  touch-action: manipulation;
}

body.tablet-editor:fullscreen,
body.tablet-editor:-webkit-full-screen {
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  width: 100dvw;
}

body.tablet-editor .editor-shell {
  display: block;
  height: 100dvh;
  overflow: hidden;
}

body.tablet-editor .workbench {
  height: 100dvh;
  transition: margin 0.18s ease;
}

body.tablet-editor.tablet-panel-intro-closing .workbench {
  transition: margin 3s linear;
}

body.tablet-editor.tablet-panel-manual-transition .workbench {
  transition: margin 1s linear;
}

body.tablet-editor .workbench-bar {
  align-items: start;
  column-gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: calc(4px + env(safe-area-inset-top, 0px)) 10px 6px;
  row-gap: 6px;
}

body.tablet-editor.tablet-show-library .workbench {
  margin-left: var(--tablet-rail-width);
}

body.tablet-editor.tablet-show-tools .workbench {
  margin-right: var(--tablet-tool-width);
}

body.tablet-editor .track-title-block {
  align-items: baseline;
  display: flex;
  grid-column: 1;
  grid-row: 1;
  gap: 10px;
  min-width: 0;
}

body.tablet-editor .track-title-row h2 {
  font-size: clamp(1.18rem, 2.4vw, 1.8rem);
  line-height: 1;
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.tablet-editor .track-title-block .eyebrow {
  display: none;
}

body.tablet-editor .track-title-row {
  min-width: 0;
}

body.tablet-editor .title-actions {
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  grid-column: 1 / -1;
  grid-row: 2;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  width: 100%;
}

body.tablet-editor .tablet-header-signature {
  align-items: center;
  color: #c7d8d7;
  display: inline-flex;
  font-size: 0.76rem;
  gap: 10px;
  grid-column: 2;
  grid-row: 1;
  justify-content: flex-end;
  line-height: 1;
  opacity: 0.9;
  white-space: nowrap;
}

body.tablet-editor .tablet-header-signature span:first-child {
  color: #9fc2e7;
}

body.tablet-editor .tablet-header-signature span:last-child {
  color: #f2bd5c;
}

body.tablet-editor .tablet-header-signature a {
  color: inherit;
  text-decoration: none;
}

body.tablet-editor .tablet-header-signature a:hover {
  color: #ffd77c;
}

body.tablet-editor .title-actions::-webkit-scrollbar {
  display: none;
}

body.tablet-editor .title-actions button {
  min-height: 36px;
  padding-bottom: 6px;
  padding-top: 6px;
}

body.tablet-editor .check-btn,
body.tablet-editor .save-header-btn,
body.tablet-editor .header-action-btn {
  min-width: auto;
}

body.tablet-editor .tablet-control-bar {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 6px;
}

body.tablet-editor .tablet-control-bar > button,
body.tablet-editor .tablet-segmented,
body.tablet-editor .tablet-zoom-control {
  background: rgba(39, 48, 56, 0.78);
  border: 1px solid rgba(222, 230, 226, 0.16);
  border-radius: 8px;
}

body.tablet-editor .tablet-control-bar > button {
  min-height: 36px;
  padding-bottom: 6px;
  padding-top: 6px;
}

body.tablet-editor .tablet-control-bar button {
  touch-action: manipulation;
}

body.tablet-editor .tablet-segmented,
body.tablet-editor .tablet-zoom-control {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  min-height: 36px;
  padding: 4px 6px;
}

body.tablet-editor .tablet-segmented span,
body.tablet-editor .tablet-zoom-control span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 0 4px;
  text-transform: uppercase;
}

body.tablet-editor .tablet-segmented button,
body.tablet-editor .tablet-zoom-control button {
  min-height: 28px;
  padding: 4px 9px;
}

body.tablet-editor .tablet-fit-btn {
  color: #f5dfaf;
  font-weight: 800;
}

body.tablet-editor .tablet-segmented button.is-active {
  background: rgba(242, 189, 92, 0.18);
  border-color: rgba(242, 189, 92, 0.78);
  color: #fff2cd;
  font-weight: 800;
}

body.tablet-editor .tablet-zoom-control strong {
  color: #f5dfaf;
  min-width: 46px;
  text-align: center;
}

body.tablet-editor .check-status.has-result {
  font-size: 0.82rem;
  gap: 4px 8px;
  max-height: none;
  overflow: visible;
}

body.tablet-editor .check-status {
  grid-column: 1 / -1;
  grid-row: 3;
}

body.tablet-editor .check-status .evaluation-summary {
  gap: 6px 12px;
}

body.tablet-editor .check-status .legend-item {
  gap: 4px;
}

body.tablet-editor .check-status .trajectory-play-button {
  background: rgba(39, 48, 56, 0.72);
  border-color: rgba(222, 230, 226, 0.16);
  margin: 0;
  min-height: 28px;
  padding: 3px 7px;
}

body.tablet-editor .check-status .trajectory-play-button.is-active {
  background: rgba(242, 189, 92, 0.1);
  border-color: rgba(242, 189, 92, 0.92);
  box-shadow: 0 0 14px rgba(242, 189, 92, 0.2);
  color: #f1f4ef;
}

body.tablet-editor .check-status .track-quality-detail-btn {
  font-size: 0.66rem;
  min-height: 26px;
  padding: 3px 8px;
}

body.tablet-editor .workbench-main {
  display: block;
  height: 100%;
  min-height: 0;
}

body.tablet-editor .track-stage {
  height: 100%;
}

body.tablet-editor .canvas-zone {
  align-items: flex-start;
  height: 100%;
  overflow: auto;
  padding: 8px 10px 118px;
  touch-action: none;
  transition: padding-bottom 0.18s ease;
  -webkit-overflow-scrolling: touch;
}

body.tablet-editor .canvas-stack {
  max-width: none;
  min-width: 680px;
  width: 900px;
}

body.tablet-editor #trackCanvas {
  touch-action: none;
  transform-origin: 0 0;
}

body.tablet-editor .under-canvas-bar {
  position: fixed;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  left: calc(10px + env(safe-area-inset-left, 0px));
  right: calc(10px + env(safe-area-inset-right, 0px));
  z-index: 55;
  background: linear-gradient(180deg, rgba(13, 15, 17, 0.72), rgba(13, 15, 17, 0.98));
  border: 1px solid rgba(222, 230, 226, 0.1);
  border-radius: 8px;
  max-height: 108px;
  opacity: 1;
  overflow: auto;
  padding: 8px;
  transform: translateY(0);
  transition: left 0.18s ease, right 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

body.tablet-editor.tablet-show-library .under-canvas-bar {
  left: calc(var(--tablet-rail-width) + 10px);
}

body.tablet-editor.tablet-show-tools .under-canvas-bar {
  right: calc(var(--tablet-tool-width) + 10px);
}

body.tablet-editor.tablet-hide-status .under-canvas-bar {
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(100% + 14px));
}

body.tablet-editor.tablet-panel-intro-closing .under-canvas-bar {
  transition: left 3s linear, right 3s linear, opacity 3s linear, transform 3s linear;
}

body.tablet-editor.tablet-panel-manual-transition .under-canvas-bar {
  transition: left 0.5s linear, right 0.5s linear, opacity 0.5s linear, transform 0.5s linear;
}

body.tablet-editor.tablet-status-intro-hiding .under-canvas-bar {
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(100% + 14px));
}

body.tablet-editor.tablet-hide-status .canvas-zone {
  padding-bottom: 42px;
}

body.tablet-editor.tablet-panel-intro-closing .canvas-zone {
  transition: padding-bottom 3s linear;
}

body.tablet-editor.tablet-panel-manual-transition .canvas-zone {
  transition: padding-bottom 0.5s linear;
}

body.tablet-editor .track-rail .app-signature {
  display: none;
}

body.tablet-editor .canvas-actions {
  gap: 8px;
}

body.tablet-editor .canvas-actions button,
body.tablet-editor .meta-pill {
  min-height: 42px;
}

body.tablet-editor .track-rail,
body.tablet-editor .tool-dock {
  bottom: 0;
  height: 100dvh;
  max-width: 88vw;
  position: fixed;
  top: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  z-index: 60;
}

body.tablet-editor.tablet-panel-intro-closing .track-rail,
body.tablet-editor.tablet-panel-intro-closing .tool-dock {
  transition: transform 3s linear, box-shadow 3s linear;
}

body.tablet-editor.tablet-panel-manual-transition .track-rail,
body.tablet-editor.tablet-panel-manual-transition .tool-dock {
  transition: transform 0.5s linear, box-shadow 0.5s linear;
}

body.tablet-editor .track-rail {
  border-right: 1px solid rgba(222, 230, 226, 0.22);
  left: 0;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 14px calc(12px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-104%);
  width: var(--tablet-rail-width);
}

body.tablet-editor.tablet-show-library .track-rail {
  box-shadow: 18px 0 42px rgba(0, 0, 0, 0.46);
  transform: translateX(0);
}

body.tablet-editor .tool-dock {
  border-left: 1px solid rgba(222, 230, 226, 0.22);
  overflow: auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 14px calc(12px + env(safe-area-inset-bottom, 0px));
  right: 0;
  transform: translateX(104%);
  width: var(--tablet-tool-width);
}

body.tablet-editor.tablet-show-tools .tool-dock {
  box-shadow: -18px 0 42px rgba(0, 0, 0, 0.46);
  transform: translateX(0);
}

body.tablet-editor .track-item {
  flex-basis: 84px;
  min-height: 84px;
}

body.tablet-editor .track-proposal-hint {
  font-size: 0.66rem;
  max-width: 185px;
}

body.tablet-editor .track-kind.is-proposal-action {
  min-height: 28px;
  padding: 5px 10px;
  touch-action: manipulation;
}

body.tablet-editor .tool-grid {
  gap: 9px;
}

body.tablet-editor .drawing-tool-grid {
  gap: 8px;
}

body.tablet-editor .drawing-tool-grid .tool-btn {
  min-height: 46px;
  padding: 6px 7px;
}

body.tablet-editor .drawing-tool-grid .tool-btn span:not(.tool-icon) {
  font-size: 0.78rem;
  line-height: 1;
}

body.tablet-editor .drawing-tool-grid .tool-icon {
  height: 16px;
  width: 16px;
}

body.tablet-editor .drawing-tool-grid .tool-hint {
  font-size: 0.62rem;
  min-height: 34px;
  padding: 5px 7px;
}

body.tablet-editor .tool-btn,
body.tablet-editor .tool-grid > button,
body.tablet-editor .mirror-tool,
body.tablet-editor .triangle-btn {
  min-height: 48px;
}

body.tablet-editor .accessory-select-btn {
  font-size: 0.78rem;
  min-height: 48px;
  padding-left: 5px;
  padding-right: 5px;
}

body.tablet-editor .tool-hint {
  font-size: 0.72rem;
  min-height: 48px;
}

body.tablet-editor .editor-dialog-overlay {
  padding: max(14px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px))
    max(14px, env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
}

body.tablet-editor .editor-dialog {
  max-height: calc(100dvh - 28px);
  overflow: auto;
}

body.tablet-editor .tablet-edge-tab {
  align-items: center;
  background: rgba(39, 48, 56, 0.96);
  border: 1px solid rgba(242, 189, 92, 0.5);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  color: #f7e0ae;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 900;
  justify-content: center;
  letter-spacing: 0.06em;
  min-height: 84px;
  padding: 8px 5px;
  position: fixed;
  text-transform: uppercase;
  touch-action: manipulation;
  transition: left 0.18s ease, right 0.18s ease, bottom 0.18s ease, background 0.18s ease;
  width: 31px;
  z-index: 72;
}

body.tablet-editor:fullscreen .tablet-edge-tab,
body.tablet-editor:-webkit-full-screen .tablet-edge-tab {
  z-index: 140;
}

body.tablet-editor.tablet-panel-intro-closing .tablet-edge-tab {
  transition: left 3s linear, right 3s linear, bottom 3s linear, background 0.18s ease;
}

body.tablet-editor.tablet-panel-manual-transition .tablet-edge-tab {
  transition: left 0.5s linear, right 0.5s linear, bottom 0.5s linear, background 0.18s ease;
}

body.tablet-editor .tablet-edge-tab[aria-pressed="true"] {
  background: rgba(242, 189, 92, 0.18);
  border-color: rgba(242, 189, 92, 0.88);
}

body.tablet-editor .tablet-library-tab,
body.tablet-editor .tablet-tools-tab {
  top: 50%;
  writing-mode: vertical-rl;
}

body.tablet-editor .tablet-library-tab {
  border-radius: 0 10px 10px 0;
  left: 0;
  transform: translateY(-50%);
}

body.tablet-editor.tablet-show-library .tablet-library-tab {
  left: var(--tablet-rail-width);
}

body.tablet-editor .tablet-tools-tab {
  border-radius: 0 10px 10px 0;
  right: 0;
  transform: translateY(-50%) rotate(180deg);
  transform-origin: center;
}

body.tablet-editor.tablet-show-tools .tablet-tools-tab {
  right: var(--tablet-tool-width);
}

body.tablet-editor .tablet-status-tab {
  border-radius: 10px 10px 0 0;
  bottom: calc(104px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  min-height: 34px;
  padding: 6px 14px;
  transform: translateX(-50%);
  width: auto;
}

body.tablet-editor.tablet-hide-status .tablet-status-tab {
  bottom: 0;
}

body.tablet-editor.tablet-status-intro-hiding .tablet-status-tab {
  bottom: 0;
}

@media (orientation: portrait) {
  body.tablet-editor .workbench-bar {
    grid-template-columns: 1fr;
    padding-left: 10px;
    padding-right: 10px;
  }

  body.tablet-editor .tablet-header-signature {
    grid-column: 1;
    grid-row: 2;
    justify-content: flex-start;
  }

  body.tablet-editor .title-actions {
    grid-column: 1;
    grid-row: 3;
  }

  body.tablet-editor .tablet-control-bar {
    gap: 6px;
  }

  body.tablet-editor .tablet-segmented {
    flex: 0 0 auto;
  }

  body.tablet-editor .canvas-stack {
    min-width: 760px;
  }
}
