.status {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 11px;
    color: var(--muted);
    background: #fff;
}

.status.good {
    color: var(--good);
    border-color: #bfe7d5;
}

.status.warn {
    color: var(--warn);
    border-color: #efd7b3;
}

.nav {
    width: 100%;
    min-height: 42px;
    margin-bottom: 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    text-align: left;
    padding: 0 12px;
}

.nav.active,
.nav:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: #cfe1fb;
}

.nav:disabled {
    background: transparent;
    color: #94a3b8;
    cursor: not-allowed;
}

.nav-link {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    padding: 0 10px;
    font-weight: 700;
}

.nav-link.active,
.nav-link:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: #cfe1fb;
}

.nav-link:disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.current-user {
    max-width: 260px;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.credit-balance {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--panel);
    border: 1px solid var(--line);
    font-size: 13px;
    font-weight: 700;
}

.credit-topup-button {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--accent);
    border: 1px solid var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.credit-topup-button:hover {
    filter: brightness(1.05);
}

.credit-topup-button:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* 상단바 크레딧 충전 드롭다운 — 로그인 상태(body[data-auth=signed-in])에서만 노출. */
.credit-topup {
    position: relative;
    display: none;
}

body[data-auth="signed-in"] .credit-topup {
    display: inline-flex;
    animation: topupReveal 260ms ease;
}

@keyframes topupReveal {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.credit-topup-caret {
    margin-left: 4px;
    font-size: 10px;
    transition: transform 180ms ease;
}

.credit-topup.open .credit-topup-caret {
    transform: rotate(180deg);
}

.credit-topup-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
    padding: 6px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scaleY(.98);
    transform-origin: top right;
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
}

.credit-topup.open .credit-topup-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scaleY(1);
}

.credit-topup-item,
.topup-product {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
    text-align: left;
}

.credit-topup-item:hover,
.topup-product:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.credit-topup-item:disabled,
.topup-product:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.topup-price {
    font-size: 13px;
    font-weight: 700;
}

.topup-credits {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

.topup-product-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.account-section:first-child {
    border-top: 0;
    padding-top: 0;
}

.account-danger strong {
    color: #b42318;
}

.form-error {
    color: #b42318;
}

.ghost-button {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    padding: 0 11px;
    font-weight: 700;
}

.dropzone,
.toolbar,
.batch-toolbar,
.account-panel,
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.dropzone {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) minmax(180px, auto) auto;
    gap: 14px;
    align-items: center;
    margin-bottom: 16px;
    border-style: dashed;
    border-width: 2px;
    border-color: #c9d5e5;
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}

.dropzone.dragging {
    background: var(--accent-soft);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(18, 105, 211, .10);
}

.dropzone.has-file {
    border-style: solid;
    border-color: #b8d0f2;
    background: #fbfdff;
}

.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.drop-visual {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 24px;
    font-weight: 700;
}

.drop-icon {
    line-height: 1;
    transform: translateY(-2px);
}

.drop-copy strong,
.drop-copy span {
    display: block;
}

