.overflow-hidden {
    overflow: hidden
}

.block {
    display: block
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0
}

.mb-2 {
    margin-bottom: .5rem
}

.mb-4 {
    margin-bottom: 1rem
}

.mb-6 {
    margin-bottom: 1.5rem
}

.border-t {
    border-top-width: 1px
}

.border-gray-200 {
    --tw-border-opacity: 1;
    border-color: rgb(229 231 235 / var(--tw-border-opacity))
}

.pt-4 {
    padding-top: 1rem
}

.mt-4 {
    margin-top: 1rem
}

.w-full {
    width: 100%
}

.text-center {
    text-align: center
}

.p-1 {
    padding: .25rem
}

.border {
    border-width: 1px;
    border-style: solid
}

.rounded {
    border-radius: .25rem
}

.font-medium {
    font-weight: 500
}

.text-sm {
    font-size: .875rem;
    line-height: 1.25rem
}

.grid {
    display: grid
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr))
}

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

.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr))
}

.gap-2 {
    gap: .5rem
}

.flex {
    display: flex
}

.flex-col {
    flex-direction: column
}

.space-y-3>:not([hidden])~:not([hidden]) {
    margin-top: .75rem
}

.fixed {
    position: fixed
}

.bottom-5 {
    bottom: 1.25rem
}

.right-5 {
    right: 1.25rem
}

.text-white {
    color: #fff
}

.py-2 {
    padding-top: .5rem;
    padding-bottom: .5rem
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem
}

.shadow-xl {
    box-shadow: 0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a
}

.translate-x-120 {
    transform: translate(120%)
}

.transition-transform {
    transition-property: transform;
    transition-timing-function: cubic-bezier(.4, 0, .2, 1);
    transition-duration: .15s
}

.duration-300 {
    transition-duration: .3s
}

:root {
    --font-sans: "Inter", "sans-serif";
    --bg-main: #f4f5f7;
    --bg-sidebar: #ffffff;
    --bg-nav: #ffffff;
    --text-primary: #172b4d;
    --text-secondary: #42526e;
    --text-muted: #6b7f99;
    --border-color: #dfe1e6;
    --primary-accent: #0052cc;
    --primary-accent-hover: #0041a3;
    --nav-height: 60px;
    --sidebar-width: 320px;
    --shadow-sm: 0 1px 1px rgba(9, 30, 66, .15);
    --shadow-md: 0 4px 8px -2px rgba(9, 30, 66, .25), 0 0 1px rgba(9, 30, 66, .31);
    --radius-sm: 3px;
    --radius-md: 6px
}

*,
*:before,
*:after {
    box-sizing: border-box
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale
}

body.overflow-hidden {
    overflow: hidden
}

input[type=file] {
    display: none
}

.hidden {
    display: none !important
}

#app-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
    padding: 0 24px;
    background-color: var(--bg-nav);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1001;
    box-shadow: var(--shadow-sm)
}

.nav-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary)
}

.nav-title a {
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px
}

.nav-links {
    display: flex;
    gap: 28px
}

.nav-links a {
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color .2s ease
}

.nav-links a:hover {
    color: var(--primary-accent)
}

#app-container {
    display: flex;
    height: 100vh;
    padding-top: var(--nav-height);
    position: relative;
    overflow-x: hidden
}

#left-sidebar,
#right-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background-color: var(--bg-sidebar);
    position: relative;
    transition: all .3s ease-in-out;
    height: calc(100vh - var(--nav-height));
    display: flex;
    flex-direction: column
}

#left-sidebar {
    border-right: 1px solid var(--border-color)
}

#right-sidebar {
    border-left: 1px solid var(--border-color)
}

#center-content {
    flex: 1;
    display: grid;
    grid-template-rows: auto 1fr;
    justify-items: center;
    padding: 2rem;
    height: calc(100vh - var(--nav-height));
    overflow: hidden
}

#canvas-viewport {
    width: 100%;
    height: 100%;
    overflow: auto;
    display: grid;
    justify-items: center;
    align-items: start
}

.collage-wrapper {
    background-color: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md)
}

#layout-wrapper {
    display: flex;
    width: 100%;
    max-height: 100%
}

#layout-grid {
    flex: 1;
    display: grid;
    position: relative
}

#stitching-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    align-self: start
}

#stitching-wrapper.is-empty {
    width: auto;
    height: auto
}

#stitching-grid {
    display: flex;
    box-sizing: border-box
}

#stitching-grid.horizontal {
    flex-direction: row;
    align-items: flex-start
}

