/* Koko page reference layer
   This file is intentionally loaded after style.css.  It owns the visual
   treatment for the supplied 1446px composition while leaving the app's
   semantic states and editing controls intact. */

:root {
  --koko-bg: #0e1015;
  --koko-panel: rgba(24, 26, 33, .74);
  --koko-panel-deep: rgba(17, 19, 25, .72);
  --koko-panel-soft: rgba(32, 35, 44, .78);
  --koko-line: rgba(225, 229, 247, .16);
  --koko-line-strong: rgba(235, 239, 255, .26);
  --koko-text: #f4f5fa;
  --koko-muted: #aeb2bd;
  --koko-blue: #8ba8ff;
  --koko-focus: #a9c0ff;
  --koko-radius: 20px;
  color-scheme: dark;
}

html,
body {
  min-height: 100%;
  background-color: var(--koko-bg) !important;
}

body.koko-page {
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--koko-text);
  background-color: var(--koko-bg) !important;
  background-image: url("/static/assets/koko-page/background.webp") !important;
  background-repeat: no-repeat !important;
  background-position: center top !important;
  background-size: cover !important;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
}

/* style.css has an older atmosphere layer and several decorative elements. */
body.koko-page::before,
body.koko-page::after,
.koko-page .ambient,
.koko-page .shape {
  display: none !important;
}

.koko-page main {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 44px;
}

.koko-page .topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 65px;
  padding: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.koko-page .brand {
  gap: 10px;
}

.koko-page .brand-mark {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(145deg, #7385c2, #3a4359 78%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), 0 5px 16px rgba(26, 38, 76, .28);
  font-size: 18px;
  font-weight: 800;
}

.koko-page .brand strong {
  color: #f2f3f8;
  font-size: 17px;
  letter-spacing: -.05em;
}

/* Landing composition: title y≈203 and a 910×422 upload frame at 1446px. */
.koko-page .start-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(910px, 100%);
  min-height: 0;
  margin: 0 auto;
  padding: 131px 0 72px;
  gap: 31px;
  overflow: visible;
}

.koko-page .start-screen::before,
.koko-page .start-screen::after {
  display: none;
}

.koko-page .product-intro {
  display: grid;
  justify-items: center;
  gap: 0;
  width: 100%;
  text-align: center;
}

.koko-page .product-intro::before {
  display: none;
}

.koko-page .product-intro h1 {
  margin: 0;
  color: var(--koko-text);
  font-size: clamp(52px, 5.35vw, 78px);
  font-weight: 780;
  line-height: .98;
  letter-spacing: -.085em;
  text-shadow: 0 5px 28px rgba(0, 0, 0, .22);
}

.koko-page .headline-top {
  display: block;
  color: #f7f8fc;
  letter-spacing: -.02em;
}

.koko-page .headline-gradient {
  display: block;
  padding: 2px 0 0;
  color: #d9dce8;
  background: none;
  -webkit-text-fill-color: currentColor;
  font-size: clamp(15px, 1.55vw, 20px);
  font-weight: 650;
  letter-spacing: -.06em;
  line-height: 1.2;
}

.koko-page .upload-card {
  position: relative;
  width: 100%;
  height: 422px;
  padding: 0;
  border: 0;
  border-radius: var(--koko-radius);
  background: transparent;
  box-shadow: none;
}

.koko-page .upload-main {
  position: relative;
  display: block;
  width: 100%;
  height: 422px;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(204, 209, 232, .18);
  border-radius: var(--koko-radius);
  outline-offset: 4px;
  background:
    linear-gradient(125deg, rgba(166, 176, 213, .10), transparent 27%, rgba(20, 22, 31, .20) 66%, rgba(143, 113, 181, .08)),
    rgba(18, 20, 27, .58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    inset 0 -1px 0 rgba(255, 255, 255, .06),
    0 20px 38px rgba(0, 0, 0, .25);
  backdrop-filter: blur(22px) saturate(125%);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.koko-page .upload-main::before,
.koko-page .upload-main::after {
  pointer-events: none;
}

.koko-page .upload-main::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(255, 255, 255, .08), transparent 24%, transparent 76%, rgba(172, 154, 255, .05));
}

.koko-page .upload-main::after {
  content: "";
  position: absolute;
  inset: 1px;
  border: 1px solid rgba(255, 255, 255, .055);
  border-radius: calc(var(--koko-radius) - 1px);
}

.koko-page .upload-main:hover,
.koko-page .upload-card.drag .upload-main {
  border-color: rgba(202, 211, 255, .36);
  background:
    linear-gradient(125deg, rgba(166, 176, 213, .14), transparent 27%, rgba(20, 22, 31, .18) 66%, rgba(143, 113, 181, .11)),
    rgba(23, 25, 34, .63);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 24px 45px rgba(0, 0, 0, .32);
}

.koko-page .upload-main > * {
  position: relative;
  z-index: 1;
}

.koko-page .upload-copy {
  position: absolute !important;
  top: 38px;
  left: 57px;
  display: block;
  min-width: 0;
  text-align: left;
}

.koko-page .upload-copy strong,
.koko-page .upload-copy span {
  display: block;
  color: #d9dbe4;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -.045em;
}

.koko-page .upload-copy span {
  display: none;
}

.koko-page .upload-icon {
  position: absolute !important;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 120px;
  height: 40px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 0;
  color: #1e222d;
  background: rgba(80, 92, 140, .64);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 4px 10px rgba(2, 4, 9, .18);
  font-size: 25px;
  font-weight: 300;
  line-height: 1;
}

.koko-page .upload-icon::before,
.koko-page .upload-icon::after {
  display: none;
}

.koko-page .upload-preview {
  position: absolute !important;
  inset: 42px 28px;
  display: grid;
  place-items: center;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden;
  border-radius: 10px;
  background: transparent;
}

.koko-page .upload-preview img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.koko-page .upload-preview span {
  display: none;
}

.koko-page .upload-card.has-upload #uploadCount {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: block !important;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  color: #f2f4fb;
  background: rgba(10, 13, 19, .72);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
  backdrop-filter: blur(10px);
  font-size: 12px;
  line-height: 1;
}

