:root {
    color-scheme: dark;
    --bg: #050812;
    --panel: rgba(8, 14, 25, 0.96);
    --panel-soft: rgba(13, 21, 36, 0.9);
    --text: #eef7fb;
    --muted: #98acb6;
    --cyan: #68b8da;
    --violet: #8f7adb;
    --pink: #d667a4;
    --yellow: #d6b834;
    --danger: #e55c70;
    --border: rgba(104, 184, 218, 0.2);
    --shadow: rgba(0, 0, 0, 0.5);
    --radius: 8px;
    font-family: Inter, Roboto, "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

.visually-hidden {
    width: 1px;
    height: 1px;
    position: absolute;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    padding-bottom: 78px;
    color: var(--text);
    background:
        linear-gradient(rgba(104, 184, 218, 0.016) 1px, transparent 1px),
        linear-gradient(90deg, rgba(143, 122, 219, 0.014) 1px, transparent 1px),
        linear-gradient(135deg, rgba(104, 184, 218, 0.035), transparent 34%),
        linear-gradient(315deg, rgba(214, 103, 164, 0.03), transparent 38%),
        var(--bg);
    background-size: 34px 34px, 34px 34px, auto, auto, auto;
    line-height: 1.5;
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

a {
    color: var(--cyan);
    text-decoration: none;
}

.app-header {
    border-bottom: 1px solid rgba(104, 184, 218, 0.16);
    background: linear-gradient(90deg, rgba(104, 184, 218, 0.05), rgba(143, 122, 219, 0.032)), rgba(5, 8, 18, 0.94);
    box-shadow: 0 12px 30px var(--shadow);
}

h1 {
    margin: 0;
    font-family: "Cascadia Mono", "Segoe UI", monospace;
    font-size: clamp(1.55rem, 4vw, 2.65rem);
    line-height: 1.05;
    text-transform: uppercase;
    text-shadow: 0 0 14px rgba(104, 184, 218, 0.12);
}

h1 a,
h1 a:hover {
    color: inherit;
    text-decoration: none;
}

.header-tagline.is-typing {
    min-width: var(--typing-width, auto);
}

.header-tagline.is-typing::after {
    content: "";
    display: inline-block;
    width: 8px;
    height: 1em;
    margin-left: 4px;
    vertical-align: -2px;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    animation: cursor-blink 800ms steps(2, start) infinite;
}

.header-tagline {
    max-width: 620px;
    margin: 8px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.decision-shell {
    width: min(1220px, calc(100% - 32px));
    margin: 30px auto 56px;
}

.storage-alert,
.decision-board,
.info-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 0 14px rgba(104, 184, 218, 0.035), 0 14px 34px var(--shadow);
}

.storage-alert {
    margin-bottom: 14px;
    padding: 12px 14px;
    color: #ffe3e9;
    border-color: rgba(255, 92, 120, 0.72);
    background: rgba(229, 92, 112, 0.1);
    box-shadow: 0 0 0 1px rgba(255, 92, 120, 0.18), 0 0 18px rgba(255, 92, 120, 0.08);
    font-weight: 800;
}

.storage-alert.is-success {
    color: #d9ffe8;
    border-color: rgba(96, 230, 150, 0.68);
    background: rgba(96, 198, 139, 0.1);
    box-shadow: 0 0 0 1px rgba(96, 230, 150, 0.16), 0 0 18px rgba(96, 230, 150, 0.07);
}

.decision-board {
    min-height: 650px;
    display: grid;
    grid-template-columns: minmax(230px, 310px) minmax(0, 1fr);
    overflow: hidden;
}

.decision-sidebar {
    padding: 18px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    border-right: 1px solid rgba(104, 184, 218, 0.14);
    background: rgba(0, 0, 0, 0.16);
}

.panel-header,
.decision-toolbar,
.column-header,
.decision-transfer-panel,
.decision-transfer-actions,
.toolbar-actions,
.item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-header,
.decision-toolbar,
.column-header,
.decision-transfer-panel {
    justify-content: space-between;
}

.panel-header h2,
.decision-toolbar h2,
.column-header h2 {
    margin: 0;
    color: var(--cyan);
    font-size: 1rem;
    text-transform: uppercase;
}

.decision-toolbar p {
    margin: 4px 0 0;
    color: var(--muted);
}

.decision-list,
.item-list {
    display: grid;
    align-content: start;
    gap: 8px;
    overflow: auto;
}

.decision-list.is-over-desktop-limit {
    max-height: 548px;
    padding-right: 4px;
    border-top: 1px solid rgba(104, 184, 218, 0.16);
    border-bottom: 1px solid rgba(104, 184, 218, 0.16);
}

.decision-tab {
    width: 100%;
    padding: 10px 11px;
    display: grid;
    gap: 4px;
    text-align: left;
    color: var(--text);
    border: 1px solid rgba(104, 184, 218, 0.12);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.035);
}

.decision-tab:hover,
.decision-tab:focus-visible,
.decision-tab.is-active {
    border-color: var(--cyan);
    background: rgba(104, 184, 218, 0.065);
    outline: none;
}

.decision-tab strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.decision-tab span,
.decision-item small {
    color: var(--muted);
    font-size: 0.82rem;
}

.decision-panel {
    min-width: 0;
    padding: clamp(16px, 3vw, 26px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 16px;
}

.toolbar-actions,
.decision-transfer-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.decision-transfer-actions {
    flex: 1;
}

.toolbar-actions .icon-button {
    flex: 0 0 42px;
}

.score-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.score-panel div {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(104, 184, 218, 0.13);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.035);
}

.score-panel span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.score-panel strong {
    color: var(--yellow);
    font-size: 1.25rem;
    text-align: right;
}

#scoreResult.is-positive {
    color: #63c68b;
}

