* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s ease,
                color 0.3s ease;
}

:root {
    --bg-body: #faf7f0;
    --bg-container: #ffffff;
    --bg-box: #f4f1e8;
    --bg-item: #ffffff;
    --text-main: #1c1d21;
    --text-muted: #6b6d76;
    --border-color: #e6e2d6;

    --topbar-bg: rgba(255, 255, 255, 0.8);
    --topbar-text: #1c1d21;
    --logo-accent: #2563eb;
    --teal: #0d9488;
    --blob-color: #cfe0fb;

    --btn-submit: #2563eb;
    --btn-submit-text: #ffffff;
    --btn-submit-hover: #1d4ed8;

    --vote-border: #e6e2d6;

    --radius-lg: 20px;
    --radius-md: 12px;

    --shadow-sm: 0 1px 2px rgba(28,29,33,0.02);
    --shadow-md: 0 8px 24px rgba(28,29,33,0.06);
    --shadow-toast: 0 20px 40px rgba(28,29,33,0.12);

    --error-color: #ef4444;
    --error-focus: rgba(239, 68, 68, 0.15);

    --dropzone-bg: #f4f1e8;
    --dropzone-border-hover: #2563eb;
    --dropzone-bg-hover: rgba(37, 99, 235, 0.04);
}

[data-theme="dark"] {
    --bg-body: #0f1115;
    --bg-container: #181a20;
    --bg-box: #1f222a;
    --bg-item: #1f222a;
    --text-main: #f2f3f5;
    --text-muted: #9296a3;
    --border-color: #2a2e38;

    --topbar-bg: rgba(15, 17, 21, 0.8);
    --topbar-text: #f2f3f5;
    --logo-accent: #3b82f6;
    --teal: #2dd4bf;
    --blob-color: #1e3a5f;

    --btn-submit: #3b82f6;
    --btn-submit-text: #ffffff;
    --btn-submit-hover: #2563eb;

    --vote-border: #2a2e38;
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.35);

    --error-focus: rgba(239, 68, 68, 0.25);

    --dropzone-bg: #1a1c22;
    --dropzone-border-hover: #3b82f6;
    --dropzone-bg-hover: rgba(59, 130, 246, 0.06);
}

[data-theme="contrast"] {
    --bg-body: #18181b;
    --bg-container: #fafafa;
    --bg-box: #f0f0f0;
    --bg-item: #fafafa;
    --text-main: #111118;
    --text-muted: #71717a;
    --border-color: #e4e4e7;

    --topbar-bg: rgba(24, 24, 27, 0.95);
    --topbar-text: #fafafa;
    --logo-accent: #2563eb;
    --teal: #0d9488;
    --blob-color: #dde8fb;

    --btn-submit: #2563eb;
    --btn-submit-text: #ffffff;
    --btn-submit-hover: #1d4ed8;

    --vote-border: #e4e4e7;
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.15);

    --error-focus: rgba(239, 68, 68, 0.15);

    --dropzone-bg: #f0f0f0;
    --dropzone-border-hover: #2563eb;
    --dropzone-bg-hover: rgba(37, 99, 235, 0.04);
}

[data-color="fiolet"] {
    --logo-accent: #a855f7; --teal: #f0abfc;
    --btn-submit: #a855f7; --btn-submit-hover: #9333ea;
    --dropzone-border-hover: #a855f7; --dropzone-bg-hover: rgba(168,85,247,0.06);
}
[data-color="ocean"] {
    --logo-accent: #0ea5e9; --teal: #06b6d4;
    --btn-submit: #0ea5e9; --btn-submit-hover: #0284c7;
    --dropzone-border-hover: #0ea5e9; --dropzone-bg-hover: rgba(14,165,233,0.06);
}
[data-color="sunset"] {
    --logo-accent: #f59e0b; --teal: #f97316;
    --btn-submit: #f59e0b; --btn-submit-text: #1c0800; --btn-submit-hover: #d97706;
    --dropzone-border-hover: #f59e0b; --dropzone-bg-hover: rgba(245,158,11,0.06);
}
[data-color="forest"] {
    --logo-accent: #16a34a; --teal: #34d399;
    --btn-submit: #16a34a; --btn-submit-hover: #15803d;
    --dropzone-border-hover: #16a34a; --dropzone-bg-hover: rgba(22,163,74,0.06);
}
[data-color="rose"] {
    --logo-accent: #f43f5e; --teal: #db2777;
    --btn-submit: #f43f5e; --btn-submit-hover: #e11d48;
    --dropzone-border-hover: #f43f5e; --dropzone-bg-hover: rgba(244,63,94,0.06);
}
[data-color="slate"] {
    --logo-accent: #64748b; --teal: #94a3b8;
    --btn-submit: #64748b; --btn-submit-hover: #475569;
    --dropzone-border-hover: #64748b; --dropzone-bg-hover: rgba(100,116,139,0.06);
}

html, body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

* {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--logo-accent) 55%, transparent) transparent;
}
*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--logo-accent) 55%, transparent);
    border-radius: 99px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--logo-accent); }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
}

