:root {
  --ink: #1f2933;
  --muted: #667085;
  --surface: #f7f7f2;
  --paper: #ffffff;
  --line: #d9ded6;
  --blue-panel: #d8dcf2;
  --blue-strong: #253cba;
  --rose-panel: #dc5a7e;
  --rose-deep: #8f2948;
  --green-soft: #c7e5c8;
  --green-deep: #357a4d;
  --shadow: 0 20px 60px rgba(38, 48, 64, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family:
    "Inter", "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #ecece7;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button > * {
  cursor: inherit;
  pointer-events: none;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(220px, 20vw) minmax(420px, 1fr) minmax(190px, 16vw);
  min-height: 100vh;
  background: var(--surface);
}

.library-panel,
.mark-panel,
.practice-stage {
  min-width: 0;
}

.library-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100vh;
  overflow: hidden;
  padding: 18px 14px;
  background: var(--blue-panel);
  border-right: 1px solid rgba(37, 60, 186, 0.18);
}

.library-panel::after {
  position: absolute;
  inset: 8px;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
  content: "放開即可匯入圖包或圖片";
  background: rgba(37, 60, 186, 0.82);
  border: 2px dashed rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.library-panel.drag-active::after {
  opacity: 1;
}

.mark-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
  color: #fff9fb;
  background: var(--rose-panel);
}

.panel-heading {
  display: grid;
  gap: 3px;
}

.eyebrow {
  margin: 0;
  color: currentColor;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.64;
}

h1,
h2 {
  margin: 0;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.15;
}

.upload-actions,
.pack-list,
.mark-actions {
  display: grid;
  gap: 10px;
}

.upload-button,
.pack-card,
.mark-button,
.current-mark-button,
.control-button,
.nav-arrow,
.picture-window-button,
.site-info-button {
  border: 0;
  border-radius: var(--radius);
  transition:
    box-shadow 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    filter 160ms ease;
}

.upload-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  color: #fff;
  font-weight: 800;
  text-align: left;
  background: var(--blue-strong);
  box-shadow: 0 8px 18px rgba(37, 60, 186, 0.2);
}

.upload-button.secondary {
  background: #4664d7;
}

.upload-button.tertiary {
  color: #1d2c76;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(37, 60, 186, 0.22);
  box-shadow: none;
}

.upload-button.tertiary .button-icon {
  border-color: rgba(37, 60, 186, 0.34);
}

.visually-hidden {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

.button-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 6px;
  font-size: 11px;
  letter-spacing: 0;
}

.demo-note {
  margin: -6px 0 0;
  color: #344054;
  font-size: 13px;
  line-height: 1.5;
}

.pack-card {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  color: #15205f;
  text-align: left;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(37, 60, 186, 0.16);
}

.pack-row {
  position: relative;
  min-width: 0;
}

.pack-row .pack-card {
  padding-right: 44px;
}

.pack-delete,
.thumbnail-delete {
  display: grid;
  place-items: center;
  color: currentColor;
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.pack-delete {
  position: absolute;
  top: 50%;
  right: 7px;
  z-index: 1;
  width: 30px;
  height: 30px;
  color: #5b2970;
  font-size: 20px;
  transform: translateY(-50%);
}

.pack-row.active .pack-delete {
  color: #fff;
}

.pack-delete:hover,
.thumbnail-delete:hover {
  background: rgba(255, 255, 255, 0.24);
}

.pack-card.active {
  color: #fff;
  background: var(--blue-strong);
  box-shadow: 0 10px 22px rgba(37, 60, 186, 0.24);
}

.pack-title {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pack-meta {
  font-size: 12px;
  opacity: 0.76;
}

.pack-list {
  flex: 0 0 auto;
  max-height: min(190px, 25vh);
  overflow-y: auto;
  padding-right: 3px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.thumbnail-browser {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid rgba(37, 60, 186, 0.16);
}

.thumbnail-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: #15205f;
  font-size: 12px;
}

.thumbnail-heading strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thumbnail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;
  min-height: 0;
  max-height: none;
  height: 100%;
  overflow-y: auto;
  padding: 2px 4px 10px 2px;
  overscroll-behavior: contain;
}

.thumbnail-button {
  display: grid;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: #15205f;
  text-align: left;
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid transparent;
  border-radius: var(--radius);
}

.thumbnail-item {
  position: relative;
  min-width: 0;
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: auto 116px;
}

.thumbnail-item .thumbnail-button {
  width: 100%;
}

.thumbnail-delete {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 1;
  width: 25px;
  height: 25px;
  padding: 0;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 20px;
  line-height: 1;
  background: rgba(31, 41, 51, 0.7);
  backdrop-filter: blur(4px);
}

.thumbnail-button.active {
  color: #fff;
  background: var(--blue-strong);
  border-color: var(--blue-strong);
}

.thumbnail-button.source-highlight:not(.active) {
  border-color: #8f2948;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.82),
    0 0 0 4px rgba(143, 41, 72, 0.72);
}

.thumbnail-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  color: rgba(21, 32, 95, 0.72);
  font-size: 11px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.72);
}