#stitching-grid.vertical {
    flex-direction: column;
    align-items: center
}

#stitching-grid.horizontal img {
    height: 400px;
    width: auto
}

#stitching-grid.vertical img {
    width: 600px;
    height: auto
}

#stitching-grid.is-sortable>img:hover {
    cursor: grab
}

#stitching-grid>img.dragging {
    opacity: .5;
    cursor: grabbing;
    transform: scale(1.03);
    box-shadow: 0 10px 20px #0003
}

.stitched-image-container {
    position: relative;
    display: block;
    line-height: 0
}

.delete-stitched-image-btn,
.add-stitched-image-btn {
    position: absolute;
    top: 10px;
    z-index: 10;
    width: 28px;
    height: 28px;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    font-weight: 700;
    line-height: 26px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity .2s ease-in-out, transform .2s ease-in-out;
    transform: scale(.8)
}

.stitched-image-container:hover .delete-stitched-image-btn,
.stitched-image-container:hover .add-stitched-image-btn {
    opacity: 1;
    transform: scale(1)
}

.delete-stitched-image-btn {
    right: 10px;
    background-color: #0009
}

.delete-stitched-image-btn:hover {
    background-color: #ff0000b3
}

.add-stitched-image-btn {
    right: 48px;
    background-color: #008000b3;
    font-size: 24px;
    line-height: 25px
}

.add-stitched-image-btn:hover {
    background-color: #009600e6
}

.stitched-image-container.drag-over {
    opacity: .5;
    transition: opacity .2s ease-in-out
}

.grid-cell.dragging {
    opacity: .4;
    border: 2px dashed var(--primary-accent)
}

#mode-switcher {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1.5rem
}

#mode-switcher button {
    flex: 1;
    padding: .625rem 0;
    font-weight: 500;
    font-size: .9rem;
    background-color: var(--bg-sidebar);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: background-color .2s, color .2s
}

#mode-switcher button:first-child {
    border-right: 1px solid var(--border-color)
}

#mode-switcher button.active {
    background-color: var(--primary-accent);
    color: #fff
}

.panel {
    background-color: transparent;
    border: none;
    box-shadow: none;
    padding: 0
}

.panel-section-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .05em
}

.layout-group-title {
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 1.5rem;
    margin-bottom: .75rem;
    padding-bottom: 0;
    border-bottom: none;
    font-size: .875rem
}

.layout-thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem
}

.layout-thumbnail {
    border-radius: var(--radius-sm);
    background-color: #fafbfc;
    border: 1px solid transparent;
    cursor: pointer
}

.layout-thumbnail:hover {
    border-color: #c1c7d0
}

.layout-thumbnail.active {
    border-color: var(--primary-accent)
}

.thumbnail-grid {
    display: grid;
    width: 100%;
    aspect-ratio: 1 / 1;
    gap: 3px
}

.thumbnail-cell {
    background-color: #b3d4ff;
    border-radius: 1px
}

.layout-thumbnail.active .thumbnail-cell {
    background-color: var(--primary-accent)
}

#aspect-ratio-btns button,
#stitching-direction-btns button {
    padding: .5rem;
    background-color: #fafbfc;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all .2s ease;
    cursor: pointer
}

#aspect-ratio-btns button:hover,
#stitching-direction-btns button:hover {
    background-color: #f4f5f7
}

#aspect-ratio-btns button.active,
#stitching-direction-btns button.active {
    background-color: #e9f2ff;
    color: var(--primary-accent);
    border-color: var(--primary-accent);
    font-weight: 600
}

input[type=range] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: #dfe1e6;
    border-radius: 2px
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-accent);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    cursor: pointer
}

input[type=range]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--primary-accent);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    cursor: pointer
}

label {
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: left
}

input[type=color] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    padding: 0;
    background-color: transparent;
    cursor: pointer
}

input[type=color]::-webkit-color-swatch-wrapper {
    padding: 4px
}

input[type=color]::-webkit-color-swatch {
    border-radius: var(--radius-sm);
    border: none
}

.action-button {
    font-size: .875rem;
    font-weight: 500;
    padding: .625rem 1rem;
    border-radius: var(--radius-sm);
    transition: all .2s ease-out;
    border: 1px solid transparent;
    text-align: center
}

.action-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm)
}

.action-button:active {
    transform: translateY(0);
    box-shadow: none
}

#download-btn {
    background-color: var(--primary-accent);
    color: #fff
}

#download-btn:hover {
    background-color: var(--primary-accent-hover)
}