.topbar {
    width: 100%;
    background-color: var(--topbar-bg);
    color: var(--topbar-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    border-bottom: 2px dashed color-mix(in srgb, var(--logo-accent) 50%, transparent);
    position: sticky;
    top: 0;
    z-index: 2000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: 60px;
    flex-shrink: 0;
    gap: 1rem;
}

.status-pill {
    display: flex;
    align-items: stretch;
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-body);
    overflow: hidden;
    flex-shrink: 0;
    font-size: 0.775rem;
}
.status-pill-cell {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.9rem;
    white-space: nowrap;
    border-right: 1px solid var(--border-color);
}
.status-pill-label { color: var(--text-muted); font-weight: 500; }

.status-pill-label.lbl-kb { min-width: 99px; }
.status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.4s ease;
}
.status-dot.checking { background: var(--border-color); }
.status-dot.ok    { background: #22c55e; animation: glow-ok   2.8s ease-in-out infinite; }
.status-dot.error { background: #ef4444; animation: glow-error 1.8s ease-in-out infinite; }
@keyframes glow-ok {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
    50%       { box-shadow: 0 0 6px 2px rgba(34,197,94,0.55); }
}
@keyframes glow-error {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
    50%       { box-shadow: 0 0 5px 2px rgba(239,68,68,0.5); }
}
.status-value {
    color: var(--text-main); font-weight: 600;
    display: inline-block;
    min-width: 3.6rem;
    font-variant-numeric: tabular-nums;
}
@keyframes fade-in-val {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: 1; transform: translateY(0); }
}
.status-refresh {
    display: flex; align-items: center; justify-content: center;
    padding: 0 0.75rem;
    background: transparent; border: none; cursor: pointer;
    color: var(--text-muted); flex-shrink: 0;
    transition: color 0.2s, background-color 0.15s;
}
.status-refresh:hover { color: var(--text-main); background: var(--bg-box); }
.status-refresh svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.status-refresh.rotating svg { animation: full-spin 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes full-spin { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }

.lang-switch {
    display: flex;
    align-items: stretch;
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-body);
    overflow: hidden;
    flex-shrink: 0;
}
.lang-switch-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 0 0.75rem;
    cursor: pointer;
    transition: color 0.2s, background-color 0.15s;
}
.lang-switch-btn:not(:last-child) { border-right: 1px solid var(--border-color); }
.lang-switch-btn:hover { color: var(--text-main); background: var(--bg-box); }
.lang-switch-btn.active { color: #fff; background: var(--logo-accent); }

.topbar-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    user-select: none;
    cursor: pointer;
    border-radius: 6px;
    padding: 0.15rem 0.35rem;
    margin-left: -0.35rem;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}
.topbar-title:hover { opacity: 0.75; }
.topbar-title:focus-visible { outline: 2px solid var(--logo-accent); outline-offset: 2px; }

.topbar-title::before {
    display: none;
}

.topbar-right { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }

.app {
    width: 100%;
    max-width: 1440px;
    padding: 1.5rem;
    margin: 0 auto;
    flex-grow: 1;
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto 0 max(0px, calc(50% - 590px));
    align-items: center;
    will-change: opacity;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

form { order: 2; }
.hero-area { order: 1; }

form {
    background-color: var(--bg-container);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    position: relative;
}

.hero-area {
    position: relative;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
    text-align: center;
}

.logo-zone {
    position: relative;
    width: 380px;
    min-height: 380px;
    margin: 0 auto 2.2rem;
}

.blob-shape {
    position: absolute;
    top: 0;
    left: 0;
    width: 380px;
    height: 380px;
    background: var(--blob-color);
    border-radius: 48% 52% 53% 47% / 52% 46% 54% 48%;
    z-index: 0;
    opacity: 0;
    animation: blobGrowIn 1.35s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards, blobDrift 14s ease-in-out 1.5s infinite;
}

@keyframes blobGrowIn {
    0%   { opacity: 0; transform: scale(0.55); }
    30%  { opacity: 1; }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes blobDrift {
    0%, 100% { border-radius: 48% 52% 53% 47% / 52% 46% 54% 48%; transform: translate(0,0) rotate(0deg) scale(1); }
    50%      { border-radius: 52% 48% 47% 53% / 48% 53% 47% 54%; transform: translate(0,0) rotate(1.5deg) scale(1.015); }
}

.hero-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(calc(-50% - 28px), -50%);
    z-index: 2;
    width: 460px;
}

.hero-text .word-line {
    font-family: 'Archivo', sans-serif;
    font-size: 5.4rem;
    font-weight: 800;
    line-height: 1.0;
    letter-spacing: 1px;
    font-stretch: 75%;
    text-transform: uppercase;
    white-space: nowrap;
}
.word-aco {
    color: var(--teal);
    margin-left: -175px;
    animation: settleAco 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}
.word-smart {
    color: var(--text-main);
    margin-left: 165px;
    animation: settleSmart 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}
.word-desk {
    color: var(--logo-accent);
    margin-left: 30px;
}

@keyframes settleAco {
    0%   { margin-left: 0; }
    100% { margin-left: -175px; }
}
@keyframes settleSmart {
    0%   { margin-left: 0; }
    100% { margin-left: 165px; }
}

.lead-text {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.5;
    letter-spacing: 0.1px;
    max-width: 420px;
    margin: 0 auto;
}

.side-toolbar {
    position: fixed; right: 1.25rem; top: 50%; transform: translateY(-50%);
    display: flex; flex-direction: column; gap: 0.5rem; z-index: 1500;
}
.toolbar-btn {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--bg-container); border: 1px solid var(--border-color);
    color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md);
}
.toolbar-btn:hover, .toolbar-btn.tb-active {
    color: var(--logo-accent); border-color: var(--logo-accent);
    box-shadow: 0 4px 14px rgba(37,99,235,0.25);
}
.toolbar-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.modal-overlay {
    position: fixed; inset: 0; z-index: 4000;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    display: none; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-card {
    background: var(--bg-container); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); width: 560px;
    max-width: calc(100vw - 2rem); max-height: 90vh; min-height: 540px;
    box-shadow: var(--shadow-toast);
    display: flex; flex-direction: column; overflow: hidden;
    animation: modal-enter 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modal-enter {
    from { opacity: 0; transform: scale(0.94) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem 1.5rem 0; flex-shrink: 0;
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--text-main); }
.modal-close {
    width: 28px; height: 28px; border-radius: 50%;
    border: 1px solid var(--border-color); background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center; padding: 0;
    color: var(--text-muted);
    transition: color 0.2s, border-color 0.2s;
}
.modal-close:hover { color: var(--text-main); border-color: var(--text-main); }
.modal-close svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; }
.modal-tabs {
    display: flex; padding: 0.75rem 1.5rem 0;
    border-bottom: 1px solid var(--border-color); flex-shrink: 0;
}
.modal-tab {
    padding: 0.5rem 1rem; font-size: 0.83rem; font-weight: 600;
    color: var(--text-muted); cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s; user-select: none;
    text-align: center;
}