.thumbnail-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
}

.thumbnail-fallback {
  font-size: 10px;
  opacity: 0.7;
}

.thumbnail-name {
  overflow: hidden;
  padding: 7px;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.practice-stage {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto;
  gap: 14px;
  padding: 16px clamp(18px, 4vw, 48px) 24px;
  background:
    linear-gradient(90deg, rgba(42, 65, 87, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px;
}

.stage-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.photo-title {
  justify-self: center;
  min-width: min(320px, 84%);
  padding: 10px 18px;
  color: #f7f0ea;
  text-align: center;
  background: #684438;
  border-radius: 0 0 var(--radius) var(--radius);
}

.site-info-button,
.picture-window-button,
.notice-button,
.dialog-close-button {
  border: 0;
  border-radius: var(--radius);
  transition:
    box-shadow 160ms ease,
    background 160ms ease,
    filter 160ms ease;
}

.site-info-button {
  order: -1;
  min-height: 34px;
  padding: 7px 11px;
  color: #425466;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
}

.picture-window-button {
  min-height: 34px;
  padding: 7px 11px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  background: #30404f;
  border: 1px solid #30404f;
}

.picture-window-button.active {
  background: var(--rose-deep);
  border-color: var(--rose-deep);
}

.photo-title h2 {
  overflow-wrap: anywhere;
  font-size: clamp(15px, 1.8vw, 20px);
}

.viewer-row {
  --viewer-max: 520px;
  --frame-content-max: 484px;
  display: grid;
  grid-template-columns: minmax(260px, var(--viewer-max));
  grid-template-rows: auto auto;
  align-items: center;
  justify-content: center;
  column-gap: clamp(10px, 3vw, 28px);
  row-gap: 0;
}

.viewer-row.landscape {
  --viewer-max: 760px;
  --frame-content-max: 724px;
}

.viewer-row .photo-title {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  width: 100%;
  min-width: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}

.nav-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 84px;
  color: var(--green-deep);
  background: var(--green-soft);
}

.nav-arrow span {
  display: block;
  margin-top: -5px;
  font-size: 46px;
  line-height: 1;
}

.photo-frame {
  box-sizing: content-box;
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  width: min(calc(100% - 36px), var(--frame-content-max));
  aspect-ratio: 2 / 3;
  padding: 18px;
  background: #df8f7a;
  border: 1px solid rgba(120, 68, 55, 0.18);
  box-shadow: var(--shadow);
}

.demo-photo {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #e8d1c8;
  border: 1px solid rgba(255, 255, 255, 0.52);
  isolation: isolate;
  touch-action: none;
}

.demo-photo > * {
  pointer-events: none;
}

.demo-photo.zoomed {
  cursor: grab;
}

.demo-photo.dragging {
  cursor: grabbing;
}

.demo-photo.loading::after {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  content: "正在載入圖片";
  background: rgba(31, 41, 51, 0.72);
  pointer-events: none;
}

.demo-artwork {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end center;
  background:
    radial-gradient(circle at 48% 30%, rgba(255, 255, 255, 0.54) 0 4%, transparent 5%),
    linear-gradient(105deg, transparent 45%, rgba(65, 45, 39, 0.22) 46% 48%, transparent 49%),
    linear-gradient(74deg, transparent 51%, rgba(65, 45, 39, 0.2) 52% 54%, transparent 55%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0 2px, transparent 2px 34px),
    repeating-linear-gradient(90deg, rgba(70, 48, 42, 0.08) 0 1px, transparent 1px 38px),
    #e8d1c8;
}

#loadedPhoto {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #202124;
  transform-origin: center;
  user-select: none;
  will-change: transform;
  cursor: inherit;
}

.zoom-indicator {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  min-width: 52px;
  padding: 6px 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  background: rgba(31, 41, 51, 0.68);
  border-radius: 6px;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.photo-wash {
  position: absolute;
  inset: 0;
  background: rgba(233, 143, 122, 0.52);
  pointer-events: none;
}

.figure {
  width: 42%;
  height: 68%;
  margin-bottom: 12%;
  border: 10px solid rgba(69, 45, 38, 0.78);
  border-top-width: 24px;
  border-bottom-width: 16px;
  border-radius: 52% 48% 45% 55% / 35% 38% 62% 65%;
  transform: rotate(-7deg);
  opacity: 0.72;
  mix-blend-mode: multiply;
}

.figure-two {
  width: 52%;
  height: 60%;
  border-radius: 44% 56% 54% 46% / 48% 34% 66% 52%;
  transform: rotate(8deg);
}

.figure-three {
  width: 36%;
  height: 72%;
  border-radius: 58% 42% 48% 52% / 32% 46% 54% 68%;
  transform: rotate(2deg);
}

.photo-caption {
  position: absolute;
  right: 14px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 28px);
  padding: 7px 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  background: rgba(37, 37, 37, 0.56);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  z-index: 4;
  pointer-events: none;
}

#photoResolution {
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.38);
  font-variant-numeric: tabular-nums;
}

