/* Version: V.6.16.1825 */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 32px;
    font-family: Arial, sans-serif;
    color: #e5e7eb;
    background:
            radial-gradient(circle at top left, #312e81, transparent 30%),
            linear-gradient(135deg, #020617, #0f172a 55%, #111827);
}

body.debug-ui-enabled {
    padding: 20px;
    color: #d1d5db;
    background:
            radial-gradient(circle at top left, rgba(14, 165, 233, 0.12), transparent 24%),
            linear-gradient(135deg, #030303, #080808 58%, #111111);
}

body.debug-ui-enabled .card {
    background: rgba(8, 8, 8, 0.94);
    border-color: rgba(75, 85, 99, 0.42);
    box-shadow: 0 22px 72px rgba(0, 0, 0, 0.72);
}

.debug-card-toggle {
    display: none;
}

body.debug-ui-enabled .debug-card-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.86);
    font-size: 12px;
    font-weight: 800;
}

body.debug-ui-enabled .debug-card-toggle:hover {
    border-color: rgba(34, 211, 238, 0.64);
    color: #67e8f9;
}

body.debug-ui-enabled .debug-collapsible-card > .debug-card-toggle {
    align-self: flex-end;
    margin-top: -40px;
    margin-bottom: 12px;
}

body.debug-ui-enabled .gear-card-heading .debug-card-toggle {
    margin-left: auto;
}

body.debug-ui-enabled .debug-card-collapsed {
    min-height: 64px;
    padding-bottom: 16px;
}

body.debug-ui-enabled .debug-card-collapsed > :not(h2):not(.gear-card-heading):not(.debug-card-toggle) {
    display: none !important;
}

body.debug-ui-enabled .debug-card-collapsed .gear-capture-actions {
    display: none;
}

body.debug-ui-enabled .debug-card-collapsed .gear-card-heading {
    min-height: 32px;
    margin-bottom: 0;
}

body.debug-ui-enabled .debug-card-collapsed .gear-card-heading h2 {
    margin-bottom: 0;
}

body.debug-ui-enabled .debug-card-collapsed > h2 {
    margin-bottom: 0;
}

.debug-gear-character-dock:empty {
    display: none;
}

.debug-skill-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 10px;
    padding: 10px 14px 0;
}

.debug-skill-info-grid .debug-gear-character-dock,
.debug-skill-info-grid .debug-skill-info-dock {
    min-width: 0;
    padding: 0;
    margin: 0;
}

body.debug-ui-enabled .debug-gear-character-dock .gear-character-bar {
    grid-template-columns: minmax(180px, 1fr);
    margin: 0;
}

body.debug-ui-enabled .debug-gear-character-dock .gear-character-name-field,
body.debug-ui-enabled .debug-gear-character-dock .gear-character-actions {
    display: none;
}

body.debug-ui-enabled .debug-gear-character-dock .gear-character-field span {
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 800;
}

body.debug-ui-enabled .debug-gear-character-dock .gear-character-field select {
    height: 40px;
}

body.debug-ui-enabled input,
body.debug-ui-enabled textarea,
body.debug-ui-enabled select {
    background: #050505;
    border-color: #374151;
}

body.debug-ui-enabled .result-card,
body.debug-ui-enabled .table-wrap {
    background-color: rgba(5, 5, 5, 0.64);
}

body.debug-ui-enabled .app {
    max-width: 2240px;
}

.app {
    max-width: 1600px;
    margin: 0 auto;
}

.header {
    height: 0;
    margin: 0;
}

.header-tools {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 1000;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.header-tool-link,
.header-debug-toggle {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 13px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 10px;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.86);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.header-debug-toggle {
    appearance: none;
    font-family: inherit;
    margin: 0;
    cursor: pointer;
    width: auto;
    min-width: 84px;
    min-height: 38px;
    padding: 9px 13px;
    border-radius: 10px;
    color: #dbeafe;
    font-size: 13px;
    opacity: 1;
    overflow: visible;
}

.header-debug-toggle::before {
    display: none;
    content: "";
}

.header-debug-toggle:hover,
.header-debug-toggle:focus-visible,
.header-debug-toggle.active {
    min-width: 84px;
    padding: 9px 13px;
    border-radius: 10px;
    color: #67e8f9;
    font-size: 13px;
    opacity: 1;
}

.header-debug-toggle:hover::before,
.header-debug-toggle:focus-visible::before,
.header-debug-toggle.active::before {
    display: none;
}

.header-tool-link:hover,
.header-debug-toggle:hover,
.header-debug-toggle.active {
    border-color: rgba(34, 211, 238, 0.64);
    color: #67e8f9;
}

.header-debug-toggle.active {
    background: rgba(14, 116, 144, 0.32);
}

.local-runner-status {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    max-width: 460px;
    padding: 7px 9px 7px 12px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 10px;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.9);
    font-size: 12px;
    line-height: 1.2;
}

.local-runner-status::before {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #f59e0b;
    content: "";
}

.local-runner-status.is-connected::before {
    background: #22c55e;
}

.local-runner-status.is-incompatible::before {
    background: #f59e0b;
}

.local-runner-status.is-error::before {
    background: #ef4444;
}

.local-runner-status-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 1px;
}

.local-runner-status-label,
.local-runner-status-detail {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.local-runner-status-label {
    font-size: 12px;
}

.local-runner-status-detail {
    color: #94a3b8;
    font-size: 11px;
}

.local-runner-status-config,
.local-runner-status-retry,
.local-runner-status-download {
    flex: 0 0 auto;
    min-height: 26px;
    min-width: auto;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 11px;
}

.local-runner-status-config {
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #dbeafe;
    background: rgba(30, 41, 59, 0.72);
}

.local-runner-status-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(34, 211, 238, 0.36);
    color: #cffafe;
    text-decoration: none;
    background: rgba(8, 145, 178, 0.18);
}

body.debug-ui-enabled .header {
    height: auto;
    margin-bottom: 10px;
}

body.debug-ui-enabled .header-tools {
    position: static;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    /*grid-template-columns: repeat(2, minmax(0, 1fr));*/
    gap: 22px;
    align-items: stretch;
}

body.debug-ui-enabled .grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

body.debug-ui-enabled .gear-selector-card,
body.debug-ui-enabled .skill-preset-card,
body.debug-ui-enabled .optimizer-card {
    grid-column: span 4;
}

.card {
    min-height: auto;
    display: flex;
    flex-direction: column;
    padding: 22px;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
}

.card h2 {
    margin: 0 0 18px;
    font-size: 18px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group.grow {
    flex: 1;
    display: flex;
    flex-direction: column;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: #cbd5e1;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid #334155;
    background: #020617;
    color: #e5e7eb;
    border-radius: 13px;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
}

textarea {
    flex: 1;
    min-height: 0;
    resize: vertical;
    font-family: Consolas, monospace;
    line-height: 1.5;
}

.skill-preset-card #arrayInput {
    min-height: clamp(260px, 34vh, 460px);
}

.skill-edit-launcher {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.72)),
        radial-gradient(circle at 90% 0, rgba(245, 158, 11, 0.18), transparent 36%);
}