#modalTabJezyk      { min-width: 96px; }
#modalTabWyglad     { min-width: 111px; }
.modal-tab.active { color: var(--logo-accent); border-bottom-color: var(--logo-accent); }
.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.modal-panel { display: none; }
.modal-panel.active { display: block; }

.modal-step-text { font-size: 0.85rem; line-height: 1.5; color: var(--text-muted); padding-top: 2px; }
.modal-step-text strong { color: var(--text-main); }
.info-intro { font-size: 0.85rem; line-height: 1.55; color: var(--text-muted); margin-bottom: 1.5rem; }

.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.mode-card {
    border: 2px solid var(--border-color); border-radius: var(--radius-md);
    overflow: hidden; cursor: pointer; position: relative;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.mode-card:hover { border-color: var(--text-muted); }
.mode-card.active { border-color: var(--logo-accent); box-shadow: 0 0 0 2px rgba(37,99,235,0.18); }
.mode-card.active::after {
    content: '✓'; position: absolute; top: 4px; right: 4px;
    width: 15px; height: 15px; border-radius: 50%;
    background: var(--logo-accent); color: #fff;
    font-size: 8px; font-weight: 800; line-height: 15px; text-align: center;
}
.mode-preview { position: relative; aspect-ratio: 1.3; overflow: hidden; }
.mode-half { position: absolute; left: 0; right: 0; height: 50%; }
.mode-half-top { top: 0; }
.mode-half-bot { bottom: 0; }
.mode-icon {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center; z-index: 1;
}
.mode-icon svg { width: 26px; height: 26px; stroke-linecap: round; stroke-linejoin: round; }

.lang-options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.lang-option {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-main);
    padding: 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.lang-option:hover { border-color: var(--text-muted); }
.lang-option.active { border-color: var(--logo-accent); box-shadow: 0 0 0 2px rgba(37,99,235,0.18); }

.wyglad-section { margin-bottom: 1.5rem; }
.wyglad-section:last-child { margin-bottom: 0; }
.wyglad-section-title {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 0.75rem;
}

.color-themes { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.color-circle {
    width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
    border: 2.5px solid transparent;
    transition: transform 0.15s ease, border-color 0.2s;
    position: relative; overflow: hidden; flex-shrink: 0;
}
.color-circle:hover { transform: scale(1.1); }
.color-circle.active { border-color: var(--text-main); box-shadow: 0 0 0 1px var(--text-main); }
.color-circle.active::after {
    content: '✓'; position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800; color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.cc-l, .cc-r { position: absolute; top: 0; bottom: 0; width: 50%; }
.cc-l { left: 0; }
.cc-r { right: 0; }

.modal-overlay.modal-info .modal-tabs { display: none; }

label {
    display: block; margin-bottom: 0.4rem; font-weight: 600; font-size: 0.85rem;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
    flex-shrink: 0;
}

input[type="text"], textarea, select {
    width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border-color);
    background-color: var(--bg-body); color: var(--text-main); font-size: 0.95rem;
    font-family: inherit; border-radius: var(--radius-md); outline: none;
}

input[type="text"] { margin-bottom: 1rem; flex-shrink: 0; }
input[type="text"]:focus, textarea:focus, select:focus {
    border-color: var(--logo-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--logo-accent) 18%, transparent);
}

input[type="text"]:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }

textarea {
    width: 100%;
    min-height: 80px;
    resize: none;
    overflow-y: auto;
    margin-bottom: 1rem;
}
textarea::-webkit-scrollbar { width: 5px; }
textarea::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--logo-accent) 55%, transparent); border-radius: 99px; }
textarea::-webkit-scrollbar-thumb:hover { background: var(--logo-accent); }