.practice-controls {
  justify-self: center;
  display: grid;
  grid-template-columns: 44px minmax(0, 520px) 44px;
  align-items: center;
  gap: clamp(10px, 2vw, 18px);
  width: min(100%, 644px);
}

.timer-presets {
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  width: min(100%, 520px);
  margin-bottom: -6px;
}

.preset-button {
  min-height: 36px;
  padding: 7px 9px;
  color: #425466;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(53, 122, 77, 0.18);
  border-radius: var(--radius);
  transition:
    background 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    filter 160ms ease;
}

.preset-button.active {
  color: #fff;
  background: #30404f;
  box-shadow: 0 5px 14px rgba(48, 64, 79, 0.18);
}

.playback-mode {
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 360px);
  margin-bottom: -6px;
}

.playback-button {
  min-height: 38px;
  padding: 8px 14px;
  color: #365141;
  font-weight: 800;
  background: rgba(199, 229, 200, 0.48);
  border: 1px solid rgba(53, 122, 77, 0.2);
  border-radius: var(--radius);
  transition:
    background 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    filter 160ms ease;
}

.playback-button.active {
  color: #fff;
  background: var(--green-deep);
  box-shadow: 0 5px 14px rgba(53, 122, 77, 0.2);
}

.practice-controls .nav-arrow {
  height: 58px;
}

.timer-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: min(100%, 520px);
  padding: 14px;
  background: var(--green-soft);
  border: 1px solid rgba(53, 122, 77, 0.14);
  border-radius: var(--radius);
}

.timer-readout {
  min-width: 120px;
  color: #173b25;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.timer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.control-button {
  min-height: 38px;
  padding: 8px 14px;
  color: #24402d;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(53, 122, 77, 0.16);
}

.control-button.primary {
  color: #fff;
  background: var(--green-deep);
}

.duration-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 9px;
  color: #24402d;
  font-size: 13px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.58);
  border-radius: var(--radius);
}

.duration-control input {
  width: 74px;
  min-width: 0;
  padding: 5px 6px;
  color: #173b25;
  font-weight: 800;
  background: #fff;
  border: 1px solid rgba(53, 122, 77, 0.2);
  border-radius: 6px;
}

.current-photo-marks {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  margin-top: -5px;
}

.current-mark-button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 11px;
  color: #5f1f36;
  font-size: 12px;
  font-weight: 900;
  background: #fff1f5;
  border: 1px solid rgba(143, 41, 72, 0.18);
}

.current-mark-button.active {
  color: #fff;
  background: var(--rose-deep);
  border-color: var(--rose-deep);
  box-shadow: 0 5px 14px rgba(143, 41, 72, 0.2);
}

.mark-folder-group {
  display: grid;
  gap: 7px;
}

.mark-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: #5f1f36;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.84);
  border: 2px solid transparent;
}

.mark-button > span:nth-child(2) {
  flex: 1;
}

.mark-button strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.mark-button.active {
  color: #fff;
  background: var(--rose-deep);
  border-color: rgba(255, 255, 255, 0.42);
}

.mark-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.mark-dot.favorite {
  background: #ffcc4d;
}

.mark-dot.redo {
  background: #5fd4ff;
}

.mark-dot.skip {
  background: #3d3d46;
}

.current-status {
  padding: 14px;
  background: rgba(90, 28, 50, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
}

.current-status p {
  margin: 0 0 5px;
  font-size: 13px;
  opacity: 0.72;
}

.current-status strong {
  font-size: 22px;
}

.mark-folder-panel {
  display: grid;
  gap: 8px;
  padding-left: 0;
}

.mark-collection-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
  min-height: 76px;
  max-height: min(240px, 28vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mark-collection-item {
  display: grid;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: #5f1f36;
  text-align: left;
  background: rgba(255, 255, 255, 0.88);
  border: 2px solid transparent;
  border-radius: 6px;
}

.mark-collection-item.active {
  border-color: #fff;
  box-shadow: inset 0 0 0 1px var(--rose-deep);
}

.mark-collection-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  color: rgba(95, 31, 54, 0.68);
  font-size: 11px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.72);
}

.mark-collection-preview:empty {
  min-height: 54px;
  background: rgba(255, 255, 255, 0.34);
}