#shuffle-btn,
.action-button.secondary {
    background-color: #fafbfc;
    color: var(--text-secondary);
    border: 1px solid var(--border-color)
}

#shuffle-btn:hover:not(:disabled),
.action-button.secondary:hover {
    background-color: #f4f5f7;
    border-color: #c1c7d0
}

.action-button:disabled,
#shuffle-btn.disabled {
    background: #fafbfc !important;
    color: #a5adba !important;
    border-color: var(--border-color) !important;
    transform: none !important;
    box-shadow: none !important;
    cursor: not-allowed
}

.grid-cell {
    background-color: #f4f5f7;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none
}

.grid-cell.drag-over {
    box-shadow: inset 0 0 0 2px var(--primary-accent)
}

.grid-cell .hidden-file-input {
    display: none
}

.grid-cell.selected {
    outline: 3px solid #007BFF;
    outline-offset: -3px;
    box-shadow: 0 0 15px #007bff80
}

.cell-button-container {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 5px;
    z-index: 10;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: 125px
}

.cell-icon-btn {
    width: 28px;
    height: 28px;
    background-color: #0009;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s ease;
    opacity: 0;
    transform: scale(.8);
    pointer-events: none
}

.remove-btn {
    font-size: 24px;
    line-height: 28px
}

.cell-icon-btn svg {
    width: 16px;
    height: 16px
}

.grid-cell.has-image:hover .cell-icon-btn,
.grid-cell.selected .cell-icon-btn {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto
}

.remove-btn:hover {
    background-color: #e53e3e
}

.replace-btn:hover {
    background-color: #007bff;
    transform: scale(1.1) rotate(90deg)
}

.zoom-in-btn:hover,
.zoom-out-btn:hover {
    background-color: #28a745;
    transform: scale(1.2)
}

.pan-toggle-btn:hover {
    background-color: #3182ce
}

.grid-cell.is-panning-touch .pan-toggle-btn {
    background-color: var(--primary-accent);
    color: #fff
}

.grid-cell.is-panning-touch {
    outline: 3px solid var(--primary-accent);
    outline-offset: -3px
}

.reset-btn:hover {
    background-color: #ffc107;
    transform: scale(1.1) rotate(360deg)
}

.upload-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%
}

.upload-icon {
    width: 32px;
    height: 32px;
    color: var(--primary-accent);
    opacity: .6
}

.gutter {
    position: absolute;
    background: transparent;
    z-index: 20;
    transition: background-color .2s ease
}

.gutter-h {
    cursor: ns-resize;
    height: 10px;
    transform: translateY(-5px)
}

.gutter-v {
    cursor: ew-resize;
    width: 10px;
    transform: translate(-5px)
}

.gutter:hover {
    background: #39f6
}

#toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    color: #fff;
    font-weight: 500;
    z-index: 2000;
    transform: translateY(150%);
    opacity: 0;
    transition: transform .4s ease-in-out, opacity .4s ease-in-out
}

#toast.show {
    transform: translateY(0);
    opacity: 1
}

#toast.info {
    background-color: #263238
}

#toast.success {
    background-color: #28a745
}

#toast.error {
    background-color: #dc3545
}

#canvas-action-toolbar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px #0000000d
}

.toolbar-group-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px
}

#canvas-action-toolbar .action-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500
}

.toolbar-group-left {
    display: flex;
    align-items: center;
    gap: 12px
}

body.stitching-mode #canvas-action-toolbar #shuffle-btn {
    display: none
}

#stitching-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 250px;
    height: 150px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color .2s, border-color .2s;
    margin: 2rem
}

#stitching-placeholder:hover {
    background-color: #fafbfc;
    border-color: var(--primary-accent)
}

#stitching-placeholder span {
    margin-top: .5rem;
    font-weight: 500
}

#stitching-placeholder.hidden {
    display: none
}

#canvas-hint {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translate(-50%);
    background-color: #172b4dcc;
    color: #fff;
    padding: .5rem 1rem;
    border-radius: var(--radius-md);
    font-size: .8rem;
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, 10px);
    transition: opacity .3s ease, transform .3s ease;
    pointer-events: none;
    z-index: 200
}

#canvas-hint.is-visible {
    opacity: 1;
    transform: translate(-50%)
}

#quality-selector .action-button.active {
    background-color: #e9f2ff;
    color: var(--primary-accent);
    border-color: var(--primary-accent);
    font-weight: 600;
    box-shadow: inset 0 1px 2px #0000001a
}