textarea#Description {
    width: 100%;
    flex-shrink: 0;
    min-height: 80px;
    height: 80px;
    resize: none;
    overflow-y: auto;
    margin-bottom: 1rem;
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s ease,
                color 0.3s ease,
                height 0.15s ease;
}
textarea#Description.capped {
    overflow-y: auto;
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s ease,
                color 0.3s ease;
}

.custom-select-wrapper { position: relative; margin-bottom: 1rem; flex-shrink: 0; }
.select-trigger {
    width: 100%; padding: 0.75rem 2.5rem 0.75rem 1rem; border: 1px solid var(--border-color);
    background-color: var(--bg-body); color: var(--text-main); font-size: 0.95rem;
    border-radius: var(--radius-md); outline: none; cursor: pointer; display: flex;
    align-items: center; justify-content: space-between; user-select: none;
}
.select-arrow {
    position: absolute; right: 1rem; top: 50%; transform: translateY(-50%) rotate(45deg);
    width: 6px; height: 6px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
    transition: transform 0.2s ease; pointer-events: none;
}
.custom-select-wrapper.open .select-arrow { transform: translateY(-50%) rotate(-135deg); }
.select-dropdown {
    position: fixed; top: 0; left: 0; background-color: var(--bg-container);
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    box-shadow: var(--shadow-toast); z-index: 9999; display: none; flex-direction: column;
    max-height: 220px; overflow: hidden;
}
.custom-select-wrapper.open .select-dropdown { display: flex; }
.options-list { overflow-y: auto; list-style: none; max-height: 216px; padding: 2px 0; }
.options-list::-webkit-scrollbar { width: 6px; }
.options-list::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--logo-accent) 55%, transparent); border-radius: 99px; }
.options-list::-webkit-scrollbar-thumb:hover { background: var(--logo-accent); }
.option-item { padding: 0.7rem 1rem; cursor: pointer; font-size: 0.95rem; }
.option-item:hover { background-color: var(--bg-box); }
.option-item.selected { background-color: var(--bg-box); color: var(--logo-accent); font-weight: 600; }

.dropzone-area {
    border: 2px dashed var(--border-color); background-color: var(--dropzone-bg);
    border-radius: var(--radius-md); padding: 0.85rem; text-align: center; cursor: pointer;
    margin-bottom: 1rem; position: relative; flex-shrink: 0;
}
.dropzone-area.dragover { border-color: var(--dropzone-border-hover); background-color: var(--dropzone-bg-hover); }
.dropzone-text { font-size: 0.85rem; color: var(--text-muted); pointer-events: none; }
.dropzone-text strong { color: var(--logo-accent); }
.dropzone-hint { display: block; font-size: 0.72rem; margin-top: 0.2rem; opacity: 0.6; }
.file-input { display: none; }

.file-preview-list {
    list-style: none; margin-top: 0.6rem; display: grid;
    grid-template-columns: repeat(3, 1fr); gap: 0.6rem; text-align: left;
}
.file-preview-item {
    position: relative; background-color: var(--bg-box); width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md); border: 1px solid var(--border-color);
    overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.file-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.file-info-overlay {
    position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0, 0, 0, 0.65);
    color: #ffffff; font-size: 0.65rem; padding: 0.2rem 0.4rem; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; pointer-events: none;
}
.remove-file-btn {
    position: absolute; top: 4px; right: 4px; background: rgba(239, 68, 68, 0.9);
    border: none; color: #ffffff; width: 20px; height: 20px; border-radius: 4px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    z-index: 10; padding: 0; line-height: 1;
}
.remove-file-btn svg {
    width: 11px; height: 11px; display: block;
    stroke: currentColor; stroke-width: 2.5; fill: none; stroke-linecap: round;
}

button[type="submit"] {
    background-color: var(--btn-submit); color: var(--btn-submit-text); width: 100%;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15); padding: 0.85rem;
    flex-shrink: 0; font-family: inherit; cursor: pointer; font-weight: 600; font-size: 0.95rem; border: none;
    border-radius: var(--radius-md); position: relative; z-index: 1;
}
button[type="submit"]:hover { background-color: var(--btn-submit-hover); box-shadow: 0 6px 20px color-mix(in srgb, var(--logo-accent) 35%, transparent); }
button:active:not(:disabled) { transform: scale(0.98); }

#result {
    display: none;
    flex-direction: column;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: visible;
}

.dashboard-container {
    display: grid;
    grid-template-columns: 320px 1fr 220px;
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "ticket ticket ticket"
        "meta main gallery";
    width: 100%;
    flex-grow: 1;
    background-color: var(--bg-container);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.db-area-ticket {
    grid-area: ticket;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    display: flex;
    width: 100%;
    height: 140px;
    flex-shrink: 0;
    overflow: visible;
    position: relative;
    position: relative;
    z-index: 10;
}

.ticket-eyebrow {
    position: absolute;
    top: 0.7rem;
    left: 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.ticket-center-content {
    flex-grow: 1;
    min-width: 0;
    padding: 2.2rem 1.5rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    position: relative;
}

.ticket-region-side {
    width: 220px;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.02);
    padding: 1rem;
    flex-shrink: 0;
}
[data-theme="dark"] .ticket-region-side { background-color: rgba(255, 255, 255, 0.01); }
.region-badge-title { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 0.25rem; }
.region-badge-value { font-size: 1.3rem; font-weight: 700; color: var(--logo-accent); }

.db-area-meta {
    grid-area: meta;
    border-right: 1px solid var(--border-color);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
}
.db-area-meta::-webkit-scrollbar { width: 5px; }
.db-area-meta::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--logo-accent) 55%, transparent); border-radius: 99px; }
.db-area-meta::-webkit-scrollbar-thumb:hover { background: var(--logo-accent); }

