@font-face {
  font-family: 'Google Sans';
  src: url('../fonts/GoogleSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Google Sans';
  src: url('../fonts/GoogleSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Google Sans';
  src: url('../fonts/GoogleSans-Bold.woff2') format('woff2');
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: 'Google Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

  --accent: #007aff;
  --accent-hover: #0068d9;
  --accent-tint: rgba(0, 122, 255, .12);
  --accent-tint-hover: rgba(0, 122, 255, .2);
  --accent-text: #0062d1;
  --red-text: #d70015;
  --accent-ring: rgba(0, 122, 255, .28);
  --green: #34c759;
  --green-hover: #2db14f;
  --red: #ff3b30;
  --red-tint: rgba(255, 59, 48, .1);
  --red-tint-hover: rgba(255, 59, 48, .16);

  --bg: #f2f3f7;
  --blob-1: rgba(0, 122, 255, .16);
  --blob-2: rgba(175, 82, 222, .12);
  --blob-3: rgba(52, 199, 89, .1);

  --label: #1d1d1f;
  --label-2: rgba(60, 60, 67, .72);
  --label-3: rgba(60, 60, 67, .48);
  --separator: rgba(60, 60, 67, .12);
  --fill: rgba(120, 120, 128, .12);
  --fill-hover: rgba(120, 120, 128, .2);

  --panel: linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .6));
  --panel-border: rgba(255, 255, 255, .85);
  --panel-solid: #fbfbfd;
  --glass: rgba(255, 255, 255, .62);
  --glass-solid: rgba(250, 250, 252, .97);
  --glass-border: rgba(255, 255, 255, .8);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 0 0 1px rgba(255, 255, 255, .25);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 12px 32px -14px rgba(16, 24, 40, .18);
  --shadow-lg: 0 24px 60px -18px rgba(16, 24, 40, .35);

  --card: rgba(255, 255, 255, .7);
  --field: rgba(255, 255, 255, .9);
  --field-border: rgba(60, 60, 67, .14);
  --segment-on: #fff;
  --toast-bg: rgba(30, 30, 32, .82);
  --scrim: rgba(15, 18, 25, .28);
  --stage-edge: rgba(60, 60, 67, .1);

  --radius-xl: 1.5rem;
  --radius-lg: 1.125rem;
  --radius-md: 0.75rem;
  --radius-sm: 0.5625rem;
  --topbar-h: 3.75rem;
  --gap: 0.875rem;
  --ease: cubic-bezier(.32, .72, 0, 1);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --accent: #0a84ff;
  --accent-hover: #3396ff;
  --accent-tint: rgba(10, 132, 255, .26);
  --accent-tint-hover: rgba(10, 132, 255, .36);
  --accent-text: #8cc4ff;
  --red-text: #ff8a82;
  --accent-ring: rgba(10, 132, 255, .4);
  --green: #30d158;
  --green-hover: #28b94c;
  --red: #ff453a;
  --red-tint: rgba(255, 69, 58, .22);
  --red-tint-hover: rgba(255, 69, 58, .32);

  --bg: #0b0c10;
  --blob-1: rgba(10, 132, 255, .2);
  --blob-2: rgba(191, 90, 242, .14);
  --blob-3: rgba(48, 209, 88, .08);

  --label: #f5f5f7;
  --label-2: rgba(235, 235, 245, .68);
  --label-3: rgba(235, 235, 245, .42);
  --separator: rgba(255, 255, 255, .1);
  --fill: rgba(120, 120, 128, .24);
  --fill-hover: rgba(120, 120, 128, .34);

  --panel: linear-gradient(180deg, rgba(44, 44, 50, .72), rgba(30, 30, 36, .62));
  --panel-border: rgba(255, 255, 255, .09);
  --panel-solid: #1c1c21;
  --glass: rgba(40, 40, 46, .6);
  --glass-solid: rgba(32, 32, 38, .97);
  --glass-border: rgba(255, 255, 255, .12);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 0 0 1px rgba(255, 255, 255, .03);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 36px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 28px 70px -20px rgba(0, 0, 0, .75);

  --card: rgba(255, 255, 255, .05);
  --field: rgba(118, 118, 128, .18);
  --field-border: rgba(255, 255, 255, .1);
  --segment-on: #636366;
  --toast-bg: rgba(58, 58, 64, .88);
  --scrim: rgba(0, 0, 0, .5);
  --stage-edge: rgba(255, 255, 255, .08);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42vw 42vw at 8% 12%, var(--blob-1), transparent 70%),
    radial-gradient(38vw 38vw at 92% 8%, var(--blob-2), transparent 70%),
    radial-gradient(46vw 46vw at 70% 100%, var(--blob-3), transparent 70%);
}

