/* Polygon tool (/polygon-tool): the stage (one canvas with the photo and the polygons) and the few controls of its own.
   Buttons, sliders, palettes and colours come from the app kit and the shared landing controls (docs/app-kit.md).
   Loaded only on this app's page (StylePaths in SeoFilterDemoCatalog.PolygonTool.cs). */

.polygon-tool-landing-app {
    display: grid;
    gap: 1rem;
    align-items: start;
}

.filter-landing-stage.poly-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: auto;
    overflow: hidden;
    box-shadow: none;
    background: #eef1f5;
}

.dark .filter-landing-stage.poly-stage {
    background: #161a22;
}

.poly-canvas {
    display: block;
    width: 100%;
    height: auto;
    max-height: 78vh;
    object-fit: contain;
    /* Corners are placed and dragged on the canvas, so it handles touch itself. */
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: crosshair;
    outline: none;
}

.poly-canvas:focus-visible {
    box-shadow: 0 0 0 3px var(--ak-accent, #2563eb);
}

.poly-canvas.is-dragging {
    cursor: move;
}

body.filter-app-mode .polygon-tool-landing-app > .filter-landing-stage.poly-stage {
    height: 100%;
    max-height: 100%;
    min-height: 0;
}

body.filter-app-mode .poly-canvas {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
}

.poly-file-input {
    display: none;
}

.poly-status {
    margin: 0;
    min-height: 1.4em;
    font-size: 0.875rem;
    color: var(--ak-muted, #64748b);
    font-variant-numeric: tabular-nums;
}

.poly-shape-options {
    display: grid;
    gap: 0.5rem;
}

.poly-shape-options[hidden],
.poly-actions [hidden] {
    display: none;
}

/* CJK labels never wrap before a prolonged sound mark or small kana (コピ / ー). */
.poly-controls {
    line-break: strict;
}