.skill-edit-launcher-label {
    display: block;
    margin-bottom: 4px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 900;
}

.skill-edit-launcher strong {
    display: block;
    color: #f8fafc;
    font-size: 16px;
    font-weight: 900;
}

.skill-edit-launcher button {
    min-width: 124px;
    border-radius: 8px;
    background: linear-gradient(180deg, #b45309, #78350f);
}

body.skill-build-dialog-open {
    overflow: hidden;
}

.skill-build-dialog[hidden] {
    display: none;
}

.skill-build-dialog {
    position: fixed;
    z-index: 20000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 10px;
}

.skill-build-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.74);
    backdrop-filter: blur(2px);
}

.skill-build-window {
    position: relative;
    width: min(1480px, 80vw);
    height: min(990px, calc(100vh - 20px));
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(245, 158, 11, 0.34);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(9, 13, 18, 0.98), rgba(2, 6, 23, 0.98)),
        radial-gradient(circle at top, rgba(245, 158, 11, 0.16), transparent 32%);
    box-shadow: 0 26px 90px rgba(0, 0, 0, 0.86);
    overflow: hidden;
}

.skill-build-window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 70px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(245, 158, 11, 0.25);
    background:
        linear-gradient(90deg, rgba(10, 10, 10, 0.96), rgba(30, 41, 59, 0.8)),
        radial-gradient(circle at 50% 0, rgba(250, 204, 21, 0.18), transparent 36%);
}

.skill-build-window-eyebrow {
    margin: 0 0 2px;
    color: #facc15;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.skill-build-window-header h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 24px;
    font-weight: 900;
}

.skill-build-close-button {
    min-width: 78px;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.92);
}

.skill-build-job-tabs {
    display: grid;
    grid-template-columns: repeat(6, minmax(44px, 1fr));
    gap: 1px;
    padding: 0 14px;
    border-bottom: 1px solid rgba(245, 158, 11, 0.18);
    background: rgba(2, 6, 23, 0.82);
}

.skill-build-job-tabs button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.94));
    color: #cbd5e1;
    font-size: 15px;
    font-weight: 900;
}

.skill-build-job-tabs button.active {
    border-color: rgba(245, 158, 11, 0.68);
    background: linear-gradient(180deg, rgba(180, 83, 9, 0.92), rgba(15, 23, 42, 0.96));
    color: #fef3c7;
}

.skill-build-job-icon {
    display: block;
    width: 28px;
    height: 28px;
    background: currentColor;
    -webkit-mask: var(--skill-build-job-icon) center / contain no-repeat;
    mask: var(--skill-build-job-icon) center / contain no-repeat;
}

.skill-build-job-tabs button[data-skill-build-job="reaper"] .skill-build-job-icon {
    --skill-build-job-icon: url("/assets/classes/jobs/reaper.svg");
}

.skill-build-job-tabs button[data-skill-build-job="artist"] .skill-build-job-icon {
    --skill-build-job-icon: url("/assets/classes/jobs/artist.svg");
}

.skill-build-job-tabs button[data-skill-build-job="warlord"] .skill-build-job-icon {
    --skill-build-job-icon: url("/assets/classes/jobs/warlord.svg");
}

.skill-build-job-tabs button[data-skill-build-job="berserker"] .skill-build-job-icon {
    --skill-build-job-icon: url("/assets/classes/jobs/berserker.svg");
}

.skill-build-job-tabs button[data-skill-build-job="slayer"] .skill-build-job-icon {
    --skill-build-job-icon: url("/assets/classes/jobs/slayer.svg");
}

.skill-build-job-tabs button[data-skill-build-job="lancemaster"] .skill-build-job-icon {
    --skill-build-job-icon: url("/assets/classes/jobs/lancemaster.svg");
}

.skill-build-editor {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 14px;
}

.skill-build-toolbar,
.skill-build-actions,
.skill-build-preset-tabs,
.skill-build-preset-name-field,
.skill-build-summary,
.skill-build-column-heading {
    display: flex;
    align-items: center;
}

.skill-build-toolbar {
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.skill-build-preset-tabs,
.skill-build-actions {
    gap: 8px;
    flex-wrap: wrap;
}

.skill-build-preset-tabs button {
    min-width: 86px;
    min-height: 44px;
    display: grid;
    gap: 2px;
    justify-items: center;
    padding: 6px 10px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.84);
    color: #cbd5e1;
    font-weight: 900;
}

.skill-build-preset-tabs button.active {
    border-color: rgba(245, 158, 11, 0.78);
    color: #fef3c7;
    background: linear-gradient(180deg, rgba(120, 53, 15, 0.9), rgba(30, 41, 59, 0.92));
}

.skill-build-preset-index {
    color: #f59e0b;
    font-size: 14px;
    line-height: 1;
}

.skill-build-preset-name {
    max-width: 72px;
    overflow: hidden;
    color: #cbd5e1;
    font-size: 11px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.skill-build-preset-tabs button.active .skill-build-preset-name {
    color: #fef3c7;
}

.skill-build-preset-name-field {
    gap: 8px;
    min-width: 0;
    margin: 0;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.skill-build-preset-name-field input {
    width: 180px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
}

.skill-build-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(2, 6, 23, 0.92), rgba(15, 23, 42, 0.86)),
        radial-gradient(circle at 70% 0, rgba(245, 158, 11, 0.16), transparent 30%);
    overflow: hidden;
}

.skill-build-summary {
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 800;
}

.skill-build-summary strong {
    color: #facc15;
    font-size: 18px;
}

.skill-build-layout {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
        "pool tripod"
        "priority priority";
    gap: 1px;
    background: rgba(148, 163, 184, 0.16);
}

.skill-build-pool-column {
    grid-area: pool;
}

.skill-build-tripod-column {
    grid-area: tripod;
}

.skill-build-priority-column {
    grid-area: priority;
    min-height: 142px;
}

.skill-build-column {
    min-width: 0;
    min-height: 0;
    background: rgba(2, 6, 23, 0.72);
}

.skill-build-column-heading {
    justify-content: space-between;
    gap: 8px;
    min-height: 42px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    color: #e5e7eb;
    font-size: 13px;
    font-weight: 900;
}

.skill-build-column-heading small {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 800;
}

.skill-build-list {
    height: 100%;
    max-height: none;
    overflow: auto;
}

.skill-build-skill-row {
    width: 100%;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 60px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 0;
    background: rgba(15, 23, 42, 0.58);
    color: #e5e7eb;
    text-align: left;
}

.skill-build-skill-row:hover,
.skill-build-skill-row.active {
    background: linear-gradient(90deg, rgba(14, 116, 144, 0.34), rgba(15, 23, 42, 0.72));
}

.skill-build-skill-row.adopted {
    box-shadow: inset 3px 0 0 #22c55e;
}

.skill-build-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(250, 204, 21, 0.48);
    border-radius: 7px;
    background:
        radial-gradient(circle at 30% 25%, rgba(254, 240, 138, 0.52), transparent 28%),
        linear-gradient(135deg, #7f1d1d, #1e3a8a 48%, #14532d);
    color: #f8fafc;
    font-size: 13px;
    font-weight: 900;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.skill-build-icon.has-image {
    background: #020617;
    border-color: rgba(250, 204, 21, 0.6);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.14);
}