#scoreResult.is-negative {
    color: #e86b7b;
}

#scoreResult.is-balanced {
    color: var(--yellow);
}

.list-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.list-column {
    min-width: 0;
    padding: 14px;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 12px;
    border: 1px solid rgba(104, 184, 218, 0.13);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.14);
}

.list-column--pros {
    border-color: rgba(96, 198, 139, 0.26);
    background: linear-gradient(135deg, rgba(96, 198, 139, 0.045), rgba(104, 184, 218, 0.018)), rgba(0, 0, 0, 0.14);
}

.list-column--cons {
    border-color: rgba(214, 103, 164, 0.22);
    background: linear-gradient(135deg, rgba(214, 103, 164, 0.045), rgba(229, 92, 112, 0.018)), rgba(0, 0, 0, 0.14);
}

.item-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 86px auto;
    align-items: end;
    gap: 10px;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    color: var(--cyan);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

input,
select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    color: var(--text);
    border: 1px solid rgba(104, 184, 218, 0.22);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.24);
    outline: none;
}

select option {
    color: var(--text);
    background-color: #0d1524;
}

input:focus,
select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(104, 184, 218, 0.085);
}

.decision-item {
    padding: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(104, 184, 218, 0.12);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.035);
}

.decision-item strong {
    display: block;
    overflow-wrap: anywhere;
}

.impact-pill {
    padding: 5px 8px;
    color: #08111f;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cyan), var(--yellow));
    font-size: 0.76rem;
    font-weight: 900;
    white-space: nowrap;
}

.empty-state {
    margin: 0;
    padding: 16px;
    color: var(--muted);
    border: 1px dashed rgba(104, 184, 218, 0.18);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.14);
}

.button-primary,
.button-secondary,
.button-danger,
.icon-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 900;
    text-transform: uppercase;
    transition:
        color 160ms ease,
        border-color 160ms ease,
        background 160ms ease,
        transform 160ms ease;
}

.button-primary,
.button-secondary,
.button-danger {
    padding: 9px 13px;
}

.button-primary {
    color: #08111f;
    border: 1px solid rgba(214, 184, 52, 0.3);
    background: linear-gradient(135deg, var(--cyan), var(--yellow));
}

.button-secondary {
    color: var(--text);
    border: 1px solid rgba(104, 184, 218, 0.2);
    background: rgba(104, 184, 218, 0.065);
}

.decision-transfer-panel .button-secondary {
    min-width: 74px;
    color: var(--cyan);
    border-color: rgba(104, 184, 218, 0.3);
    background:
        linear-gradient(135deg, rgba(104, 184, 218, 0.1), rgba(143, 122, 219, 0.065)),
        rgba(5, 11, 24, 0.82);
    box-shadow: 0 4px 0 rgba(28, 48, 80, 0.62);
    transition:
        color 160ms ease,
        border-color 160ms ease,
        background 160ms ease,
        transform 160ms ease;
}

.decision-transfer-panel .button-secondary:hover {
    color: #eefcff;
    border-color: rgba(104, 184, 218, 0.5);
    background:
        linear-gradient(135deg, rgba(104, 184, 218, 0.15), rgba(214, 184, 52, 0.075)),
        rgba(5, 11, 24, 0.9);
    box-shadow: 0 4px 0 rgba(28, 48, 80, 0.68);
    transform: translateY(-1px);
}