h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

kbd {
  display: inline-flex;
  align-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.375rem;
  border-radius: 0.375rem;
  font-family: var(--font);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .02em;
  white-space: nowrap;
  background: var(--fill);
  color: var(--label-2);
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--highlight), var(--shadow);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: calc(100% - 2rem);
  max-width: none;
  height: var(--topbar-h);
  margin: 0.75rem auto var(--gap);
  padding: 0 0.625rem 0 0.75rem;
  border-radius: var(--radius-lg);
}
.brand { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06), 0 6px 14px -8px rgba(232, 33, 39, .55);
  transition: transform .2s var(--ease);
}
.brand-mark:hover { transform: scale(1.05); }
.brand-mark img { display: block; width: auto; height: 1.625rem; }
.brand-text { min-width: 0; }
.brand-text h1 {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
  white-space: nowrap;
}
.brand-text p { font-size: 0.75rem; color: var(--label-2); line-height: 1.2; }
.topbar-actions { display: flex; align-items: center; gap: 0.375rem; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.375rem;
  height: 2.375rem;
  padding: 0;
  border: 0;
  border-radius: 0.6875rem;
  background: transparent;
  color: var(--label-2);
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--fill); color: var(--label); }
.icon-btn .ic { width: 1.25rem; height: 1.25rem; }

.theme-switch { position: relative; display: inline-flex; cursor: pointer; }
.theme-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.theme-switch-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 3.875rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 62.4375rem;
  background: var(--fill);
  transition: background-color .25s;
}
.theme-switch-track .ic { width: 0.875rem; height: 0.875rem; color: var(--label-2); }
.theme-switch-knob {
  position: absolute;
  top: 0.1875rem;
  left: 0.1875rem;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18), 0 0 0 .5px rgba(0, 0, 0, .04);
  transition: transform .3s var(--ease);
}
.theme-switch input:checked + .theme-switch-track { background: var(--accent); }
.theme-switch input:checked + .theme-switch-track .ic { color: #fff; }
.theme-switch input:checked + .theme-switch-track .theme-switch-knob { transform: translateX(1.875rem); }
.theme-switch input:focus-visible + .theme-switch-track { box-shadow: 0 0 0 0.25rem var(--accent-ring); }

.app {
  display: grid;
  grid-template-columns: clamp(16.875rem, 17vw, 23.75rem) minmax(0, 1fr) clamp(18.75rem, 18vw, 23.75rem);
  grid-template-areas: "library stage inspector";
  gap: var(--gap);
  width: calc(100% - 2rem);
  max-width: none;
  height: calc(100vh - var(--topbar-h) - 0.75rem - var(--gap) * 2);
  height: calc(100dvh - var(--topbar-h) - 0.75rem - var(--gap) * 2);
  min-height: 36.25rem;
  margin: 0 auto;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.875rem;
  border-radius: var(--radius-xl);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--highlight), var(--shadow);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 2px 0.25rem 0.75rem;
}
.panel-head h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.panel-head h2 .ic { color: var(--accent-text); }
.badge {
  min-width: 1.625rem;
  height: 1.375rem;
  padding: 0 0.5rem;
  border-radius: 62.4375rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.375rem;
  text-align: center;
  background: var(--fill);
  color: var(--label-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.625rem;
  padding: 0 1rem;
  border: 0;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  background: var(--fill);
  color: var(--label);
  cursor: pointer;
  user-select: none;
  transition: background-color .15s, color .15s, transform .12s var(--ease), opacity .15s;
}
.btn:hover { background: var(--fill-hover); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .icon-btn:focus-visible, .tool-btn:focus-visible, .chip:focus-visible, .swatch:focus-visible, .link-button:focus-visible, .drop-area:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.btn kbd { background: rgba(127, 127, 127, .2); color: inherit; opacity: .85; font-weight: 600; }
.btn-sm { min-height: 2.125rem; padding: 0 0.75rem; font-size: 0.8125rem; border-radius: 0.625rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary kbd, .btn-success kbd, .btn-danger kbd { background: rgba(255, 255, 255, .24); opacity: 1; }
.btn-success { text-shadow: 0 1px 1px rgba(0, 0, 0, .12); }
.btn-tinted { background: var(--accent-tint); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-tint-hover); }
.btn-tinted kbd { background: var(--accent-tint-hover); }
.btn-tinted:hover { background: var(--accent-tint-hover); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: var(--green-hover); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red); filter: brightness(1.08); }
.btn-danger-tinted { background: var(--red-tint); color: var(--red-text); box-shadow: inset 0 0 0 1px var(--red-tint-hover); }
.btn-danger-tinted kbd { background: var(--red-tint-hover); }
.btn-danger-tinted:hover { background: var(--red-tint-hover); }
.btn-plain { background: transparent; color: var(--label); }
.btn-plain:hover { background: var(--fill); color: var(--label); }
.btn-count {
  min-width: 1.375rem;
  height: 1.25rem;
  padding: 0 0.375rem;
  border-radius: 62.4375rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25rem;
  background: rgba(255, 255, 255, .25);
}

.spinner {
  width: 1rem;
  height: 1rem;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.library { grid-area: library; }
#settingsBtn, .add-tile, .sheet-handle, .sheet-close, .sheet-scrim { display: none; }
.add-tile {
  place-items: center;
  flex: none;
  padding: 0;
  border: 1.5px dashed var(--accent-ring);
  border-radius: 0.875rem;
  background: var(--accent-tint);
  color: var(--accent-text);
  cursor: pointer;
}
.add-tile .ic { width: 1.5rem; height: 1.5rem; }
.drop-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1rem 0.75rem 0.875rem;
  margin-bottom: 0.75rem;
  border: 1.5px dashed var(--accent-ring);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: var(--radius-lg);
  background: transparent;
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  text-align: center;
  cursor: pointer;
  transition: background-color .2s, border-color .2s;
}
.drop-area:hover, .drop-area.highlight {
  border-color: var(--accent-text);
  background: var(--accent-tint);
}
.drop-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.25rem;
  border-radius: 0.75rem;
  color: var(--accent-text);
  background: var(--accent-tint);
}
.drop-icon .ic { width: 1.375rem; height: 1.375rem; }
.drop-title { font-weight: 600; font-size: 0.875rem; }
.drop-sub { font-size: 0.75rem; color: var(--label-2); margin-bottom: 0.5rem; }
.drop-sub kbd { height: 1.125rem; font-size: 0.6562rem; }

