/*
 * Compact surface: phones, tablets, the forced phone mode and every fullscreen preview.
 * Scoped by body[data-surface="compact"] (set in ui/layout.js). :where() keeps the scope at zero
 * specificity, so the order inside this file decides, exactly as before.
 */
@layer component {
  :root {
    --tray-visual-control: 26px;
    --tray-touch-padding: 9px;
    --tray-row: 44px;
    --tray-gap: 4px;
    --tray-desk-row: 36px;
    --tray-desk-margin: 5px;
  }
  :where(body[data-surface=compact])[data-input=mouse] {
    --tray-touch-padding: 4px;
    --tray-row: 34px;
    --tray-desk-row: 30px;
    --tray-desk-margin: 2px;
  }
  :where(body[data-surface=compact]) .fullscreen-button,
  :where(body[data-surface=compact]) .fullscreen-save-button,
  :where(body[data-surface=compact]) .fullscreen-adjust-button {
    position: absolute;
    z-index: 3;
    min-height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 999px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .2);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .01em;
    cursor: pointer;
    transition:
      transform .16s,
      background .16s,
      box-shadow .16s;
  }
  :where(body[data-surface=compact]) .fullscreen-button:hover,
  :where(body[data-surface=compact]) .fullscreen-save-button:hover,
  :where(body[data-surface=compact]) .fullscreen-adjust-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .25);
  }
  :where(body[data-surface=compact]) .fullscreen-button svg,
  :where(body[data-surface=compact]) .fullscreen-save-button svg,
  :where(body[data-surface=compact]) .fullscreen-adjust-button svg {
    width: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  :where(body[data-surface=compact]) .fullscreen-button[hidden],
  :where(body[data-surface=compact]) .fullscreen-save-button[hidden],
  :where(body[data-surface=compact]) .fullscreen-adjust-button[hidden] {
    display: none;
  }
  :where(body[data-surface=compact]) .fullscreen-adjust-button {
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, .28);
    color: #fff;
    background: rgba(27, 27, 26, .62);
    display: none;
  }
  :where(body[data-surface=compact]).preview-fullscreen .fullscreen-button svg,
  :where(body[data-surface=compact]).preview-fullscreen .fullscreen-save-button svg,
  :where(body[data-surface=compact]).preview-fullscreen .fullscreen-adjust-button svg {
    width: 14px;
  }
  :where(body[data-surface=compact]).preview-fullscreen .fullscreen-adjust-button:hover {
    transform: translateX(-50%) translateY(-1px);
  }
  :where(body[data-surface=compact]) .clear-cache-button {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 0 8px;
    border: 0;
    border-radius: 7px;
    color: var(--muted);
    background: rgba(255, 255, 255, .7);
    font-size: 9px;
    cursor: pointer;
  }
  :where(body[data-surface=compact]) .clear-cache-button:hover {
    color: var(--ink);
    background: #fff;
  }
  :where(body[data-surface=compact]) .clear-cache-button:disabled {
    opacity: .45;
    cursor: wait;
  }
  :where(body[data-surface=compact]).preview-fullscreen .fullscreen-button::before,
  :where(body[data-surface=compact]).preview-fullscreen .fullscreen-save-button::before,
  :where(body[data-surface=compact]).preview-fullscreen .fullscreen-adjust-button::before {
    content: "";
    position: absolute;
    inset: -6px -8px;
    pointer-events: auto;
  }
  :where(body[data-surface=compact]) .adjust-button {
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid rgba(77, 65, 49, .38);
    border-radius: 8px;
    color: #fff;
    background: var(--accent);
    font-size: 9px;
    font-weight: 650;
    cursor: pointer;
  }
  :where(body[data-surface=compact]) .adjust-button:hover {
    background: #3f3324;
  }
  :where(body[data-surface=compact]) .adjust-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }
  :where(body[data-surface=compact]) .adjust-toggle input:checked + i {
    background: var(--accent);
  }
  :where(body[data-surface=compact]) .adjust-launcher {
    width: 100%;
    min-height: 48px;
    margin-top: 12px;
    padding: 8px 13px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 8px;
    align-items: center;
    text-align: left;
    border-radius: 11px;
    font-size: 12px;
  }
  :where(body[data-surface=compact]) .adjust-launcher svg {
    grid-row: 1 / -1;
    width: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
  }
  :where(body[data-surface=compact]) .adjust-launcher span {
    font-weight: 680;
  }
  :where(body[data-surface=compact]) .adjust-launcher small {
    overflow: hidden;
    color: rgba(255, 255, 255, .76);
    font-size: 9px;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  :where(body[data-surface=compact]).preview-fullscreen .fullscreen-save-button,
  :where(body[data-surface=compact]).preview-fullscreen .fullscreen-adjust-button,
  :where(body[data-surface=compact]).preview-fullscreen .fullscreen-button {
    width: var(--fullscreen-action-width);
    padding: 0 6px;
    justify-content: center;
  }
  :where(body[data-surface=compact]).preview-fullscreen .fullscreen-adjust-button {
    left: 50%;
    bottom: max(12px, env(safe-area-inset-bottom));
    display: inline-flex;
    min-height: 32px;
    padding: 0 10px;
    font-size: 10px;
  }
  :where(body[data-surface=compact]) .adjust-dialog {
    position: sticky;
    bottom: 0;
    inset-inline: auto;
    z-index: 40;
    display: block;
    width: 100%;
    margin: 10px 0 0;
    padding: 0;
  }
  :where(body[data-surface=compact]) .adjust-dialog[hidden] {
    display: none;
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls .option-label {
    margin-bottom: 5px;
  }
  :where(body[data-surface=compact]) .adjust-dialog-footer .reset-style-button {
    flex: 0 0 auto;
    min-height: 30px;
  }
  :where(body[data-surface=compact]).preview-fullscreen .adjust-dialog-heading {
    display: none;
  }
  :where(body[data-surface=compact]).preview-fullscreen .adjust-dialog-note {
    display: none;
  }
  :where(body[data-surface=compact]).preview-fullscreen .adjust-dialog-footer {
    margin-top: 7px;
    border-top-color: rgba(255, 255, 255, .16);
  }
  :where(body[data-surface=compact]).preview-fullscreen .adjust-dialog-footer .reset-style-button {
    border-color: rgba(255, 255, 255, .24);
    color: #fff;
    background: rgba(255, 255, 255, .1);
  }
  :where(body[data-surface=compact]) .adjust-sheet {
    width: 100%;
    max-height: min(38vh, 320px);
    overflow: auto;
    padding: 5px 8px;
    border: 1px solid rgba(77, 65, 49, .2);
    border-radius: 11px;
    background: rgba(250, 249, 246, .56);
    box-shadow: 0 5px 16px rgba(56, 50, 42, .06);
    -webkit-backdrop-filter: blur(10px) saturate(1.08);
    backdrop-filter: blur(10px) saturate(1.08);
    border-color: rgba(77, 65, 49, .15);
  }
  :where(body[data-surface=compact]) .adjust-dialog-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  :where(body[data-surface=compact]) .adjust-toggle {
    min-height: 25px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    background: rgba(255, 255, 255, .38);
    font-size: 9px;
    cursor: pointer;
    gap: 4px;
    position: relative;
    flex: 0 0 auto;
    height: 25px;
    border-color: rgba(77, 65, 49, .18);
  }
  :where(body[data-surface=compact]) .adjust-toggle::before,
  :where(body[data-surface=compact]) .adjust-quick-layout-controls .ratio-picker button::before {
    content: "";
    position: absolute;
    inset: -5px 0;
  }
  :where(body[data-surface=compact]) .adjust-toggle i {
    position: relative;
    width: 20px;
    height: 12px;
    display: block;
    border-radius: 999px;
    background: #d2cfc8;
    transition: background .18s;
  }
  :where(body[data-surface=compact]) .adjust-toggle i::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: transform .18s;
  }
  :where(body[data-surface=compact]) .adjust-toggle input:checked + i::after {
    transform: translateX(8px);
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls .option-block {
    margin-top: 2px;
    min-height: 25px;
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls #ratioOptionBlock > .option-label {
    flex: 0 0 auto;
    margin: 0;
    font-size: 9px;
    white-space: nowrap;
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls .ratio-picker {
    flex: 1 1 auto;
    margin-left: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls .ratio-picker button {
    position: relative;
    min-height: 25px;
    height: 25px;
    padding: 0 6px;
    border-radius: 7px;
    font-size: 9px;
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls #polaroidMarginControls > .option-label {
    grid-column: 1 / -1;
    display: none;
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls #polaroidMarginControls .range-field {
    min-width: 0;
    margin-top: 4px;
    min-height: 25px;
    margin: 0;
    display: grid;
    grid-template-columns: auto minmax(30px, 1fr);
    align-items: center;
    gap: 5px;
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls #polaroidMarginControls .range-field > span {
    margin-bottom: 4px;
    font-size: 8px;
    margin: 0;
    white-space: nowrap;
  }
  :where(body[data-surface=compact]).preview-fullscreen .adjust-dialog {
    position: absolute;
    inset: auto var(--fullscreen-pad-right) calc(var(--fullscreen-pad-bottom) + 48px) var(--fullscreen-pad-left);
    z-index: 5;
    width: auto;
    margin: 0;
    max-width: min(560px, calc(100vw - var(--fullscreen-pad-left) - var(--fullscreen-pad-right)));
    margin-inline: auto;
  }
  :where(body[data-surface=compact]).preview-fullscreen .adjust-toggle {
    border-color: rgba(255, 255, 255, .18);
    color: #fff;
    background: rgba(255, 255, 255, .08);
  }
  :where(body[data-surface=compact]).preview-fullscreen .adjust-reset-button {
    border-color: rgba(255, 255, 255, .2);
    color: #fff;
    background: rgba(255, 255, 255, .08);
  }
  :where(body[data-surface=compact]).preview-fullscreen .adjust-quick-layout-controls .option-label,
  :where(body[data-surface=compact]).preview-fullscreen .adjust-quick-layout-controls .range-field > span {
    color: rgba(255, 255, 255, .88);
  }
  :where(body[data-surface=compact]) .adjust-place-position-controls {
    margin-top: 2px;
    display: grid;
    gap: 2px;
  }
  :where(body[data-surface=compact]) .adjust-place-position-controls[hidden] {
    display: none;
  }
  :where(body[data-surface=compact]) .adjust-place-position-row {
    min-height: 25px;
    display: grid;
    grid-template-columns: auto minmax(150px, 1fr);
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-size: 9px;
  }
  :where(body[data-surface=compact]) .adjust-place-position-buttons {
    justify-self: end;
    width: min(270px, 100%);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }
  :where(body[data-surface=compact]) .adjust-place-position-buttons button {
    min-height: 25px;
    height: 25px;
    padding: 0 7px;
    border: 1px solid rgba(77, 65, 49, .18);
    border-radius: 7px;
    color: var(--muted);
    background: rgba(255, 255, 255, .36);
    font-size: 9px;
    cursor: pointer;
  }
  :where(body[data-surface=compact]) .adjust-place-position-buttons button.is-active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(236, 232, 226, .72);
    box-shadow: inset 0 0 0 1px rgba(77, 65, 49, .18);
  }
  :where(body[data-surface=compact]).preview-fullscreen .adjust-place-position-row {
    color: rgba(255, 255, 255, .88);
  }
  :where(body[data-surface=compact]).preview-fullscreen .adjust-place-position-buttons button {
    border-color: rgba(255, 255, 255, .18);
    color: rgba(255, 255, 255, .72);
    background: rgba(255, 255, 255, .08);
  }
  :where(body[data-surface=compact]).preview-fullscreen .adjust-place-position-buttons button.is-active {
    border-color: rgba(234, 222, 206, .72);
    color: #fff;
    background: rgba(139, 118, 91, .48);
  }
  :where(body[data-surface=compact]) .photo-order-actions button {
    min-height: 32px;
    padding: 0 8px;
    border: 1px solid rgba(77, 65, 49, .25);
    border-radius: 8px;
    color: var(--accent);
    background: rgba(255, 255, 255, .68);
    font-size: 9px;
    cursor: pointer;
  }
  :where(body[data-surface=compact]) .photo-order-actions button:hover {
    background: var(--accent-soft);
  }
  :where(body[data-surface=compact]) .dual-photo-controls {
    margin-top: 2px;
    display: grid;
    gap: 2px;
  }
  :where(body[data-surface=compact]) .dual-photo-direction-picker {
    justify-self: end;
    width: min(270px, 100%);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }
  :where(body[data-surface=compact]) .dual-photo-direction-picker button {
    position: relative;
    min-height: 25px;
    height: 25px;
    padding: 0 5px;
    border: 1px solid rgba(77, 65, 49, .18);
    border-radius: 7px;
    color: var(--muted);
    background: rgba(255, 255, 255, .36);
    font-size: 9px;
    cursor: pointer;
  }
  :where(body[data-surface=compact]) .dual-photo-direction-picker button::before {
    content: "";
    position: absolute;
    inset: -5px 0;
  }
  :where(body[data-surface=compact]) .dual-photo-direction-picker button.is-active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(236, 232, 226, .72);
    box-shadow: inset 0 0 0 1px rgba(77, 65, 49, .18);
  }
  :where(body[data-surface=compact]) .dual-photo-gap-row.is-disabled {
    opacity: .56;
  }
  :where(body[data-surface=compact]).preview-fullscreen .dual-photo-direction-row,
  :where(body[data-surface=compact]).preview-fullscreen .dual-photo-gap-row {
    color: rgba(255, 255, 255, .88);
  }
  :where(body[data-surface=compact]).preview-fullscreen .dual-photo-direction-picker button {
    border-color: rgba(255, 255, 255, .18);
    color: rgba(255, 255, 255, .72);
    background: rgba(255, 255, 255, .08);
  }
  :where(body[data-surface=compact]).preview-fullscreen .dual-photo-direction-picker button.is-active {
    border-color: rgba(234, 222, 206, .72);
    color: #fff;
    background: rgba(139, 118, 91, .48);
  }
  :where(body[data-surface=compact]) .photo-crop-controls {
    margin-top: 2px;
    display: grid;
    gap: 2px;
  }
  :where(body[data-surface=compact]) .photo-crop-ratio-row {
    min-height: 25px;
    display: grid;
    grid-template-columns: auto minmax(150px, 1fr);
    align-items: center;
    gap: 8px;
    font-size: 9px;
  }
  :where(body[data-surface=compact]) .photo-crop-ratio-picker button {
    min-height: 25px;
    height: 25px;
    padding: 0 4px;
    border: 1px solid rgba(77, 65, 49, .18);
    border-radius: 7px;
    color: var(--muted);
    background: rgba(255, 255, 255, .36);
    font-size: 9px;
    cursor: pointer;
  }
  :where(body[data-surface=compact]) .photo-crop-ratio-picker button.is-active,
  :where(body[data-surface=compact]) .photo-crop-position-picker button.is-active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(236, 232, 226, .72);
    box-shadow: inset 0 0 0 1px rgba(77, 65, 49, .18);
  }
  :where(body[data-surface=compact]) .photo-crop-controls.is-original .photo-crop-position-row {
    opacity: .55;
  }
  :where(body[data-surface=compact]) .photo-crop-note {
    margin: 0;
    color: var(--muted);
    font-size: 8px;
    text-align: right;
  }
  :where(body[data-surface=compact]).preview-fullscreen .photo-crop-ratio-row,
  :where(body[data-surface=compact]).preview-fullscreen .photo-crop-position-row {
    color: rgba(255, 255, 255, .88);
  }
  :where(body[data-surface=compact]).preview-fullscreen .photo-crop-ratio-picker button,
  :where(body[data-surface=compact]).preview-fullscreen .photo-crop-position-picker button {
    border-color: rgba(255, 255, 255, .18);
    color: rgba(255, 255, 255, .72);
    background: rgba(255, 255, 255, .08);
  }
  :where(body[data-surface=compact]).preview-fullscreen .photo-crop-ratio-picker button.is-active,
  :where(body[data-surface=compact]).preview-fullscreen .photo-crop-position-picker button.is-active {
    border-color: rgba(234, 222, 206, .72);
    color: #fff;
    background: rgba(139, 118, 91, .48);
  }
  :where(body[data-surface=compact]).preview-fullscreen .photo-crop-note {
    color: rgba(255, 255, 255, .62);
  }
  :where(body[data-surface=compact]) .photo-slot-card > span {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 10px;
  }
  :where(body[data-surface=compact]) .photo-slot-card small {
    overflow: hidden;
    color: var(--muted);
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  :where(body[data-surface=compact]) .photo-slot-card label,
  :where(body[data-surface=compact]) .photo-slot-card button,
  :where(body[data-surface=compact]) .swap-photos-button {
    position: relative;
    min-height: 30px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(77, 65, 49, .24);
    border-radius: 7px;
    color: var(--accent);
    background: rgba(255, 255, 255, .76);
    font-size: 9px;
    cursor: pointer;
  }
  :where(body[data-surface=compact]) .photo-slot-card input,
  :where(body[data-surface=compact]) .tray-photo-slot input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
  }
  :where(body[data-surface=compact]) .photo-slot-card button:disabled,
  :where(body[data-surface=compact]) .swap-photos-button:disabled {
    opacity: .38;
    cursor: default;
  }
  :where(body[data-surface=compact]) .tray-group {
    border-top: 1px solid rgba(77, 65, 49, .14);
  }
  :where(body[data-surface=compact]) .tray-group:first-of-type {
    border-top: 0;
  }
  :where(body[data-surface=compact]) .tray-group > summary {
    min-height: 32px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: inherit;
    font-size: 10px;
    font-weight: 680;
    cursor: pointer;
    list-style: none;
  }
  :where(body[data-surface=compact]) .tray-group > summary::-webkit-details-marker {
    display: none;
  }
  :where(body[data-surface=compact]) .tray-group > summary::after {
    content: "+";
    font-size: 15px;
    font-weight: 300;
  }
  :where(body[data-surface=compact]) .tray-group[open] > summary::after {
    content: "\2212";
  }
  :where(body[data-surface=compact]) .crop-slot-picker button,
  :where(body[data-surface=compact]) .tray-photo-slot label,
  :where(body[data-surface=compact]) .tray-photo-slot button,
  :where(body[data-surface=compact]) .tray-swap-button {
    position: relative;
    min-height: 32px;
    border: 1px solid rgba(77, 65, 49, .2);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .52);
    font-size: 9px;
    cursor: pointer;
  }
  :where(body[data-surface=compact]) .tray-template-picker button.is-active,
  :where(body[data-surface=compact]) .crop-slot-picker button.is-active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(236, 232, 226, .76);
  }
  :where(body[data-surface=compact]) .tray-photo-slot small {
    color: var(--muted);
  }
  :where(body[data-surface=compact]) .photo-crop-ratio-picker {
    justify-self: end;
    width: min(300px, 100%);
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  :where(body[data-surface=compact]).preview-fullscreen .adjust-sheet {
    max-height: min(26dvh, 215px);
    overflow: auto;
    padding: 5px 8px;
    border-color: rgba(255, 255, 255, .18);
    color: #fff;
    background: rgba(25, 25, 24, .54);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .32);
    -webkit-backdrop-filter: blur(11px) saturate(1.08);
    backdrop-filter: blur(11px) saturate(1.08);
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-group > summary,
  :where(body[data-surface=compact]).preview-fullscreen .tray-select-field {
    color: rgba(255, 255, 255, .9);
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-group {
    border-top-color: rgba(255, 255, 255, .14);
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-template-picker button,
  :where(body[data-surface=compact]).preview-fullscreen .crop-slot-picker button,
  :where(body[data-surface=compact]).preview-fullscreen .tray-photo-slot label,
  :where(body[data-surface=compact]).preview-fullscreen .tray-photo-slot button,
  :where(body[data-surface=compact]).preview-fullscreen .tray-swap-button {
    border-color: rgba(255, 255, 255, .18);
    color: rgba(255, 255, 255, .78);
    background: rgba(255, 255, 255, .08);
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-template-picker button.is-active,
  :where(body[data-surface=compact]).preview-fullscreen .crop-slot-picker button.is-active {
    color: #fff;
    background: rgba(139, 118, 91, .48);
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-select-field select {
    border-color: rgba(255, 255, 255, .2);
    color: #fff;
    background: rgba(255, 255, 255, .1);
  }
  :where(body[data-surface=compact]) .preview-stage.crop-editor-active > #previewCanvas,
  :where(body[data-surface=compact]) .preview-stage.crop-editor-active > .fullscreen-button,
  :where(body[data-surface=compact]) .preview-stage.crop-editor-active > .fullscreen-save-button,
  :where(body[data-surface=compact]) .preview-stage.crop-editor-active > .fullscreen-adjust-button,
  :where(body[data-surface=compact]) .preview-stage.crop-editor-active > .fullscreen-swipe-hint,
  :where(body[data-surface=compact]) .preview-stage.crop-editor-active > .adjust-dialog {
    visibility: hidden;
  }
  @media (max-width: 560px) {
    :where(body[data-surface=compact]) .clear-cache-button {
      min-height: var(--touch-min);
      padding: 0 10px;
    }
    :where(body[data-surface=compact]) .adjust-button,
    :where(body[data-surface=compact]) .section-title-actions .reset-style-button {
      min-height: var(--touch-min);
      padding: 0 9px;
    }
    :where(body[data-surface=compact]) .adjust-dialog-footer .reset-style-button {
      width: 100%;
    }
    :where(body[data-surface=compact]) .adjust-launcher {
      min-height: 52px;
      margin-top: 8px;
      font-size: 12px;
    }
    :where(body[data-surface=compact]).preview-fullscreen .fullscreen-save-button,
    :where(body[data-surface=compact]).preview-fullscreen .fullscreen-adjust-button,
    :where(body[data-surface=compact]).preview-fullscreen .fullscreen-button {
      min-height: var(--touch-min);
    }
    :where(body[data-surface=compact]).preview-fullscreen .adjust-dialog {
      inset: auto var(--fullscreen-pad-right) calc(var(--fullscreen-pad-bottom) + 52px) var(--fullscreen-pad-left);
    }
    :where(body[data-surface=compact]) .adjust-quick-layout-controls #polaroidMarginControls {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
    }
    :where(body[data-surface=compact]) .photo-order-actions button {
      min-height: var(--touch-min);
    }
    :where(body[data-surface=compact]) .dual-photo-direction-row,
    :where(body[data-surface=compact]) .dual-photo-gap-row {
      grid-template-columns: auto minmax(120px, 1fr);
      gap: 6px;
      min-height: var(--touch-min);
    }
    :where(body[data-surface=compact]) .dual-photo-direction-picker button {
      min-height: var(--touch-min);
      height: var(--touch-min);
    }
    :where(body[data-surface=compact]) .dual-photo-gap-row input[type=range] {
      height: var(--touch-min);
    }
    :where(body[data-surface=compact]) .adjust-toggle {
      min-height: var(--touch-min);
      height: var(--touch-min);
    }
    :where(body[data-surface=compact]) .adjust-quick-layout-controls input[type=range] {
      height: var(--touch-min);
    }
    :where(body[data-surface=compact]) .adjust-quick-layout-controls .ratio-picker button {
      min-height: var(--touch-min);
      height: var(--touch-min);
    }
    :where(body[data-surface=compact]) .adjust-place-position-row {
      grid-template-columns: auto minmax(120px, 1fr);
      gap: 6px;
      min-height: var(--touch-min);
    }
    :where(body[data-surface=compact]) .adjust-place-position-buttons button {
      min-height: var(--touch-min);
      height: var(--touch-min);
    }
    :where(body[data-surface=compact]) .adjust-quick-layout-controls #polaroidMarginControls .range-field {
      min-height: var(--touch-min);
      grid-template-columns: auto minmax(24px, 1fr);
      gap: 4px;
    }
    :where(body[data-surface=compact]) .adjust-quick-layout-controls #polaroidMarginControls input[type=range] {
      height: var(--touch-min);
      margin: 0;
    }
    :where(body[data-surface=compact]) .photo-slot-card {
      min-height: 52px;
    }
    :where(body[data-surface=compact]) .photo-slot-card label,
    :where(body[data-surface=compact]) .photo-slot-card button,
    :where(body[data-surface=compact]) .photo-order-actions > .swap-photos-button {
      min-height: var(--touch-min);
    }
    :where(body[data-surface=compact]) .tray-group > summary {
      min-height: var(--touch-min);
      font-size: 11px;
    }
    :where(body[data-surface=compact]) .crop-slot-picker button,
    :where(body[data-surface=compact]) .tray-photo-slot label,
    :where(body[data-surface=compact]) .tray-photo-slot button,
    :where(body[data-surface=compact]) .tray-swap-button {
      min-height: var(--touch-min);
    }
    :where(body[data-surface=compact]) .tray-photo-slot {
      min-height: var(--touch-min);
      grid-template-columns: minmax(62px, 1fr) 58px 52px;
    }
    :where(body[data-surface=compact]) .photo-crop-ratio-row {
      min-height: var(--touch-min);
      grid-template-columns: 1fr;
      gap: 6px;
    }
    :where(body[data-surface=compact]) .photo-crop-ratio-picker {
      width: 100%;
      grid-template-columns: repeat(3, 1fr);
    }
    :where(body[data-surface=compact]) .photo-crop-ratio-picker button {
      min-height: var(--touch-min);
      height: var(--touch-min);
    }
  }
  :where(body[data-surface=compact]) .tray-tabbar button {
    position: relative;
    min-width: 0;
    height: var(--tray-visual-control);
    min-height: var(--tray-visual-control);
    margin: var(--tray-touch-padding) 0;
    padding: 0 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid rgba(77, 65, 49, .18);
    border-radius: 6px;
    color: var(--muted);
    background: rgba(255, 255, 255, .45);
    font-size: 9px;
    cursor: pointer;
  }
  :where(body[data-surface=compact]) .tray-tabbar button::before {
    content: "";
    position: absolute;
    inset: calc(-1 * var(--tray-touch-padding)) 0;
  }
  :where(body[data-surface=compact]) .tray-tabbar button span,
  :where(body[data-surface=compact]) .tray-tabbar button small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  :where(body[data-surface=compact]) .tray-tabbar button span {
    flex: 0 1 auto;
    font-weight: 680;
  }
  :where(body[data-surface=compact]) .tray-tabbar button small {
    flex: 0 1 auto;
    color: inherit;
    font-size: 7px;
    opacity: .7;
  }
  :where(body[data-surface=compact]) .tray-tabbar button.is-active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(236, 232, 226, .78);
    box-shadow: inset 0 0 0 1px rgba(77, 65, 49, .14);
  }
  :where(body[data-surface=compact]) .tray-tabbar .tray-global-reset {
    padding-inline: 3px;
    color: #765d34;
    background: rgba(247, 238, 218, .72);
  }
  :where(body[data-surface=compact]) .tray-tabbar .tray-global-reset span {
    font-size: 8px;
    font-weight: 650;
  }
  :where(body[data-surface=compact]) .tray-tabbar .tray-close-button {
    padding-inline: 0;
    border-color: rgba(139, 90, 80, .34);
    color: #8a4b3f;
    background: rgba(247, 232, 228, .92);
    font-weight: 700;
  }
  :where(body[data-surface=compact]) .tray-tabbar .tray-close-button span {
    font-size: 17px;
    font-weight: 500;
    line-height: 1;
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-tabbar .tray-close-button {
    border-color: rgba(255, 255, 255, .34);
    color: #ffe9e4;
    background: rgba(150, 86, 74, .55);
  }
  :where(body[data-surface=compact]) .tray-group {
    border: 0;
  }
  :where(body[data-surface=compact]) .tray-group:not([open]) {
    display: none;
  }
  :where(body[data-surface=compact]) .tray-group[open] {
    display: block;
  }
  :where(body[data-surface=compact]) .tray-group > summary {
    display: none;
  }
  :where(body[data-surface=compact]) .tray-group-content {
    padding: 2px 0 4px;
    display: grid;
    gap: 0;
  }
  :where(body[data-surface=compact]) .tray-photo-slot label,
  :where(body[data-surface=compact]) .tray-photo-slot button,
  :where(body[data-surface=compact]) .crop-slot-picker button,
  :where(body[data-surface=compact]) .photo-crop-ratio-picker button,
  :where(body[data-surface=compact]) .dual-photo-direction-picker button,
  :where(body[data-surface=compact]) .adjust-place-position-buttons button,
  :where(body[data-surface=compact]) .tray-format-buttons button,
  :where(body[data-surface=compact]) .tray-save-draft-button,
  :where(body[data-surface=compact]) .adjust-quick-layout-controls .ratio-picker button,
  :where(body[data-surface=compact]) .adjust-reset-button {
    position: relative;
    min-height: var(--tray-visual-control);
    height: var(--tray-visual-control);
    margin-block: var(--tray-touch-padding);
    border-radius: 6px;
    font-size: 8.5px;
  }
  :where(body[data-surface=compact]) .tray-photo-slot label::before,
  :where(body[data-surface=compact]) .tray-photo-slot button::before,
  :where(body[data-surface=compact]) .crop-slot-picker button::before,
  :where(body[data-surface=compact]) .photo-crop-ratio-picker button::before,
  :where(body[data-surface=compact]) .dual-photo-direction-picker button::before,
  :where(body[data-surface=compact]) .adjust-place-position-buttons button::before,
  :where(body[data-surface=compact]) .tray-format-buttons button::before,
  :where(body[data-surface=compact]) .tray-save-draft-button::before,
  :where(body[data-surface=compact]) .adjust-quick-layout-controls .ratio-picker button::before,
  :where(body[data-surface=compact]) .adjust-reset-button::before {
    content: "";
    position: absolute;
    inset: calc(-1 * var(--tray-touch-padding)) 0;
  }
  :where(body[data-surface=compact]) .tray-photo-slots {
    display: grid;
    grid-template-columns: repeat(2, max-content) 32px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-top: 1px solid rgba(77, 65, 49, .1);
  }
  :where(body[data-surface=compact]) .tray-swap-button {
    position: relative;
    width: 32px;
    min-height: var(--tray-visual-control);
    height: var(--tray-visual-control);
    margin-block: var(--tray-touch-padding);
    padding: 0;
    border: 1px solid rgba(77, 65, 49, .2);
    border-radius: 6px;
    color: var(--accent);
    background: rgba(255, 255, 255, .55);
    font-size: 13px;
    cursor: pointer;
  }
  :where(body[data-surface=compact]) .tray-swap-button::before {
    content: "";
    position: absolute;
    inset: calc(-1 * var(--tray-touch-padding)) 0;
  }
  :where(body[data-surface=compact]) .tray-swap-button:disabled {
    opacity: .36;
  }
  :where(body[data-surface=compact]) .tray-photo-slot {
    min-width: 0;
    min-height: var(--tray-row);
    display: grid;
    grid-template-columns: 29px repeat(2, 46px);
    align-items: center;
    gap: 2px;
    border-top: 0;
    font-size: 9px;
  }
  :where(body[data-surface=compact]) .tray-photo-slot:first-child {
    border-top: 0;
  }
  :where(body[data-surface=compact]) .tray-slot-name {
    min-width: 0;
    padding-left: 1px;
    display: flex;
    align-items: baseline;
    gap: 2px;
    white-space: nowrap;
  }
  :where(body[data-surface=compact]) .tray-slot-name strong {
    font-size: 9px;
  }
  :where(body[data-surface=compact]) .tray-slot-name small {
    display: none;
  }
  :where(body[data-surface=compact]) .tray-photo-slot label,
  :where(body[data-surface=compact]) .tray-photo-slot button {
    min-width: 0;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(77, 65, 49, .18);
    color: var(--accent);
    background: rgba(255, 255, 255, .55);
    cursor: pointer;
  }
  :where(body[data-surface=compact]) .tray-photo-slot input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
  }
  :where(body[data-surface=compact]) .tray-photo-slot.is-empty button {
    opacity: .35;
    pointer-events: none;
  }
  :where(body[data-surface=compact]) .photo-crop-controls:not([hidden]) {
    min-width: 0;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    border-top: 1px solid rgba(77, 65, 49, .1);
  }
  :where(body[data-surface=compact]) .photo-crop-controls[hidden] {
    display: none;
  }
  :where(body[data-surface=compact]) .tray-control-row {
    min-width: 0;
    min-height: var(--tray-row);
  }
  :where(body[data-surface=compact]) .crop-target-row > span,
  :where(body[data-surface=compact]) .photo-crop-ratio-row > span,
  :where(body[data-surface=compact]) .tray-photo-group .photo-crop-note {
    display: none;
  }
  :where(body[data-surface=compact]) .crop-slot-picker {
    height: var(--tray-row);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
  }
  :where(body[data-surface=compact]) .crop-slot-picker button,
  :where(body[data-surface=compact]) .photo-crop-ratio-picker button {
    min-width: 0;
    padding: 0 4px;
    border: 1px solid rgba(77, 65, 49, .18);
    color: var(--muted);
    background: rgba(255, 255, 255, .42);
    cursor: pointer;
  }
  :where(body[data-surface=compact]) .crop-slot-picker button.is-active,
  :where(body[data-surface=compact]) .photo-crop-ratio-picker button.is-active,
  :where(body[data-surface=compact]) .tray-format-buttons button.is-active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(236, 232, 226, .78);
    box-shadow: inset 0 0 0 1px rgba(77, 65, 49, .14);
  }
  :where(body[data-surface=compact]) .photo-crop-ratio-row {
    display: block;
  }
  :where(body[data-surface=compact]) .photo-crop-ratio-picker {
    width: 100%;
    height: var(--tray-row);
    display: flex;
    gap: 3px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  :where(body[data-surface=compact]) .photo-crop-ratio-picker::-webkit-scrollbar {
    display: none;
  }
  :where(body[data-surface=compact]) .photo-crop-ratio-picker button {
    flex: 1 0 43px;
  }
  :where(body[data-surface=compact]) .dual-photo-controls:not([hidden]) {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    border-top: 1px solid rgba(77, 65, 49, .1);
  }
  :where(body[data-surface=compact]) .dual-photo-controls[hidden] {
    display: none;
  }
  :where(body[data-surface=compact]) .dual-photo-direction-row,
  :where(body[data-surface=compact]) .dual-photo-gap-row {
    min-width: 0;
    min-height: var(--tray-row);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 4px;
    font-size: 8px;
  }
  :where(body[data-surface=compact]) .dual-photo-direction-picker {
    min-width: 0;
    width: 100%;
    height: var(--tray-row);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
  }
  :where(body[data-surface=compact]) .dual-photo-direction-picker button {
    min-width: 0;
    padding: 0 3px;
    border: 1px solid rgba(77, 65, 49, .18);
    color: var(--muted);
    background: rgba(255, 255, 255, .42);
    cursor: pointer;
  }
  :where(body[data-surface=compact]) .dual-photo-direction-picker button.is-active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(236, 232, 226, .78);
  }
  :where(body[data-surface=compact]) .dual-photo-gap-row label {
    min-width: 0;
    display: contents;
  }
  :where(body[data-surface=compact]) .dual-photo-gap-row span {
    white-space: nowrap;
  }
  :where(body[data-surface=compact]) .dual-photo-gap-row input[type=range] {
    min-width: 0;
    width: 100%;
    height: var(--tray-row);
    margin: 0;
  }
  :where(body[data-surface=compact]) .tray-save-group .tray-group-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls:empty {
    display: none;
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls .option-block {
    min-height: var(--tray-row);
    margin: 0;
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls #ratioOptionBlock {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr);
    align-items: center;
    gap: 5px;
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls #ratioOptionBlock > .option-label {
    margin: 0;
    padding-left: 4px;
    font-size: 8px;
    white-space: nowrap;
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls .option-label small {
    display: none;
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls .ratio-picker {
    width: 100%;
    height: var(--tray-row);
    margin-left: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls .ratio-picker button {
    min-width: 0;
    padding: 0 4px;
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls #polaroidMarginControls {
    min-height: var(--tray-row);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 6px;
    border-top: 1px solid rgba(77, 65, 49, .1);
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls #polaroidMarginControls > .option-label {
    display: none;
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls #polaroidMarginControls .range-field {
    min-width: 0;
    min-height: var(--tray-row);
    margin: 0;
    display: grid;
    grid-template-columns: auto minmax(28px, 1fr);
    align-items: center;
    gap: 4px;
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls #polaroidMarginControls .range-field > span {
    margin: 0;
    font-size: 8px;
    white-space: nowrap;
  }
  :where(body[data-surface=compact]) .adjust-quick-layout-controls #polaroidMarginControls input[type=range] {
    min-width: 0;
    width: 100%;
    height: var(--tray-row);
    margin: 0;
  }
  :where(body[data-surface=compact]) .adjust-place-position-controls {
    margin: 0;
    gap: 0;
  }
  :where(body[data-surface=compact]) .adjust-place-position-row {
    min-height: var(--tray-row);
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 5px;
    font-size: 8px;
  }
  :where(body[data-surface=compact]) .adjust-place-position-buttons {
    width: 100%;
    height: var(--tray-row);
    gap: 3px;
  }
  :where(body[data-surface=compact]) .adjust-place-position-buttons button {
    min-width: 0;
  }
  :where(body[data-surface=compact]) .tray-save-controls {
    min-width: 0;
    min-height: var(--tray-row);
    display: grid;
    grid-template-columns: minmax(98px, 1.05fr) minmax(88px, .96fr) minmax(82px, .9fr) 72px;
    align-items: center;
    gap: 5px;
    border-top: 1px solid rgba(77, 65, 49, .1);
  }
  :where(body[data-surface=compact]) .tray-format-control {
    min-width: 0;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 3px;
    font-size: 9px;
  }
  :where(body[data-surface=compact]) .tray-format-buttons {
    min-width: 0;
    height: var(--tray-row);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
  }
  :where(body[data-surface=compact]) .tray-format-buttons button,
  :where(body[data-surface=compact]) .tray-save-draft-button {
    min-width: 0;
    padding: 0 5px;
    border: 1px solid rgba(77, 65, 49, .18);
    color: var(--muted);
    background: rgba(255, 255, 255, .5);
    cursor: pointer;
  }
  :where(body[data-surface=compact]) .tray-save-draft-button {
    color: var(--accent);
    font-weight: 650;
  }
  :where(body[data-surface=compact]) .tray-save-group .preserve-time-toggle,
  :where(body[data-surface=compact]) .tray-save-group .preserve-camera-toggle {
    min-width: 0;
    width: 100%;
    min-height: var(--tray-visual-control);
    height: var(--tray-visual-control);
    margin-block: var(--tray-touch-padding);
    padding: 0 7px;
    border-radius: 8px;
    font-size: 9px;
  }
  :where(body[data-surface=compact]) .tray-save-group .preserve-time-toggle::before,
  :where(body[data-surface=compact]) .tray-save-group .preserve-camera-toggle::before {
    inset: calc(-1 * var(--tray-touch-padding)) 0;
  }
  :where(body[data-surface=compact]) .tray-save-group .preserve-time-toggle > span,
  :where(body[data-surface=compact]) .tray-save-group .preserve-camera-toggle > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  :where(body[data-surface=compact]) .tray-draft-row {
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 9px;
  }
  :where(body[data-surface=compact]) .tray-draft-row span,
  :where(body[data-surface=compact]) .tray-draft-row small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  :where(body[data-surface=compact]) .tray-draft-row small {
    font-size: 8px;
    font-weight: 400;
  }
  :where(body[data-surface=compact]) .tray-text-group .adjust-toggle,
  :where(body[data-surface=compact]) .tray-text-group .adjust-reset-button {
    min-width: var(--touch-min);
    min-height: var(--tray-visual-control);
    height: var(--tray-visual-control);
    margin-block: var(--tray-touch-padding);
    font-size: 8px;
  }
  :where(body[data-surface=compact]) .tray-text-group .adjust-toggle::before,
  :where(body[data-surface=compact]) .tray-text-group .adjust-reset-button::before {
    inset: calc(-1 * var(--tray-touch-padding)) 0;
  }
  :where(body[data-surface=compact]).preview-fullscreen .adjust-sheet {
    max-height: min(26dvh, 215px);
    overflow: auto;
    padding: 5px 7px;
    border-color: rgba(255, 255, 255, .24);
    color: #f1eee8;
    background: rgba(55, 54, 52, .96);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .34);
    -webkit-backdrop-filter: blur(16px) saturate(1.08);
    backdrop-filter: blur(16px) saturate(1.08);
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-tabbar button {
    border-color: rgba(255, 255, 255, .2);
    color: #f0ede7;
    background: rgba(255, 255, 255, .12);
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-tabbar button.is-active {
    border-color: rgba(231, 219, 204, .82);
    color: #4c3c26;
    background: rgba(236, 229, 220, .96);
    box-shadow: inset 0 0 0 1px rgba(77, 65, 49, .1);
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-group-content,
  :where(body[data-surface=compact]).preview-fullscreen .tray-format-control,
  :where(body[data-surface=compact]).preview-fullscreen .dual-photo-direction-row,
  :where(body[data-surface=compact]).preview-fullscreen .dual-photo-gap-row,
  :where(body[data-surface=compact]).preview-fullscreen .adjust-place-position-row,
  :where(body[data-surface=compact]).preview-fullscreen .adjust-quick-layout-controls .option-label,
  :where(body[data-surface=compact]).preview-fullscreen .adjust-quick-layout-controls .range-field > span {
    color: #f1eee8;
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-slot-name small,
  :where(body[data-surface=compact]).preview-fullscreen .photo-crop-note,
  :where(body[data-surface=compact]).preview-fullscreen .tray-draft-row {
    color: #cfccc9;
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-photo-slot,
  :where(body[data-surface=compact]).preview-fullscreen .photo-crop-controls:not([hidden]),
  :where(body[data-surface=compact]).preview-fullscreen .dual-photo-controls:not([hidden]),
  :where(body[data-surface=compact]).preview-fullscreen .tray-save-controls,
  :where(body[data-surface=compact]).preview-fullscreen .adjust-quick-layout-controls #polaroidMarginControls {
    border-color: rgba(255, 255, 255, .14);
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-photo-slot label,
  :where(body[data-surface=compact]).preview-fullscreen .tray-photo-slot button,
  :where(body[data-surface=compact]).preview-fullscreen .tray-swap-button,
  :where(body[data-surface=compact]).preview-fullscreen .crop-slot-picker button,
  :where(body[data-surface=compact]).preview-fullscreen .photo-crop-ratio-picker button,
  :where(body[data-surface=compact]).preview-fullscreen .dual-photo-direction-picker button,
  :where(body[data-surface=compact]).preview-fullscreen .tray-format-buttons button,
  :where(body[data-surface=compact]).preview-fullscreen .tray-save-draft-button,
  :where(body[data-surface=compact]).preview-fullscreen .adjust-quick-layout-controls .ratio-picker button,
  :where(body[data-surface=compact]).preview-fullscreen .adjust-place-position-buttons button,
  :where(body[data-surface=compact]).preview-fullscreen .adjust-toggle,
  :where(body[data-surface=compact]).preview-fullscreen .adjust-reset-button {
    border-color: rgba(77, 65, 49, .2);
    color: #554e46;
    background: rgba(255, 255, 255, .92);
  }
  :where(body[data-surface=compact]).preview-fullscreen .crop-slot-picker button.is-active,
  :where(body[data-surface=compact]).preview-fullscreen .photo-crop-ratio-picker button.is-active,
  :where(body[data-surface=compact]).preview-fullscreen .dual-photo-direction-picker button.is-active,
  :where(body[data-surface=compact]).preview-fullscreen .tray-format-buttons button.is-active,
  :where(body[data-surface=compact]).preview-fullscreen .adjust-quick-layout-controls .ratio-picker button.is-active {
    border-color: rgba(151, 131, 104, .72);
    color: #4b3922;
    background: rgba(231, 221, 207, .98);
  }
  :where(body[data-surface=compact]) .photo-order-actions {
    width: 100%;
    margin-top: 6px;
    display: none;
    grid-template-columns: repeat(2, max-content) 76px;
    justify-content: center;
    gap: 0 6px;
  }
  :where(body[data-surface=compact]) .photo-order-actions.is-visible {
    display: grid;
  }
  :where(body[data-surface=compact]) .photo-slot-card {
    min-width: 0;
    min-height: var(--tray-row);
    padding: 0;
    display: grid;
    grid-template-columns: 30px repeat(2, 58px);
    align-items: center;
    gap: 3px;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
  }
  :where(body[data-surface=compact]) .photo-slot-card > span {
    min-width: 0;
    padding-left: 1px;
    gap: 2px;
  }
  :where(body[data-surface=compact]) .photo-slot-card small {
    display: none;
  }
  :where(body[data-surface=compact]) .photo-slot-card label,
  :where(body[data-surface=compact]) .photo-slot-card button,
  :where(body[data-surface=compact]) .photo-order-actions > .swap-photos-button {
    position: relative;
    min-width: 0;
    min-height: var(--tray-visual-control);
    height: var(--tray-visual-control);
    margin-block: var(--tray-touch-padding);
    padding: 0 6px;
    border-radius: 8px;
    font-size: 9px;
  }
  :where(body[data-surface=compact]) .photo-slot-card label::before,
  :where(body[data-surface=compact]) .photo-slot-card button::before,
  :where(body[data-surface=compact]) .photo-order-actions > .swap-photos-button::before {
    content: "";
    position: absolute;
    inset: calc(-1 * var(--tray-touch-padding)) 0;
  }
  :where(body[data-surface=compact]) .photo-order-actions > .swap-photos-button {
    grid-column: auto;
    justify-self: center;
    align-self: center;
    width: 76px;
    margin-block: 0;
  }
  @media (max-width: 370px) {
    :where(body[data-surface=compact]) .photo-order-actions {
      grid-template-columns: repeat(2, max-content);
    }
    :where(body[data-surface=compact]) .photo-order-actions > .swap-photos-button {
      grid-column: 1 / -1;
      width: 92px;
    }
  }
  :where(body[data-surface=compact]) .photo-order-actions > #removeSecondPhotoButton {
    display: none;
  }
  :where(body[data-surface=compact]) .save-sheet {
    width: min(400px, 100%);
    max-height: min(82dvh, 680px);
    padding: 16px;
    border-radius: 18px;
  }
  :where(body[data-surface=compact]) .save-heading h2 {
    font-size: 18px;
  }
  :where(body[data-surface=compact]) .save-heading .eyebrow {
    font-size: 8px;
  }
  :where(body[data-surface=compact]) .save-image-wrap {
    height: min(30dvh, 250px);
    margin: 10px 0 8px;
    padding: 8px;
    text-decoration: none;
  }
  :where(body[data-surface=compact]) .save-instruction {
    margin: 0 1px 8px;
    font-size: 9px;
    line-height: 1.45;
  }
  :where(body[data-surface=compact]) .save-actions {
    gap: 6px;
    margin-bottom: 8px;
  }
  :where(body[data-surface=compact]) .save-actions .primary-button {
    min-height: 46px;
  }
  :where(body[data-surface=compact]) .save-actions .secondary-link-button {
    min-height: var(--touch-min);
  }
  @media (max-width: 560px) {
    :where(body[data-surface=compact]) .tray-tabbar button {
      padding: 0 4px;
      gap: 3px;
    }
    :where(body[data-surface=compact]) .tray-tabbar button small {
      display: none;
    }
    :where(body[data-surface=compact]) .tray-tabbar button span {
      font-size: 10.5px;
      letter-spacing: .01em;
    }
    :where(body[data-surface=compact]) .tray-tabbar button {
      color: #514b43;
    }
    :where(body[data-surface=compact]) .tray-tabbar .tray-global-reset span {
      font-size: 10px;
    }
    :where(body[data-surface=compact]) .tray-photo-slot {
      grid-template-columns: 29px repeat(2, 46px);
    }
    :where(body[data-surface=compact]) .tray-slot-name small {
      display: none;
    }
    :where(body[data-surface=compact]) .photo-crop-controls:not([hidden]) {
      grid-template-columns: 92px minmax(0, 1fr);
      gap: 4px;
    }
    :where(body[data-surface=compact]) .photo-crop-ratio-picker button {
      flex-basis: 46px;
    }
    :where(body[data-surface=compact]) .dual-photo-controls:not([hidden]) {
      grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
      gap: 4px;
    }
    :where(body[data-surface=compact]) .dual-photo-direction-row,
    :where(body[data-surface=compact]) .dual-photo-gap-row {
      font-size: 7px;
      gap: 3px;
    }
    :where(body[data-surface=compact]) .tray-save-controls {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      grid-template-rows: var(--tray-row);
      gap: 0 3px;
    }
    :where(body[data-surface=compact]) .tray-save-controls .tray-format-control {
      grid-column: span 1;
      grid-template-columns: 1fr;
    }
    :where(body[data-surface=compact]) .tray-save-controls .tray-format-control > span {
      display: none;
    }
    :where(body[data-surface=compact]) .tray-save-controls .tray-save-draft-button {
      grid-column: auto;
      width: 100%;
      padding: 0 3px;
      font-size: 8px;
    }
    :where(body[data-surface=compact]) .tray-save-group .preserve-time-toggle,
    :where(body[data-surface=compact]) .tray-save-group .preserve-camera-toggle {
      padding-inline: 4px;
    }
    :where(body[data-surface=compact]) .photo-slot-card {
      grid-template-columns: 29px repeat(2, 44px);
    }
    :where(body[data-surface=compact]) .save-sheet {
      width: calc(100% - 16px);
      max-height: 82dvh;
      margin: 0 8px max(8px, env(safe-area-inset-bottom));
      padding: 14px;
      border-radius: 18px;
    }
    :where(body[data-surface=compact]) .save-image-wrap {
      height: min(30dvh, 250px);
      margin-top: 8px;
    }
  }
  :where(body[data-surface=compact]).preview-fullscreen .adjust-dialog {
    max-width: min(430px, calc(100vw - var(--fullscreen-pad-left) - var(--fullscreen-pad-right)));
  }
  :where(body[data-surface=compact]) .tray-tabbar {
    min-width: 0;
    height: var(--tray-row);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr) minmax(0, 1fr) 48px 34px;
    gap: 4px;
    position: sticky;
    top: 0;
    z-index: 6;
    background: rgba(250, 249, 246, .82);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-tabbar {
    background: rgba(44, 43, 42, .94);
  }
  :where(body[data-surface=compact]) .tray-text-group .tray-group-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  :where(body[data-surface=compact]) .draft-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 3px;
  }
  :where(body[data-surface=compact]) .save-draft-button,
  :where(body[data-surface=compact]) .clear-cache-button,
  :where(body[data-surface=compact]) .draft-library-button {
    position: relative;
    min-height: var(--tray-visual-control);
    height: var(--tray-visual-control);
    margin-block: var(--tray-touch-padding);
    padding: 0 8px;
    border: 1px solid rgba(77, 65, 49, .16);
    border-radius: 7px;
    color: var(--accent);
    background: rgba(255, 255, 255, .72);
    font-size: 8px;
    cursor: pointer;
  }
  :where(body[data-surface=compact]) .save-draft-button::before,
  :where(body[data-surface=compact]) .clear-cache-button::before,
  :where(body[data-surface=compact]) .draft-library-button::before {
    content: "";
    position: absolute;
    inset: calc(-1 * var(--tray-touch-padding)) 0;
  }
  :where(body[data-surface=compact]) .draft-library-button {
    font-weight: 650;
    white-space: nowrap;
  }
  :where(body[data-surface=compact]) .draft-library-count {
    display: inline-block;
    min-width: 12px;
    padding: 0 3px;
    border-radius: 999px;
    color: #fff;
    background: var(--accent);
    font-size: 8px;
    font-variant-numeric: tabular-nums;
    text-align: center;
  }
  :where(body[data-surface=compact]) .draft-library-button[data-count="0"] .draft-library-count {
    color: var(--muted);
    background: rgba(77, 65, 49, .14);
  }
  @media (max-width: 560px) {
    :where(body[data-surface=compact]) .editor-panel.has-image .upload-section {
      display: grid;
      grid-template-columns: 1fr;
      justify-items: center;
      gap: 3px;
      padding: 8px 10px;
    }
    :where(body[data-surface=compact]) .editor-panel.has-image .upload-button {
      width: min(168px, 100%);
      min-height: var(--touch-min);
    }
    :where(body[data-surface=compact]) .editor-panel.has-image .file-status {
      width: 100%;
      margin: 0;
      text-align: center;
    }
    :where(body[data-surface=compact]) .editor-panel.has-image .photo-order-actions {
      justify-self: stretch;
    }
    :where(body[data-surface=compact]) .cache-bar {
      min-height: var(--tray-row);
      padding: 0 10px;
    }
    :where(body[data-surface=compact]) .form-section {
      padding: 8px 10px;
    }
    :where(body[data-surface=compact]) .title-input {
      min-height: var(--touch-min);
      height: var(--touch-min);
      padding-block: 5px;
    }
    :where(body[data-surface=compact]) .textarea {
      min-height: 56px;
      max-height: 72px;
      padding-block: 7px;
    }
    :where(body[data-surface=compact]) .caption-label {
      margin-top: 7px;
    }
    :where(body[data-surface=compact]) .metadata-settings summary,
    :where(body[data-surface=compact]) .advanced-settings summary {
      min-height: var(--touch-min);
      padding: 6px 10px;
    }
    :where(body[data-surface=compact]) .metadata-content,
    :where(body[data-surface=compact]) .advanced-content {
      padding: 0 10px 10px;
    }
    :where(body[data-surface=compact]) .field-with-toggle {
      margin-block: 6px 4px;
    }
    :where(body[data-surface=compact]) .field-spacer {
      margin-top: 10px;
    }
    :where(body[data-surface=compact]) .field-note {
      margin-top: 3px;
      line-height: 1.3;
    }
    :where(body[data-surface=compact]) .option-block {
      margin-top: 8px;
    }
    :where(body[data-surface=compact]) .style-section {
      padding: 8px 10px 9px;
    }
    :where(body[data-surface=compact]) .section-title-row {
      margin-bottom: 6px;
    }
    :where(body[data-surface=compact]) .template-picker {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 5px;
      overflow: visible;
      padding: 0;
    }
    :where(body[data-surface=compact]) .template-button {
      min-width: 0;
      min-height: var(--touch-min);
      padding: 0 5px;
      flex-direction: row;
      justify-content: center;
      gap: 0;
      font-size: 9px;
    }
    :where(body[data-surface=compact]) .template-mini {
      display: none;
    }
    :where(body[data-surface=compact]) .adjust-launcher {
      min-height: var(--touch-min);
      margin-top: 6px;
      padding: 5px 10px;
    }
  }
  :where(body[data-surface=compact]) .font-size-range-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 8px;
  }
  :where(body[data-surface=compact]) .font-size-range-field > .font-size-caption,
  :where(body[data-surface=compact]) .font-size-range-field > .font-size-stepper {
    margin: 0;
  }
  :where(body[data-surface=compact]) .font-size-range-field > input[type=range] {
    grid-column: 1 / -1;
    min-width: 0;
  }
  :where(body[data-surface=compact]) .font-size-stepper {
    min-width: 0;
    display: inline-grid;
    grid-template-columns: 30px 20px 30px;
    align-items: center;
    justify-content: end;
    gap: 2px;
    font-variant-numeric: tabular-nums;
  }
  :where(body[data-surface=compact]) .font-size-stepper output {
    min-width: 20px;
    color: var(--ink);
    text-align: center;
    font-size: 12px;
    font-weight: 700;
  }
  :where(body[data-surface=compact]) .font-size-step-button {
    position: relative;
    isolation: isolate;
    justify-self: center;
    width: var(--touch-min);
    min-width: var(--touch-min);
    height: var(--touch-min);
    min-height: var(--touch-min);
    padding: 0;
    border: 0;
    color: var(--accent);
    background: transparent;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
  }
  :where(body[data-surface=compact]) .font-size-step-button::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 7px;
    border: 1px solid rgba(77, 65, 49, .2);
    border-radius: 8px;
    background: rgba(255, 255, 255, .72);
  }
  :where(body[data-surface=compact]) .font-size-step-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 0;
  }
  :where(body[data-surface=compact]) .font-size-step-button:disabled {
    cursor: default;
    opacity: .38;
  }
  :where(body[data-surface=compact]).preview-fullscreen .font-size-stepper output {
    color: #f1eee8;
  }
  :where(body[data-surface=compact]).preview-fullscreen .font-size-step-button {
    color: #4c3c27;
  }
  :where(body[data-surface=compact]).preview-fullscreen .font-size-step-button::before {
    border-color: rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .82);
  }
  :where(body[data-surface=compact]) .adjust-dialog:not([hidden]) {
    position: static;
    z-index: 40;
    display: block;
    width: 100%;
    margin: 8px 0 0;
    padding: 0;
  }
  :where(body[data-surface=compact]).adjust-open:not(.preview-fullscreen) .adjust-dialog:not([hidden]) {
    flex: 0 0 auto;
    margin: auto 0 0;
  }
  :where(body[data-surface=compact]) .adjust-sheet {
    display: block;
    padding: 5px 7px;
    max-height: min(34vh, 300px);
    overflow: auto;
  }
  @media (max-width: 560px) {
    :where(body[data-surface=compact]) .adjust-sheet {
      padding: 5px 7px;
      max-height: min(27dvh, 225px);
    }
  }
  :where(body[data-surface=compact]).preview-fullscreen .adjust-dialog:not([hidden]) {
    position: absolute;
    margin: 0 auto;
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-text-group .tray-group-content {
    gap: 2px;
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-group-content {
    padding-bottom: 2px;
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-draft-row {
    display: none;
  }
  :where(body[data-surface=compact]).preview-fullscreen .photo-crop-note {
    display: none;
  }
  :where(body[data-surface=compact]).tray-peek.preview-fullscreen .adjust-dialog:not([hidden]),
  :where(body[data-surface=compact]).tray-peek.preview-fullscreen .fullscreen-save-button,
  :where(body[data-surface=compact]).tray-peek.preview-fullscreen .fullscreen-adjust-button,
  :where(body[data-surface=compact]).tray-peek.preview-fullscreen .fullscreen-button {
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s ease;
  }
  :where(body[data-surface=compact]).preview-fullscreen .adjust-dialog:not([hidden]) {
    transition: opacity .16s ease;
  }
  :where(body[data-surface=compact]) .tray-geometry-strip {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 10px;
    border-top: 1px solid rgba(77, 65, 49, .1);
  }
  :where(body[data-surface=compact]) .tray-geometry-strip > * {
    flex: 0 0 auto;
  }
  :where(body[data-surface=compact]) .tray-geometry-strip .dual-photo-controls:not([hidden]),
  :where(body[data-surface=compact]) .tray-geometry-strip .tray-margin-controls {
    display: contents;
  }
  :where(body[data-surface=compact]) .tray-geometry-strip .dual-photo-controls[hidden] {
    display: none;
  }
  :where(body[data-surface=compact]) .tray-number-field {
    min-width: 0;
    min-height: var(--tray-row);
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
  }
  :where(body[data-surface=compact]) .tray-number-caption {
    font-size: 8px;
  }
  :where(body[data-surface=compact]) .tray-number-stepper {
    display: inline-grid;
    grid-template-columns: 30px 22px 30px;
    align-items: center;
    gap: 1px;
    font-variant-numeric: tabular-nums;
  }
  :where(body[data-surface=compact]) .tray-number-stepper output {
    min-width: 22px;
    color: var(--ink);
    text-align: center;
    font-size: 11px;
    font-weight: 700;
  }
  :where(body[data-surface=compact]) .tray-number-button {
    position: relative;
    isolation: isolate;
    justify-self: center;
    width: 30px;
    min-width: 30px;
    height: var(--tray-row);
    padding: 0;
    border: 0;
    color: var(--accent);
    background: transparent;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
  }
  :where(body[data-surface=compact]) .tray-number-button::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: var(--tray-touch-padding) 0;
    border: 1px solid var(--line-tint);
    border-radius: var(--radius-sm);
    background: var(--surface-light);
  }
  :where(body[data-surface=compact]) .tray-number-button:disabled {
    cursor: default;
    opacity: .36;
  }
  :where(body[data-surface=compact]) .tray-number-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-number-caption {
    color: #f1eee8;
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-number-stepper output {
    color: #f1eee8;
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-number-button {
    color: #4c3c27;
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-number-button::before {
    border-color: rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .82);
  }
  :where(body[data-surface=compact]).preview-fullscreen .tray-geometry-strip {
    border-top-color: rgba(255, 255, 255, .14);
  }
  :where(body[data-surface=compact]) #trayPhotoSlots .photo-slot-card {
    grid-template-columns: minmax(34px, auto) repeat(2, minmax(0, 1fr));
    gap: 4px;
    border-top: 0;
  }
  :where(body[data-surface=compact]) #trayTextSlot {
    display: grid;
    gap: 4px;
  }
  :where(body[data-surface=compact]) #trayTextSlot > * {
    order: 0;
  }
  :where(body[data-surface=compact]) #trayTextSlot .panel-section {
    padding: 0;
    border-bottom: 0;
    overflow: hidden;
  }
  :where(body[data-surface=compact]) #trayTextSlot .metadata-content {
    overflow: hidden;
  }
  :where(body[data-surface=compact]) #trayTextSlot .textarea-label {
    margin-top: 5px;
    font-size: 9px;
  }
  :where(body[data-surface=compact]) #trayTextSlot .textarea-label:first-child {
    margin-top: 0;
  }
  :where(body[data-surface=compact]) #trayTextSlot .text-input {
    min-height: 32px;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 12px;
  }
  :where(body[data-surface=compact]) #trayTextSlot #captionText {
    min-height: 46px;
  }
  :where(body[data-surface=compact]) #trayTextSlot #titleText {
    min-height: 32px;
    height: 32px;
    resize: none;
  }
  :where(body[data-surface=compact]) #trayTextSlot .metadata-settings {
    border-bottom: 0;
  }
  :where(body[data-surface=compact]) #trayTextSlot .metadata-settings > summary {
    padding: 5px 0;
    font-size: 10px;
  }
  :where(body[data-surface=compact]) #trayTextSlot .metadata-content {
    padding: 0;
  }
  :where(body[data-surface=compact]) #trayTextSlot .field-note {
    display: none;
  }
  :where(body[data-surface=compact]) #trayTextSlot .field-with-toggle {
    margin-top: 5px;
  }
  :where(body[data-surface=compact]) #trayTextSlot .option-block {
    margin-top: 6px;
  }
  :where(body[data-surface=compact]).preview-fullscreen #trayTextSlot .textarea-label,
  :where(body[data-surface=compact]).preview-fullscreen #trayTextSlot .metadata-settings > summary,
  :where(body[data-surface=compact]).preview-fullscreen #trayTextSlot .field-with-toggle label,
  :where(body[data-surface=compact]).preview-fullscreen #trayTextSlot .option-label {
    color: rgba(255, 255, 255, .9);
  }
  :where(body[data-surface=compact]).preview-fullscreen #trayTextSlot .text-input {
    border-color: rgba(255, 255, 255, .2);
    color: #fff;
    background: rgba(255, 255, 255, .1);
  }
  :where(body[data-surface=compact]).preview-fullscreen #trayTextSlot .character-count {
    color: rgba(255, 255, 255, .6);
  }
  :where(body[data-surface=compact]).preview-fullscreen #trayTextSlot #captionText {
    min-height: 52px;
    height: 52px;
    line-height: 1.4;
  }
  @media (max-width: 560px) {
    :where(body[data-surface=compact]) #trayPhotoSlots .photo-slot-card label,
    :where(body[data-surface=compact]) #trayPhotoSlots .photo-slot-card button {
      min-height: var(--touch-min);
    }
    :where(body[data-surface=compact]) #trayTextSlot .text-input {
      min-height: var(--input-row-height);
      height: var(--input-row-height);
      font-size: 16px;
      transform: scale(var(--input-visual-scale));
      transform-origin: left center;
      width: var(--input-width-compensation);
    }
    :where(body[data-surface=compact]) #trayTextSlot #captionText {
      min-height: var(--input-body-height);
      height: var(--input-body-height);
      line-height: 1.4;
      resize: none;
    }
  }
  @media (min-width: 1200px) {
    :where(body[data-surface=compact]).preview-fullscreen .adjust-dialog:not([hidden]) {
      inset: var(--fullscreen-pad-top) var(--fullscreen-pad-right) calc(var(--fullscreen-pad-bottom) + 48px) auto;
      width: 340px;
      max-width: 340px;
      margin: 0;
    }
    :where(body[data-surface=compact]).preview-fullscreen .adjust-sheet {
      max-height: 100%;
      height: 100%;
      overflow-y: auto;
      padding: 10px 12px;
      border-radius: 14px;
    }
    :where(body[data-surface=compact]).preview-fullscreen .tray-tabbar {
      height: auto;
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-start;
      gap: 4px;
      margin-bottom: 6px;
    }
    :where(body[data-surface=compact]).preview-fullscreen .tray-tabbar button[data-tray-target] {
      flex: 1 1 88px;
    }
    :where(body[data-surface=compact]).preview-fullscreen .tray-tabbar button:not([data-tray-target]) {
      flex: 0 0 auto;
    }
    :where(body[data-surface=compact]).preview-fullscreen .tray-group > summary {
      display: none;
    }
    :where(body[data-surface=compact]).preview-fullscreen .tray-group {
      border-top: 1px solid rgba(255, 255, 255, .14);
      padding-top: 8px;
      margin-top: 8px;
    }
    :where(body[data-surface=compact]).preview-fullscreen .tray-group:first-of-type {
      border-top: 0;
      padding-top: 0;
      margin-top: 0;
    }
    :where(body[data-surface=compact]).preview-fullscreen .tray-draft-row {
      display: none;
    }
    :where(body[data-surface=compact]).preview-fullscreen .crop-target-row,
    :where(body[data-surface=compact]).preview-fullscreen .photo-crop-ratio-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      row-gap: 1px;
      width: auto;
      min-height: 0;
    }
    :where(body[data-surface=compact]).preview-fullscreen .crop-target-row > span,
    :where(body[data-surface=compact]).preview-fullscreen .photo-crop-ratio-row > span {
      display: block;
      color: rgba(255, 255, 255, .66);
      font-size: 9px;
      line-height: 1.3;
    }
    :where(body[data-surface=compact]).preview-fullscreen .photo-crop-ratio-picker {
      flex-wrap: wrap;
      justify-content: start;
      overflow: visible;
      height: auto;
      row-gap: 4px;
    }
    :where(body[data-surface=compact]).preview-fullscreen .photo-crop-ratio-picker button {
      flex: 0 0 46px;
    }
    :where(body[data-surface=compact]).preview-fullscreen .photo-crop-controls:not([hidden]) {
      grid-template-columns: minmax(0, 1fr);
    }
    :where(body[data-surface=compact]).preview-fullscreen .crop-slot-picker {
      grid-template-columns: repeat(2, 52px);
    }
  }
  :where(body[data-surface=compact]) .title-field-row,
  :where(body[data-surface=compact]) .metadata-field-card {
    display: contents;
  }
  :where(body[data-surface=compact]) #trayPhotoSlots .photo-slot-card {
    min-height: var(--tray-row);
    height: var(--tray-row);
    max-height: var(--tray-row);
  }
  :where(body[data-surface=compact]) #trayPhotoSlots .photo-slot-card label,
  :where(body[data-surface=compact]) #trayPhotoSlots .photo-slot-card button,
  :where(body[data-surface=compact]) #trayPhotoSlots .photo-order-actions > .swap-photos-button {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    min-height: var(--tray-visual-control) !important;
    height: var(--tray-visual-control) !important;
    max-height: var(--tray-visual-control) !important;
    padding-block: 0 !important;
    line-height: 1 !important;
    white-space: nowrap;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  :where(body[data-surface=compact]) #trayTextSlot .font-size-range-field > #fontSizeRange {
    display: none;
  }
  :where(body[data-surface=compact]) #locationSource,
  :where(body[data-surface=compact]) #mapAttribution {
    display: none !important;
  }
  :where(body[data-surface=compact]) #recognizeCityButton {
    position: relative;
    align-self: center;
    min-width: 54px;
    min-height: var(--tray-visual-control) !important;
    height: var(--tray-visual-control) !important;
    max-height: var(--tray-visual-control);
    padding: 0 5px;
    border-radius: 7px;
    font-size: 8px;
  }
  :where(body[data-surface=compact]) #recognizeCityButton::before {
    content: "";
    position: absolute;
    inset: calc(-1 * var(--tray-touch-padding)) 0;
  }
  @media (max-width: 560px) {
    :where(body[data-surface=compact]) #trayTextSlot {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 4px 6px;
    }
    :where(body[data-surface=compact]) #trayTextSlot > .font-size-range-field {
      grid-column: 2;
      grid-row: 1;
      align-self: center;
      height: var(--tray-row);
      margin: 0;
      grid-template-columns: auto max-content;
      gap: 4px;
      min-width: 0;
    }
    :where(body[data-surface=compact]) #trayTextSlot .font-size-caption {
      white-space: nowrap;
    }
    :where(body[data-surface=compact]) #trayTextSlot > .form-section {
      display: contents;
    }
    :where(body[data-surface=compact]) #trayTextSlot .title-field-row {
      grid-column: 1;
      grid-row: 1;
      min-width: 0;
      height: var(--tray-row);
      display: grid;
      grid-template-columns: 30px minmax(0, 1fr);
      align-items: center;
      gap: 4px;
      overflow: hidden;
    }
    :where(body[data-surface=compact]) #trayTextSlot .title-field-row .textarea-label {
      display: block;
      margin: 0;
      white-space: nowrap;
    }
    :where(body[data-surface=compact]) #trayTextSlot .title-field-row .character-count {
      display: none;
    }
    :where(body[data-surface=compact]) #trayTextSlot #titleText {
      min-width: 0;
    }
    :where(body[data-surface=compact]) #trayTextSlot .caption-label {
      grid-column: 1 / -1;
      grid-row: 2;
      margin: 0;
    }
    :where(body[data-surface=compact]) #trayTextSlot #captionText {
      grid-column: 1 / -1;
      grid-row: 3;
    }
    :where(body[data-surface=compact]) #trayTextSlot > .metadata-settings {
      grid-column: 1 / -1;
      grid-row: 4;
      min-width: 0;
    }
    :where(body[data-surface=compact]) #trayTextSlot .metadata-content {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      align-items: start;
      gap: 6px;
    }
    :where(body[data-surface=compact]) #trayTextSlot .metadata-field-card {
      min-width: 0;
      display: block;
      overflow: hidden;
    }
    :where(body[data-surface=compact]) #trayTextSlot .metadata-field-card .field-with-toggle {
      margin: 3px 0;
    }
    :where(body[data-surface=compact]) #trayTextSlot .metadata-field-card .field-spacer {
      margin-top: 3px;
    }
    :where(body[data-surface=compact]) #trayTextSlot .metadata-field-card .text-input {
      min-width: 0;
    }
    :where(body[data-surface=compact]) #trayTextSlot .metadata-field-card .option-block {
      margin-top: 4px;
    }
    :where(body[data-surface=compact]) #trayTextSlot .metadata-field-card .option-label small {
      display: none;
    }
    :where(body[data-surface=compact]) #trayTextSlot .input-action-row {
      gap: 3px;
    }
  }
  :where(body[data-surface=compact]) .draft-item-name-input {
    min-width: 0;
    width: 100%;
    height: 26px;
    padding: 0 7px;
    border: 1px solid var(--accent);
    border-radius: 7px;
    outline: none;
    color: var(--ink);
    background: #fff;
    font-size: 10.5px;
  }
  :where(body[data-surface=compact]) .draft-item-name-input:focus {
    box-shadow: 0 0 0 2px rgba(77, 65, 49, .1);
  }
}