.decision-transfer-panel .button-secondary:active {
    box-shadow: 0 2px 0 rgba(28, 48, 80, 0.68);
    transform: translateY(2px);
}

.decision-transfer-label {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.decision-transfer-panel .button-import {
    margin-right: auto;
    color: var(--text);
    border-color: rgba(143, 122, 219, 0.36);
    background:
        linear-gradient(135deg, rgba(143, 122, 219, 0.12), rgba(104, 184, 218, 0.065)),
        rgba(5, 11, 24, 0.86);
    box-shadow: 0 4px 0 rgba(28, 48, 80, 0.62);
}

.decision-transfer-panel .button-import:hover {
    color: #eefcff;
    border-color: rgba(143, 122, 219, 0.54);
    background:
        linear-gradient(135deg, rgba(143, 122, 219, 0.18), rgba(104, 184, 218, 0.1)),
        rgba(5, 11, 24, 0.92);
    box-shadow: 0 4px 0 rgba(28, 48, 80, 0.68);
}

.decision-transfer-panel .button-import:active {
    box-shadow: 0 2px 0 rgba(28, 48, 80, 0.68);
    transform: translateY(2px);
}

.button-danger {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.62);
    background: var(--danger);
}

.icon-button {
    width: 42px;
    padding: 0;
    color: var(--text);
    border: 1px solid rgba(104, 184, 218, 0.2);
    background: rgba(104, 184, 218, 0.065);
}

.icon-button--rename,
.icon-button--create {
    color: #08111f;
    border-color: rgba(104, 184, 218, 0.34);
    background: linear-gradient(135deg, var(--cyan), var(--violet));
}

.icon-button--danger {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.62);
    background: #9f2638;
}

.button-primary:hover,
.icon-button--rename:hover,
.icon-button--create:hover {
    color: #04101d;
    border-color: rgba(214, 184, 52, 0.48);
    background: linear-gradient(135deg, #80d6e8, #d6b834);
}

.button-danger:hover,
.icon-button--danger:hover {
    border-color: rgba(255, 255, 255, 0.82);
    background: var(--danger);
}

.button-primary:active,
.button-danger:active,
.icon-button--rename:active,
.icon-button--create:active,
.icon-button--danger:active {
    transform: scale(0.97);
}

.bi {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

.info-panel {
    margin-top: 18px;
    padding: clamp(18px, 4vw, 30px);
}

.info-panel h2 {
    margin: 0 0 12px;
    color: var(--cyan);
}

.info-panel p {
    margin: 12px 0 0;
    color: var(--muted);
}

.privacy-note {
    padding: 10px 12px;
    border-left: 3px solid var(--violet);
    background: rgba(143, 122, 219, 0.045);
    border-radius: 6px;
}

.decision-dialog {
    width: min(460px, calc(100% - 32px));
    padding: 0;
    color: var(--text);
    border: 1px solid rgba(104, 184, 218, 0.24);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(104, 184, 218, 0.075), rgba(143, 122, 219, 0.04)),
        var(--panel);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.58);
}

.decision-dialog::backdrop {
    background: rgba(2, 5, 12, 0.72);
    backdrop-filter: blur(6px);
}

.decision-dialog__panel {
    padding: 20px;
    display: grid;
    gap: 14px;
}