.text-element-container {
    position: absolute;
    transform: translate(-50%, -50%);
    padding: 10px;
    border: 2px dashed transparent;
    transition: border-color .2s ease
}

.text-element-container:hover {
    border-color: #0ea5e980
}

.text-element-container.selected {
    border-color: #0ea5e9;
    z-index: 10
}

.text-content {
    cursor: move;
    padding: 8px 12px;
    white-space: pre-wrap;
    outline: none;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, .5)
}

.text-content:focus {
    cursor: text
}

.text-toolbar,
.delete-text-button {
    display: none
}

.text-element-container.selected .text-toolbar,
.text-element-container.selected .delete-text-button {
    display: flex
}

.text-toolbar {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translate(-50%);
    margin-bottom: 8px;
    background: #2d3748;
    color: #fff;
    padding: 8px;
    border-radius: 6px;
    box-shadow: 0 4px 12px #0000004d;
    align-items: center;
    gap: 10px;
    z-index: 20
}

.text-toolbar input[type=number] {
    width: 60px;
    background-color: #4a5568;
    border: 1px solid #718096;
    color: #fff;
    padding: 4px;
    border-radius: 4px
}

.text-toolbar input[type=color] {
    width: 32px;
    height: 32px;
    padding: 2px;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer
}

.delete-text-button {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: #fff;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    font-family: sans-serif;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 20
}

.arrow-container {
    position: absolute;
    cursor: move;
    z-index: 5
}

.arrow-container.selected {
    z-index: 15
}

.arrow-container svg {
    width: 100%;
    height: 100%;
    overflow: visible
}

.arrow-handle {
    display: none;
    position: absolute;
    width: 14px;
    height: 14px;
    background-color: #fff;
    border: 2px solid #0ea5e9;
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%)
}

.arrow-container.selected .arrow-handle {
    display: block
}

.arrow-container .text-toolbar,
.arrow-container .delete-text-button {
    display: none
}

.arrow-container.selected .text-toolbar,
.arrow-container.selected .delete-text-button {
    display: flex
}

.shape-container {
    position: absolute;
    border: 1px dashed transparent;
    transition: border-color .2s;
    z-index: 5
}

.shape-container.selected {
    border-color: #0ea5e9;
    z-index: 15
}

.shape-element {
    width: 100%;
    height: 100%;
    cursor: move
}

.shape-toolbar {
    display: none;
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translate(-50%);
    background: #2d3748;
    color: #fff;
    padding: 8px;
    border-radius: 6px;
    box-shadow: 0 4px 12px #0000004d;
    align-items: center;
    gap: 10px;
    z-index: 20
}

.shape-container.selected .shape-toolbar {
    display: flex
}

.shape-toolbar input[type=number] {
    width: 60px;
    background-color: #4a5568;
    border: 1px solid #718096;
    color: #fff;
    padding: 4px;
    border-radius: 4px
}

.shape-toolbar input[type=color] {
    width: 32px;
    height: 32px;
    padding: 2px;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer
}

.resize-handle {
    display: none;
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #fff;
    border: 2px solid #007bff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 25
}

.shape-container.selected .resize-handle {
    display: block
}

.resize-handle.n {
    top: 0;
    left: 50%;
    cursor: ns-resize
}

.resize-handle.ne {
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
    cursor: nesw-resize
}

.resize-handle.e {
    top: 50%;
    right: 0;
    transform: translate(50%, -50%);
    cursor: ew-resize
}

.resize-handle.se {
    bottom: 0;
    right: 0;
    transform: translate(50%, 50%);
    cursor: nwse-resize
}

.resize-handle.s {
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 50%);
    cursor: ns-resize
}

.resize-handle.sw {
    bottom: 0;
    left: 0;
    transform: translate(-50%, 50%);
    cursor: nesw-resize
}

.resize-handle.w {
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
    cursor: ew-resize
}

.resize-handle.nw {
    top: 0;
    left: 0;
    cursor: nwse-resize
}

.rotation-handle {
    display: none;
    position: absolute;
    left: 50%;
    top: -25px;
    transform: translate(-50%);
    width: 16px;
    height: 16px;
    background-color: #f59e0b;
    border: 2px solid white;
    border-radius: 50%;
    cursor: alias
}

.rotation-handle:before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%);
    width: 2px;
    height: 15px;
    background-color: #f59e0b
}

.arrow-container.selected .rotation-handle {
    display: block
}

.toolbar-delete-btn {
    background: #ef4444;
    color: #fff;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    transition: background-color .2s
}

.toolbar-delete-btn:hover {
    background: #dc2626
}