.koko-page .upload-card.has-upload .upload-icon,
.koko-page .upload-card.has-upload .upload-copy {
  display: none;
}

.koko-page .home-tools {
  position: absolute;
  right: 0;
  bottom: 50px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 184px;
  margin: 0;
}

.koko-page .home-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, .04);
  border-radius: 0;
  color: #d4d6df;
  background: rgba(44, 46, 56, .46);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.04em;
}

.koko-page .home-tool:first-child {
  border-radius: 0;
}

.koko-page .home-tool:hover {
  color: #f5f6fb;
  background: rgba(74, 76, 90, .58);
}

.koko-page .upload-bottom {
  display: flex;
  justify-content: center;
  width: min(558px, 100%);
  margin: 25px auto 0;
  padding: 0;
  border: 0;
}

.koko-page .primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 22px;
  border: 1px solid rgba(229, 232, 255, .34);
  border-radius: 9px;
  color: #eef3ff;
  background: linear-gradient(100deg, rgba(106, 145, 218, .82), rgba(112, 90, 179, .82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 8px 22px rgba(36, 29, 78, .24);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.045em;
}

.koko-page .primary-action:hover {
  filter: brightness(1.10);
}

.koko-page .primary-action:active:not(:disabled) {
  filter: brightness(.96);
}

.koko-page .primary-action:disabled {
  opacity: .66;
  filter: saturate(.82);
}

.koko-page .primary-action b {
  display: none;
}

.koko-page .filename {
  display: none !important;
}

/* Processing feedback must remain visible once app.js removes [hidden]. */
.koko-page #progressPanel:not([hidden]) {
  display: block !important;
}

.koko-page .progress-panel {
  position: absolute;
  right: 24px;
  bottom: 20px;
  left: 24px;
  z-index: 4;
  width: auto;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--koko-line);
  border-radius: 12px;
  background: rgba(12, 15, 22, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(14px);
}

.koko-page .progress-top strong { color: #e8eafd; }
.koko-page .progress-top small { color: #a9afc2; }
.koko-page .progress-top output { color: #c6b9ff; }
.koko-page .progress-track { background: rgba(255, 255, 255, .10); }
.koko-page .progress-track i { background: linear-gradient(90deg, #7ba9ff, #aa8eff, #d3a6eb); }

.koko-page .status {
  border: 1px solid var(--koko-line);
  border-radius: 12px;
  color: var(--koko-muted);
  background: rgba(15, 18, 25, .72);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .18);
}

/* Result state: the start page disappears and the editor gets the second
   reference composition with a 1120px glass workspace. */
.koko-page.has-result .start-screen {
  display: none !important;
}

/* The current DOM keeps the result intro as the workspace's first child;
   reserve the title space above the glass card while the intro is absolute. */
.koko-page.has-result .result-workspace {
  margin-top: 180px;
}

.koko-page.has-result > main > .result-intro,
.koko-page .result-workspace > .result-intro {
  display: grid;
  justify-items: center;
  gap: 0;
  color: var(--koko-text);
  text-align: center;
}

.koko-page.has-result > main > .result-intro {
  margin: 53px auto 31px;
}

.koko-page .result-workspace > .result-intro {
  position: absolute;
  top: -121px;
  right: 0;
  left: 0;
}

.koko-page .result-intro .headline-top {
  display: block;
  color: #f4f5fa;
  font-size: clamp(48px, 4.25vw, 62px);
  font-weight: 780;
  line-height: .98;
  letter-spacing: -.02em;
}

.koko-page .result-intro .headline-gradient {
  display: block;
  padding: 1px 0 0;
  color: #d7dbe7;
  background: none;
  -webkit-text-fill-color: currentColor;
  font-size: clamp(14px, 1.45vw, 18px);
  font-weight: 650;
  line-height: 1.2;
}

.koko-page .result-workspace,
.koko-page .batch-workspace {
  position: relative;
  width: min(1114px, 100%);
  margin: 0 auto;
  padding: 20px;
  border: 1px solid rgba(197, 206, 235, .19);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(119, 167, 153, .08), transparent 26%, rgba(60, 68, 118, .11) 90%),
    rgba(22, 26, 34, .78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 24px 55px rgba(0, 0, 0, .28);
  backdrop-filter: blur(24px) saturate(125%);
}

.koko-page .batch-current-progress {
  display: grid;
  gap: 10px;
  margin: 18px 0 4px;
  padding: 18px 20px 15px;
  border: 1px solid rgba(199, 210, 241, .15);
  border-radius: 14px;
  background: rgba(10, 13, 20, .38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
}

.koko-page .batch-current-progress[hidden] { display: none !important; }

.koko-page .batch-current-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #ebedf6;
  font-size: 14px;
}

.koko-page .batch-current-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .28);
}

.koko-page .batch-current-track i {
  position: relative;
  display: block;
  width: 0;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(90deg, #769fff, #9988ff 62%, #c49ce9);
  box-shadow: 0 0 18px rgba(133, 145, 255, .42);
}

.koko-page .batch-current-track i.is-advancing {
  transition: width .8s cubic-bezier(.22, .8, .28, 1);
}

.koko-page .batch-current-track i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .42), transparent);
  transform: translateX(-100%);
  animation: batch-progress-sheen 1.8s ease-in-out infinite;
}