.skill-build-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.skill-build-skill-main {
    min-width: 0;
}

.skill-build-skill-name {
    display: block;
    overflow: hidden;
    color: #f8fafc;
    font-size: 14px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.skill-build-skill-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 800;
}

.skill-build-check {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.36);
    border-radius: 6px;
    color: #64748b;
    font-size: 16px;
    font-weight: 900;
}

.skill-build-skill-row.adopted .skill-build-check {
    border-color: rgba(34, 197, 94, 0.72);
    color: #86efac;
    background: rgba(22, 101, 52, 0.36);
}

.skill-build-priority-slots {
    display: grid;
    grid-template-columns: repeat(8, minmax(84px, 1fr));
    grid-auto-rows: 92px;
    align-content: start;
    gap: 8px;
    height: auto;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px;
}

.skill-build-slot {
    position: relative;
    min-width: 0;
    min-height: 92px;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 42px minmax(0, auto);
    gap: 6px;
    align-items: start;
    justify-items: center;
    padding: 10px 6px 7px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.72);
}

.skill-build-slot.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.skill-build-slot.dragging {
    opacity: 0.52;
}

.skill-build-slot-index {
    position: absolute;
    top: 6px;
    left: 7px;
    color: #f59e0b;
    font-size: 13px;
    font-weight: 900;
    text-align: center;
    line-height: 1;
}

.skill-build-slot-icon {
    width: 42px;
    height: 42px;
}

.skill-build-slot-body {
    width: 100%;
    min-width: 0;
    text-align: center;
}

.skill-build-slot-name {
    overflow: hidden;
    color: #f8fafc;
    font-size: 11px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.skill-build-slot-controls {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
}

.skill-build-slot-controls button {
    width: 21px;
    min-width: 21px;
    height: 21px;
    min-height: 21px;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.86);
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1;
}

.skill-build-slot-controls button:hover {
    border-color: rgba(248, 113, 113, 0.72);
    color: #fecaca;
    background: rgba(127, 29, 29, 0.72);
}

.skill-build-tripod-panel {
    height: calc(100% - 42px);
    overflow: auto;
    padding: 14px 16px;
    background:
        radial-gradient(circle at 50% 8%, rgba(30, 64, 175, 0.22), transparent 24%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(2, 6, 23, 0.88));
}

.skill-build-tripod-empty {
    padding: 26px 10px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.skill-build-tripod-board {
    min-height: 100%;
    display: grid;
    gap: 12px;
    padding: 2px 0;
    position: relative;
}

.skill-build-tripod-tier {
    position: relative;
    display: grid;
    grid-template-rows: 38px minmax(74px, auto);
    align-items: start;
    min-height: 124px;
    padding: 2px 4px 8px;
}

.skill-build-tripod-tier::before {
    content: "";
    position: absolute;
    top: 64px;
    right: 46px;
    left: 46px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.32), transparent);
}

.skill-build-tripod-tier:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 73px;
    bottom: -17px;
    left: 50%;
    width: 1px;
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.38), transparent);
}

.skill-build-tripod-rank {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    z-index: 2;
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    color: #f8fafc;
    font-size: 14px;
    font-weight: 900;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
    box-shadow: 0 0 16px rgba(96, 165, 250, 0.34);
}

.skill-build-tripod-rank.tier-1 {
    background: linear-gradient(135deg, #1d4ed8, #60a5fa);
}

.skill-build-tripod-rank.tier-2 {
    background: linear-gradient(135deg, #15803d, #86efac);
}

.skill-build-tripod-rank.tier-3 {
    background: linear-gradient(135deg, #b45309, #fcd34d);
}

.skill-build-tripod-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    justify-items: center;
    gap: 10px;
    z-index: 1;
}

.skill-build-tripod-options.option-count-1 {
    grid-template-columns: minmax(96px, 132px);
    justify-content: center;
}

.skill-build-tripod-options.option-count-2 {
    grid-template-columns: repeat(2, minmax(88px, 132px));
    justify-content: center;
}

.skill-build-tripod-option {
    width: min(100%, 132px);
    min-width: 0;
    min-height: 76px;
    display: grid;
    justify-items: center;
    gap: 7px;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: #cbd5e1;
    text-align: center;
    position: relative;
}

.skill-build-tripod-option:hover {
    color: #f8fafc;
    background: transparent;
}

.skill-build-tripod-option.active::before {
    content: "";
    position: absolute;
    top: -7px;
    width: 18px;
    height: 13px;
    clip-path: polygon(50% 0, 64% 43%, 100% 24%, 78% 100%, 22% 100%, 0 24%, 36% 43%);
    background: #facc15;
    filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.86));
}

.skill-build-tripod-orb {
    width: 50px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(148, 163, 184, 0.36);
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.48), transparent 18%),
        radial-gradient(circle at 50% 55%, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.98));
    box-shadow:
        inset 0 0 12px rgba(255, 255, 255, 0.07),
        0 5px 12px rgba(0, 0, 0, 0.34);
}

.skill-build-tripod-orb::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    opacity: 0.86;
    filter: blur(0.1px);
}

.skill-build-tripod-orb::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 42%);
}

.skill-build-tripod-orb.tier-1::before {
    background: radial-gradient(circle, rgba(96, 165, 250, 0.92), rgba(30, 64, 175, 0.42) 54%, transparent 70%);
}

.skill-build-tripod-orb.tier-2::before {
    background: radial-gradient(circle, rgba(134, 239, 172, 0.9), rgba(22, 101, 52, 0.44) 54%, transparent 70%);
}

.skill-build-tripod-orb.tier-3::before {
    background: radial-gradient(circle, rgba(252, 211, 77, 0.92), rgba(180, 83, 9, 0.44) 54%, transparent 70%);
}

.skill-build-tripod-option.active .skill-build-tripod-orb {
    border-color: rgba(254, 240, 138, 0.88);
    transform: translateY(-1px);
}

.skill-build-tripod-option.active .skill-build-tripod-orb.tier-1 {
    box-shadow: 0 0 18px rgba(96, 165, 250, 0.82), inset 0 0 12px rgba(255, 255, 255, 0.12);
}

.skill-build-tripod-option.active .skill-build-tripod-orb.tier-2 {
    box-shadow: 0 0 18px rgba(74, 222, 128, 0.78), inset 0 0 12px rgba(255, 255, 255, 0.12);
}

.skill-build-tripod-option.active .skill-build-tripod-orb.tier-3 {
    box-shadow: 0 0 18px rgba(251, 191, 36, 0.8), inset 0 0 12px rgba(255, 255, 255, 0.12);
}

.skill-build-tripod-orb-core {
    width: 18px;
    height: 18px;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.18);
    transform: rotate(45deg);
    background: rgba(2, 6, 23, 0.72);
}

