/* Corelyn Tools — Hexagon Splitter */

:root {
    --bg-base: #0d1925;
    --bg-panel: rgba(255, 255, 255, 0.04);
    --bg-input: rgba(8, 14, 22, 0.65);
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(79, 140, 255, 0.28);
    --text-primary: #f4f7fb;
    --text-secondary: rgba(244, 247, 251, 0.72);
    --text-muted: rgba(244, 247, 251, 0.52);
    --accent-blue: #4f8cff;
    --accent-violet: #8b6cff;
    --accent-green: #7dffb2;
    --radius-md: 14px;
    --radius-sm: 8px;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    -webkit-text-size-adjust: 100%;
    height: 100%;
}

body {
    margin: 0;
    height: 100%;
    min-height: 100svh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
    background:
        radial-gradient(ellipse 70% 45% at 50% -5%, rgba(79, 140, 255, 0.12), transparent 60%),
        radial-gradient(ellipse 50% 35% at 90% 100%, rgba(139, 108, 255, 0.08), transparent 55%),
        var(--bg-base);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

.hs-app {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

/* Topbar */

.hs-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    min-height: 64px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(13, 25, 37, 0.92);
}

.hs-topbar__brand {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 0.75rem;
}

.hs-topbar__suite {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-blue);
}

.hs-topbar__tool {
    font-size: 1rem;
    font-weight: 600;
}

.hs-topbar__back {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: color 180ms var(--ease-out), background 180ms var(--ease-out);
}

.hs-topbar__back:hover,
.hs-topbar__back:focus-visible {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.hs-topbar__back:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Main */

.hs-main {
    flex: 1;
    padding: clamp(1rem, 3vw, 1.75rem);
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.hs-intro h1 {
    margin: 0 0 0.4rem;
    font-size: clamp(1.4rem, 4vw, 1.85rem);
    letter-spacing: -0.02em;
}

.hs-intro p {
    margin: 0 0 0.35rem;
    color: var(--text-secondary);
}

.hs-privacy {
    font-size: 0.82rem !important;
    color: var(--text-muted) !important;
}

/* Layout */

.hs-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 1.25rem;
    margin-top: 1.25rem;
    align-items: start;
}

@media (max-width: 900px) {
    .hs-layout {
        grid-template-columns: 1fr;
    }
}

.hs-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.hs-workspace-col {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
}

/* Panels */

.hs-panel {
    padding: 1rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-panel);
}

.hs-panel__title {
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-blue);
}

/* Fields */

.hs-field {
    margin-bottom: 0.7rem;
}

.hs-field:last-child {
    margin-bottom: 0;
}

.hs-field label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.hs-field input[type="number"],
.hs-field input[type="range"],
.hs-field select {
    width: 100%;
    font: inherit;
    color: var(--text-primary);
}

.hs-field input[type="number"],
.hs-field select {
    min-height: 40px;
    padding: 0.5rem 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
}

.hs-field input[type="number"]:focus-visible,
.hs-field select:focus-visible,
.hs-field input[type="range"]:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.hs-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.hs-field--check label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-bottom: 0;
}

.hs-field--check input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent-blue);
}

/* Dropzone */

.hs-dropzone {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-accent);
    background: rgba(79, 140, 255, 0.04);
    text-align: center;
    cursor: pointer;
    transition: border-color 180ms var(--ease-out), background 180ms var(--ease-out);
}

.hs-dropzone:hover,
.hs-dropzone.is-dragover {
    border-color: var(--accent-blue);
    background: rgba(79, 140, 255, 0.08);
}

.hs-dropzone__label {
    margin: 0;
    font-weight: 600;
}