.koko-page .batch-current-count {
  justify-self: center;
  color: #aeb5c8;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

.koko-page .batch-item-download {
  display: block;
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  color: inherit;
  line-height: 0;
  cursor: pointer;
}

.koko-page .batch-item-download img {
  transition: filter .18s ease, transform .18s ease;
}

.koko-page .batch-item-download:hover img {
  filter: brightness(1.05);
  transform: scale(1.012);
}

.koko-page .batch-item-download:focus-visible {
  outline: 2px solid var(--focus-ring, #8fb4ff);
  outline-offset: 3px;
}

@keyframes batch-progress-sheen {
  50%, 100% { transform: translateX(100%); }
}

.koko-page .workspace-head.result-head {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr) 124px;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
}

.koko-page .result-batch-button,
.koko-page .result-head .back-button,
.koko-page .inline-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(227, 232, 255, .17);
  border-radius: 10px;
  color: #eef0f8;
  background: rgba(255, 255, 255, .06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.koko-page .result-batch-button {
  font-size: 14px;
}

.koko-page .inline-download {
  background: linear-gradient(100deg, rgba(102, 137, 202, .50), rgba(94, 77, 149, .50));
  font-size: 17px;
}

.koko-page .inline-download span { display: none; }

.koko-page .result-head .back-button {
  color: #d6d9e4;
  background: rgba(255, 255, 255, .055);
}

.koko-page .result-batch-button:hover,
.koko-page .result-head .back-button:hover,
.koko-page .inline-download:hover {
  border-color: rgba(208, 217, 255, .40);
  background-color: rgba(255, 255, 255, .10);
}

.koko-page .result-display {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  gap: 14px;
}

.koko-page .compare-card,
.koko-page .toolbar,
.koko-page .pane {
  border: 1px solid rgba(213, 220, 244, .13);
  background: rgba(10, 13, 19, .46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

.koko-page .compare-card {
  overflow: hidden;
  border-radius: 14px;
}

.koko-page .compare-view {
  --image-zoom: 1;
  --image-pan-x: 0px;
  --image-pan-y: 0px;
  height: clamp(300px, 30.1vw, 435px);
  min-height: 0;
}

.koko-page .compare-image,
.koko-page .compare-clip .compare-image {
  object-fit: contain;
  transform: translate(var(--image-pan-x), var(--image-pan-y)) scale(var(--image-zoom));
  transform-origin: 50% 50%;
  transition: transform .16s ease-out;
}

/* The opaque source is the base layer. Only the transparent result above it
   is clipped by the comparison position; clipping both layers can expose the
   checkerboard between the source image and the divider. */
.koko-page .compare-image.original {
  clip-path: none;
}

.koko-page .background-tabs {
  gap: 8px;
  min-width: 0;
}

.koko-page .background-tabs .tool-label {
  color: #afb3c0;
  font-size: 10px;
}

.koko-page .background-card {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 37px;
  padding: 8px 10px;
  border: 1px solid rgba(224, 228, 249, .10);
  border-radius: 9px;
  color: #d9dce6;
  background: rgba(255, 255, 255, .045);
  font-size: 11px;
}

.koko-page .background-card.selected {
  border-color: rgba(167, 183, 255, .78);
  box-shadow: 0 0 0 1px rgba(167, 183, 255, .25);
}

.koko-page .background-tabs > small { display: none; }

.koko-page .editor-details {
  margin-top: 14px;
  padding: 0;
  border: 0;
}

.koko-page .toolbar {
  min-height: 56px;
  margin: 0;
  padding: 9px 12px;
  border-radius: 12px;
  align-items: center;
}

.koko-page .upscale-button {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(221, 225, 255, .32);
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(100deg, rgba(94, 139, 222, .82), rgba(121, 87, 191, .82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 5px 18px rgba(40, 29, 88, .24);
  font-size: 13px;
  font-weight: 680;
}

.koko-page .toolbar-upscale-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 126px;
  min-height: 36px;
  height: 36px;
  padding-inline: 14px;
}

.koko-page .visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.koko-page .upscale-button:hover:not(:disabled) {
  border-color: rgba(235, 238, 255, .52);
  background: linear-gradient(100deg, rgba(107, 154, 235, .92), rgba(135, 99, 207, .92));
}

.koko-page .upscale-button:disabled {
  opacity: .48;
  cursor: not-allowed;
  transform: none;
}

.koko-page .segmented {
  background: rgba(255, 255, 255, .06);
}

.koko-page .segmented .mode {
  min-height: 34px;
  color: #bdc1cf;
}

.koko-page .segmented .active.keep {
  color: #77e6aa;
  background: rgba(36, 126, 86, .28);
}

.koko-page .segmented .active.erase {
  color: #ff9da4;
  background: rgba(152, 53, 63, .28);
}

.koko-page .range input { accent-color: var(--koko-blue); }

.koko-page #colorTolerance {
  height: 24px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: ew-resize;
}

.koko-page #colorTolerance::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(220, 225, 244, .34);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .28);
}

.koko-page #colorTolerance::-webkit-slider-thumb {
  width: 13px;
  height: 24px;
  margin-top: -10px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(232, 235, 255, .68);
  border-radius: 5px;
  background: linear-gradient(180deg, #d9d5ff, #8f82d8);
  box-shadow: 0 3px 9px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .52);
}

.koko-page #colorTolerance::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: rgba(220, 225, 244, .34);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .28);
}

.koko-page #colorTolerance::-moz-range-thumb {
  width: 13px;
  height: 24px;
  border: 1px solid rgba(232, 235, 255, .68);
  border-radius: 5px;
  background: linear-gradient(180deg, #d9d5ff, #8f82d8);
  box-shadow: 0 3px 9px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .52);
}
.koko-page #editStatus { color: #aeb4c4; }

.koko-page .panes {
  gap: 13px;
  margin-top: 13px;
}

.koko-page .pane {
  overflow: hidden;
  border-radius: 12px;
}

.koko-page .pane-title {
  border: 0;
  color: #d9dce6;
}

.koko-page .canvas-wrap,
.koko-page .result-wrap {
  height: min(48vh, 500px);
}