.skill-build-tripod-label {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.skill-build-tripod-option.tier-1 .skill-build-tripod-label {
    color: #93c5fd;
}

.skill-build-tripod-option.tier-2 .skill-build-tripod-label {
    color: #a3e635;
}

.skill-build-tripod-option.tier-3 .skill-build-tripod-label {
    color: #fbbf24;
}

.skill-build-tripod-node-empty {
    align-self: center;
    grid-column: 1 / -1;
    padding: 18px 8px;
}

.skill-build-special-skill-card {
    min-height: 100%;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 16px;
    padding: 30px 18px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 24%, rgba(250, 204, 21, 0.16), transparent 28%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.52), rgba(2, 6, 23, 0.74));
    text-align: center;
}

.skill-build-special-skill-card.skill-build-special-skill-hyper {
    border-color: rgba(45, 212, 191, 0.34);
    background:
        radial-gradient(circle at 50% 24%, rgba(45, 212, 191, 0.18), transparent 30%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.54), rgba(2, 6, 23, 0.76));
}

.skill-build-special-skill-icon {
    width: 76px;
    height: 76px;
    border-radius: 12px;
    box-shadow:
        0 0 0 1px rgba(250, 204, 21, 0.26),
        0 16px 32px rgba(0, 0, 0, 0.34);
}

.skill-build-special-skill-body {
    display: grid;
    justify-items: center;
    gap: 8px;
}

.skill-build-special-skill-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 5px 10px;
    border: 1px solid rgba(250, 204, 21, 0.38);
    border-radius: 999px;
    color: #fde68a;
    background: rgba(120, 53, 15, 0.28);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.skill-build-special-skill-hyper .skill-build-special-skill-badge {
    border-color: rgba(45, 212, 191, 0.38);
    color: #99f6e4;
    background: rgba(20, 83, 45, 0.24);
}

.skill-build-special-skill-title {
    color: #f8fafc;
    font-size: 18px;
    font-weight: 900;
}

.skill-build-special-skill-note {
    max-width: 240px;
    margin: 0;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.5;
}

.skill-build-status {
    min-height: 34px;
    padding: 9px 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    color: #94a3b8;
    font-size: 12px;
    font-weight: 800;
}

.skill-build-status.warning {
    color: #fde68a;
}

.skill-build-status.error {
    color: #fecaca;
}

.skill-json-editor.hidden {
    display: none;
}

.skill-build-window .skill-json-editor {
    flex: 1;
    min-height: 0;
    margin: 0;
}

.skill-build-window #arrayInput {
    min-height: 0;
    height: 100%;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.18);
}

.button-row {
    display: flex;
    gap: 10px;
    margin-top: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

button {
    border: none;
    border-radius: 13px;
    padding: 11px 16px;
    color: white;
    background: #6366f1;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: 0.2s ease;
}

button:hover {
    background: #4f46e5;
}

button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

button.secondary {
    background: #334155;
}

button.secondary:hover {
    background: #475569;
}

button.danger {
    background: #dc2626;
}

button.danger:hover {
    background: #b91c1c;
}

.viewer-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 16px;
}

.optimize-row {
    margin-top: 0;
    margin-bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.optimize-row #optimizeButton {
    width: 100%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.optimize-row #optimizeButton:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

body.debug-ui-enabled .optimizer-card .optimize-row {
    display: none;
}

.optimization-control-row {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 28px;
}

.optimization-control-row.hidden,
.optimization-icon-button.hidden {
    display: none;
}

.optimization-icon-button {
    width: 34px;
    height: 28px;
    min-width: 34px;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.82);
    color: #dbeafe;
    font-size: 13px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.optimization-icon-button:hover:not(:disabled) {
    background: rgba(79, 70, 229, 0.88);
    border-color: rgba(165, 180, 252, 0.64);
}

.optimization-icon-button:disabled {
    opacity: 0.42;
}

.progress-wrapper {
    width: min(420px, 100%);
    height: 8px;
    margin: 14px auto 0;
    border-radius: 999px;
    overflow: hidden;
    background: #1e293b;
}

.progress-bar {
    width: 35%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    animation: progressMove 1s linear infinite;
}

@keyframes progressMove {
    0% {
        transform: translateX(-120%);
    }

    100% {
        transform: translateX(320%);
    }
}

.result-card {
    grid-column: 1 / -1;
    width: 100%;
    min-height: auto;
    margin-top: 0;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.result-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #cbd5e1;
}

.result-hint {
    margin-left: 10px;
    font-size: 13px;
    font-weight: 700;
}

.result-hint.success {
    color: #4ade80;
}

.result-hint.fail {
    color: #f87171;
}

.result-hint.live-search-hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
}

.live-search-label {
    color: #93c5fd;
    font-size: 13px;
    font-weight: 900;
}

.result-hint.live-search-hint .live-best-status {
    min-height: 28px;
    margin: 0;
    padding: 5px 11px;
    font-size: 13px;
}

.live-best-preview-button {
    margin-left: 8px;
    border: 1px solid rgba(52, 211, 153, 0.45);
    border-radius: 6px;
    padding: 3px 8px;
    background: rgba(5, 150, 105, 0.18);
    color: #bbf7d0;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.live-best-preview-button:hover {
    border-color: rgba(74, 222, 128, 0.75);
    background: rgba(5, 150, 105, 0.3);
    color: #ecfdf5;
}

.result-main-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.85);
}

.result-main-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    padding: 8px 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.55);
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.result-main-tab:hover {
    border-color: rgba(129, 140, 248, 0.7);
    background: rgba(30, 41, 59, 0.75);
    color: #ffffff;
}

.result-main-tab.active {
    background: rgba(99, 102, 241, 0.32);
    border-color: rgba(167, 139, 250, 0.95);
    color: #ffffff;
}

.result-panel {
    display: none;
}

.result-panel.active {
    display: block;
}

.debug-only,
.debug-only-panel {
    display: none;
}

body.debug-ui-enabled .debug-only {
    display: inline-flex;
}

body.debug-ui-enabled .debug-only-panel.result-panel.active {
    display: block;
}

.debug-workspace {
    display: none;
}

body.debug-ui-enabled .debug-workspace {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(75, 85, 99, 0.54);
    border-radius: 8px;
    background: rgba(8, 10, 13, 0.96);
    box-shadow: 0 22px 72px rgba(0, 0, 0, 0.72);
}

.debug-workspace-header {
    grid-column: 1 / -1;
    order: 1;
}

.debug-policy-panel {
    grid-column: 1;
    order: 6;
}

.debug-rust-runner-panel {
    grid-column: 2;
    order: 6;
}

.debug-summary-grid {
    grid-column: 1 / -1;
    order: 2;
}

.debug-route-overview {
    grid-column: 1 / -1;
    order: 3;
}

.debug-panel-grid {
    grid-column: 1 / -1;
    order: 7;
}

.debug-workspace-header,
.debug-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.debug-workspace-header {
    min-height: 44px;
    flex-wrap: wrap;
}

.debug-run-controls {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
    min-width: 0;
}

.debug-run-controls label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.debug-run-controls span {
    color: #93c5fd;
    font-size: 12px;
    font-weight: 800;
}

.debug-run-controls select {
    min-height: 40px;
}

.debug-run-controls button {
    min-width: 160px;
    min-height: 34px;
    padding: 0 18px;
    white-space: nowrap;
}