.thumbs {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.375rem, 1fr));
  align-content: start;
  gap: 0.625rem;
  margin: 0 -0.375rem 0.75rem;
  padding: 2px 0.375rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.thumbs:empty::before {
  content: 'Danh sách ảnh sẽ hiển thị tại đây';
  grid-column: 1 / -1;
  padding: 1.5rem 0.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--label-3);
}
.thumb {
  position: relative;
  min-width: 0;
  padding: 0.3125rem;
  border-radius: 0.875rem;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--separator);
  cursor: pointer;
  contain: layout paint;
  transition: box-shadow .15s, background-color .15s, opacity .15s;
}
.thumb:hover { box-shadow: 0 0 0 1px var(--accent-ring); }
.thumb.active { box-shadow: 0 0 0 2px var(--accent); background: var(--accent-tint); }
.thumb.dragging { opacity: .4; }
.thumb.drag-over { box-shadow: 0 0 0 2px var(--accent), 0 0 0 0.375rem var(--accent-ring); }
.thumb-media {
  position: relative;
  aspect-ratio: 1;
  border-radius: 0.625rem;
  overflow: hidden;
  background: var(--fill);
}
.thumb-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
}
.thumb-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .25) 50%, transparent 70%) var(--fill);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.thumb-index {
  position: absolute;
  top: 0.3125rem;
  left: 0.3125rem;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.375rem;
  border-radius: 62.4375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.25rem;
  text-align: center;
  color: #fff;
  background: rgba(0, 0, 0, .5);
}
.thumb-check {
  position: absolute;
  right: 0.3125rem;
  bottom: 0.3125rem;
  display: none;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .9);
}
.thumb-check .ic { width: 0.8125rem; height: 0.8125rem; stroke-width: 2.6; }
.thumb.done .thumb-check { display: grid; }
.thumb-busy {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  border-radius: inherit;
  color: #fff;
  background: rgba(0, 0, 0, .35);
}
.thumb.encoding .thumb-busy { display: grid; }
.thumb.encoding .thumb-check { display: none; }
.remove-thumb-btn {
  position: absolute;
  top: 0.3125rem;
  right: 0.3125rem;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background-color .15s;
}
.remove-thumb-btn .ic { width: 0.8125rem; height: 0.8125rem; stroke-width: 2.4; }
.remove-thumb-btn:hover { background: var(--red); }
.thumb:hover .remove-thumb-btn, .thumb.active .remove-thumb-btn, .remove-thumb-btn:focus-visible { opacity: 1; }
.thumb-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0.375rem 0.1875rem 2px;
  min-width: 0;
}
.thumb-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 500;
}
.thumb-info-original, .thumb-info {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.6875rem;
  color: var(--label-3);
  font-variant-numeric: tabular-nums;
}
.thumb-info { color: var(--green); font-weight: 500; }