.drop-copy span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.selected-file {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.selected-file[hidden] {
    display: none !important;
}

.file-ext {
    min-width: 44px;
    border-radius: 6px;
    padding: 5px 7px;
    background: #eef2f7;
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

.file-name {
    min-width: 0;
    max-width: 280px;
    overflow: hidden;
    color: var(--text) !important;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toolbar select {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 7px;
}

.toolbar input {
    min-height: 40px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 7px 10px;
}

.login-panel,
.signup-panel {
    max-width: 760px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.login-stack {
    max-width: 760px;
    display: grid;
    gap: 14px;
}

.login-panel {
    max-width: 420px;
    display: grid;
    gap: 14px;
}

.login-panel label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.login-panel input {
    min-height: 40px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 8px 10px;
}

.login-panel button {
    min-height: 38px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
}

.login-error,
.access-banner {
    color: #b91c1c;
    font-weight: 700;
}

.access-banner {
    margin-bottom: 14px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fee2e2;
    padding: 12px 14px;
}

.access-banner[hidden] {
    display: none !important;
}

.signup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.signup-grid label,
.consent-row {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.signup-grid input,
.signup-grid select {
    min-height: 40px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 8px 10px;
}

.signup-grid input:disabled {
    background: #eef2f7;
    color: #758091;
}

.consent-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    margin-top: 14px;
}

.consent-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.signup-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.signup-actions button {
    min-height: 38px;
    border: 0;
    border-radius: 8px;
    padding: 0 14px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
}

.signup-actions button:not(:first-child) {
    background: var(--accent-soft);
    color: var(--accent);
}

.signup-result {
    display: block;
    min-height: 34px;
    margin-top: 14px;
    color: var(--text);
    font-weight: 700;
}

.account-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 18px;
}

.auth-form {
    display: grid;
    gap: 12px;
}

.auth-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.auth-form input {
    min-height: 40px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 8px 10px;
}

.auth-form button {
    justify-self: start;
    min-height: 38px;
    border: 0;
    border-radius: 8px;
    padding: 0 14px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
}

.auth-form button:disabled {
    background: #d7dee8;
    color: #758091;
}

.form-message {
    min-height: 20px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.dropzone button,
.toolbar button,
.identity-actions button {
    min-height: 40px;
    border: 0;
    border-radius: 8px;
    padding: 0 14px;
    color: #fff;
    background: var(--accent);
}

.identity-actions button {
    min-height: 34px;
    padding: 0 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
}

#microsoftWorkLoginButton {
    background: var(--accent);
    color: #fff;
}

.dropzone button:disabled {
    background: #d7dee8;
    color: #758091;
}

#translateButton[hidden] {
    display: none;
}

.batch-toolbar {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin: -6px 0 16px;
    padding: 10px 12px;
}

.batch-toolbar[hidden] {
    display: none !important;
}

.batch-select-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid #cfe1fb;
    border-radius: 10px;
    background: var(--accent-soft);
}

.batch-select-toggle input {
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.batch-select-toggle:has(input:disabled) {
    background: #eef2f7;
    border-color: var(--line);
    opacity: .7;
}

.batch-toolbar button {
    min-height: 34px;
    border: 0;
    border-radius: 8px;
    padding: 0 12px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
}

.danger-button {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

.danger-button:hover:not(:disabled) {
    background: #fecaca !important;
}

.danger-button:disabled {
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
}

#batchTranslateButton {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
}

#batchTranslateButton:disabled {
    background: #d7dee8;
    color: #758091;
}

#batchDownloadButton:disabled {
    background: #eef2f7;
    color: #758091;
}

.dropzone span,
.card span,
.console-title span {
    color: var(--muted);
    font-size: 13px;
}

.engine-console {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    padding: 0;
    overflow: hidden;
    background: var(--panel);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 20px rgba(15, 23, 42, .08);
}

.console-title {
    min-height: 42px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    text-align: left;
}

.engine-console pre {
    min-height: 160px;
    max-height: 36vh;
    margin: 0;
    padding: 14px;
    overflow: auto;
    background: #101418;
    color: #d7e1ec;
    font: 13px/1.5 Consolas, "Courier New", monospace;
    white-space: pre-wrap;
}