.debug-run-controls-top {
    flex-wrap: wrap;
}

.debug-active-constraints {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 28px;
    margin-top: 8px;
}

.debug-active-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 8px;
    border: 1px solid rgba(45, 212, 191, 0.32);
    border-radius: 999px;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.72);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.debug-active-chip strong {
    margin-left: 4px;
    color: #67e8f9;
    font-weight: 900;
}

.debug-test-controls {
    margin: 10px 14px 14px;
    border-top: 1px solid rgba(48, 57, 70, 0.72);
}

.debug-test-controls summary {
    min-height: 34px;
    padding: 10px 0 0;
    color: #93c5fd;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
}

.debug-test-controls .debug-policy-grid {
    padding-top: 10px;
}

.debug-run-controls .debug-test-controls {
    min-width: 0;
    margin: 0;
    align-self: end;
}

.debug-run-controls .debug-wide-test-controls[open] {
    grid-column: 1 / -1;
}

.debug-run-controls .debug-v2-policy-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.debug-run-target-test-controls {
    margin: 0;
    align-self: end;
}

.debug-run-target-test-controls summary {
    padding-top: 0;
}

.debug-run-checkbox {
    align-items: center;
    min-height: 34px;
}

.debug-run-checkbox input {
    width: 16px;
    min-height: 16px;
    padding: 0;
    accent-color: #38bdf8;
}

.debug-condition-dock {
    border-top: 1px solid rgba(48, 57, 70, 0.72);
    border-bottom: 1px solid rgba(48, 57, 70, 0.72);
    background: rgba(9, 11, 14, 0.42);
}

.debug-condition-dock:empty {
    display: none;
}

.debug-condition-dock .optimizer-basic-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    padding: 14px;
}

.debug-workspace-header h2,
.debug-panel-header h3 {
    margin: 0;
}

.debug-workspace-header h2 {
    font-size: 22px;
    line-height: 1.15;
}

.debug-panel-header h3 {
    font-size: 16px;
}

.debug-eyebrow {
    margin: 0 0 5px;
    color: #2dd4bf;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.debug-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.debug-summary-group {
    min-width: 0;
}

.debug-summary-group h3 {
    margin: 0 0 8px;
    color: #93c5fd;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.debug-summary-group-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.debug-metric-tile,
.debug-panel {
    min-width: 0;
    border: 1px solid rgba(48, 57, 70, 0.95);
    border-radius: 8px;
    background: #15191f;
    overflow: hidden;
}

.debug-metric-tile {
    min-height: 76px;
    padding: 12px;
}

.debug-route-tile {
    grid-column: span 3;
}

.debug-route-tile strong {
    white-space: normal;
    line-height: 1.35;
}

.debug-current-route-bar {
    min-height: 58px;
    padding: 13px 14px;
    border-bottom: 1px solid rgba(48, 57, 70, 0.95);
    background: #15191f;
}

.debug-route-overview {
    border: 1px solid rgba(48, 57, 70, 0.95);
    border-radius: 8px;
    overflow: hidden;
}

.debug-route-overview.debug-current-route-bar {
    border-bottom: 1px solid rgba(48, 57, 70, 0.95);
}

.debug-current-route-bar.debug-route-tile {
    grid-column: auto;
}

.debug-current-route-bar.debug-route-overview {
    grid-column: 1 / -1;
}

body.debug-ui-enabled .debug-workspace:not(.debug-workspace-run-visible) .debug-summary-grid,
body.debug-ui-enabled .debug-workspace:not(.debug-workspace-run-visible) .debug-route-overview,
body.debug-ui-enabled .debug-workspace:not(.debug-workspace-run-visible) .debug-log-panel,
body.debug-ui-enabled .debug-workspace:not(.debug-workspace-run-visible) > .result-card {
    display: none;
}

body.debug-ui-enabled .debug-workspace.debug-output-collapsed .debug-summary-grid,
body.debug-ui-enabled .debug-workspace.debug-output-collapsed .debug-route-overview,
body.debug-ui-enabled .debug-workspace.debug-output-collapsed .debug-log-panel,
body.debug-ui-enabled .debug-workspace.debug-output-collapsed > .result-card {
    display: none;
}

.debug-route-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 5px;
}

.debug-current-route-bar span {
    display: block;
    color: #2dd4bf;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.debug-current-route-bar .debug-run-controls span {
    color: #93c5fd;
    font-size: 12px;
    font-weight: 800;
    text-transform: none;
}

.debug-current-route-bar strong {
    display: block;
    color: #f3f4f6;
    font-size: 15px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.debug-metric-tile span,
.debug-metrics-list span {
    display: block;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 700;
}

.debug-metric-tile strong {
    display: block;
    margin-top: 8px;
    color: #f3f4f6;
    font-size: 18px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.debug-panel-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}

.debug-policy-panel {
    overflow: visible;
}

.debug-policy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 10px;
    padding: 14px;
}

.debug-policy-grid label {
    margin: 0;
}

.debug-policy-grid label[hidden] {
    display: none;
}

.debug-policy-grid span {
    display: block;
    margin-bottom: 7px;
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 800;
}

.debug-policy-grid .debug-checkbox-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.debug-policy-grid .debug-checkbox-field span {
    margin-bottom: 0;
}

.debug-policy-grid .debug-checkbox-field input {
    width: 18px;
    min-height: 18px;
    padding: 0;
    accent-color: #38bdf8;
}

.debug-rust-runner-panel {
    overflow: visible;
}

.debug-skill-section {
    border-bottom: 1px solid rgba(48, 57, 70, 0.72);
    background: rgba(9, 11, 14, 0.26);
}

.debug-js-file-section {
    background: rgba(9, 11, 14, 0.12);
}

.debug-rust-control-groups {
    display: grid;
    gap: 12px;
    padding: 10px 14px 14px;
}

.debug-rust-control-group {
    min-width: 0;
    margin: 0;
    padding: 10px 12px 12px;
    border: 1px solid rgba(48, 57, 70, 0.95);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.26);
}

.debug-rust-control-group legend {
    padding: 0 6px;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
}

.debug-rust-control-group input:disabled,
.debug-rust-control-group select:disabled,
.debug-rust-control-group textarea:disabled {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(75, 85, 99, 0.86);
    color: #94a3b8;
    opacity: 1;
    cursor: not-allowed;
}

.debug-rust-control-group input:disabled::placeholder,
.debug-rust-control-group textarea:disabled::placeholder {
    color: #64748b;
}

.debug-rust-group-grid {
    padding: 10px 0 0;
}

.debug-section-label {
    padding: 12px 14px 0;
    color: #2dd4bf;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.debug-rust-runner-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    padding-top: 10px;
}

.debug-prefix-grid {
    padding-top: 10px;
    padding-bottom: 14px;
}

.debug-skill-priority-details {
    border-top: 1px solid rgba(48, 57, 70, 0.72);
    padding: 10px 14px 14px;
}

.debug-skill-priority-details summary {
    color: #93c5fd;
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
}

.debug-priority-grid {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
    padding: 10px 0 0;
}

.debug-skill-info-dock {
    padding: 10px 14px 0;
}