.stage { grid-area: stage; padding: 0.75rem; gap: 0.75rem; }
.stage-toolbar {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 0.25rem;
  border-radius: 0.875rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.stage-toolbar::-webkit-scrollbar { display: none; }
.tool-btn {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.125rem;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 0.625rem;
  background: transparent;
  color: var(--label);
  cursor: pointer;
  transition: background-color .15s, opacity .15s;
}
.tool-btn:hover:not(:disabled) { background: var(--fill); }
.tool-btn:active:not(:disabled) { background: var(--fill-hover); }
.tool-btn:disabled { opacity: .3; cursor: default; }
.tool-sep { width: 1px; height: 1.25rem; margin: 0 0.25rem; flex: none; background: var(--separator); }
.tool-counter {
  min-width: 3.5rem;
  padding: 0 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: center;
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
}

#image-container {
  position: relative;
  flex: 1;
  min-height: 15rem;
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px var(--stage-edge);
}
#image-container::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background-color: var(--preview-bg, #f5f5f7);
  transition: background-color .2s;
}
#image {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
  max-height: 100%;
}
.empty-state {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 1.5rem;
  text-align: center;
  border-radius: inherit;
  background: var(--panel-solid);
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  margin-bottom: 0.5rem;
  border-radius: 1.25rem;
  color: var(--accent-text);
  background: var(--accent-tint);
}
.empty-icon .ic { width: 2rem; height: 2rem; stroke-width: 1.6; }
.empty-title { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; }
.empty-text { max-width: 21.25rem; color: var(--label-2); margin-bottom: 0.75rem; }
.empty-state.is-done .empty-icon { color: var(--green); background: rgba(52, 199, 89, .15); }

.guide-line {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  background: #ff2d55;
  box-shadow: 0 0 4px rgba(255, 45, 85, .6);
}
.guide-line.horizontal { left: 0; width: 100%; height: 1px; }
.guide-line.vertical { top: 0; height: 100%; width: 1px; }

.cropper-modal { background-color: transparent !important; opacity: 1 !important; }
.cropper-view-box { outline: 2px solid var(--accent); outline-color: var(--accent-text); }
.cropper-line { background-color: var(--accent-text); }
.cropper-dashed { border-color: rgba(255, 255, 255, .75); }
.cropper-center::before, .cropper-center::after { background-color: rgba(255, 255, 255, .9); }
.cropper-point {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background-color: #fff;
  opacity: 1;
  box-shadow: 0 0 0 1.5px var(--accent), 0 1px 3px rgba(0, 0, 0, .3);
}
.cropper-point.point-e, .cropper-point.point-w { margin-top: -0.3125rem; }
.cropper-point.point-n, .cropper-point.point-s { margin-left: -0.3125rem; }
.cropper-point.point-e { right: -0.3125rem; }
.cropper-point.point-w { left: -0.3125rem; }
.cropper-point.point-n { top: -0.3125rem; }
.cropper-point.point-s { bottom: -0.3125rem; }
.cropper-point.point-ne, .cropper-point.point-nw, .cropper-point.point-se, .cropper-point.point-sw { width: 0.75rem; height: 0.75rem; }
.cropper-point.point-ne { right: -0.375rem; top: -0.375rem; }
.cropper-point.point-nw { left: -0.375rem; top: -0.375rem; }
.cropper-point.point-sw { left: -0.375rem; bottom: -0.375rem; }
.cropper-point.point-se { right: -0.375rem; bottom: -0.375rem; opacity: 1; }
.cropper-point.point-se::before { display: none; }

.progress { display: flex; align-items: center; gap: 0.75rem; padding: 0 0.25rem; }
.progress-track {
  flex: 1;
  height: 0.375rem;
  border-radius: 62.4375rem;
  overflow: hidden;
  background: var(--fill);
}
.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .25s var(--ease);
}
.progress-text {
  min-width: 6rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: right;
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
}

.main-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.625rem;
}
.main-action-buttons .btn { flex: 1 1 10.625rem; }