.koko-page .result-wrap { background: #34363b; }

.koko-page footer {
  color: rgba(180, 184, 198, .45);
}

/* Native focus stays visible on the div upload affordance and all controls. */
.koko-page button:focus-visible,
.koko-page a:focus-visible,
.koko-page input:focus-visible,
.koko-page .upload-main:focus-visible {
  outline: 2px solid var(--koko-focus);
  outline-offset: 3px;
}

@media (max-width: 700px) {
  body.koko-page {
    background-size: cover !important;
  }

  .koko-page main {
    width: min(100% - 24px, 600px);
    padding-bottom: 26px;
  }

  .koko-page .topbar {
    height: 58px;
  }

  .koko-page .start-screen {
    width: 100%;
    padding: 92px 0 36px;
    gap: 26px;
  }

  .koko-page .product-intro h1 {
    font-size: clamp(47px, 17vw, 70px);
  }

  .koko-page .headline-gradient {
    font-size: clamp(14px, 5vw, 18px);
  }

  .koko-page .upload-card,
  .koko-page .upload-main {
    height: min(422px, 108vw);
    min-height: 330px;
  }

  .koko-page .upload-copy {
    top: 25px;
    left: 25px;
  }

  .koko-page .upload-copy strong { font-size: 15px; }

  .koko-page .home-tools {
    right: 0;
    bottom: 28px;
    width: 150px;
  }

  .koko-page .home-tool {
    min-height: 44px;
    font-size: 14px;
  }

  .koko-page .upload-bottom {
    width: 100%;
    margin-top: 18px;
  }

  .koko-page .primary-action {
    min-height: 52px;
  }

  .koko-page .progress-panel {
    right: 14px;
    bottom: 14px;
    left: 14px;
  }

  .koko-page.has-result > main > .result-intro {
    margin: 34px auto 22px;
  }

  .koko-page .result-workspace,
  .koko-page .batch-workspace {
    width: 100%;
    padding: 12px;
    border-radius: 15px;
  }

  .koko-page.has-result .result-workspace {
    margin-top: 124px;
  }

  .koko-page .result-workspace > .result-intro {
    top: -91px;
  }

  .koko-page .result-intro .headline-top { font-size: 44px; }
  .koko-page .result-intro .headline-gradient { font-size: 14px; }

  .koko-page .workspace-head.result-head {
    grid-template-columns: 92px minmax(0, 1fr) 92px;
    gap: 7px;
  }

  .koko-page .result-batch-button,
  .koko-page .result-head .back-button,
  .koko-page .inline-download {
    min-height: 44px;
    height: 44px;
    padding-inline: 8px;
    font-size: 12px;
  }

  .koko-page .inline-download { font-size: 13px; }

  .koko-page .result-display {
    grid-template-columns: 1fr;
  }

  .koko-page .compare-view {
    height: min(74vw, 420px);
    min-height: 280px;
  }

  .koko-page .background-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .koko-page .background-tabs .tool-label {
    grid-column: 1 / -1;
  }

  .koko-page .background-card {
    justify-content: center;
    min-height: 44px;
    padding-inline: 4px;
    font-size: 10px;
  }

  .koko-page .background-card .swatch { flex: 0 0 auto; }

  .koko-page .toolbar {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 8px;
  }

  .koko-page .tool-spacer { display: none; }

  .koko-page .range {
    flex: 1 1 150px;
    min-height: 44px;
  }

  .koko-page .range input {
    flex: 1 1 auto;
    width: auto;
  }

  .koko-page .panes { grid-template-columns: 1fr; }
}

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

  .koko-page button:hover,
  .koko-page a:hover {
    transform: none;
  }
}

/* Browser verification fixes: remove inherited slab decorations and keep the
   selected-image state inside the same glass frame as the empty state. */
.koko-page .upload-main::before,
.koko-page .upload-main::after {
  background: none !important;
  box-shadow: none !important;
}

@media (min-width: 701px) {
  .koko-page .start-screen {
    padding-top: 123px;
  }

  .koko-page .upload-card,
  .koko-page .upload-main {
    border-radius: 32px;
  }

  .koko-page .upload-main::after {
    border-radius: 31px;
  }

  .koko-page .upload-bottom {
    margin-top: -6px;
  }
}

.koko-page .upload-card.has-upload .upload-main {
  height: 422px !important;
  min-height: 422px !important;
  padding: 0 !important;
  overflow: hidden;
}

.koko-page .upload-card.has-upload .upload-preview {
  position: absolute !important;
  inset: 42px 28px !important;
  display: grid !important;
  align-items: center;
  justify-items: center;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
  background: transparent !important;
}

.koko-page .upload-card.has-upload .upload-preview img {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

@media (max-width: 700px) {
  .koko-page .upload-card,
  .koko-page .upload-main {
    border-radius: 24px;
  }

  .koko-page .upload-main::after {
    border-radius: 23px;
  }

  .koko-page .upload-card.has-upload .upload-main {
    height: clamp(330px, 108vw, 422px) !important;
    min-height: clamp(330px, 108vw, 422px) !important;
  }

  .koko-page .upload-card.has-upload .upload-preview {
    inset: 36px 16px !important;
  }
}

/* Keep DOM reading order on narrow screens as well as desktop. */
.koko-page .result-head > * { order: 0; }
.koko-page #uploadCount { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .koko-page .batch-current-track i,
  .koko-page .batch-current-track i::after,
  .koko-page .batch-item-download img { transition: none; animation: none; }
}
@media (max-width: 700px) {
  .koko-page #editStatus {
    flex: 1 0 100%;
    white-space: normal;
    line-height: 1.6;
    overflow-wrap: anywhere;
  }
}

/* v36 — The selected source must always be shown in full.  The preview is a
   fixed viewport; the image scales down proportionally instead of filling and
   cropping.  Clipping on both layers gives the visible image a consistent
   rounded mask without changing its aspect ratio. */
.koko-page .upload-card.has-upload .upload-preview {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  border-radius: 12px !important;
}

.koko-page .upload-card.has-upload .upload-preview-frame {
  display: block !important;
  width: var(--upload-preview-width, 100%);
  height: var(--upload-preview-height, 100%);
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto !important;
  overflow: hidden;
  border-radius: 12px !important;
  clip-path: inset(0 round 12px);
}

.koko-page .upload-card.has-upload .upload-preview-frame img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: 50% 50% !important;
  border-radius: 0 !important;
  clip-path: none !important;
}

/* v38 — edit directly on the large comparison result.  The divider keeps a
   44px drag target while the rest of the image remains available to the brush. */
.koko-page .compare-editor-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  transform: translate(calc(-50% + var(--image-pan-x)), calc(-50% + var(--image-pan-y))) scale(var(--image-zoom));
  transform-origin: 50% 50%;
  transition: transform .16s ease-out;
  touch-action: none;
  cursor: none;
}

.koko-page .image-zoom-control {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 34px;
  padding: 2px;
  border: 1px solid rgba(229, 233, 255, .30);
  border-radius: 999px;
  background: rgba(15, 18, 27, .82);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .10);
  backdrop-filter: blur(12px);
}

.koko-page .image-zoom-range {
  width: 104px;
  height: 30px;
  margin: 0 3px;
  padding: 0;
  accent-color: #aebcff;
  cursor: pointer;
}