.debug-skill-info-dock:empty {
    display: none;
}

.debug-skill-info-dock .optimizer-preset-row {
    display: block;
    margin: 0;
}

.debug-skill-info-dock .optimizer-preset-row label {
    display: block;
    margin: 0 0 7px;
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 800;
}

.debug-log-panel {
    grid-column: 1 / -1;
    grid-row: auto;
    order: 4;
}

body.debug-ui-enabled .debug-workspace > .result-card {
    grid-column: 1 / -1;
    order: 5;
}

.debug-metrics-panel {
    grid-column: 1;
}

.debug-metrics-details summary {
    min-height: 42px;
    padding: 12px 14px;
    color: #93c5fd;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
}

.debug-metrics-details[open] summary {
    border-bottom: 1px solid rgba(48, 57, 70, 0.95);
}

.debug-panel-header {
    min-height: 54px;
    padding: 13px 14px;
    border-bottom: 1px solid rgba(48, 57, 70, 0.95);
}

.debug-panel-header.compact {
    min-height: 48px;
}

.debug-run-log {
    min-height: 480px;
    max-height: 480px;
    overflow: auto;
    padding: 14px;
    color: #d1fae5;
    background: #090b0e;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.55;
}

.debug-log-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 14px;
    border-top: 1px solid rgba(48, 57, 70, 0.72);
    background: rgba(9, 11, 14, 0.78);
}

.debug-log-panel .debug-log-filter-bar {
    border-top: 0;
    border-bottom: 1px solid rgba(48, 57, 70, 0.72);
}

.debug-log-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid rgba(75, 85, 99, 0.82);
    border-radius: 6px;
    color: #cbd5e1;
    background: rgba(17, 24, 39, 0.74);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.debug-log-filter-chip input {
    width: 14px;
    min-height: 14px;
    margin: 0;
    padding: 0;
    accent-color: #2dd4bf;
}

.debug-log-line {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    padding: 3px 0;
    border-bottom: 1px solid rgba(48, 57, 70, 0.32);
}

.debug-log-time {
    color: #9ca3af;
}

.debug-log-message {
    min-width: 0;
    overflow-wrap: anywhere;
}

.debug-log-line.rust-runner-raw .debug-log-message {
    white-space: pre;
    overflow-wrap: normal;
}

.debug-log-line[data-log-kind="pareto"] .debug-log-message {
    white-space: pre-wrap;
}

.debug-log-line.error .debug-log-message {
    color: #f87171;
}

.debug-log-line.done .debug-log-message {
    color: #34d399;
}

.debug-log-line.running .debug-log-message {
    color: #fbbf24;
}

.debug-panel-status {
    min-height: 40px;
    padding: 10px 14px;
    border-top: 1px solid rgba(48, 57, 70, 0.95);
    color: #9ca3af;
    font-size: 13px;
}

.debug-panel-status.error {
    color: #f87171;
}

.debug-panel-status.running {
    color: #fbbf24;
}

.debug-panel-status.done {
    color: #34d399;
}

.debug-metrics-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
}

.debug-metrics-list div {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(48, 57, 70, 0.95);
    border-radius: 8px;
    background: #101418;
}

.debug-metrics-list strong {
    display: block;
    margin-top: 6px;
    color: #f3f4f6;
    font-size: 15px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}


.result-view-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
}

.result-toggle-button {
    min-width: 112px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 800;
}

.result-toggle-button.is-off {
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.55);
}

.wait-row td {
    color: rgba(148, 163, 184, 0.62);
    background: rgba(15, 23, 42, 0.22);
    font-size: 12px;
}

.wait-row td:first-child,
.wait-row td:nth-child(2) {
    color: rgba(148, 163, 184, 0.52);
}

.wait-row:hover td {
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.42);
}

.record-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
}

.record-actions button {
    padding: 6px 9px;
    font-size: 12px;
}

#recordTable {
    min-width: 1180px;
    table-layout: fixed;
}

#recordTable th:nth-child(1),
#recordTable td:nth-child(1) {
    width: 250px;
    white-space: normal;
    line-height: 1.45;
}

#recordTable th:nth-child(2),
#recordTable td:nth-child(2) {
    width: 150px;
}

#recordTable th:nth-child(3),
#recordTable td:nth-child(3) {
    width: 130px;
}

#recordTable th:nth-child(4),
#recordTable td:nth-child(4) {
    width: 140px;
}

#recordTable th:nth-child(5),
#recordTable td:nth-child(5) {
    width: 140px;
}

#recordTable th:nth-child(6),
#recordTable td:nth-child(6) {
    width: 130px;
}

#recordTable th:nth-child(7),
#recordTable td:nth-child(7) {
    width: 230px;
    white-space: nowrap;
}

.record-expand-button {
    width: auto;
    min-width: 48px;
    height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid rgba(129, 140, 248, 0.65);
    background: rgba(49, 46, 129, 0.78);
    color: #ede9fe;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    margin-left: auto;
}

.record-expand-button:hover {
    background: rgba(109, 40, 217, 0.9);
}

.record-detail-row.hidden {
    display: none;
}

.record-detail-row td {
    width: auto !important;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.92);
    white-space: normal;
}

.record-detail {
    display: grid;
    gap: 16px;
    padding: 8px 2px 6px;
}

.record-detail-title {
    margin-top: 4px;
    color: #c7d2fe;
    font-size: 16px;
    font-weight: 800;
}

.record-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.record-detail-field {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid rgba(71, 85, 105, 0.72);
    border-radius: 6px;
    background: rgba(2, 6, 23, 0.58);
}

.record-detail-field span {
    color: #94a3b8;
    font-size: 15px;
    white-space: nowrap;
}

.record-detail-field strong {
    color: #e5e7eb;
    font-size: 16px;
    font-weight: 800;
    text-align: right;
}

.record-effect-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(340px, 1fr));
    gap: 0 42px;
    padding: 16px 18px;
    border: 1px solid rgba(71, 85, 105, 0.72);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.72);
}

.record-effect-panel .record-detail-field {
    min-height: 50px;
    padding: 10px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.record-effect-panel .record-detail-field span {
    color: #cbd5e1;
}

.record-effect-panel .record-detail-field strong {
    color: #93c5fd;
    font-size: 18px;
}

.record-gear-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
    gap: 12px;
}

.record-gear-card {
    display: grid;
    gap: 8px;
    justify-items: center;
    min-width: 0;
    padding: 8px 8px 9px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.record-gear-preview {
    position: relative;
    width: 64px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
}

.record-gear-preview::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.24));
}