.inspector { grid-area: inspector; padding-bottom: 0.75rem; }
.preview-card {
  flex: none;
  margin-bottom: 0.625rem;
  padding: 0.5rem;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: 0 0 0 1px var(--separator);
}
.preview-box {
  display: grid;
  place-items: center;
  height: 10.375rem;
  border-radius: 0.75rem;
  background-color: var(--fill);
  background-image: linear-gradient(45deg, rgba(127, 127, 127, .12) 25%, transparent 25%, transparent 75%, rgba(127, 127, 127, .12) 75%), linear-gradient(45deg, rgba(127, 127, 127, .12) 25%, transparent 25%, transparent 75%, rgba(127, 127, 127, .12) 75%);
  background-size: 1rem 1rem;
  background-position: 0 0, 0.5rem 0.5rem;
  overflow: hidden;
}
.preview-box canvas { display: block; border-radius: 0.25rem; box-shadow: 0 0.25rem 0.875rem -0.375rem rgba(0, 0, 0, .35); }
.preview-box { position: relative; }
.preview-warn,
.preview-tip {
  position: absolute;
  left: 0.375rem;
  right: 0.375rem;
  z-index: 2;
  margin: 0;
  border-radius: 0.75rem;
  font-size: 0.71875rem;
  line-height: 1.4;
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  animation: fade-in .2s ease both;
}
.preview-warn { top: 0.375rem; padding: 0.4375rem 0.625rem; background: rgba(200, 30, 30, .86); }
.preview-tip { bottom: 0.375rem; padding: 0.5rem 0.5rem 0.5rem 0.625rem; background: rgba(28, 28, 32, .9); }
.preview-tip-head { display: flex; align-items: flex-start; gap: 0.375rem; }
.preview-tip-head span { flex: 1; }
.preview-tip-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: -0.125rem -0.125rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  cursor: pointer;
}
.preview-tip-close .ic { width: 0.75rem; height: 0.75rem; stroke-width: 2.4; }
.preview-tip-options { display: flex; flex-wrap: wrap; gap: 0.3125rem; margin-top: 0.375rem; }
.tip-chip {
  height: 1.625rem;
  padding: 0 0.5625rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.625rem;
  white-space: nowrap;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background-color .15s;
}
button.tip-chip:hover { background: rgba(255, 255, 255, .26); }
.tip-chip.is-loading { opacity: .55; cursor: default; }
.tip-chip.is-lighter { background: rgba(48, 209, 88, .32); }
button.tip-chip.is-lighter:hover { background: rgba(48, 209, 88, .48); }
.tip-chip.is-best { box-shadow: inset 0 0 0 1.5px #30d158; }
.lite .preview-warn, .lite .preview-tip { -webkit-backdrop-filter: none; backdrop-filter: none; }
.preview-empty { font-size: 0.7812rem; color: var(--label-3); }
.preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.25rem 2px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
}
.preview-size { flex: none; color: var(--accent-text); }
.engine-status {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--label-2);
  background: color-mix(in srgb, var(--green) 12%, transparent);
}
.engine-status .ic { flex: none; width: 1rem; height: 1rem; margin-top: 0.0625rem; color: var(--green); }
.engine-status.is-fallback { background: var(--fill); }
.engine-status.is-fallback .ic { color: var(--label-3); }

.scale-seg span { display: flex; align-items: baseline; justify-content: center; gap: 0.25rem; font-weight: 600; }
.scale-seg small { font-size: 0.6875rem; font-weight: 500; opacity: .7; }
.preview-size.is-warn { color: var(--red-text); }
.preview-size.is-good { color: var(--green); }
.preview-meta { display: grid; justify-content: stretch; gap: 0.125rem; }
.preview-meta > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-size { text-align: left; }

.tabs { flex: none; margin-bottom: 0.75rem; }
.tab-panel { display: flex; flex-direction: column; gap: 0.75rem; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; cursor: pointer; }
.switch-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-title { display: flex; align-items: center; gap: 0.375rem; font-size: 0.8438rem; font-weight: 600; }
.switch-title .ic { width: 1rem; height: 1rem; color: var(--accent-text); }
.switch {
  position: relative;
  flex: none;
  width: 2.875rem;
  height: 1.75rem;
  margin: 0;
  border-radius: 62.4375rem;
  background: var(--fill-hover);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background-color .25s;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
  transition: transform .3s var(--ease);
}
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(1.125rem); }
.switch:focus-visible { outline: none; box-shadow: 0 0 0 0.25rem var(--accent-ring); }
.hint-warn { color: var(--red-text); }
.picker-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: auto;
  min-height: 3.5rem;
  padding: 0.5rem 0.75rem;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.picker-trigger:hover { border-color: var(--accent-ring); }