.koko-page .image-zoom-range:focus-visible {
  outline: 2px solid #b8c6ff;
  outline-offset: 2px;
  border-radius: 999px;
}

.koko-page .image-pan-toggle {
  position: absolute;
  bottom: 44px;
  left: 12px;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border: 1px solid rgba(229, 233, 255, .28);
  border-radius: 9px;
  color: rgba(238, 241, 250, .78);
  background: rgba(15, 18, 27, .76);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .09);
  backdrop-filter: blur(12px);
}

.koko-page .image-pan-toggle:hover {
  border-color: rgba(219, 226, 255, .52);
  color: #fff;
  background: rgba(53, 58, 79, .88);
}

.koko-page .image-pan-toggle.active {
  border-color: rgba(191, 181, 255, .78);
  color: #fff;
  background: linear-gradient(135deg, rgba(87, 126, 201, .88), rgba(103, 76, 168, .92));
}

.koko-page .image-pan-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.koko-page .image-pan-toggle:focus-visible {
  outline: 2px solid #b8c6ff;
  outline-offset: 2px;
}

.koko-page .compare-view.is-pan-mode { cursor: grab; }
.koko-page .compare-view.is-pan-mode.is-zoomed { touch-action: none; }
.koko-page .compare-view.is-panning { cursor: grabbing; }
.koko-page .compare-view.is-pan-mode .compare-editor-canvas { cursor: grab; }
.koko-page .compare-view.is-panning .compare-editor-canvas { cursor: grabbing; }
.koko-page .compare-view.is-panning .compare-image,
.koko-page .compare-view.is-panning .compare-editor-canvas { transition: none; }

.koko-page .image-zoom-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border: 1px solid rgba(229, 233, 255, .26);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
  font-size: 16px;
  line-height: 1;
}

.koko-page .image-zoom-button:hover:not(:disabled) {
  border-color: rgba(219, 226, 255, .56);
  background: rgba(150, 164, 231, .28);
}

.koko-page .image-zoom-button.active {
  border-color: rgba(191, 181, 255, .78);
  color: #fff;
  background: linear-gradient(135deg, rgba(87, 126, 201, .82), rgba(103, 76, 168, .88));
}

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

.koko-page .image-zoom-button:focus-visible {
  outline: 2px solid #b8c6ff;
  outline-offset: 2px;
}

.koko-page .image-zoom-button:disabled {
  opacity: .42;
  cursor: default;
}

@media (max-width: 520px) {
  .koko-page .image-zoom-control {
    top: 8px;
    right: 8px;
    gap: 2px;
  }

  .koko-page .image-zoom-range { width: 74px; }
  .koko-page .image-pan-toggle { bottom: 42px; left: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .koko-page .compare-image,
  .koko-page .compare-clip .compare-image,
  .koko-page .compare-editor-canvas { transition: none; }
}

.koko-page .compare-range { pointer-events: none; }

.koko-page .compare-divider {
  z-index: 6;
  width: 44px;
  transform: translateX(-22px);
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
  touch-action: none;
  cursor: ew-resize;
}

.koko-page .compare-divider::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 21px;
  width: 2px;
  background: #bce9ff;
  box-shadow:
    0 0 0 1px rgba(22, 72, 126, .34),
    0 0 6px rgba(73, 174, 255, .95),
    0 0 16px rgba(58, 142, 255, .72);
}

.koko-page .compare-divider::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 22px;
  z-index: 1;
  width: 52px;
  background: linear-gradient(90deg, rgba(78, 178, 255, .72), rgba(62, 129, 255, .24) 42%, rgba(62, 129, 255, 0));
  filter: blur(5px);
  pointer-events: none;
}

.koko-page .compare-divider::before { z-index: 2; }
.koko-page .compare-divider span {
  z-index: 3;
  width: 26px;
  height: 42px;
  border: 1px solid rgba(35, 38, 47, .14);
  border-radius: 9px;
  color: #292c34;
  background: rgba(250, 250, 252, .96);
  box-shadow: 0 5px 16px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .86);
  font-size: 12px;
  font-weight: 700;
}

.koko-page .result-preview-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  width: min(100%, 860px);
  margin: 0 auto;
}

.koko-page .upscale-preview-pane {
  border-color: rgba(174, 184, 255, .34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 0 1px rgba(123, 107, 214, .08);
}

.koko-page .preview-result-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 2;
  max-width: calc(100% - 14px);
  padding: 4px 7px;
  overflow: hidden;
  border: 1px solid rgba(229, 233, 255, .26);
  border-radius: 6px;
  color: #fff;
  background: rgba(30, 26, 54, .82);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .22);
  font-size: 10px;
  font-weight: 680;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.koko-page .result-preview-workspace {
  width: 100%;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(213, 220, 244, .13);
  border-radius: 14px;
  background: #30333a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 10px 30px rgba(0, 0, 0, .14);
}