.mark-collection-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mark-collection-name {
  overflow: hidden;
  padding: 6px;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.privacy-notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(560px, calc(100vw - 36px));
  padding: 13px 14px;
  color: #f8fafc;
  background: rgba(31, 41, 51, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(31, 41, 51, 0.24);
}

.privacy-notice[hidden] {
  display: none;
}

.privacy-notice p {
  flex: 1;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.privacy-notice-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.notice-button {
  min-height: 36px;
  padding: 7px 12px;
  color: #173b25;
  font-weight: 800;
  white-space: nowrap;
  background: var(--green-soft);
}

.notice-button.secondary {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.site-info-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.site-info-dialog::backdrop {
  background: rgba(20, 28, 38, 0.56);
  backdrop-filter: blur(3px);
}

.site-info-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 20px 16px;
  color: #fff;
  background: var(--blue-strong);
}

.site-info-heading .eyebrow {
  margin-bottom: 4px;
}

.dialog-close-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.14);
}

.site-info-content {
  max-height: calc(min(720px, 100vh - 32px) - 92px);
  overflow-y: auto;
  padding: 20px;
  line-height: 1.65;
  overscroll-behavior: contain;
}

.site-info-content > p {
  margin: 0 0 18px;
}

.site-info-content h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.site-info-content ul {
  margin: 0;
  padding-left: 1.4em;
}

.site-facts {
  display: grid;
  gap: 8px;
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.site-facts div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
}

.site-facts dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.site-facts dd {
  margin: 0;
  font-size: 13px;
}

.upload-button:hover,
.pack-card:hover,
.mark-button:hover,
.current-mark-button:hover,
.control-button:hover,
.nav-arrow:hover,
.site-info-button:hover,
.picture-window-button:hover,
.notice-button:hover,
.dialog-close-button:hover {
  filter: brightness(1.05);
  box-shadow: 0 0 0 2px rgba(27, 99, 255, 0.12);
}

.playback-button:hover {
  filter: brightness(1.05);
  box-shadow: 0 0 0 2px rgba(53, 122, 77, 0.14);
}

.preset-button:hover {
  filter: brightness(1.05);
  box-shadow: 0 0 0 2px rgba(48, 64, 79, 0.12);
}

.upload-button:focus-visible,
.pack-card:focus-visible,
.thumbnail-button:focus-visible,
.pack-delete:focus-visible,
.thumbnail-delete:focus-visible,
.mark-button:focus-visible,
.current-mark-button:focus-visible,
.control-button:focus-visible,
.nav-arrow:focus-visible,
.site-info-button:focus-visible,
.picture-window-button:focus-visible,
.notice-button:focus-visible,
.dialog-close-button:focus-visible,
.mark-collection-item:focus-visible,
.playback-button:focus-visible,
.preset-button:focus-visible,
.duration-control input:focus-visible {
  outline: 3px solid rgba(27, 99, 255, 0.38);
  outline-offset: 2px;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .library-panel,
  .mark-panel {
    padding: 16px;
  }

  .library-panel {
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid rgba(37, 60, 186, 0.18);
  }

  .pack-list,
  .mark-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mark-collection-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-height: 420px;
  }

  .thumbnail-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-height: 420px;
  }

  .practice-stage {
    min-height: 760px;
    grid-template-rows: auto 1fr auto;
  }

  .viewer-row {
    grid-template-columns: minmax(220px, 460px);
  }
}

@media (max-width: 620px) {
  .pack-list,
  .mark-actions {
    grid-template-columns: 1fr;
  }

  .mark-collection-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .thumbnail-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .practice-stage {
    min-height: auto;
    padding: 12px;
  }

  .stage-header {
    align-items: stretch;
    flex-direction: column;
  }

  .site-info-button {
    align-self: flex-start;
  }

  .picture-window-button {
    align-self: flex-start;
  }

  .privacy-notice {
    right: 10px;
    bottom: 10px;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    width: calc(100vw - 20px);
  }

  .privacy-notice-actions {
    justify-content: flex-end;
  }

  .viewer-row {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 0;
  }

  .viewer-row .photo-title {
    grid-column: 1 / -1;
    grid-row: 1;
    width: min(100%, 360px);
  }

  .photo-frame {
    grid-column: 1 / -1;
    grid-row: 2;
    width: min(calc(100% - 24px), 336px);
    justify-self: center;
    padding: 12px;
  }

  .practice-controls {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 8px;
    width: 100%;
  }

  .playback-mode {
    width: min(100%, 320px);
  }

  .timer-presets {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(100%, 360px);
  }

  .practice-controls .nav-arrow {
    width: 42px;
    height: 56px;
  }

  .nav-arrow span {
    margin-top: -3px;
    font-size: 36px;
  }

  .timer-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .timer-controls {
    justify-content: center;
  }

}
