/* ================================================================
   LAYOUT — Content area, panels, responsive
   ================================================================ */
.content-area { display: flex; gap: 6px; padding: 6px; }
.left-panel  { width: 340px; flex-shrink: 0; }
.right-panel { flex: 1; min-width: 0; }

/* ── Menu Bar ── */
.menu-bar {
    background: #d4d0c8; border-bottom: 1px solid #808080;
    padding: 2px 2px; display: flex; align-items: center; justify-content: space-between;
    position: relative;
}
.menu-bar-left { display: flex; }
.menu-item { padding: 2px 8px; cursor: default; font-size: 11px; user-select: none; }
.menu-item:hover { background: #000080; color: #ffffff; }

.menu-bar-right { display: flex; align-items: center; gap: 6px; padding-right: 4px; }

.mode-switcher { display: flex; gap: 2px; }
.mode-btn {
    background: #d4d0c8;
    border-top: 1px solid #ffffff; border-left: 1px solid #ffffff;
    border-right: 1px solid #404040; border-bottom: 1px solid #404040;
    font-family: Tahoma, 'MS Sans Serif', Arial, sans-serif;
    font-size: 10px; padding: 1px 8px; cursor: pointer; color: #000000;
}
.mode-btn.active {
    border-top: 1px solid #404040; border-left: 1px solid #404040;
    border-right: 1px solid #ffffff; border-bottom: 1px solid #ffffff;
    background: #c5d8ea;
}
.mode-btn:hover:not(.active) { background: #c8c4bc; }

.user-badge { display: flex; align-items: center; gap: 4px; font-size: 10px; color: #444444; }
.user-avatar { width: 16px; height: 16px; border: 1px solid #808080; object-fit: cover; }

#btn-signout {
    background: #d4d0c8;
    border-top: 1px solid #ffffff; border-left: 1px solid #ffffff;
    border-right: 1px solid #404040; border-bottom: 1px solid #404040;
    font-family: Tahoma, 'MS Sans Serif', Arial, sans-serif;
    font-size: 10px; padding: 1px 8px; cursor: pointer; color: #000000;
}
#btn-signout:active {
    border-top: 1px solid #404040; border-left: 1px solid #404040;
    border-right: 1px solid #ffffff; border-bottom: 1px solid #ffffff;
}

/* ── Language Switcher ── */
.lang-switcher { display: flex; gap: 2px; }
.lang-btn {
    background: #d4d0c8;
    border-top: 1px solid #ffffff; border-left: 1px solid #ffffff;
    border-right: 1px solid #404040; border-bottom: 1px solid #404040;
    font-family: Tahoma, 'MS Sans Serif', Arial, sans-serif;
    font-size: 10px; padding: 1px 6px; cursor: pointer; color: #000000;
}
.lang-btn.active {
    border-top: 1px solid #404040; border-left: 1px solid #404040;
    border-right: 1px solid #ffffff; border-bottom: 1px solid #ffffff;
    background: #c0bdb5;
}
.lang-btn:hover:not(.active) { background: #c8c4bc; }

.designer-banner {
    margin-bottom: 6px;
    padding: 6px 8px;
    border-top: 1px solid #ffffff; border-left: 1px solid #ffffff;
    border-right: 1px solid #808080; border-bottom: 1px solid #808080;
    background: #f3efe3;
}
.designer-banner-title {
    font-size: 11px;
    font-weight: bold;
    color: #000080;
}
.designer-banner-body {
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.4;
    color: #444444;
}

body.designer-mode .left-panel {
    display: none;
}
body.designer-mode .right-panel {
    width: 100%;
    flex: 1 1 100%;
}

.edit-dialog { width: min(760px, calc(100vw - 24px)); }
.edit-image-tools {
    margin-bottom: 10px;
    padding: 8px;
    border-top: 1px solid #ffffff; border-left: 1px solid #ffffff;
    border-right: 1px solid #808080; border-bottom: 1px solid #808080;
    background: #efefe7;
}
.edit-image-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.edit-image-status {
    display: inline-block;
    min-width: 58px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
    color: #ffffff;
    background: #666666;
}
.edit-image-status.is-raw { background: #8c5f1f; }
.edit-image-status.is-edited { background: #006633; }
.edit-image-compare {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}
.edit-image-panel {
    padding: 6px;
    border-top: 1px solid #808080; border-left: 1px solid #808080;
    border-right: 1px solid #ffffff; border-bottom: 1px solid #ffffff;
    background: #ffffff;
}
.edit-image-caption {
    margin-bottom: 6px;
    font-size: 10px;
    font-weight: bold;
    color: #000080;
}
.edit-image-panel img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    background: #d4d0c8;
    border: 1px solid #808080;
    cursor: zoom-in;
}
.edit-image-meta {
    margin-top: 6px;
    font-size: 10px;
    color: #444444;
}
.edit-image-delete-btn {
    color: #990000;
}
.image-viewer-dialog {
    width: min(1120px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    background: #d4d0c8;
    border-top: 2px solid #ffffff; border-left: 2px solid #ffffff;
    border-right: 2px solid #404040; border-bottom: 2px solid #404040;
}
.image-viewer-titlebar {
    flex-shrink: 0;
}
.image-viewer-body {
    padding: 10px;
    overflow: auto;
    background: #c7c4bb;
}
.image-viewer-img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - 110px);
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #808080;
}

/* ── Responsive ── */
.pin-pad-body {
    padding: 14px 16px 16px;
    text-align: left;
}
.pin-pad-prompt {
    margin-bottom: 8px;
    font-size: 11px;
    line-height: 1.4;
    color: #444444;
}
.pin-pad-display {
    margin-bottom: 8px;
    padding: 6px 8px;
    min-height: 30px;
    border-top: 1px solid #808080; border-left: 1px solid #808080;
    border-right: 1px solid #dfdfdf; border-bottom: 1px solid #dfdfdf;
    background: #ffffff;
    font-family: Tahoma, Arial, sans-serif;
    font-size: 16px;
    letter-spacing: 4px;
    text-align: center;
}
.pin-pad-error {
    min-height: 14px;
    margin-bottom: 8px;
    font-size: 10px;
    color: #cc0000;
}
.pin-pad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.pin-pad-key {
    min-height: 34px;
    background: #d4d0c8;
    border-top: 1px solid #ffffff; border-left: 1px solid #ffffff;
    border-right: 1px solid #404040; border-bottom: 1px solid #404040;
    font-family: Tahoma, 'MS Sans Serif', Arial, sans-serif;
    font-size: 12px;
    cursor: pointer;
}
.pin-pad-key:active {
    border-top: 1px solid #404040; border-left: 1px solid #404040;
    border-right: 1px solid #ffffff; border-bottom: 1px solid #ffffff;
}
.pin-pad-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 10px;
}

@media (max-width: 900px) {
    .left-panel { width: 280px; }
}

@media (max-width: 640px) {
    .content-area { flex-direction: column; padding: 4px; gap: 4px; }
    .left-panel  { width: 100%; }
    .right-panel { width: 100%; }
    .menu-bar { flex-wrap: wrap; gap: 2px; padding: 3px 4px; }
    .menu-bar-left  { order: 1; }
    .menu-bar-right { order: 2; flex-wrap: wrap; }
    .mode-switcher { order: -1; }
    input[type="text"], input[type="number"], textarea { font-size: 13px; padding: 4px 6px; }
    label { font-size: 12px; }
    .login-dialog { width: calc(100vw - 24px); max-width: 360px; }
    #edit-overlay > .login-dialog { width: calc(100vw - 24px); max-width: 760px; }
    .btn-row { gap: 4px; }
    .btn { flex: 1; min-width: 0; padding: 7px 8px; font-size: 12px; }
    .status-item:nth-child(2) { display: none; }
    .title-bar-left { font-size: 11px; }
    .edit-image-compare { grid-template-columns: 1fr; }
    .edit-image-panel img { height: 180px; }
    body.designer-mode .left-panel { display: none; }
}

@media (max-width: 400px) {
    .menu-bar-left { display: none; }
}