.decision-dialog__header,
.decision-dialog__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.decision-dialog h2 {
    margin: 0;
    color: var(--cyan);
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.decision-dialog p {
    margin: 0;
    color: var(--muted);
}

.decision-dialog__field {
    display: grid;
    gap: 8px;
}

.decision-dialog__field[hidden] {
    display: none;
}

.decision-dialog__field span {
    color: var(--cyan);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.decision-dialog .decision-dialog__error {
    min-height: 1.2em;
    color: #e86b7b;
    font-weight: 800;
}

.decision-dialog__close {
    width: 34px;
    height: 34px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 6px;
    background: var(--danger);
    font-weight: 900;
    transition:
        background 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.decision-dialog__close:hover {
    border-color: rgba(255, 255, 255, 0.92);
    background: #cf4359;
}

.decision-dialog__close:active {
    transform: scale(0.97);
}

.decision-dialog__actions {
    justify-content: flex-end;
}

.decision-dialog__actions button[hidden] {
    display: none !important;
}

.decision-dialog__actions .button-primary,
.decision-dialog__actions .button-secondary,
.decision-dialog__actions .button-danger {
    border-bottom-width: 5px;
    box-shadow: none;
    transform: translateY(0);
}

.decision-dialog__actions .button-primary {
    border-bottom-color: #7e6507;
}

.decision-dialog__actions .button-secondary {
    border-bottom-color: #183e5d;
}

.decision-dialog__actions .button-secondary--current {
    color: #d9f4ff;
    border-color: rgba(104, 184, 218, 0.32);
    border-bottom-color: #1f5c74;
    background: rgba(104, 184, 218, 0.11);
}

.decision-dialog__actions .button-secondary--strong {
    color: #fff4fb;
    border-color: rgba(214, 103, 164, 0.42);
    border-bottom-color: #7d305e;
    background: rgba(214, 103, 164, 0.16);
}

.decision-dialog__actions .button-danger {
    border-bottom-color: #761625;
}

.decision-dialog__actions .button-primary:hover,
.decision-dialog__actions .button-secondary:hover,
.decision-dialog__actions .button-danger:hover {
    box-shadow: none;
    transform: translateY(-1px);
}

.decision-dialog__actions .button-primary:active,
.decision-dialog__actions .button-secondary:active,
.decision-dialog__actions .button-danger:active {
    border-bottom-width: 2px;
    transform: translateY(4px);
}

.noscript-alert {
    width: min(1080px, calc(100% - 32px));
    margin: 16px auto 0;
    padding: 12px 14px;
    color: #ffe1e8;
    border: 1px solid rgba(255, 116, 137, 0.36);
    border-radius: var(--radius);
    background: rgba(255, 79, 109, 0.12);
}

@keyframes cursor-blink {
    50% {
        opacity: 0;
    }
}

@media (max-width: 980px) {
    .decision-board,
    .list-columns {
        grid-template-columns: 1fr;
    }

    .decision-sidebar {
        border-right: 0;
    border-bottom: 1px solid rgba(104, 184, 218, 0.14);
    }
}

@media (max-width: 760px) {
    .decision-shell {
        width: calc(100% - 20px);
    }

    .decision-toolbar,
    .decision-transfer-panel,
    .item-form,
    .decision-item {
        align-items: stretch;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .score-panel {
        grid-template-columns: 1fr;
    }

    .toolbar-actions,
    .decision-transfer-actions,
    .button-primary,
    .button-secondary,
    .button-danger {
        width: 100%;
    }

    body {
        padding-bottom: 0;
    }
}

@media (min-width: 320px) and (max-width: 426px) {
    .decision-board {
        gap: 18px;
        overflow: visible;
    }

    .decision-sidebar {
        border-bottom: 1px solid rgba(104, 184, 218, 0.14);
    }

    .decision-list.is-over-mobile-limit {
        max-height: 228px;
        padding-right: 4px;
        border-top: 1px solid rgba(104, 184, 218, 0.16);
        border-bottom: 1px solid rgba(104, 184, 218, 0.16);
    }

    .column-header {
        justify-content: center;
        text-align: center;
    }

    .decision-item {
        align-items: center;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "copy copy"
            "impact actions";
        gap: 10px;
    }

    .decision-item__copy {
        grid-area: copy;
    }

    .decision-item .impact-pill {
        grid-area: impact;
        justify-self: start;
    }

    .decision-item .item-actions {
        grid-area: actions;
        justify-self: end;
    }

    .decision-item .icon-button {
        width: 36px;
        min-height: 36px;
    }

    .decision-transfer-panel {
        margin-top: 14px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: flex-start;
    }

    .decision-transfer-label {
        width: 100%;
        align-self: stretch;
        text-align: left;
    }

    .decision-transfer-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .decision-dialog.is-choice-dialog .decision-dialog__actions {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: stretch;
    }

    .decision-dialog.is-choice-dialog .decision-dialog__actions .button-secondary {
        width: 100%;
        min-width: 0;
        white-space: normal;
    }
}

@media (min-width: 375px) and (max-width: 425px) {
    .decision-toolbar {
        align-items: center;
        flex-direction: row;
    }

    .score-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .score-panel div:last-child {
        grid-column: 1 / -1;
    }

    .decision-toolbar__copy {
        min-width: 0;
        flex: 1;
    }

    .toolbar-actions {
        width: auto;
        flex-wrap: nowrap;
    }

    .toolbar-actions .icon-button {
        width: 42px;
    }
}

@media (min-width: 320px) and (max-width: 374px) {
    .decision-toolbar {
        align-items: center;
        text-align: center;
    }

    .toolbar-actions {
        justify-content: center;
    }
}

.score-card strong,
.score-card span,
.impact-badge,
.decision-created,
#storageAlert {
    font-family: var(--font-data), "Cascadia Mono", "Segoe UI", monospace;
}