.picker-trigger[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 0.25rem var(--accent-ring); }
.picker-trigger.has-value .ratio-box > span { background: var(--accent); border-color: var(--accent); }
.picker-text { display: flex; flex-direction: column; gap: 0.125rem; flex: 1; min-width: 0; }
.picker-title, .picker-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-title { font-size: 0.875rem; font-weight: 600; }
.picker-sub { font-size: 0.75rem; color: var(--label-3); }
.picker-chevron { color: var(--label-3); transition: transform .25s var(--ease); }
.picker-trigger[aria-expanded="true"] .picker-chevron { transform: rotate(180deg); }
.ratio-box {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0.375rem;
  border-radius: 0.625rem;
  background: var(--fill);
}
.ratio-box > span {
  display: block;
  min-width: 3px;
  min-height: 3px;
  border-radius: 3px;
  border: 1.5px solid var(--label-2);
  background: transparent;
  transition: background-color .15s, border-color .15s;
}
.menu {
  position: fixed;
  z-index: 90;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.375rem;
  border-radius: 1.125rem;
  background: var(--glass);
  scrollbar-width: thin;
  transform-origin: top center;
  animation: menu-in .22s var(--ease) both;
}
.menu.from-bottom { transform-origin: bottom center; }
@keyframes menu-in { from { opacity: 0; transform: scale(.96) translateY(-0.25rem); } }
.menu.from-bottom { animation-name: menu-in-up; }
@keyframes menu-in-up { from { opacity: 0; transform: scale(.96) translateY(0.25rem); } }
.menu-group + .menu-group { margin-top: 0.25rem; padding-top: 0.25rem; border-top: 1px solid var(--separator); }
.menu-heading {
  padding: 0.5rem 0.625rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--label-3);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.4375rem 0.625rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--label);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.menu-item .ratio-box { width: 2rem; height: 2rem; padding: 0.3125rem; border-radius: 0.5rem; }
.menu-item:hover, .menu-item:focus { outline: none; background: var(--accent); color: #fff; }
.menu-item:hover .ratio-box, .menu-item:focus .ratio-box { background: rgba(255, 255, 255, .2); }
.menu-item:hover .ratio-box > span, .menu-item:focus .ratio-box > span { border-color: #fff; }
.menu-item:hover .menu-sub, .menu-item:focus .menu-sub,
.menu-item:hover .menu-size, .menu-item:focus .menu-size { color: rgba(255, 255, 255, .8); }
.menu-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.menu-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.875rem; font-weight: 500; }
.menu-sub { font-size: 0.71875rem; color: var(--label-3); }
.menu-size { flex: none; font-size: 0.8125rem; font-weight: 600; color: var(--label-2); font-variant-numeric: tabular-nums; }
.menu-check { width: 1rem; height: 1rem; stroke-width: 2.4; visibility: hidden; color: var(--accent-text); }
.menu-item.selected .menu-check { visibility: visible; }
.menu-item.selected:not(:hover):not(:focus) .ratio-box > span { background: var(--accent); border-color: var(--accent); }
.menu-item:hover .menu-check, .menu-item:focus .menu-check { color: #fff; }
.chip-removable {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 0.25rem 0 0;
  cursor: default;
}
.chip-removable:hover { background: var(--fill); }
.chip-main {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 100%;
  padding: 0 0.25rem 0 0.6875rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
span.chip-main { cursor: default; }
.chip-main small { font-size: 0.6875rem; color: var(--label-3); }
.chip-x {
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--label-3);
  cursor: pointer;
}
.chip-x:hover { background: var(--red-tint); color: var(--red-text); }
.chip-x .ic { width: 0.75rem; height: 0.75rem; stroke-width: 2.4; }
.btn-left { justify-content: flex-start; align-self: flex-start; padding: 0 0.5rem; color: var(--accent-text); }
.add-size-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: 0.375rem; }
.add-size-row .btn { min-height: 2.375rem; width: 2.625rem; padding: 0; }
.times { color: var(--label-3); }
.wm-pick { display: flex; align-items: center; gap: 0.75rem; }
.wm-thumb {
  display: grid;
  place-items: center;
  flex: none;
  width: 4.75rem;
  height: 4.75rem;
  padding: 0.5rem;
  border-radius: 0.875rem;
  background-color: var(--fill);
  background-image: linear-gradient(45deg, rgba(127, 127, 127, .14) 25%, transparent 25%, transparent 75%, rgba(127, 127, 127, .14) 75%), linear-gradient(45deg, rgba(127, 127, 127, .14) 25%, transparent 25%, transparent 75%, rgba(127, 127, 127, .14) 75%);
  background-size: 0.75rem 0.75rem;
  background-position: 0 0, 0.375rem 0.375rem;
  cursor: pointer;
  text-align: center;
  font-size: 0.6875rem;
  color: var(--label-3);
}
.wm-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.wm-pick-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.pos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.375rem;
  width: 100%;
  max-width: 13.75rem;
  aspect-ratio: 16 / 10;
  padding: 0.5rem;
  border-radius: 0.875rem;
  background: var(--fill);
}
.pos-grid button {
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  cursor: pointer;
  transition: background-color .15s;
}
.pos-grid button::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--label-3);
  transform: translate(-50%, -50%);
  transition: all .2s var(--ease);
}
.pos-grid button:hover { background: var(--fill); }
.pos-grid button.active { background: var(--accent-tint); }
.pos-grid button.active::after { width: 1.375rem; height: 0.875rem; border-radius: 0.25rem; background: var(--accent); }
.wm-off [data-tab="logo"] .group + .group { opacity: .5; }
.thumb.edited:not(.done) .thumb-check { display: grid; background: var(--accent); }
.thumb.edited:not(.done) .thumb-check .ic { display: none; }
.thumb.edited:not(.done) .thumb-check { width: 0.625rem; height: 0.625rem; }
.modal-input { margin: -0.375rem 0 1.125rem; }
.install-btn { min-height: 2.125rem; }
.inspector-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0 -0.375rem;
  padding: 0 0.375rem 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.group {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.875rem;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: 0 0 0 1px var(--separator);
}
.group h3 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--label-2);
}
.field { display: flex; flex-direction: column; gap: 0.375rem; min-width: 0; }
.field-label, .field-label-row label { font-size: 0.7812rem; color: var(--label-2); }
.field-label-row { display: flex; align-items: center; justify-content: space-between; }
.field-label-row output {
  min-width: 2.125rem;
  padding: 1px 0.5rem;
  border-radius: 62.4375rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  color: var(--accent-text);
  background: var(--accent-tint);
  font-variant-numeric: tabular-nums;
}
.input {
  width: 100%;
  height: 2.375rem;
  padding: 0 0.75rem;
  border: 1px solid var(--field-border);
  border-radius: 0.625rem;
  background: var(--field);
  color: var(--label);
  font-size: 0.875rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--label-3); }