.db-area-main {
    grid-area: main;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
    position: relative;
}

.db-area-gallery {
    grid-area: gallery;
    border-left: 1px solid var(--border-color);
    padding: 1.25rem;
    overflow-y: visible;
}

@media (max-width: 1200px) {
    .dashboard-container {
        grid-template-columns: 300px 1fr;
        grid-template-areas: "ticket ticket" "meta main" "gallery gallery";
    }
    .db-area-meta { border-right: 1px solid var(--border-color); }
    .db-area-gallery { border-left: none; border-top: 1px solid var(--border-color); overflow-y: auto; }
    .ticket-region-side { width: 150px; }
}

.result-box {
    background-color: var(--bg-box); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 1rem 1.1rem; margin-bottom: 0.6rem;
    display: flex; flex-direction: column; position: relative; overflow: visible;
}
.result-box:last-of-type { margin-bottom: 0; }

.scroll-text {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text-main);
    word-break: break-word;
    white-space: pre-wrap;
    padding-right: 0.4rem;
}
.scroll-text::-webkit-scrollbar { width: 6px; }
.scroll-text::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.scroll-text::-webkit-scrollbar-thumb:hover { background: var(--logo-accent); }

.result-header {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.8px; margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    display: block;
    flex-shrink: 0; white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.recommendation-item {
    background: var(--bg-item); border: 1px solid var(--border-color); border-radius: var(--radius-md);
    padding: 0.6rem 0.85rem; margin-bottom: 0.45rem; display: flex; justify-content: space-between;
    align-items: center; gap: 1rem; box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.row-label { font-weight: 600; font-size: 0.92rem; line-height: 1.4; word-break: break-word; }

.controls { display: flex; gap: 6px; flex-shrink: 0; }
.controls button {
    padding: 0.35rem; background: transparent; border: 1px solid var(--vote-border);
    border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.controls button svg { width: 14px; height: 14px; fill: none; stroke: var(--text-muted); stroke-width: 1.8; }
.btn-vote-up:hover svg { stroke: #22c55e; }
.btn-vote-down:hover svg { stroke: #ef4444; }
.btn-vote-up.btn-selected { background-color: #22c55e !important; border-color: #22c55e !important; }
.btn-vote-up.btn-selected svg { stroke: #ffffff !important; fill: rgba(255, 255, 255, 0.1) !important; }
.btn-vote-down.btn-selected { background-color: #ef4444 !important; border-color: #ef4444 !important; }
.btn-vote-down.btn-selected svg { stroke: #ffffff !important; fill: rgba(255, 255, 255, 0.1) !important; }

.controls button:disabled { cursor: not-allowed; opacity: 0.35; }
.controls button:disabled:hover svg { stroke: var(--text-muted); }
.recommendation-item.is-unknown .row-label { color: var(--text-muted); font-style: italic; }
.recommendation-item.is-unknown .reco-dot { background: var(--border-color) !important; }

.thermometer-track { flex-grow: 1; height: 8px; background-color: var(--border-color); border-radius: 99px; overflow: hidden; position: relative; }
.thermometer-fill { height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, #2563eb, #22c55e); transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); position: relative; }

:root {
    --conf-main: var(--logo-accent);

    --conf-alt:  #f59e0b;
    --conf-rest: color-mix(in srgb, var(--text-muted) 38%, transparent);
    --conf-v: #f59e0b;
    --conf-a: var(--logo-accent);
    --conf-b: var(--teal);
}
[data-theme="dark"] { --conf-v: #fbbf24; --conf-alt: #fbbf24; }

[data-color="sunset"] { --conf-alt: #7c3aed; }
[data-color="forest"] { --conf-alt: #7c3aed; }
[data-color="rose"]   { --conf-alt: #0d9488; }
[data-theme="dark"][data-color="sunset"] { --conf-alt: #a78bfa; }
[data-theme="dark"][data-color="forest"] { --conf-alt: #a78bfa; }
[data-theme="dark"][data-color="rose"]   { --conf-alt: #2dd4bf; }

.share-viz { margin-top: 0.75rem; flex-shrink: 0; }

.share-bar {
    display: flex; height: 9px; border-radius: 99px; overflow: hidden;
    background: var(--border-color);
}
.share-seg { height: 100%; width: 0; transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1); }
.share-seg-main { background: var(--conf-main); }
.share-seg-alt  { background: var(--conf-alt); }
.share-seg-rest { background: var(--conf-rest); }

.share-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 0.85rem; margin-top: 0.55rem; }
.share-legend-item {
    display: flex; align-items: center; gap: 0.35rem; min-width: 0;
    font-size: 0.72rem; color: var(--text-muted); line-height: 1.35;
}
.share-legend-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 10rem; }

.reco-dot {
    display: inline-block; width: 9px; height: 9px; border-radius: 3px;
    margin-right: 0.5rem; flex-shrink: 0;
}
.share-dot { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }
.share-pct { font-weight: 700; color: var(--text-main); font-variant-numeric: tabular-nums; white-space: nowrap; }

.conf-hero { display: flex; align-items: center; gap: 0.6rem; margin: 0.2rem 0 0.65rem; flex-wrap: wrap; }
.conf-hero-val {
    font-size: 2.05rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em;
    color: var(--text-main); font-variant-numeric: tabular-nums;
}
.conf-hero-tier {
    font-size: 0.7rem; font-weight: 700; padding: 0.24rem 0.6rem;
    border-radius: 99px; letter-spacing: 0.03em; white-space: nowrap;
}

.conf-breakdown { display: flex; flex-direction: column; gap: 0.65rem; min-height: 0; }

.conf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.conf-card {
    background: var(--bg-item); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 0.7rem 0.75rem;
    display: flex; flex-direction: column; gap: 0.45rem;
    position: relative; overflow: hidden; min-width: 0;
}
.conf-card-label {
    font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
    color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conf-card-val {
    font-size: 1.4rem; font-weight: 800; line-height: 1;
    color: var(--text-main); font-variant-numeric: tabular-nums;
}
.conf-card-track { height: 5px; background: var(--border-color); border-radius: 99px; overflow: hidden; }
.conf-card-fill {
    height: 100%; width: 0; border-radius: 99px;
    background: var(--c, var(--logo-accent));
    transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.conf-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.conf-panel {
    background: var(--bg-item); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 0.7rem 0.85rem;
    display: flex; flex-direction: column; gap: 0.45rem; min-width: 0;
}
.conf-sub-title {
    font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--text-muted);
}
.conf-row { display: grid; grid-template-columns: 1.7rem 1fr 3rem; align-items: center; gap: 0.55rem; }
.conf-row-label { font-size: 0.74rem; font-weight: 700; color: var(--text-muted); }
.conf-mini-track { height: 6px; background: var(--border-color); border-radius: 99px; overflow: hidden; }
.conf-mini-fill { height: 100%; width: 0; border-radius: 99px; transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1); }
.conf-row-val {
    font-size: 0.74rem; font-weight: 700; text-align: right;
    color: var(--text-main); font-variant-numeric: tabular-nums;
}

.conf-source-wrap { display: flex; flex-direction: column; gap: 0.5rem; justify-content: center; flex: 1; }
.conf-source-bar {
    display: flex; height: 10px; border-radius: 99px; overflow: hidden;
    background: var(--border-color);
}
.conf-source-seg { height: 100%; width: 0; transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1); }
.conf-source-hist { background: var(--conf-b); }
.conf-source-own  { background: var(--conf-v); }
.conf-source-empty { font-size: 0.75rem; color: var(--text-muted); }

.aco-tip {
    position: fixed; z-index: 1200; max-width: 380px;
    background: var(--bg-container); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); box-shadow: var(--shadow-md);
    padding: 0.7rem 0.85rem; font-size: 0.8rem; line-height: 1.55;
    color: var(--text-main); white-space: pre-wrap;
    opacity: 0; transform: translateY(4px);

    pointer-events: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    transition: opacity 0.16s ease, transform 0.16s ease;
}
.aco-tip.show { pointer-events: auto; }
.aco-tip.show { opacity: 1; transform: translateY(0); }
.aco-tip-title {
    font-size: 0.64rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 0.4rem;
}

.aco-tip.variant-ticket { max-width: 520px; }
.aco-tip.variant-ticket .aco-tip-title {
    font-size: 0.95rem; font-weight: 800; line-height: 1.35;
    text-transform: none; letter-spacing: -0.01em; color: var(--text-main);
    margin-bottom: 0.55rem; padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--border-color);
}
.aco-tip.variant-ticket .aco-tip-body { color: var(--text-muted); }

[data-tip] { cursor: pointer; }
[data-tip]:focus-visible { outline: 2px solid var(--logo-accent); outline-offset: 2px; }
.conf-card[data-tip]:hover, .conf-panel[data-tip]:hover {
    border-color: color-mix(in srgb, var(--c, var(--logo-accent)) 60%, var(--border-color));
}

.conf-card[data-tip]::after, .conf-panel[data-tip]::after {
    content: ''; position: absolute; top: 0.55rem; right: 0.55rem;
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--text-muted); opacity: 0.35;
    transition: opacity 0.2s ease;
}
.conf-card[data-tip]:hover::after, .conf-panel[data-tip]:hover::after { opacity: 0.8; }
.conf-panel { position: relative; }

.conf-facts {
    display: flex; flex-wrap: wrap; gap: 0.35rem 1.15rem;
    padding-top: 0.6rem; border-top: 1px dashed var(--border-color);
}
.conf-fact { display: flex; align-items: baseline; gap: 0.35rem; font-size: 0.72rem; color: var(--text-muted); }
.conf-fact-val { font-weight: 700; color: var(--text-main); font-variant-numeric: tabular-nums; }

.result-box.box-alert {
    border-color: var(--error-color);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--error-color) 22%, transparent);
}
.result-box.box-alert .result-header { color: var(--error-color); }

@media (max-width: 1100px) {
    .conf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .conf-panels { grid-template-columns: 1fr; }
    .share-legend-name { max-width: 8rem; }
    .conf-card-val { font-size: 1.2rem; }
}

.panel-footer-actions { margin-top: auto; display: flex; flex-direction: column; width: 100%; flex-shrink: 0; }

.btn-reset-layout-bottom {
    background-color: var(--btn-submit); color: var(--btn-submit-text); width: 100%; max-width: 100%;
    padding: 0.85rem 1.5rem; font-size: 0.95rem; font-weight: 600; margin-top: 1rem;
    display: block; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15); text-transform: uppercase; letter-spacing: 0.5px;
    flex-shrink: 0; border: none; cursor: pointer; border-radius: var(--radius-md);
}
.btn-reset-layout-bottom:hover { background-color: var(--btn-submit-hover); box-shadow: 0 6px 20px color-mix(in srgb, var(--logo-accent) 35%, transparent); }

.btn-feedback-floating {
    background-color: #22c55e; color: #ffffff; width: 100%;
    padding: 0.85rem; font-size: 0.95rem; font-weight: 700; box-shadow: none; display: block;
    margin-top: 1rem; border: none; cursor: pointer; border-radius: var(--radius-md);
}
.btn-feedback-floating:hover:not(:disabled) { background-color: #16a34a; }
.btn-feedback-floating:disabled { opacity: 0.4; cursor: not-allowed; }

.ticket-title {
    font-weight: 800;
    font-size: 1.5rem;
    line-height: 1.28;
    letter-spacing: -0.02em;
    color: var(--text-main);
    text-align: center;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.ticket-center-content[data-tip] { cursor: pointer; border-radius: 8px; transition: background-color 0.15s ease; }
.ticket-center-content[data-tip]:hover { background-color: color-mix(in srgb, var(--logo-accent) 5%, transparent); }
.ticket-center-content[data-tip]:hover .ticket-title { color: var(--logo-accent); }
.ticket-center-content[data-tip]:focus-visible { outline: 2px solid var(--logo-accent); outline-offset: -2px; }

@media (max-width: 900px) { .ticket-title { font-size: 1.25rem; } }
@media (max-width: 520px) { .ticket-title { font-size: 1.1rem; -webkit-line-clamp: 3; } }

.ticket-copy {
    position: absolute; top: 0.6rem; right: 236px; z-index: 3;
    width: 30px; height: 30px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid var(--border-color); border-radius: 8px;
    color: var(--text-muted); cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.ticket-copy:hover { color: var(--logo-accent); border-color: var(--logo-accent); background: color-mix(in srgb, var(--logo-accent) 8%, transparent); }
.ticket-copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ticket-copy .ico-check { display: none; stroke: #22c55e; }
.ticket-copy.copied { color: #22c55e; border-color: #22c55e; background: color-mix(in srgb, #22c55e 10%, transparent); }
.ticket-copy.copied .ico-copy { display: none; }
.ticket-copy.copied .ico-check { display: block; }
@media (max-width: 1200px) { .ticket-copy { right: 166px; } }
@media (max-width: 768px)  { .ticket-copy { right: 116px; } }

.aco-tip.pinned { padding-right: 1.9rem; }
.aco-tip-close {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px; line-height: 1; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; border-radius: 6px;
    color: var(--text-muted); font-size: 1.15rem; cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}
.aco-tip-close:hover { color: var(--text-main); background: var(--bg-box); }

.fade-in { opacity: 1 !important; transform: translateY(0) !important; }
.fade-out { opacity: 0 !important; transform: translateY(-16px) !important; }

.sidebar-preview-list { list-style: none; margin-top: 0.5rem; display: flex; flex-direction: column; gap: 1rem; }
.sidebar-preview-item {
    position: relative; background-color: var(--bg-box); aspect-ratio: 16 / 9;
    border: 1px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.sidebar-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.download-file-btn {
    position: absolute; top: 8px; right: 8px; background: #10b981; border: none;
    color: #ffffff; width: 28px; height: 28px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3); text-decoration: none;
}
.download-file-btn:hover { background: #059669; transform: scale(1.08); }
.download-file-btn svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.input-error {
    border-color: var(--error-color) !important;
    box-shadow: 0 0 0 3px var(--error-focus) !important;
}

.form-status {
    position: absolute;
    bottom: 0.5rem;
    left: 0;
    right: 0;
    font-size: 0.82rem;
    font-weight: 500;
    text-align: center;
    color: var(--error-color);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 1rem;
}
.form-status.error { opacity: 1; }
.form-status.loading { opacity: 1; color: #2563eb; }

.btn-laser-wrapper {
    margin-top: auto;
    flex-shrink: 0;
}

.btn-spinner { display: inline-block; vertical-align: middle; }
.btn-spinner circle {
    fill: rgba(255,255,255,0.15);
    animation: spinner-fade 0.8s linear infinite;
}
.btn-spinner circle:nth-child(1) { animation-delay: -0.70s; }
.btn-spinner circle:nth-child(2) { animation-delay: -0.60s; }
.btn-spinner circle:nth-child(3) { animation-delay: -0.50s; }
.btn-spinner circle:nth-child(4) { animation-delay: -0.40s; }
.btn-spinner circle:nth-child(5) { animation-delay: -0.30s; }
.btn-spinner circle:nth-child(6) { animation-delay: -0.20s; }
.btn-spinner circle:nth-child(7) { animation-delay: -0.10s; }
.btn-spinner circle:nth-child(8) { animation-delay:  0.00s; }
@keyframes spinner-fade {
    0%   { fill: rgba(255,255,255,0.9); }
    100% { fill: rgba(255,255,255,0.1); }
}

.login-card {
    order: 2;
    background-color: var(--bg-container);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-md);
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 1.25rem;
}
.login-lock {
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--bg-box); border: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
}
.login-lock svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.login-heading { text-align: center; }
.login-title { font-size: 1.05rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.3rem; }
.login-sub { font-size: 0.85rem; color: var(--text-muted); }
.login-password {
    width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border-color);
    background-color: var(--bg-body); color: var(--text-main); font-size: 0.95rem;
    font-family: inherit; border-radius: var(--radius-md); outline: none;
    text-align: center; letter-spacing: 0.15em;
}
.login-password:focus { border-color: var(--logo-accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.login-password:focus-visible { outline: none; }
.login-password.input-error { border-color: var(--error-color) !important; box-shadow: 0 0 0 3px var(--error-focus) !important; }
.login-submit {
    width: 100%; background-color: var(--btn-submit); color: var(--btn-submit-text);
    border: none; border-radius: var(--radius-md); padding: 0.85rem;
    font-size: 0.95rem; font-weight: 600; font-family: inherit; cursor: pointer;
    position: relative; z-index: 1;

    display: flex; align-items: center; justify-content: center; line-height: 22px;
}
.login-submit:hover { background-color: var(--btn-submit-hover); }
.login-error {
    font-size: 0.82rem; color: var(--error-color); text-align: center;
    min-height: 1.2em; opacity: 0; transition: opacity 0.2s;
}
.login-error.show { opacity: 1; }
@keyframes login-fade-in {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.login-card { animation: login-fade-in 0.4s cubic-bezier(0.16,1,0.3,1); }

@media (max-width: 1024px) {
    .workspace-grid {
        grid-template-columns: 1fr;
        margin: 0 auto;
    }
    form { order: 1; max-height: none; }
    .hero-area { order: 2; min-height: 280px; padding: 1.5rem 0; }
    .logo-zone { width: 280px; min-height: 280px; margin: 0 auto 1.5rem; }
    .blob-shape { width: 280px; height: 280px; }
    .hero-text { width: 340px; }
    .lead-text { margin: 0 auto; }
    .side-toolbar { right: 0.75rem; bottom: 1.25rem; top: auto; transform: none; flex-direction: row; }
    html, body { height: auto; max-height: none; overflow: visible; }
    .app { height: auto; max-height: none; overflow: visible; }
    #result { overflow: visible; }
}

.topbar-status-mobile {
    display: none;
}
@media (max-width: 680px) {
    .topbar {
        padding: 0 1rem;
        height: auto !important;
        flex-wrap: wrap;
        padding-bottom: 0.5rem;
        row-gap: 0.3rem;
    }
    .status-pill { display: none; }
    .lang-switch { height: 26px; }
    .lang-switch-btn { padding: 0 0.55rem; font-size: 0.68rem; }
    .topbar-status-mobile {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
        height: 24px;
        font-size: 0.76rem;
        order: 3;
    }
    .tsm-label { color: var(--text-muted); font-weight: 500; }
    .tsm-value  { color: var(--text-main);  font-weight: 600; font-variant-numeric: tabular-nums; }
    .tsm-sep    { color: var(--border-color); margin: 0 0.1rem; }
    .topbar-status-mobile .status-dot { width: 7px; height: 7px; }
    .topbar-status-mobile .status-refresh {
        margin-left: auto; padding: 0.2rem; height: auto; border: none;
    }
    .topbar-status-mobile .status-refresh svg { width: 14px; height: 14px; }
    .hero-area { display: none; }
    form { max-height: none; }
    .app { padding: 1rem; }
    .workspace-grid { padding: 0; }
    .dashboard-container {
        grid-template-columns: 1fr;
        grid-template-areas: "ticket" "meta" "main" "gallery";
    }
    .db-area-meta { border-right: none; border-bottom: 1px solid var(--border-color); }
    .db-area-gallery { border-left: none; border-top: 1px solid var(--border-color); }
    .ticket-region-side { width: 100px; }
    .modal-card { max-height: 95vh; width: calc(100vw - 1.5rem); }
    .side-toolbar { bottom: 0.75rem; right: 0.75rem; }
}

.attach-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0.5rem 0 1rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-muted);
    background: color-mix(in srgb, #f59e0b 8%, var(--bg-box));
    border: 1px solid color-mix(in srgb, #f59e0b 35%, var(--border-color));
    border-radius: 8px;
}
.attach-warning-ico {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    fill: none;
    stroke: #f59e0b;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:focus-visible {
    outline: 2px solid var(--logo-accent);
    outline-offset: 2px;
}

.option-item.kb-active {
    background: color-mix(in srgb, var(--logo-accent) 14%, transparent);
}