.koko-page .preview-pane {
  position: relative;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(213, 220, 244, .13);
  border-radius: 12px;
  background: rgba(10, 13, 19, .46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  cursor: zoom-in;
  transform: none;
}

.koko-page .preview-pane:hover {
  border-color: rgba(190, 196, 230, .32);
  transform: translateY(-1px);
}

.koko-page .mini-result {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}

.koko-page .mini-result img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.koko-page .original-mini { background: #34363b; }
.koko-page .preview-green { background: #54ed00; }
.koko-page .preview-black { background: #08090b; }
.koko-page .preview-white { background: #fff; }

.koko-page .result-preview-dialog {
  width: min(1120px, 92vw);
  max-width: none;
  height: min(820px, 88vh);
  max-height: none;
  padding: 42px 18px 18px;
  overflow: hidden;
  border: 1px solid rgba(220, 225, 248, .20);
  border-radius: 18px;
  color: #fff;
  background: #202329;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .60), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.koko-page .result-preview-dialog::backdrop {
  background: rgba(4, 6, 10, .76);
  backdrop-filter: blur(5px);
}

.koko-page .result-hover-preview {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 40;
  width: min(780px, 76vw);
  height: min(580px, 72vh);
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(220, 225, 248, .20);
  border-radius: 17px;
  background: #202329;
  box-shadow: 0 26px 76px rgba(0, 0, 0, .52), inset 0 1px 0 rgba(255, 255, 255, .06);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -48%) scale(.96);
  transition: opacity .14s ease, transform .14s ease, visibility 0s linear .14s;
  pointer-events: none;
}

.koko-page .result-hover-preview.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
  transition-delay: 0s;
}

.koko-page .result-preview-close {
  position: absolute;
  top: 8px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border: 1px solid rgba(229, 233, 255, .20);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .10);
  font-size: 20px;
  line-height: 1;
}

.koko-page .result-preview-stage {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
}

.koko-page .result-preview-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.koko-page .result-preview-dialog .result-preview-stage {
  display: block;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
  overscroll-behavior: contain;
  cursor: grab;
  touch-action: pan-x pan-y;
}

.koko-page .result-preview-dialog .result-preview-stage.is-grabbing {
  cursor: grabbing;
  user-select: none;
}

.koko-page .result-preview-dialog .result-preview-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: auto;
  object-fit: none;
  user-select: none;
  -webkit-user-drag: none;
}

@media (max-width: 700px) {
  .koko-page .result-preview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .koko-page .result-preview-workspace { padding: 8px; }
  .koko-page .result-preview-dialog { width: 96vw; height: 82vh; padding: 40px 10px 10px; }
}

@media (hover: none), (pointer: coarse) {
  .koko-page .result-hover-preview { display: none; }
}

/* Illustrator-approved KOKO mark. The header uses one mark plus the KOKOCUT wordmark;
   the hero and result view use one standalone mark above the descriptor. */
.koko-page .brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.koko-page .brand-mark {
  display: block;
  width: 31px;
  height: 33px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.koko-page .brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.koko-page .brand strong {
  color: #f6f7fb;
  font-size: 17px;
  font-weight: 760;
  letter-spacing: .055em;
  line-height: 1;
}

.koko-page .headline-symbols {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 92px;
  margin: 0 auto;
}

.koko-page .headline-symbols img {
  display: block;
  width: auto;
  height: 100%;
  flex: 0 0 auto;
}

.koko-page .product-intro .headline-gradient {
  padding-top: 8px;
  color: rgba(217, 220, 232, .68);
  font-size: clamp(12px, 1.2vw, 15px);
  font-weight: 560;
  letter-spacing: .08em;
}

.koko-page .result-intro .headline-symbols {
  height: 70px;
  gap: 5px;
}

.koko-page .result-intro .headline-gradient {
  padding-top: 5px;
  color: rgba(217, 220, 232, .64);
  font-size: clamp(11px, 1.05vw, 14px);
  font-weight: 560;
  letter-spacing: .07em;
}

@media (max-width: 700px) {
  .koko-page .brand-mark {
    width: 28px;
    height: 30px;
  }

  .koko-page .brand strong {
    font-size: 15px;
  }

  .koko-page .headline-symbols {
    height: 78px;
    gap: 5px;
  }

  .koko-page .product-intro .headline-gradient {
    padding-top: 7px;
    font-size: 12px;
  }

  .koko-page .result-intro .headline-symbols {
    height: 58px;
    gap: 4px;
  }

  .koko-page .result-intro .headline-gradient {
    padding-top: 4px;
    font-size: 11px;
  }
}

/* v44 — demo account console replaces the standalone result-page mark.
   It is intentionally presentation-only until real authentication exists. */
.koko-page .result-account {
  position: relative;
  z-index: 18;
  flex: 0 1 278px;
  min-width: 0;
}

.koko-page .result-account-trigger {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-width: 238px;
  height: 48px;
  padding: 5px 9px 5px 6px;
  border: 1px solid rgba(220, 227, 255, .19);
  border-radius: 14px;
  color: #f3f5fb;
  background: linear-gradient(120deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .045));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 7px 20px rgba(0, 0, 0, .13);
  text-align: left;
}

.koko-page .result-account-trigger:hover,
.koko-page .result-account-trigger:focus-visible,
.koko-page .result-account-trigger[aria-expanded="true"] {
  border-color: rgba(191, 202, 255, .42);
  background: linear-gradient(120deg, rgba(137, 155, 218, .16), rgba(120, 92, 177, .11));
}

.koko-page .result-account-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border: 1px solid rgba(222, 229, 255, .35);
  border-radius: 50%;
  color: #f6f7ff;
  background: linear-gradient(145deg, #7391d6, #7453a8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 4px 12px rgba(25, 22, 58, .28);
}

.koko-page .result-account-avatar svg {
  width: 29px;
  height: 29px;
  overflow: visible;
  fill: rgba(255, 255, 255, .18);
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
}

.koko-page .result-account-avatar.large {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
}

.koko-page .result-account-identity,
.koko-page .result-account-balance {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.koko-page .result-account-identity strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.koko-page .result-account-identity small,
.koko-page .result-account-balance small {
  color: #aeb5c6;
  font-size: 9px;
  line-height: 1.25;
  letter-spacing: .02em;
}

.koko-page .result-account-balance {
  align-items: flex-end;
  padding-left: 8px;
  border-left: 1px solid rgba(224, 229, 255, .14);
}

.koko-page .result-account-balance strong {
  color: #cdd7ff;
  font-size: 12px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.koko-page .result-account-chevron {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #9fa7b8;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.koko-page .result-account-trigger[aria-expanded="true"] .result-account-chevron {
  transform: rotate(180deg);
}

.koko-page .result-account-panel {
  position: absolute;
  top: calc(100% + 9px);
  left: 0;
  width: min(306px, calc(100vw - 42px));
  padding: 14px;
  border: 1px solid rgba(214, 222, 255, .22);
  border-radius: 15px;
  color: #f1f3f9;
  background: rgba(24, 28, 38, .97);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(22px) saturate(130%);
}

.koko-page .result-account-panel[hidden] { display: none; }

.koko-page .result-account-panel-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(220, 227, 255, .12);
}

.koko-page .result-account-panel-head > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.koko-page .result-account-panel-head strong { font-size: 14px; }
.koko-page .result-account-panel-head small { color: #aeb5c5; font-size: 10px; }

.koko-page .result-account-facts {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.koko-page .result-account-facts > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.koko-page .result-account-facts dt { color: #aeb5c5; font-size: 11px; }
.koko-page .result-account-facts dd { margin: 0; color: #edf0fb; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.koko-page .result-account-panel p { margin: 0 0 11px; color: #9098aa; font-size: 10px; line-height: 1.5; }

.koko-page .result-account-login {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(218, 224, 249, .13);
  border-radius: 9px;
  color: #858c9c;
  background: rgba(255, 255, 255, .045);
  font-size: 11px;
  cursor: not-allowed;
}

@media (max-width: 700px) {
  .koko-page .workspace-head.result-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .koko-page .result-account {
    width: min(278px, 100%);
  }

  .koko-page .result-account-trigger {
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .koko-page .result-account { width: 100%; }
  .koko-page .result-account-panel { width: 100%; }
}

/* v40 — lift every result-page control one visual level while preserving the
   hierarchy: download stays primary, selected choices stay unmistakable, and
   disabled actions remain visibly unavailable. */
.koko-page .result-workspace {
  --result-control-surface: rgba(255, 255, 255, .105);
  --result-control-hover: rgba(255, 255, 255, .155);
  --result-control-border: rgba(227, 232, 255, .27);
  --result-control-text: #f5f6fb;
}

.koko-page .result-batch-button,
.koko-page .result-head .back-button,
.koko-page .background-card,
.koko-page .toolbar .quiet {
  color: var(--result-control-text);
  border-color: var(--result-control-border);
  background: var(--result-control-surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    0 3px 12px rgba(0, 0, 0, .12);
}

.koko-page .result-head .inline-download {
  color: #fff;
  border-color: rgba(229, 232, 255, .34);
  background: linear-gradient(100deg, rgba(106, 145, 218, .72), rgba(112, 90, 179, .72));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    0 4px 16px rgba(36, 29, 78, .20);
}

.koko-page .result-batch-button:hover,
.koko-page .result-head .back-button:hover,
.koko-page .background-card:hover,
.koko-page .toolbar .quiet:hover:not(:disabled) {
  color: #fff;
  border-color: rgba(218, 226, 255, .44);
  background: var(--result-control-hover);
}

.koko-page .result-head .inline-download:hover {
  border-color: rgba(232, 235, 255, .50);
  background: linear-gradient(100deg, rgba(116, 157, 232, .82), rgba(125, 100, 195, .82));
}

.koko-page .edit-history-actions {
  display: grid;
  grid-template-columns: repeat(2, 64px);
  gap: 8px;
  flex: 0 0 auto;
}

.koko-page .edit-history-actions .quiet {
  width: 64px;
  min-height: 36px;
  padding-inline: 10px;
}

@media (max-width: 700px), (pointer: coarse) {
  .koko-page .edit-history-actions .quiet { min-height: 44px; }
}

.koko-page .background-card.selected {
  color: #fff;
  border-color: rgba(188, 201, 255, .92);
  background: rgba(137, 146, 218, .18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .15),
    0 0 0 1px rgba(129, 145, 224, .18),
    0 5px 16px rgba(33, 29, 68, .16);
}

.koko-page .segmented {
  border: 1px solid rgba(227, 232, 255, .16);
  background: rgba(255, 255, 255, .10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.koko-page .segmented .mode {
  color: #e2e5ef;
  background: rgba(255, 255, 255, .025);
}

.koko-page .segmented .mode:hover {
  color: #fff;
  background: rgba(255, 255, 255, .10);
}

.koko-page .segmented .active.keep {
  color: #8ff4bc;
  background: rgba(38, 152, 100, .38);
}

.koko-page .segmented .active.erase {
  color: #ffb1b7;
  background: rgba(178, 62, 75, .38);
}

/* v41 — compact background swatches and a deliberately small preview strip.
   Hover preview requires a short dwell in app.js so passing over the strip does
   not cover the editor with a large image. */
.koko-page .result-display {
  grid-template-columns: minmax(0, 1fr) 56px;
  gap: 10px;
}

.koko-page .background-tabs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.koko-page .background-card {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 11px;
}

.koko-page .background-card .swatch {
  display: block;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
}

.koko-page .background-card .swatch.checker {
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}

.koko-page .result-preview-workspace {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 11px;
}

.koko-page .result-preview-grid {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.koko-page .preview-pane {
  flex: 0 0 82px;
  width: 82px;
  height: 56px;
  border-radius: 9px;
}

.koko-page .preview-pane:hover {
  transform: translateY(-1px);
}

.koko-page .mini-result {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  box-sizing: border-box;
  padding: 4px;
}

/* The compact result strip is a fit preview, not a crop thumbnail. Keep the
   outer tiles uniform while allowing every source aspect ratio to scale down
   inside the available rectangle. */
.koko-page .mini-result img {
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: 50% 50%;
}

.koko-page .preview-result-badge {
  top: 4px;
  left: 4px;
  max-width: calc(100% - 8px);
  padding: 3px 5px;
  font-size: 8px;
}

@media (max-width: 700px) {
  .koko-page .result-display { grid-template-columns: 1fr; }

  .koko-page .background-tabs {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
  }

  .koko-page .background-card {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .koko-page .result-preview-workspace { padding: 7px; }
  .koko-page .result-preview-grid { justify-content: flex-start; gap: 7px; }
  .koko-page .preview-pane { flex-basis: 68px; width: 68px; height: 48px; }
}

.koko-page .result-workspace button:disabled {
  opacity: .5;
}

/* Touch layouts intentionally provide the automatic result workflow only.
   Fine brush editing remains a desktop feature; previews, download, upscale,
   background checks and image panning stay available on mobile. */
@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  .koko-page .editor-details > .toolbar {
    display: flex !important;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    justify-content: flex-end;
  }

  .koko-page .editor-details > .toolbar > :not(.toolbar-upscale-button):not(#upscaleHint) {
    display: none !important;
  }

  .koko-page .toolbar-upscale-button {
    width: 100%;
    min-height: 44px;
    height: 44px;
  }
}

/* Result feedback stays visible without competing with the finished image.
   Processing progress keeps its dedicated panel; post-result messages become
   a single unobtrusive line in the lower-right viewport corner. */
.koko-page.has-result #status {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  left: auto;
  z-index: 40;
  width: auto;
  max-width: min(520px, calc(100vw - 36px));
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: rgba(206, 211, 225, .78);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  font-size: 11px;
  line-height: 1.45;
  text-align: right;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .88);
  pointer-events: none;
}

.koko-page.has-result #status.error {
  color: #ffb8bf;
  border: 0;
  background: transparent;
}

@media (max-width: 700px) {
  .koko-page.has-result #status {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
    font-size: 10px;
  }
}

/* Batch upload is intentionally a short choice instead of an ambiguous file
   picker: browsers expose multi-file and folder selection as separate native
   modes. */
.koko-page .batch-picker-dialog {
  width: min(520px, calc(100vw - 28px));
  margin: auto;
  padding: 26px;
  border: 1px solid rgba(219, 226, 255, .24);
  border-radius: 18px;
  color: #eef1f8;
  background: linear-gradient(145deg, rgba(35, 40, 52, .98), rgba(15, 18, 25, .98));
  box-shadow: 0 30px 90px rgba(0, 0, 0, .62), inset 0 1px 0 rgba(255, 255, 255, .10);
}

.koko-page .batch-picker-dialog::backdrop {
  background: rgba(2, 4, 8, .76);
  backdrop-filter: blur(8px);
}

.koko-page .batch-picker-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 9px;
  color: #dfe3ee;
  background: rgba(255, 255, 255, .06);
  font-size: 22px;
  line-height: 1;
}

.koko-page .batch-picker-copy { padding-right: 30px; }
.koko-page .batch-picker-copy h2 { margin: 0; font-size: 24px; }

.koko-page .batch-picker-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
}

.koko-page .batch-picker-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 68px;
  padding: 16px 18px;
  border: 1px solid rgba(220, 227, 255, .18);
  border-radius: 13px;
  color: #f2f4fa;
  background: rgba(255, 255, 255, .065);
  text-align: left;
}

.koko-page .batch-import-control {
  position: relative;
  min-width: 0;
}

.koko-page .batch-picker-option > span {
  color: #aeb5c5;
  font-size: 18px;
  line-height: 1;
}

.koko-page .batch-picker-option.is-selected {
  border-color: rgba(156, 180, 255, .52);
  background: rgba(117, 123, 198, .18);
}

.koko-page .batch-import-menu {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  z-index: 4;
  display: grid;
  width: 100%;
  padding: 6px;
  border: 1px solid rgba(220, 227, 255, .20);
  border-radius: 12px;
  background: rgba(27, 31, 41, .98);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .07);
}

.koko-page .batch-import-menu[hidden] { display: none; }

.koko-page .batch-import-choice {
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: #edf0f7;
  background: transparent;
  text-align: left;
  font-size: 14px;
}

.koko-page .batch-import-choice:hover,
.koko-page .batch-import-choice:focus-visible {
  background: rgba(137, 145, 211, .18);
}

.koko-page .batch-picker-option:hover,
.koko-page .batch-picker-option:focus-visible {
  border-color: rgba(191, 202, 255, .46);
  background: rgba(133, 127, 211, .18);
}

.koko-page .batch-picker-option strong { font-size: 16px; }

@media (max-width: 560px) {
  .koko-page .batch-picker-dialog { padding: 22px 18px; }
  .koko-page .batch-picker-actions { grid-template-columns: 1fr; }
  .koko-page .batch-picker-option { min-height: 62px; }
}

/* v42 — result actions follow one compact header row: standalone mark on the
   left, three equal actions on the right. Batch upload remains home-only. */
.koko-page .workspace-head.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 48px;
  margin-bottom: 16px;
}

.koko-page .result-head-logo {
  display: block;
  width: 42px;
  height: 46px;
  flex: 0 0 auto;
  object-fit: contain;
}

.koko-page .result-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.koko-page .result-head-actions .result-head-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 118px;
  width: 118px;
  min-width: 118px;
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(227, 232, 255, .24);
  border-radius: 10px;
  color: #f2f4fa;
  background: rgba(255, 255, 255, .09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .11), 0 3px 12px rgba(0, 0, 0, .12);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  order: 0;
}

.koko-page .result-head-actions .inline-download {
  color: #fff;
  border-color: rgba(229, 232, 255, .34);
  background: linear-gradient(100deg, rgba(106, 145, 218, .82), rgba(112, 90, 179, .82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 4px 16px rgba(36, 29, 78, .20);
}

.koko-page .result-head-actions .upscale-button,
.koko-page .result-head-actions .back-button {
  color: #eef0f6;
  background: rgba(255, 255, 255, .09);
}

.koko-page .result-head-actions .result-head-action:hover:not(:disabled) {
  border-color: rgba(218, 226, 255, .43);
  background: rgba(255, 255, 255, .14);
}

.koko-page .result-head-actions .inline-download:hover {
  background: linear-gradient(100deg, rgba(116, 157, 232, .92), rgba(125, 100, 195, .92));
}

@media (max-width: 700px) {
  .koko-page .workspace-head.result-head {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
  }

  .koko-page .result-head-logo {
    width: 36px;
    height: 40px;
  }

  .koko-page .result-head-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    min-width: 0;
    margin-left: 0;
  }

  .koko-page .result-head-actions .result-head-action {
    width: 100%;
    min-width: 0;
    height: 44px;
    min-height: 44px;
    padding-inline: 6px;
    font-size: 11px;
  }

  .koko-page .editor-details > .toolbar {
    display: none !important;
  }
}

/* v43 — make the top-right canvas zoom control visually secondary. */
.koko-page .image-zoom-control {
  top: 10px;
  right: 10px;
  gap: 2px;
  min-height: 28px;
  padding: 1px;
}

.koko-page .image-zoom-range {
  width: 76px;
  height: 24px;
  margin: 0 2px;
}

.koko-page .image-zoom-button {
  width: 24px;
  height: 24px;
  min-width: 24px;
  font-size: 14px;
}

@media (max-width: 520px) {
  .koko-page .image-zoom-control {
    top: 8px;
    right: 8px;
    min-height: 32px;
  }

  .koko-page .image-zoom-range { width: 58px; }

  .koko-page .image-zoom-button {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }
}