.input:focus { border-color: var(--accent-text); box-shadow: 0 0 0 0.25rem var(--accent-ring); }
.input[type="number"] { font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.input[type="number"]::-webkit-outer-spin-button,
.input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-wrap { position: relative; display: block; }
.input-wrap .input { padding-right: 2rem; }
.unit {
  position: absolute;
  right: 0.6875rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--label-3);
  pointer-events: none;
}
.size-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 0.5rem; }
.link-button {
  display: grid;
  place-items: center;
  width: 2.125rem;
  height: 2.375rem;
  padding: 0;
  border: 0;
  border-radius: 0.625rem;
  background: transparent;
  color: var(--label-3);
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.link-button:hover { background: var(--fill); color: var(--label); }
.link-button.linked { color: var(--accent-text); background: var(--accent-tint); }

.chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.chip {
  height: 1.75rem;
  padding: 0 0.6875rem;
  border: 0;
  border-radius: 62.4375rem;
  font-size: 0.7812rem;
  font-weight: 500;
  background: var(--fill);
  color: var(--label);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background-color .15s, color .15s;
}
.chip:hover { background: var(--fill-hover); }
.chip.active { background: var(--accent); color: #fff; font-weight: 600; }

.color-row { display: flex; align-items: center; gap: 0.625rem; }
.color-swatch {
  position: relative;
  width: 2.375rem;
  height: 2.375rem;
  flex: none;
  border-radius: 0.6875rem;
  overflow: hidden;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1);
}
.color-swatch input {
  position: absolute;
  inset: -0.5rem;
  width: calc(100% + 1rem);
  height: calc(100% + 1rem);
  padding: 0;
  border: 0;
  cursor: pointer;
}
.hex { flex: 1; font-family: var(--mono); font-size: 0.8125rem; color: var(--label-2); }
.swatches { display: flex; gap: 0.375rem; }
.swatch {
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .35);
  cursor: pointer;
  transition: transform .15s var(--ease);
}
.swatch:hover { transform: scale(1.1); }
.swatch.active { box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .35), 0 0 0 2px var(--panel-solid), 0 0 0 0.25rem var(--accent); }

