/* Keep preview controls easy to tap without changing the canvas or icon sizes. */
.preview-toolbar .zoom-controls { gap: 4px; flex-shrink: 0; }
.preview-toolbar .zoom-controls .icon-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
  border-radius: 8px;
}
.preview-toolbar .zoom-controls .icon-button:focus-visible {
  outline: 2px solid #9cdef5;
  outline-offset: 2px;
}
.integration-nav { margin-inline-start: auto; display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.1rem; font-family: sans-serif; font-size: .75rem; }
.integration-nav a, .integration-footer a { color: #b8d7c5; text-decoration: underline; text-underline-offset: .25em; }
.integration-nav a:focus-visible, .integration-footer :focus-visible { outline: 2px solid #b8d7c5; outline-offset: 5px; }
.integration-beta { border: 1px solid #597768; border-radius: 2px; padding: .2rem .45rem; color: #c5ddce; }
.integration-footer { padding-block: 1.5rem 2rem; color: #c5cdca; font-family: sans-serif; font-size: .75rem; line-height: 1.9; }
.integration-footer details { border-block-start: 1px solid #384440; padding-block-start: 1rem; }
.integration-footer summary { cursor: pointer; width: fit-content; color: #d5ded9; }
.integration-footer p { max-width: 75rem; }
.integration-skip { position: fixed; top: -6rem; left: 1rem; z-index: 100; padding: .75rem; background: #edf4ee; color: #12251b; }
.integration-skip:focus { top: .5rem; }
.integration-notice { padding: 1rem; border: 1px solid #a9b388; }
@media (max-width: 600px) { .header-inner { flex-wrap: wrap; gap: .6rem; } .integration-nav { margin-inline-start: 0; width: 100%; } }

/* Native popup menus need an explicit foreground/background pair on Windows. */
.export-select #exportFormat {
  color-scheme: dark;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 30px 8px 12px;
  background-color: var(--input);
  color: var(--ink);
  font-family: "MC Canvas UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

.export-select > .icon {
  right: 12px;
}

.drop-zone {
  border-radius: 14px;
}

#exportFormat option {
  background-color: var(--input);
  color: var(--ink);
}

#exportFormat option:checked {
  background-color: var(--accent-fill);
  color: var(--accent-ink);
}

/* Match the homepage's rounded glass language/theme pickers. */
.export-picker__trigger {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 8px 30px 8px 12px;
  border: 1px solid #ffffff24;
  border-radius: 14px;
  background: #ffffff04;
  color: #edf3f1;
  font-family: "MC Canvas UI", sans-serif;
  font-size: 14px;
  text-align: left;
  letter-spacing: 0;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.export-picker__trigger[aria-expanded="true"] {
  border-color: #ffffff52;
  background: #ffffff0d;
}
.export-picker__trigger:focus-visible {
  outline: 2px solid #9cdef5;
  outline-offset: 3px;
}
.export-select--open > .icon { transform: translateY(-50%) rotate(-90deg); }
.export-picker__menu {
  position: fixed;
  inset: auto;
  z-index: 1000;
  box-sizing: border-box;
  margin: 0;
  padding: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #ffffff26;
  border-radius: 14px;
  background: #14191bf5;
  color: #edf3f1;
  font-family: "MC Canvas UI", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-backdrop-filter: blur(18px) saturate(115%);
  backdrop-filter: blur(18px) saturate(115%);
  box-shadow: 0 14px 36px #0000003d, inset 0 1px 0 #ffffff08;
}
.export-picker__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #edf3f1;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.export-picker__option[aria-selected="true"] { background: #ffffff0f; color: #fff; }
.export-picker__option::after { content: "✓"; color: #9cdef5; opacity: 0; }
.export-picker__option[aria-selected="true"]::after { opacity: 1; }
.export-picker__option.is-active { border-color: #ffffff38; background: #ffffff12; }
@media (hover: none), (pointer: coarse) {
  .export-picker__option { min-height: 44px; }
}
@media (hover: hover) and (pointer: fine) {
  .export-picker__trigger:hover { border-color: #ffffff52; background: #ffffff0d; }
  .export-picker__option:hover { border-color: #ffffff38; background: #ffffff17; }
}
@media (prefers-reduced-motion: reduce) {
  .export-picker__trigger, .export-picker__option { transition: none; }
}
@media (forced-colors: active) {
  .export-select #exportFormat,
  #exportFormat option,
  .export-picker__trigger,
  .export-picker__menu,
  .export-picker__option {
    background-color: Canvas;
    color: CanvasText;
  }

  #exportFormat option:checked,
  .export-picker__option[aria-selected="true"] {
    background-color: Highlight;
    color: HighlightText;
  }
  .export-picker__option.is-active { outline: 1px solid Highlight; outline-offset: -2px; }
  .export-picker__option::after { color: currentColor; }
}

/* Keep hover feedback separate from the persistent selected state. */
.view-tabs button,
.setting-choices button {
  transition: color 180ms ease, background-color 180ms ease,
    box-shadow 180ms ease, transform 180ms ease;
}

.view-tabs button[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1px #6bcab238;
}

.view-tabs button:enabled:focus-visible,
.setting-choices button:enabled:focus-visible {
  background-color: var(--raised);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px #6bcab259;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.view-tabs button[aria-pressed="true"]:focus-visible {
  background-color: var(--accent-soft);
  color: var(--accent);
}

@media (hover: hover) and (pointer: fine) {
  .view-tabs button:enabled:hover,
  .setting-choices button:enabled:hover {
    background-color: var(--raised);
    color: var(--ink);
    box-shadow: inset 0 0 0 1px #6bcab259, 0 3px 8px #00000026;
    transform: translateY(-1px);
  }

  .view-tabs button[aria-pressed="true"]:enabled:hover,
  .setting-choices button[aria-pressed="true"]:enabled:hover {
    background-color: #29473f;
    color: var(--accent);
    box-shadow: inset 0 0 0 1px #6bcab285, 0 3px 8px #00000026;
  }
}

.view-tabs button:enabled:active,
.setting-choices button:enabled:active {
  transform: translateY(0) scale(.98);
  transition-duration: 80ms;
}

@media (prefers-reduced-motion: reduce) {
  .view-tabs button,
  .setting-choices button {
    transition: none !important;
    transform: none !important;
  }
}

.share-button { min-height: 38px; padding: .5rem .75rem; border: 1px solid #526a60; border-radius: 7px; color: #d5eee2; background: #20312b; }
.share-button:enabled:hover { background: #2b4539; }
.share-dialog { width: min(36rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; padding: 1.5rem; border: 1px solid #526a60; border-radius: 12px; color: #edf3f1; background: #1a2023; font-family: "MC Canvas UI", sans-serif; font-size: 14px; line-height: 1.8; }
.share-dialog::backdrop { background: #000a; }
.share-dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.share-dialog-heading h2 { font: inherit; font-size: 1.125rem; font-weight: 600; }
.share-dialog p { margin-block: 1rem; }
.share-consent { display: flex; align-items: flex-start; gap: .75rem; margin-block: 1rem; }
.share-consent input { margin-top: .4rem; }
.share-copy-row { display: flex; align-items: stretch; gap: .5rem; margin-block: .5rem 1rem; }
.share-copy-row input { width: 100%; min-width: 0; border: 1px solid #526a60; border-radius: 4px; padding: .5rem; background: #111719; color: #edf3f1; font: inherit; font-size: .75rem; }
.share-dialog details { padding-top: 1rem; border-top: 1px solid #526a60; }
.share-dialog summary { text-decoration: underline; text-underline-offset: .2em; }
.share-status { min-height: 1.8em; overflow-wrap: anywhere; }
.share-delete { margin-block: .5rem; color: #ffc9bf; border-color: #9e6c60; }

.image-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.image-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 7px 11px; border: 1px solid #ffffff26; border-radius: 12px; background: #ffffff05; color: #edf3f1; font-family: "MC Canvas UI", sans-serif; font-size: 12px; line-height: 1.5; letter-spacing: 0; }
.image-action:enabled:hover { background: #ffffff10; border-color: #ffffff52; }
.image-action:focus-visible { outline: 2px solid #9cdef5; outline-offset: 3px; }
.export-actions { display: grid; gap: 8px; }
.copy-image { width: 100%; min-height: 38px; }
.crop-dialog { width: min(60rem, calc(100% - 24px)); max-height: calc(100dvh - 24px); margin: auto; padding: 20px; overflow-y: auto; border: 1px solid #ffffff26; border-radius: 16px; background: #14191b; color: #edf3f1; font-family: "MC Canvas UI", sans-serif; font-size: 14px; line-height: 1.7; letter-spacing: 0; }
.crop-dialog::backdrop { background: #000b; }
.crop-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.crop-dialog-heading h2 { font-size: 19px; font-weight: 500; }
.crop-dialog > p { margin-block: 10px 16px; color: #bbc9c4; }
.crop-viewport { display: flex; align-items: center; justify-content: center; height: clamp(180px, 46dvh, 520px); padding: 12px; overflow: hidden; border: 1px solid #ffffff1f; border-radius: 12px; background: repeating-conic-gradient(#1c2528 0% 25%, #111719 0% 50%) 0 0 / 18px 18px; }
.crop-stage { position: relative; flex-shrink: 0; overflow: hidden; touch-action: none; user-select: none; cursor: crosshair; }
.crop-stage canvas { display: block; width: 100%; height: 100%; pointer-events: none; }
.crop-selection { position: absolute; border: 2px solid #8cdfc8; box-shadow: 0 0 0 9999px #0009; cursor: move; }
.crop-selection::before, .crop-selection::after { position: absolute; inset: 0; pointer-events: none; content: ""; }
.crop-selection::before { inset-inline: 33.333%; border-inline: 1px solid #ffffff55; }
.crop-selection::after { inset-block: 33.333%; border-block: 1px solid #ffffff55; }
.crop-selection:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.crop-handle { position: absolute; z-index: 1; width: 28px; height: 28px; padding: 0; }
.crop-handle::after { position: absolute; inset: 7px; border: 1px solid #0b2520; border-radius: 3px; background: #b7f0df; content: ""; }
.crop-handle[data-crop-corner="nw"] { top: 0; left: 0; cursor: nwse-resize; }
.crop-handle[data-crop-corner="ne"] { top: 0; right: 0; cursor: nesw-resize; }
.crop-handle[data-crop-corner="sw"] { bottom: 0; left: 0; cursor: nesw-resize; }
.crop-handle[data-crop-corner="se"] { bottom: 0; right: 0; cursor: nwse-resize; }
.crop-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.crop-fields label { display: grid; gap: 5px; font-size: 12px; color: #bbc9c4; }
.crop-fields input { width: 100%; min-height: 40px; border: 1px solid #ffffff26; border-radius: 8px; padding: 8px 10px; background: #111719; color: #edf3f1; font: inherit; font-size: 14px; }
.crop-status { min-height: 1.7em; font-size: 12px; }
.local-brush-toolbar, .local-brush-modes, .local-brush-history { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.local-brush-toolbar { justify-content: space-between; margin-bottom: 12px; }
.local-brush-modes { gap: 3px; padding: 4px; border: 1px solid #ffffff1f; border-radius: 14px; background: #ffffff04; }
.local-brush-modes .image-action { min-width: 104px; border-color: transparent; background: transparent; }
.local-brush-modes .image-action[aria-pressed="true"] { border-color: #8cdfc855; background: #8cdfc818; color: #b7f0df; }
.local-brush-modes .image-action span { font-size: 17px; line-height: 1; }
.local-brush-stage { cursor: none; }
.local-brush-stage.is-before { cursor: default; }
.local-brush-stage:focus-visible { outline: 2px solid #9cdef5; outline-offset: -2px; }
.local-brush-cursor { position: absolute; transform: translate(-50%, -50%); border: 1px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #000b, inset 0 0 0 1px #0007; pointer-events: none; }
.local-brush-cursor::after { content: "−"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #fff; text-shadow: 0 1px 3px #000, 0 -1px 3px #000; font-size: 16px; line-height: 1; }
.local-brush-cursor[data-mode="light"]::after { content: "+"; }
.local-light-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.local-light-controls .range-label { color: #d2dfd9; font-size: 13px; }
.local-light-controls input { min-height: 32px; }
.crop-dialog > .local-keyboard-help { margin-block: 8px; color: #a8b9b1; font-size: 11px; }
.local-brush-history { margin-block: 12px 16px; }
.local-brush-footer { padding-top: 16px; border-top: 1px solid #ffffff1f; }
.local-brush-footer > span { color: #bbc9c4; font-size: 12px; }
.crop-actions, .crop-actions > div { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.crop-actions button { min-height: 42px; }
@media (max-width: 600px) {
  .crop-dialog { padding: 14px; }
  .local-light-controls { grid-template-columns: 1fr; gap: 10px; }
  .crop-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .crop-actions > div { width: 100%; }
  .crop-actions .primary-button { flex: 1; }
}
@media (hover: none), (pointer: coarse) {
  .image-action { min-height: 44px; }
  .crop-handle { width: 36px; height: 36px; }
}
@media (forced-colors: active) {
  .image-action, .crop-dialog, .crop-fields input { border-color: ButtonText; background: Canvas; color: CanvasText; }
  .local-brush-modes .image-action { border-color: ButtonText; }
  .local-brush-modes .image-action[aria-pressed="true"] { border-color: Highlight; background: Highlight; color: HighlightText; }
  .local-brush-cursor { border-color: Highlight; }
  .crop-selection { border-color: Highlight; }
}
.integration-privacy { width: min(54rem, calc(100% - 2rem)); margin: 2rem auto; font-family: sans-serif; font-size: 1rem; line-height: 1.9; }
.integration-privacy h1 { font-size: 1.7rem; }.integration-privacy h2 { margin-top: 2rem; font-size: 1.2rem; }.integration-privacy p { margin-block: 1rem; }