.hs-dropzone__hint {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.hs-meta {
    margin: 0.6rem 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.hs-warning {
    margin: 0.4rem 0 0;
    font-size: 0.82rem;
    color: #ffcc80;
}

/* Mode */

.hs-mode-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.hs-mode {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: border-color 180ms var(--ease-out), background 180ms var(--ease-out);
}

.hs-mode:has(input:checked) {
    border-color: var(--border-accent);
    background: rgba(79, 140, 255, 0.08);
}

.hs-mode input {
    accent-color: var(--accent-blue);
}

.hs-mode span {
    font-size: 0.88rem;
}

.hs-mode-help {
    margin: 0.65rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.hs-mode-help li {
    margin-bottom: 0.2rem;
}

/* Buttons */

.hs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.hs-btn--primary {
    color: #fff;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-violet));
}

.hs-btn--ghost {
    width: 100%;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
}

.hs-btn:hover,
.hs-btn:focus-visible {
    opacity: 0.92;
}

.hs-btn:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 3px;
}

/* Canvas */

.hs-panel--workspace {
    padding: 0.75rem;
}

.hs-canvas-wrap {
    position: relative;
    width: 100%;
    min-height: 280px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.25);
    overflow: hidden;
    touch-action: none;
}

#hs-canvas {
    display: block;
    width: 100%;
    height: auto;
    cursor: grab;
}

#hs-canvas.mode-pan-view {
    cursor: grab;
}

#hs-canvas.mode-pan-view.is-dragging {
    cursor: grabbing;
}

#hs-canvas.mode-move-image,
#hs-canvas.mode-move-grid {
    cursor: move;
}

#hs-canvas.mode-move-hex {
    cursor: grab;
}

#hs-canvas.mode-move-hex.is-dragging {
    cursor: grabbing;
}

#hs-canvas.mode-select {
    cursor: crosshair;
}

#hs-canvas.is-dragging {
    cursor: grabbing;
}

.hs-canvas-hint {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.hs-status-panel {
    margin-bottom: 0.5rem;
}

.hs-status-detail {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.hs-status-detail.is-warn {
    color: #ffcc80;
}

.hs-panel--auto .hs-btn {
    width: 100%;
    margin-top: 0.35rem;
}

.hs-panel .hs-btn.hs-btn--ghost {
    width: 100%;
    margin-top: 0.35rem;
}

.hs-panel--snap .hs-check,
.hs-panel--hex-tools .hs-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.35rem 0;
    font-size: 0.85rem;
    cursor: pointer;
}

.hs-panel--snap .hs-check input,
.hs-panel--hex-tools .hs-check input {
    margin: 0;
}

.hs-btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.hs-btn-row .hs-btn {
    width: 100%;
    margin-top: 0;
}

.hs-panel--align .hs-btn-row:last-child {
    margin-bottom: 0.15rem;
}

#hs-collision-count.quality-bad {
    color: #ff8a80;
}

#hs-collision-count.quality-good {
    color: #7dcea0;
}

.hs-auto-intro {
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.hs-auto-detected {
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    color: #7dcea0;
    line-height: 1.4;
}

#hs-3d-quality-group[hidden],
#hs-photo-quality-group[hidden],
#hs-printer3d-custom-row[hidden] {
    display: none !important;
}

.hs-rec-box {
    margin: 0.75rem 0;
    padding: 0.75rem;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.15);
}

.hs-rec-box.quality-good {
    border-color: rgba(125, 206, 160, 0.35);
}

.hs-rec-box.quality-warn {
    border-color: rgba(255, 204, 128, 0.45);
}

.hs-rec-box.quality-bad {
    border-color: rgba(255, 138, 128, 0.45);
}

.hs-rec-box__title {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.hs-rec-dims {
    margin: 0;
}

.hs-rec-warning {
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
    color: #ffcc80;
    line-height: 1.4;
}

.hs-rec-box .hs-btn--primary {
    margin-top: 0.65rem;
}

.hs-auto-dims {
    margin: 0.5rem 0;
}

.hs-auto-summary {
    margin: 0.5rem 0 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.quality-good,
.hs-auto-quality.quality-good,
#hs-dim-quality.quality-good {
    color: #7dcea0;
}

.quality-warn,
.hs-auto-quality.quality-warn,
#hs-dim-quality.quality-warn {
    color: #ffcc80;
}

.quality-bad,
.hs-auto-quality.quality-bad,
#hs-dim-quality.quality-bad {
    color: #ff8a80;
}

.hs-canvas-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.hs-canvas-empty[hidden] {
    display: none !important;
}

/* Export */

.hs-export-status {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}

.hs-export-statusline {
    margin: 0.5rem 0 0;
    font-size: 0.82rem;
    color: var(--accent-green);
    min-height: 1.2em;
}