.engine-console.collapsed pre {
    display: none;
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(120px, auto) minmax(220px, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.api-key-form {
    grid-template-columns: minmax(160px, 1fr) minmax(220px, 2fr) minmax(140px, auto) auto;
}

.webhook-toolbar {
    grid-template-columns: minmax(140px, .8fr) minmax(220px, 1.2fr) minmax(260px, 1fr) auto auto;
}

.webhook-event-types {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.webhook-event-option {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 8px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
}

.webhook-event-option input {
    min-height: 0;
    width: 16px;
    height: 16px;
    padding: 0;
    accent-color: var(--accent);
}

.webhook-card .actions {
    justify-content: flex-end;
    margin-top: 0;
}

.webhook-delivery-toolbar {
    grid-template-columns: auto 1fr;
    margin-top: 16px;
}

.api-key-metering {
    justify-content: flex-start;
    margin-top: 0;
}

.api-key-metering span {
    color: var(--muted);
}

.api-key-card {
    grid-template-columns: minmax(0, 1fr) minmax(260px, auto);
}

.api-key-secret {
    display: inline-block;
    max-width: 100%;
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    background: #f8fafc;
    color: #263445;
    font: 12px/1.4 Consolas, "Courier New", monospace;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.api-key-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.api-key-actions button {
    min-height: 34px;
    border: 0;
    border-radius: 8px;
    padding: 0 12px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.admin-toolbar {
    grid-template-columns: minmax(80px, auto) minmax(180px, 240px) minmax(0, 1fr);
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-tab {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    background: #fff;
    color: var(--muted);
    font-weight: 700;
}

.admin-tab.active {
    border-color: #cfe1fb;
    background: var(--accent-soft);
    color: var(--accent);
}

.admin-panel-card,
.admin-audit-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: #fff;
}

.admin-panel-card span,
.admin-audit-row span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.admin-audit-row {
    grid-template-columns: minmax(0, 1fr);
}

.list {
    display: grid;
    gap: 10px;
}

.card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    overflow: hidden;
    transition: background .35s ease;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    width: var(--progress, 0%);
    background: linear-gradient(90deg, rgba(18, 105, 211, .14), rgba(18, 105, 211, .07));
    transition: width .35s ease, opacity .35s ease;
    pointer-events: none;
}

.card.progress-settled::before {
    opacity: 0;
}

.card>* {
    position: relative;
    z-index: 1;
}

.card strong,
.card span {
    display: block;
}

.asset-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asset-extension {
    display: inline !important;
    margin-left: 1px;
    color: #b7c0cd;
    font-weight: 600;
}

.card span {
    margin-top: 4px;
}

.badge {
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.stage-badge {
    min-width: 104px;
    text-align: center;
}

.asset-status-stack {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.validation-badge {
    background: #eef2f7;
    color: var(--muted);
}

.asset-check {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
}

.stage-translate {
    min-width: 104px;
    min-height: 34px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    text-transform: lowercase;
}

.stage-translate:disabled {
    background: #d7dee8;
    color: #758091;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.actions a,
.actions button {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    border: 0;
    border-radius: 8px;
    padding: 0 12px;
    background: var(--accent-soft);
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

.actions .danger-button {
    margin-left: 2px;
}

.actions a.disabled,
.actions button:disabled {
    color: var(--muted);
    background: #eef2f7;
    pointer-events: none;
}

.empty-list {
    min-height: 74px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
    color: var(--muted);
}

.viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: transparent;
    padding: 14px;
    pointer-events: none;
}

.viewer-overlay[hidden] {
    display: none !important;
}

.viewer-panel {
    position: absolute;
    width: min(1180px, calc(100vw - 48px));
    height: min(760px, calc(100vh - 48px));
    min-width: 420px;
    min-height: 320px;
    display: grid;
    grid-template-rows: 44px minmax(0, 1fr);
    background: #fff;
    border-radius: 8px;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .25);
    pointer-events: auto;
}

.viewer-panel.edit-mode {
    border: 2px solid #dc2626;
}

.viewer-panel.resizing {
    user-select: none;
}

.viewer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 12px;
    border-bottom: 1px solid var(--line);
    cursor: move;
    user-select: none;
}

.viewer-bar button {
    min-height: 32px;
    border: 0;
    border-radius: 8px;
    padding: 0 12px;
    color: var(--accent);
    background: var(--accent-soft);
    font-weight: 700;
}

.viewer-frame,
.viewer-surface {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
    overflow: auto;
}

.viewer-resize {
    position: absolute;
    z-index: 4;
    width: 26px;
    height: 26px;
    background: radial-gradient(circle at center, #b7c0cd 0 2px, transparent 2px);
}

.viewer-resize-n {
    left: 26px;
    right: 26px;
    top: 0;
    width: auto;
    height: 8px;
    cursor: ns-resize;
    background: transparent;
}

.viewer-resize-e {
    right: 0;
    top: 26px;
    bottom: 26px;
    width: 8px;
    height: auto;
    cursor: ew-resize;
    background: transparent;
}

.viewer-resize-s {
    left: 26px;
    right: 26px;
    bottom: 0;
    width: auto;
    height: 8px;
    cursor: ns-resize;
    background: transparent;
}

.viewer-resize-w {
    left: 0;
    top: 26px;
    bottom: 26px;
    width: 8px;
    height: auto;
    cursor: ew-resize;
    background: transparent;
}

.viewer-resize-nw {
    left: 0;
    top: 0;
    cursor: nwse-resize;
}

.viewer-resize-ne {
    right: 0;
    top: 0;
    cursor: nesw-resize;
}

.viewer-resize-sw {
    left: 0;
    bottom: 0;
    cursor: nesw-resize;
}

.viewer-resize-se {
    right: 0;
    bottom: 0;
    cursor: nwse-resize;
}

.viewer-focus-layer {
    position: absolute;
    left: 0;
    right: 0;
    top: 44px;
    bottom: 0;
    z-index: 2;
    background: transparent;
}

.viewer-panel.is-front .viewer-focus-layer {
    pointer-events: none;
}

.viewer-capture-layer {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    background: transparent;
}

.viewer-title-group {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.viewer-title-group strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.viewer-mode-toggle {
    position: relative;
    min-width: 92px;
    min-height: 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    padding: 2px;
    border-radius: 999px;
    background: #eef2f7;
    color: var(--muted);
    overflow: hidden;
}

.viewer-mode-thumb {
    position: absolute;
    left: 2px;
    top: 2px;
    width: calc(50% - 2px);
    height: calc(100% - 4px);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .16);
    transition: transform .16s ease;
}

.viewer-mode-label {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
}

.viewer-panel.edit-mode .viewer-mode-thumb {
    transform: translateX(100%);
}

.viewer-panel:not(.edit-mode) .viewer-mode-view,
.viewer-panel.edit-mode .viewer-mode-edit {
    color: var(--accent);
}

.viewer-save[hidden] {
    display: none;
}

.viewer-panel.edit-mode .viewer-resize {
    display: none;
}

.asset-title-row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
}