.segmented {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  padding: 2px;
  border-radius: 0.625rem;
  background: var(--fill);
}
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: block;
  padding: 0.375rem 0;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: center;
  color: var(--label-2);
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.segmented input:checked + span {
  background: var(--segment-on);
  color: var(--label);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04);
}
.segmented input:focus-visible + span { box-shadow: 0 0 0 0.1875rem var(--accent-ring); }

.range {
  --val: 90%;
  width: 100%;
  height: 1.375rem;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.range::-webkit-slider-runnable-track {
  height: 0.25rem;
  border-radius: 62.4375rem;
  background: linear-gradient(to right, var(--accent) var(--val), var(--fill-hover) var(--val));
}
.range::-moz-range-track { height: 0.25rem; border-radius: 62.4375rem; background: var(--fill-hover); }
.range::-moz-range-progress { height: 0.25rem; border-radius: 62.4375rem; background: var(--accent); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.375rem;
  height: 1.375rem;
  margin-top: -0.5625rem;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25), 0 0 0 .5px rgba(0, 0, 0, .06);
}
.range::-moz-range-thumb {
  width: 1.375rem;
  height: 1.375rem;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25), 0 0 0 .5px rgba(0, 0, 0, .06);
}
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 0.25rem var(--accent-ring); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 0.25rem var(--accent-ring); }

.hint { font-size: 0.75rem; color: var(--label-3); }
.filename-preview {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
  min-width: 0;
  font-size: 0.75rem;
  color: var(--label-3);
}
.filename-preview span { flex: none; }
.filename-preview code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.7188rem;
  color: var(--label-2);
}
.inspector-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  padding-top: 0.75rem;
}

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 1.375rem 1rem 1.625rem;
  font-size: 0.7812rem;
  text-align: center;
  color: var(--label-2);
}
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1.125rem; }

.toasts {
  position: fixed;
  top: calc(var(--topbar-h) + 1.375rem);
  right: 1.75rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: min(27.5rem, calc(100vw - 2rem));
  padding: 0.625rem 1rem;
  border-radius: 62.4375rem;
  font-size: 0.8438rem;
  font-weight: 500;
  color: #fff;
  background: var(--toast-bg);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  animation: toast-in .35s var(--ease) both;
}
.toast::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}
.toast-success::before { background: var(--green); }
.toast-warn::before { background: #ff9f0a; }
.toast-error::before { background: var(--red); }
.toast.out { animation: toast-out .25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-0.625rem) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-0.5rem) scale(.96); } }

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: var(--scrim);
  animation: fade-in .2s ease both;
}
.modal-card {
  width: min(23.75rem, 100%);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.375rem;
  border-radius: var(--radius-xl);
  background: var(--glass-solid);
  box-shadow: var(--highlight), var(--shadow-lg);
  animation: pop-in .3s var(--ease) both;
}
.modal-wide { width: min(47.5rem, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.875rem; }
.modal-title { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; }
.modal-text { margin: 0.5rem 0 1.25rem; color: var(--label-2); }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.94); } }

.shortcut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.875rem 1.5rem; }
.shortcut-grid h3 {
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--label-2);
}
.shortcut-grid dl { margin: 0; }
.shortcut-grid dl div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4375rem 0;
  border-bottom: 1px solid var(--separator);
}
.shortcut-grid dl div:last-child { border-bottom: 0; }
.shortcut-grid dt { font-size: 0.8125rem; }
.shortcut-grid dd { display: flex; gap: 0.25rem; margin: 0; flex: none; }

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--accent-tint);
  pointer-events: none;
  animation: fade-in .15s ease both;
}
.drop-overlay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  padding: 1.75rem 2.25rem;
  border-radius: var(--radius-xl);
  border: 2px dashed var(--accent);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-text);
}
.drop-overlay-card .ic { width: 2.5rem; height: 2.5rem; stroke-width: 1.5; }

::-webkit-scrollbar { width: 0.625rem; height: 0.625rem; }
::-webkit-scrollbar-thumb { border: 0.1875rem solid transparent; border-radius: 62.4375rem; background: var(--fill-hover); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.lite .glass,
.lite .toast {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.lite .glass { background: var(--glass-solid); }
.lite .panel { background: var(--panel-solid); }
.lite .thumb-skeleton { animation: none; }

@media (prefers-reduced-transparency: reduce) {
  .glass, .toast { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .glass { background: var(--glass-solid); }
  .panel { background: var(--panel-solid); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
