/* ===========================================================================
   RoDecomp — Dex-inspired three-pane explorer (blue product theme)
   =========================================================================== */

.dc {
    /* RoDecomp blue system (scoped — rest of Authsy stays green) */
    --accent: #4ea1ff;
    --accent-2: #2b7fd4;
    --accent-ink: #041018;
    --rd-blue: #4ea1ff;
    --rd-blue-dim: rgba(78, 161, 255, 0.18);
    --rd-bg: #0b0f14;
    --rd-panel: #10161e;
    --success: #43c463;

    display: flex; flex-direction: column; height: 100vh; overflow: hidden;
    background: var(--rd-bg, #0b0f14);
    color: var(--text, #e6edf3);
}

/* ---- Toolbar ---- */
.dc-toolbar {
    flex: none; display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, color-mix(in srgb, var(--rd-panel) 88%, #4ea1ff) 0%, var(--rd-panel) 100%);
}
.dc .plogo-mark {
    background: color-mix(in srgb, #4ea1ff 22%, transparent);
    border-color: color-mix(in srgb, #4ea1ff 45%, transparent);
    color: #4ea1ff;
}
.dc .btn-primary {
    background: #4ea1ff;
    border-color: #2b7fd4;
    color: #041018;
}
.dc .btn-primary:hover { background: #6bb4ff; border-color: #4ea1ff; }
.dc-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; margin-right: 4px; }
.dc-toolbar-actions { display: flex; align-items: center; gap: 6px; }
.dc-place {
    display: flex; flex-direction: column; gap: 1px; min-width: 0; max-width: 280px;
    padding: 2px 10px; border-left: 1px solid var(--border); margin-left: 4px;
}
.dc-place-label {
    font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
    color: var(--text-faint); font-weight: 600;
}
.dc-file-name {
    color: var(--text); font-size: 12.5px; font-family: var(--font-mono);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dc-spacer { flex: 1; }
.dc-toolbar .btn { height: 30px; padding-top: 0; padding-bottom: 0; }

/* usage meter */
.dc-usage {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 10px; border-radius: 100px;
    border: 1px solid var(--border); background: var(--surface-2);
    font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
}
.dc-usage-label { color: var(--text-faint); text-transform: uppercase; letter-spacing: .08em; font-size: 9px; }
.dc-usage-val { color: var(--text); font-weight: 600; min-width: 3.2em; }
.dc-usage-bar {
    width: 56px; height: 5px; border-radius: 100px; overflow: hidden;
    background: var(--surface-3, #1a1f1c); border: 1px solid var(--border);
}
.dc-usage-bar i {
    display: block; height: 100%; width: 0%; background: var(--accent);
    transition: width .35s ease, background .2s ease;
}
.dc-usage.warn .dc-usage-bar i { background: #fbbf24; }
.dc-usage.empty .dc-usage-bar i { background: #f87171; }
.dc-usage.empty .dc-usage-val { color: #f87171; }

.dc-engine, .dc-access {
    font-family: var(--font-mono); font-size: 11px; color: var(--text-faint);
    border: 1px solid var(--border); border-radius: 100px; padding: 3px 10px;
}
.dc-engine.ready { color: #4ea1ff; border-color: rgba(78,161,255,.4); }
.dc-access.ok { color: #43c463; border-color: rgba(67,196,99,.35); }
.dc-access.pro { color: #4ea1ff; border-color: rgba(78,161,255,.4); }
.dc-access.locked { color: var(--warning, #fbbf24); border-color: rgba(251,191,36,.35); }

.dc-gate-progress { text-align: center; padding: 8px 0 4px; }
.dc-gate-bar {
    height: 8px; border-radius: 100px; background: var(--surface-2);
    border: 1px solid var(--border); overflow: hidden; margin-bottom: 12px;
}
.dc-gate-bar i { display: block; height: 100%; width: 0%; background: var(--accent); transition: width .2s linear; }
.dc-gate-label { font-size: 13px; color: var(--text-muted); margin: 0 0 14px; }
.dc-gate-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* history */
.dc-history { position: relative; }
.dc-history-menu {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
    min-width: 240px; max-height: 320px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--radius); box-shadow: var(--hard); padding: 6px;
}
.dc-hist-item {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
    padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text);
}
.dc-hist-item:hover { background: var(--surface-2); }
.dc-hist-name { font-size: 13px; font-weight: 550; }
.dc-hist-meta { font-size: 11px; color: var(--text-faint); }
.dc-hist-empty { padding: 12px; color: var(--text-faint); font-size: 12.5px; text-align: center; }

/* ---- Body ---- */
.dc-body {
    flex: 1; display: grid;
    grid-template-columns: var(--dc-left, 300px) 5px 1fr 5px var(--dc-right, 280px);
    min-height: 0;
}
.dc-resizer { background: var(--border); cursor: col-resize; transition: background .15s ease; }
.dc-resizer:hover, .dc-resizer.dragging { background: var(--accent); }
.dc.resizing { cursor: col-resize; user-select: none; }
.dc-pane { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.dc-explorer { border-right: 1px solid var(--border); background: var(--surface); }
.dc-inspector { border-left: 1px solid var(--border); background: var(--surface); }
.dc-pane-head {
    flex: none; display: flex; align-items: center; justify-content: space-between;
    padding: 9px 12px; font-size: 11px; font-weight: 600; letter-spacing: .07em;
    text-transform: uppercase; color: var(--text-faint); border-bottom: 1px solid var(--border);
}
.dc-pane-tools { display: flex; gap: 4px; }
.dc-icon-btn {
    width: 26px; height: 22px; border: 1px solid var(--border); border-radius: 6px;
    background: transparent; color: var(--text-faint); cursor: pointer; font-size: 12px;
}
.dc-icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }
.dc-stats { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text-faint); }

/* filter */
.dc-filter-bar {
    flex: none; display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.dc-search {
    flex: 1; min-width: 0; height: 30px; padding: 0 10px;
    border: 1px solid var(--border); border-radius: var(--radius-sm, 8px);
    background: var(--surface-2); color: var(--text); font-size: 12.5px; font-family: var(--font-mono);
}
.dc-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(78,161,255,.18); }
.dc-filter-chk {
    flex: none; display: flex; align-items: center; gap: 5px;
    font-size: 11.5px; color: var(--text-muted); cursor: pointer; user-select: none; white-space: nowrap;
}
.dc-filter-chk input { accent-color: var(--accent); }

/* tree — Dex-like rows */
.dc-tree { flex: 1; overflow: auto; padding: 4px 2px 20px; contain: content; }
.dc-node { user-select: none; }
.dc-row {
    display: flex; align-items: center; gap: 5px; padding: 2px 8px 2px 4px;
    border-radius: 4px; cursor: pointer; font-size: 12.5px; color: var(--text-muted);
    white-space: nowrap; height: 22px; line-height: 22px;
}
.dc-row:hover { background: rgba(255,255,255,.04); color: var(--text); }
.dc-row.selected {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--text); box-shadow: inset 2px 0 0 var(--accent);
}
.dc-row.is-script { color: var(--text); }
.dc-row.hit .dc-name { color: var(--accent); }
.dc-row.dim { opacity: 0.4; }
.dc-caret {
    width: 14px; flex: none; text-align: center; color: var(--text-faint);
    transition: transform .12s ease; font-size: 9px;
}
.dc-node.collapsed > .dc-row .dc-caret { transform: rotate(-90deg); }
.dc-node.collapsed > .dc-children { display: none; }
.dc-caret.leaf { visibility: hidden; }
.dc-ico { width: 14px; height: 14px; flex: none; opacity: .9; }
.dc-ico svg { width: 14px; height: 14px; display: block; }
.dc-ico.script { color: #4ea1ff; }
.dc-ico.gui { color: #38bdf8; }
.dc-ico.part { color: #fbbf24; }
.dc-ico.folder { color: var(--text-faint); }
.dc-ico.service { color: #6ec6ff; }
.dc-name { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.dc-name .dc-cls {
    color: var(--text-faint); font-size: 10.5px; margin-left: 6px;
    font-family: var(--font-mono); opacity: .75;
}
.dc-children { padding-left: 12px; border-left: 1px solid rgba(255,255,255,.04); margin-left: 10px; }

.dc-breadcrumb {
    flex: none; padding: 6px 10px; border-top: 1px solid var(--border);
    font-size: 11px; font-family: var(--font-mono); color: var(--text-faint);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    background: var(--surface-2);
}
.dc-breadcrumb b { color: var(--text-muted); font-weight: 500; }

/* code viewer */
.dc-viewer { background: #0a0e14; }
.dc-tabs {
    flex: none; display: flex; gap: 2px; padding: 6px 8px 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    overflow-x: auto; scrollbar-width: none;
}
.dc-tabs::-webkit-scrollbar { display: none; }
.dc-tab {
    flex: none; display: flex; align-items: center; gap: 8px; padding: 7px 12px;
    border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0;
    background: transparent; color: var(--text-muted); font-size: 12.5px; cursor: pointer;
}
.dc-tab:hover { color: var(--text); }
.dc-tab.active { background: #0a0e14; color: var(--text); border-color: var(--border); }
.dc-tab .dc-x { color: var(--text-faint); border-radius: 4px; padding: 0 3px; }
.dc-tab .dc-x:hover { background: var(--surface-3); color: var(--text); }

.dc-code-toolbar {
    flex: none; display: flex; align-items: center; justify-content: space-between;
    padding: 6px 12px; border-bottom: 1px solid var(--border); background: #0d1218;
    font-size: 11.5px; color: var(--text-faint);
}
.dc-code-actions { display: flex; gap: 6px; }
.dc-code-wrap { flex: 1; overflow: hidden; min-height: 0; position: relative; display: flex; flex-direction: column; }
.dc-code {
    flex: 1; min-height: 0; height: 100%; width: 100%;
    display: flex; flex-direction: column; position: relative;
}
.dc-monaco {
    flex: 1 1 auto;
    min-height: 200px;
    width: 100%;
    height: 100%;
    position: relative;
}
/* Monaco is the editor — kill old table styles when present */
.dc-code .monaco-editor,
.dc-code .overflow-guard {
    border-radius: 0;
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}
.dc-code-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55; }
.dc-code-table td { padding: 0; vertical-align: top; }
.dc-ln {
    width: 1%; text-align: right; padding: 0 14px 0 16px !important;
    color: var(--text-faint); user-select: none; white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,.05);
}
.dc-src { padding: 0 18px !important; white-space: pre; color: #d7e0ea; overflow: hidden; text-overflow: ellipsis; }
.dc-src:hover { background: rgba(78,161,255,.04); }
.dc-virt-pad td { line-height: 0 !important; }

.lua-kw { color: #7ec0ff; }
.lua-str { color: #7ddea0; }
.lua-com { color: var(--text-faint); font-style: italic; }
.lua-num { color: #e2c069; }
.lua-fn { color: #9ecbff; }

.dc-decompiling { display: inline-flex; align-items: center; gap: 10px; color: var(--text-muted); font-style: italic; }

/* inspector */
.dc-inspect { flex: 1; overflow: auto; padding: 14px; font-size: 13px; }
.dc-muted { color: var(--text-faint); line-height: 1.6; }
.dc-inspect h4 { font-size: 14px; margin-bottom: 2px; word-break: break-word; }
.dc-inspect .dc-cls-tag { font-family: var(--font-mono); font-size: 11px; color: #4ea1ff; }
.dc-inspect .dc-path {
    margin-top: 8px; font-family: var(--font-mono); font-size: 11px;
    color: var(--text-faint); word-break: break-all; line-height: 1.45;
}
.dc-prop {
    display: flex; justify-content: space-between; gap: 10px;
    padding: 6px 0; border-bottom: 1px solid var(--border);
}
.dc-prop .k { color: var(--text-faint); }
.dc-prop .v {
    color: var(--text); font-family: var(--font-mono); font-size: 11.5px;
    text-align: right; word-break: break-word;
}
.dc-preview-box {
    margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg); padding: 10px; min-height: 120px; position: relative; overflow: hidden;
}
.dc-preview-label { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin-bottom: 8px; }
.gui-node {
    position: absolute; border: 1px solid rgba(78,161,255,.5); background: rgba(78,161,255,.08);
    font-size: 9px; color: var(--text-muted); overflow: hidden;
}
.dc-3d-note { color: var(--text-faint); font-size: 11.5px; line-height: 1.5; margin-top: 8px; }
.dc-3d-box canvas {
    display: block; width: 100%; height: 180px; border-radius: 8px;
    background: #0b0c0e; cursor: grab; touch-action: none;
    border: 1px solid var(--border);
}
.dc-3d-box canvas:active { cursor: grabbing; }
.dc-inspect-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* empty / banners */
.dc-empty { padding: 22px 16px; color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.dc-empty p { margin: 6px 0; }
.dc-empty-hero { text-align: center; padding: 36px 18px; }
.dc-empty-mark {
    font-family: 'Griaste', 'Shrikhand', cursive; font-size: 36px;
    color: var(--accent); margin-bottom: 12px; line-height: 1;
}
.dc-empty-hint { color: var(--text-faint) !important; font-size: 12.5px !important; }
.dc-empty code {
    font-family: var(--font-mono); font-size: 11px; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px;
}
.dc-viewer-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; text-align: center; color: var(--text-faint); padding: 24px;
}
.dc-viewer-empty[hidden], .dc-code[hidden], .dc-code-toolbar[hidden] { display: none; }
.dc-logo { font-family: var(--font-mono); font-size: 46px; color: var(--surface-3); margin-bottom: 12px; }
.dc.drag .dc-tree { outline: 2px dashed var(--accent); outline-offset: -8px; }
.dc-banner {
    margin: 12px; padding: 12px 14px; border-radius: var(--radius-sm, 8px);
    background: var(--surface-2); border: 1px solid var(--border);
    border-left: 3px solid var(--warning); color: var(--text-muted);
    font-size: 13px; line-height: 1.45;
}

/* status bar */
.dc-status {
    flex: none; display: flex; align-items: center; justify-content: space-between;
    padding: 5px 14px; border-top: 1px solid var(--border);
    background: var(--surface); font-size: 11.5px; color: var(--text-faint);
    font-family: var(--font-mono);
}
.dc-status-right { color: var(--text-muted); }

/* capture modal */
.dc-cap-row { display: flex; gap: 8px; align-items: stretch; margin-top: 6px; }
.dc-cap-code {
    flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 12px; color: var(--accent);
    background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: 9px 12px; overflow-x: auto; white-space: nowrap;
}
.dc-cap-status {
    display: flex; align-items: center; gap: 8px; margin-top: 14px;
    font-size: 13px; color: var(--text-muted);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2); padding: 10px 12px;
}
.dc-cap-status.ok { color: var(--success); border-color: rgba(74,222,128,.3); }
.dc-cap-status.err { color: var(--danger); border-color: rgba(248,113,113,.3); }

/* context menu */
.dc-ctx {
    position: fixed; z-index: 200; min-width: 200px;
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--radius); box-shadow: var(--hard); padding: 5px;
}
.dc-ctx[hidden] { display: none; }
.dc-ctx-item {
    display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
    border: 0; background: transparent; cursor: pointer; color: var(--text);
    padding: 7px 11px; border-radius: var(--radius-sm); font-size: 13px;
}
.dc-ctx-item:hover { background: var(--surface-2); }
.dc-ctx-item.primary { color: var(--accent); font-weight: 550; }
.dc-ctx-item.primary:hover { background: rgba(94, 232, 138, .1); }
.dc-ctx-sep { height: 1px; margin: 4px 6px; background: var(--border); }
.dc-ctx-ico { font-family: var(--font-mono); font-size: 12px; }

@media (max-width: 1000px) {
    .dc-body { grid-template-columns: 220px 1fr; }
    .dc-inspector, .dc-resizer[data-resize="right"] { display: none; }
    .dc-place { display: none; }
    .dc-usage-bar { display: none; }
}