.hs-export-note {
    margin: 0.65rem 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.hs-export-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.hs-field input[type="text"] {
    width: 100%;
    min-height: 40px;
    padding: 0.5rem 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    font: inherit;
    color: var(--text-primary);
}

.hs-field input[type="text"]:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.hs-field-hint {
    margin: 0.35rem 0 0;
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Dimensions panel */

.hs-dims {
    margin: 0;
    display: grid;
    gap: 0.35rem;
}

.hs-dims__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    font-size: 0.84rem;
}

.hs-dims__row dt {
    margin: 0;
    color: var(--text-secondary);
}

.hs-dims__row dd {
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.hs-dims__bed {
    margin: 0.65rem 0 0;
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 180, 80, 0.28);
    background: rgba(255, 180, 80, 0.08);
    font-size: 0.8rem;
    color: #ffcc80;
    line-height: 1.45;
}

.hs-dims__bed.is-ok {
    border-color: rgba(80, 220, 140, 0.28);
    background: rgba(80, 220, 140, 0.08);
    color: var(--accent-green);
}

.hs-export-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

.hs-export-group__title {
    margin: 0 0 0.15rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-blue);
}

.hs-field-hint--warn {
    color: #ffcc80;
}

.hs-export-svg {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

.hs-export-svg__label {
    margin: 0 0 0.15rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.hs-export-actions--secondary {
    margin-top: 0.5rem;
}

.hs-field--file {
    margin-top: 0.75rem;
}

.hs-file-input {
    width: 100%;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.hs-export-hint {
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.hs-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.hs-preview-grid[hidden] {
    display: none !important;
}

.hs-preview-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.03);
}

.hs-preview-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    background: repeating-conic-gradient(#1a2835 0% 25%, #152030 0% 50%) 50% / 16px 16px;
    border-radius: 4px;
}

.hs-preview-item__name {
    font-size: 0.75rem;
    color: var(--text-muted);
    word-break: break-all;
}

.hs-preview-item .hs-btn {
    min-height: 34px;
    font-size: 0.82rem;
    padding: 0.35rem 0.75rem;
}

/* Preview modal */

.hs-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(6px);
}

.hs-preview-modal[hidden] {
    display: none !important;
}

.hs-preview-modal__panel {
    width: min(1180px, 96vw);
    max-height: 90vh;
    overflow: auto;
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: rgba(15, 23, 42, 0.98);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.hs-preview-modal__head {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
    position: sticky;
    top: -1rem;
    z-index: 1;
    padding: 0.25rem 0 0.75rem;
    background: rgba(15, 23, 42, 0.98);
}

.hs-preview-modal__head h2 {
    margin: 0;
    font-size: 1.05rem;
}

.hs-preview-modal__meta,
.hs-preview-modal__warnings {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.hs-preview-modal__warnings {
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: var(--radius-sm);
    background: rgba(245, 158, 11, 0.08);
    color: #facc15;
}

.hs-preview-grid--modal {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

/* Toast */

.hs-toast {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    z-index: 200;
    max-width: min(380px, calc(100vw - 2rem));
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-accent);
    background: rgba(13, 25, 37, 0.96);
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}

.hs-toast[hidden] {
    display: block !important;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(12px);
}

.hs-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Editor workflow layout */

.hs-privacy {
    margin: 0 0 0.4rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.hs-editor {
    min-height: 0;
    display: grid;
    grid-template-columns: 76px minmax(520px, 1fr) minmax(340px, 400px);
    grid-template-rows: minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    overflow: hidden;
    align-items: stretch;
}

.hs-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    width: 76px;
    min-width: 76px;
    max-width: 76px;
    padding: 0.5rem 0.35rem;
    background: rgba(8, 14, 22, 0.92);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    align-self: stretch;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.hs-tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    width: 3.4rem;
    min-height: 3.2rem;
    padding: 0.35rem 0.2rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.62rem;
    line-height: 1.2;
    transition: background 150ms var(--ease-out), border-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

.hs-tool-btn__icon {
    font-size: 1.05rem;
    line-height: 1;
}

.hs-tool-btn:hover,
.hs-tool-btn:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    outline: none;
}

.hs-tool-btn.is-active {
    background: rgba(79, 140, 255, 0.18);
    border-color: rgba(79, 140, 255, 0.45);
    color: var(--text-primary);
}

.hs-tool-btn[data-hs-tool="delete-hex"].is-active {
    background: rgba(255, 120, 80, 0.18);
    border-color: rgba(255, 120, 80, 0.45);
}

.hs-info-btn {
    align-self: center;
    width: 1.1rem;
    height: 1.1rem;
    margin: -0.15rem 0 0.35rem;
    padding: 0;
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 0.62rem;
    line-height: 1;
    cursor: pointer;
}

.hs-info-btn:hover,
.hs-info-btn:focus-visible {
    color: var(--accent-blue);
    border-color: var(--border-accent);
}

.hs-workspace {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.hs-stage-card {
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: rgba(8, 14, 22, 0.75);
}

.hs-canvas-wrap {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 280px;
    border-radius: var(--radius-sm);
    border: none;
    background: #0a1018;
    overflow: hidden;
    touch-action: none;
}

.hs-workspace-status {
    margin-top: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    font-size: 0.78rem;
}

.hs-properties {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
    width: 100%;
    max-width: 400px;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 5rem;
    overscroll-behavior: contain;
    justify-self: stretch;
}

.hs-properties input,
.hs-properties select,
.hs-properties textarea,
.hs-properties .hs-btn {
    max-width: 100%;
}

/* Accordion / editor sections */

.hs-accordion,
.editor-section {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-panel);
    overflow: hidden;
    flex-shrink: 0;
}

.hs-accordion > summary,
.editor-section-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 20px;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 14px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.hs-accordion > summary::-webkit-details-marker {
    display: none;
}

.editor-section-title,
.hs-accordion__title {
    min-width: 0;
    font-weight: 700;
    font-size: 0.84rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.editor-section-meta,
.hs-accordion__status {
    max-width: 120px;
    min-width: 0;
    font-weight: 400;
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.editor-section-chevron {
    width: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1;
    flex: none;
    transition: transform 150ms var(--ease-out);
}

.editor-section:not([open]) .editor-section-chevron,
.hs-accordion:not([open]) .editor-section-chevron {
    transform: rotate(-90deg);
}

.hs-accordion__body,
.editor-section-body {
    padding: 14px 16px 16px;
    display: grid;
    gap: 14px;
    border-top: 1px solid var(--border-subtle);
}

.hs-accordion__body > .hs-field,
.editor-section-body > .hs-field {
    margin-bottom: 0;
}

.control-grid-2,
.hs-field-row.control-grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

.hs-control-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.hs-control-label__text {
    min-width: 0;
    flex: 1;
}

.hs-control-label .hs-info-btn,
.hs-check .hs-info-btn--inline {
    margin: 0;
    flex-shrink: 0;
}

.hs-check {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
}

@media (max-width: 900px) {
    .editor-section-summary,
    .hs-accordion > summary {
        grid-template-columns: minmax(0, 1fr) 20px;
    }

    .editor-section-meta,
    .hs-accordion__status {
        display: none;
    }
}

@media (max-width: 1100px) {
    .control-grid-2,
    .hs-field-row.control-grid-2 {
        grid-template-columns: 1fr;
    }
}

.hs-topbar__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.hs-topbar__actions .hs-btn {
    width: auto;
    min-width: 0;
    height: 36px;
    padding: 0 14px;
    font-size: 0.82rem;
    white-space: nowrap;
}

.hs-topbar__back {
    height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
}

.hs-btn--file {
    cursor: pointer;
}

#hs-canvas.mode-delete-hex {
    cursor: cell;
}

#hs-canvas.mode-add-hex {
    cursor: copy;
}

#hs-canvas.mode-select-hex,
#hs-canvas.mode-select {
    cursor: default;
}

@media (max-width: 1100px) {
    .hs-editor {
        grid-template-columns: 76px minmax(420px, 1fr) minmax(300px, 360px);
    }
}

@media (max-width: 800px) {
    body {
        overflow: auto;
    }

    .hs-app {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible;
    }

    .hs-editor {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(50vh, 1fr) auto;
        overflow: visible;
    }

    .hs-toolbar {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .hs-tool-btn {
        width: 3rem;
        min-height: 2.8rem;
    }

    .hs-info-btn {
        display: none;
    }

    .hs-workspace {
        order: 2;
        min-height: 50vh;
    }

    .hs-properties {
        order: 3;
        max-width: none;
        max-height: min(55vh, 520px);
        min-height: 200px;
    }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

@media (hover: none) {
    .hs-btn:hover {
        opacity: 1;
    }
}