.record-gear-preview img {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: 68%;
    height: 68%;
    object-fit: contain;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.record-gear-star {
    position: absolute;
    z-index: 3;
    right: 4px;
    bottom: 3px;
    color: #fde68a;
    font-size: 10px;
    font-weight: 900;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.record-gear-info {
    display: grid;
    gap: 2px;
    justify-items: center;
    min-width: 0;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}

.record-gear-quality,
.record-gear-level {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-gear-level {
    color: #bfdbfe;
}

.table-wrap {
    width: 100%;
    border-radius: 15px;
    border: 1px solid #334155;
    overflow-x: auto;
    overflow-y: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #020617;
    min-width: 0;
}

th,
td {
    border-bottom: 1px solid #1e293b;
    padding: 12px 14px;
    text-align: left;
    font-size: 13px;
    white-space: nowrap;
}

th {
    background: #1e293b;
    color: #c7d2fe;
}

td {
    color: #e5e7eb;
}

tr:hover td {
    background: rgba(99, 102, 241, 0.08);
}

.result-health-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.result-health-cell > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-detail-toggle-button {
    flex: 0 0 auto;
    border: 1px solid rgba(129, 140, 248, 0.45);
    border-radius: 6px;
    padding: 4px 8px;
    background: rgba(67, 56, 202, 0.26);
    color: #ddd6fe;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.skill-detail-toggle-button:hover {
    border-color: rgba(167, 139, 250, 0.78);
    background: rgba(109, 40, 217, 0.38);
    color: #f5f3ff;
}

.kill-summary-row td {
    background: rgba(20, 184, 166, 0.12);
    color: #a7f3d0;
}

.kill-summary-row:hover td {
    background: rgba(20, 184, 166, 0.18);
}

.awakening-skill-row td {
    background: rgba(239, 68, 68, 0.105);
    border-bottom-color: rgba(248, 113, 113, 0.28);
}

.awakening-skill-row:hover td {
    background: rgba(239, 68, 68, 0.16);
}

.hyper-skill-row td {
    background: rgba(56, 189, 248, 0.105);
    border-bottom-color: rgba(125, 211, 252, 0.28);
}

.hyper-skill-row:hover td {
    background: rgba(56, 189, 248, 0.16);
}

.just-guard-row td {
    background: rgba(234, 179, 8, 0.16);
    border-bottom-color: rgba(250, 204, 21, 0.34);
    color: #fef3c7;
}

.just-guard-row:hover td {
    background: rgba(234, 179, 8, 0.23);
}

.counter-row td {
    background: rgba(37, 99, 235, 0.18);
    border-bottom-color: rgba(96, 165, 250, 0.36);
    color: #dbeafe;
}

.counter-row:hover td {
    background: rgba(37, 99, 235, 0.26);
}

.result-buff-list {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 88px;
}

.result-buff-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.78);
    overflow: hidden;
}

.result-buff-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.result-buff-initial {
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 900;
}

.skill-damage-inline-row td {
    padding: 0;
    background: #050b1a;
}

.skill-damage-inline-row:hover td {
    background: #050b1a;
}

.skill-damage-inline-panel {
    padding: 16px;
    border-top: 1px solid rgba(129, 140, 248, 0.3);
    border-bottom: 1px solid rgba(30, 41, 59, 0.95);
}

.skill-damage-inline-title {
    margin-bottom: 12px;
    color: #f8fafc;
    font-size: 15px;
    font-weight: 900;
}

.skill-damage-detail-summary,
.skill-damage-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.skill-damage-detail-summary {
    margin-bottom: 14px;
}

.skill-damage-detail-grid-compact {
    margin-top: 8px;
}

.skill-damage-detail-field {
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    padding: 9px 10px;
    background: rgba(15, 23, 42, 0.78);
}

.skill-damage-detail-field span {
    display: block;
    margin-bottom: 4px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
}

.skill-damage-detail-field strong {
    display: block;
    overflow-wrap: anywhere;
    color: #e5e7eb;
    font-size: 14px;
}

.skill-damage-hit-card {
    margin-top: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 10px;
    padding: 12px;
    background: #020617;
}

.skill-damage-hit-title {
    margin-bottom: 10px;
    color: #c7d2fe;
    font-weight: 900;
}

.skill-damage-detail-section-title {
    margin-top: 12px;
    color: #93c5fd;
    font-size: 12px;
    font-weight: 900;
}

.skill-damage-detail-note {
    margin-top: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.62);
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.active-record-row td {
    background: rgba(20, 184, 166, 0.08);
}

.empty {
    padding: 44px;
    text-align: center;
    color: #94a3b8;
}

.empty.loading {
    padding: 32px 44px;
}

.loading-text {
    color: #c7d2fe;
    font-size: 13px;
    font-weight: 700;
}

.status {
    display: none;
}

.hidden {
    display: none !important;
}

.toast-container {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 260px;
    max-width: 360px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(30, 41, 59, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.24);
    color: #e5e7eb;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    font-size: 14px;
    animation: toastIn 0.22s ease-out;
}

.toast.success {
    border-color: rgba(129, 140, 248, 0.55);
}

.toast.error {
    border-color: rgba(248, 113, 113, 0.7);
    color: #fecaca;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(18px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

app-footer {
    display: block;
    margin-top: 28px;
}

.app-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}


.version-button {
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 999px;
    padding: 8px 14px;
    background: rgba(15, 23, 42, 0.72);
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    backdrop-filter: blur(10px);
    transition:
            background 0.2s ease,
            border-color 0.2s ease,
            color 0.2s ease,
            transform 0.2s ease;
}

.version-button:hover {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(129, 140, 248, 0.35);
    color: #c7d2fe;
    transform: translateY(-1px);
}

/* Gear */
.gear-selector-card {
    min-width: 0;
}

.gear-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: stretch;
}

.gear-left,
.gear-right {
    min-width: 0;
}

.gear-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.gear-card {
    padding: 4px;
    border-radius: 6px;
    background: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.gear-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin-bottom: 4px;
    overflow: hidden;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
}

.gear-preview::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
            linear-gradient(
                    180deg,
                    rgba(255, 255, 255, 0.03),
                    rgba(0, 0, 0, 0.2)
            );
}

.gear-img {
    position: absolute;
    z-index: 2;

    width: 62%;
    height: 62%;

    object-fit: contain;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);

    filter:
            drop-shadow(
                    0 1px 2px rgba(0, 0, 0, 0.4)
            );
}

.damage-reduction-row td {
    color: #fbbf24;
    background: rgba(15, 23, 42, 0.18);
    font-size: 12px;
}

.damage-reduction-row td:first-child,
.damage-reduction-row td:nth-child(2) {
    color: rgba(251, 191, 36, 0.78);
}