.action-button.danger {
    background-color: #ef4444;
    color: #fff
}

.action-button.danger:hover {
    background-color: #dc2626
}

.mobile-nav-btn {
    display: none;
    background: none;
    border: none;
    padding: 4px;
    color: var(--text-primary);
    cursor: pointer
}

#mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #091e4280;
    z-index: 999;
    transition: opacity .3s ease
}

#mobile-overlay.hidden {
    opacity: 0;
    pointer-events: none
}

body.sidebar-open {
    overflow: hidden
}

.sidebar-content-wrapper {
    width: 100%;
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0
}

#left-sidebar,
#right-sidebar,
#pc-toggle-left,
#pc-toggle-right {
    transition: all .3s ease-in-out
}

.pc-sidebar-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 48px;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    color: var(--text-muted)
}

.pc-sidebar-toggle:hover {
    background-color: var(--primary-accent);
    color: #fff;
    border-color: var(--primary-accent)
}

#pc-toggle-left {
    left: calc(var(--sidebar-width) - 2px);
    border-radius: 0 6px 6px 0
}

#pc-toggle-right {
    right: calc(var(--sidebar-width) - 2px);
    border-radius: 6px 0 0 6px
}

#app-container.left-sidebar-collapsed #left-sidebar {
    margin-left: calc(-1 * var(--sidebar-width))
}

#app-container.left-sidebar-collapsed #pc-toggle-left {
    left: -2px
}

#app-container.left-sidebar-collapsed #pc-toggle-left svg {
    transform: scaleX(-1)
}

#app-container.right-sidebar-collapsed #right-sidebar {
    margin-right: calc(-1 * var(--sidebar-width))
}

#app-container.right-sidebar-collapsed #pc-toggle-right {
    right: -2px
}

#app-container.right-sidebar-collapsed #pc-toggle-right svg {
    transform: scaleX(-1)
}

.grid-cell.has-image {
    cursor: grab
}

.grid-cell.has-image.is-panning {
    cursor: grabbing
}

#wechat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000d9;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    text-align: center;
    color: #fff;
    font-family: var(--font-primary)
}

#wechat-overlay.hidden {
    display: none
}

.wechat-overlay-content {
    margin-top: 60px;
    padding: 20px
}

.wechat-overlay-arrow {
    width: 80px;
    height: 80px;
    color: #fff;
    transform: rotate(45deg);
    margin: 0 auto 20px;
    display: block
}

.wechat-overlay-content p {
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.6;
    margin: 0
}

.wechat-overlay-subtext {
    font-size: .9rem;
    font-weight: 400;
    color: #b0b0b0;
    margin-top: 10px !important
}

.action-button.danger {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca
}

.action-button.danger:hover {
    background-color: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5
}

.grid-cell.has-image,
.stitched-image-container {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none
}

.is-ipad .grid-cell.has-image,
.is-ipad .stitched-image-container {
    touch-action: none
}

@media (max-width: 1024px) {
    body.sidebar-open {
        overflow: hidden
    }

    .pc-sidebar-toggle {
        display: none
    }

    #app-nav {
        padding: 0 16px
    }

    .nav-title {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        font-size: 1.1rem;
        max-width: calc(100% - 140px);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis
    }

    .nav-title .nav-icon {
        width: 24px;
        height: 24px
    }

    .nav-links {
        display: none
    }

    .mobile-nav-btn {
        display: block
    }

    #center-content {
        padding: 1rem
    }

    #left-sidebar,
    #right-sidebar {
        width: 280px;
        height: 100%;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1000;
        border: none;
        padding-top: var(--nav-height);
        box-shadow: var(--shadow-md);
        transform: translate(-100%);
        transition: transform .3s ease-in-out
    }

    #right-sidebar {
        left: auto;
        right: 0;
        transform: translate(100%)
    }

    #left-sidebar.is-open,
    #right-sidebar.is-open {
        transform: translate(0)
    }

    #stitching-grid.vertical img {
        width: 100%
    }

    #stitching-grid.horizontal img {
        height: 200px
    }

    #canvas-action-toolbar {
        justify-content: center;
        flex-wrap: wrap
    }

    .toolbar-group-right {
        margin-left: 0
    }

    #canvas-action-toolbar .action-button span {
        display: none
    }

    #canvas-action-toolbar .action-button {
        padding: 10px;
        justify-content: center;
        gap: 0
    }

    .grid-cell.has-image,
    .stitched-image-container {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none
    }

    #canvas-hint {
        display: none
    }
}