@media (max-width: 900px) {
    body {
        padding: 18px;
    }

    body.debug-ui-enabled {
        padding: 14px;
    }

    .header {
        align-items: flex-start;
        flex-direction: column;
        width: 100%;
    }

    .header-tools {
        justify-content: flex-start;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    body.debug-ui-enabled .grid,
    body.debug-ui-enabled .debug-panel-grid,
    body.debug-ui-enabled .debug-summary-grid {
        grid-template-columns: 1fr;
    }

    body.debug-ui-enabled .debug-workspace {
        grid-template-columns: 1fr;
    }

    body.debug-ui-enabled .debug-policy-panel,
    body.debug-ui-enabled .debug-rust-runner-panel,
    body.debug-ui-enabled .debug-run-controls,
    body.debug-ui-enabled .debug-summary-grid,
    body.debug-ui-enabled .debug-panel-grid {
        grid-column: 1;
    }

    body.debug-ui-enabled .debug-policy-grid,
    body.debug-ui-enabled .debug-rust-runner-grid,
    body.debug-ui-enabled .debug-run-controls,
    body.debug-ui-enabled .debug-condition-dock .optimizer-basic-grid {
        grid-template-columns: 1fr;
    }

    body.debug-ui-enabled .gear-selector-card,
    body.debug-ui-enabled .skill-preset-card,
    body.debug-ui-enabled .optimizer-card,
    body.debug-ui-enabled .debug-workspace,
    body.debug-ui-enabled .debug-log-panel,
    body.debug-ui-enabled .debug-metrics-panel,
    body.debug-ui-enabled .debug-route-tile {
        grid-column: auto;
    }

    .card {
        min-height: auto;
    }

    .viewer-top {
        grid-template-columns: 1fr;
    }

    .result-card {
        grid-column: auto;
    }

    .result-header {
        align-items: stretch;
        flex-direction: column;
    }

    textarea {
        min-height: 340px;
    }

    .record-effect-panel {
        grid-template-columns: 1fr;
    }
}

.route-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0 10px;
}

.route-tab {
    padding: 7px 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.55);
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

.route-tab:hover {
    background: rgba(30, 41, 59, 0.75);
    border-color: rgba(129, 140, 248, 0.7);
    color: #ffffff;
    transform: translateY(-1px);
}

.route-tab.active {
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.95),
        rgba(124, 58, 237, 0.95)
    );
    border-color: rgba(167, 139, 250, 0.95);
    color: #ffffff;
    font-weight: 800;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08) inset,
        0 6px 14px rgba(79, 70, 229, 0.28);
}
.optimizer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.optimizer-grid .form-group {
    margin-bottom: 0;
}

.optimizer-grid .optimizer-full {
    grid-column: 1 / -1;
}

.optimizer-card {
    position: relative;
}

.optimizer-card > h2 {
    padding-right: 150px;
}

.optimizer-basic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
}

.optimizer-basic-grid .select-wrap {
    min-width: 0;
}

.optimizer-basic-grid .select-wrap label {
    display: block;
    margin-bottom: 8px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 700;
}

.advanced-search-panel {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.advanced-search-panel:not([open]) {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.advanced-search-panel summary {
    position: absolute;
    top: 22px;
    right: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    background: #334155;
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.advanced-search-panel summary::-webkit-details-marker {
    display: none;
}

.advanced-search-panel summary:hover {
    background: #475569;
}

.advanced-search-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 14px;
}

.optimizer-debug-row {
    display: flex;
    justify-content: flex-start;
    margin-top: 14px;
}

.advanced-search-actions {
    margin-top: 14px;
}

.debug-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    margin: 0;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 800;
}

.debug-mode-toggle input {
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    accent-color: #6366f1;
}

@media (max-width: 720px) {
    .optimizer-grid {
        grid-template-columns: 1fr;
    }

    .optimizer-basic-grid,
    .advanced-search-grid {
        grid-template-columns: 1fr;
    }

    body.debug-ui-enabled .debug-summary-group-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 360px) {
    body.debug-ui-enabled .debug-summary-group-grid {
        grid-template-columns: 1fr;
    }
}

.live-best-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin: 12px auto 4px;
    padding: 7px 14px;
    border: 1px solid rgba(52, 211, 153, 0.35);
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.08);
    color: #34d399;
    font-size: 14px;
    font-weight: 800;
}
.optimizer-card .viewer-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: end;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.optimizer-card .viewer-top .select-wrap {
    min-width: 0;
}

.optimizer-card .viewer-top .select-wrap label {
    display: block;
    margin-bottom: 8px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 700;
}

.optimizer-card .viewer-top select {
    width: 100%;
}

.optimizer-card .viewer-top button {
    height: 44px;
    padding: 0 16px;
    white-space: nowrap;
}

.optimizer-card .optimize-row {
    margin-top: 16px;
}

.optimizer-card .optimize-row button {
    width: 100%;
}
.optimizer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.optimizer-grid .form-group {
    margin-bottom: 0;
}

.optimizer-grid .optimizer-full {
    grid-column: 1 / -1;
}

.wait-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
}

.wait-grid .form-group {
    min-width: 0;
}

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

@media (max-width: 720px) {
    .optimizer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1180px) {
    .skill-build-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
    }

    .skill-build-layout {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(220px, auto) minmax(260px, auto) auto;
        grid-template-areas:
            "pool"
            "tripod"
            "priority";
    }

    .skill-build-list {
        max-height: 300px;
    }

    .skill-build-priority-slots {
        grid-template-columns: repeat(4, minmax(78px, 1fr));
    }
}

@media (max-width: 720px) {
    .skill-build-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .skill-build-actions button,
    .skill-build-preset-tabs button {
        flex: 1 1 auto;
    }

    .skill-build-preset-name-field {
        width: 100%;
    }

    .skill-build-preset-name-field input {
        flex: 1 1 auto;
        width: auto;
    }

    .skill-build-priority-slots {
        grid-template-columns: repeat(4, minmax(64px, 1fr));
    }

    .skill-build-slot {
        min-height: 88px;
    }

    .skill-build-priority-slots {
        grid-auto-rows: 88px;
    }

    .skill-build-slot-name {
        font-size: 10px;
    }
}


.report-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin: 4px 0 16px;
}

.report-panel-header h3 {
    margin: 0 0 6px;
    color: #e5e7eb;
    font-size: 18px;
    font-weight: 900;
}

.report-panel-header p {
    margin: 0;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
}

.near-best-report .near-best-grid-layout {
    grid-template-columns: 1fr;
    gap: 16px;
}

.near-best-report .near-best-chart {
    padding: 16px;
}

.near-best-report .near-best-chart h4 {
    font-size: 16px;
}

.debug-mode-footer {
    display: flex;
    justify-content: center;
    margin: 22px auto 8px;
}

.debug-mode-footer .debug-mode-toggle {
    padding: 10px 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
}


.report-section + .report-section {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.wait-report-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 16px;
}

.wait-report-filter-button {
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid rgba(96, 165, 250, 0.34);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.76);
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.wait-report-filter-button:hover {
    border-color: rgba(147, 197, 253, 0.72);
    color: #f8fafc;
}

.wait-report-filter-button.active {
    border-color: rgba(239, 68, 68, 0.82);
    background: rgba(127, 29, 29, 0.38);
    color: #fee2e2;
}

.best-timeline-grid {
    grid-template-columns: 1fr;
}

.best-timeline-chart svg {
    min-height: 300px;
}

.best-timeline-point {
    fill: #38bdf8;
    fill-opacity: 0.88;
    stroke: rgba(224, 242, 254, 0.84);
    stroke-width: 0.8;
}

.best-timeline-point--near {
    fill: #f59e0b;
    fill-opacity: 0.96;
    stroke: rgba(255, 237, 213, 0.95);
    stroke-width: 1.05;
}

.best-timeline-point--highlight,
.best-timeline-point--best {
    fill: #ef4444;
    fill-opacity: 1;
    stroke: rgba(254, 226, 226, 0.98);
    stroke-width: 1.25;
}


.best-timeline-y-label {
    dominant-baseline: hanging;
}
