* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Rubik', sans-serif;
}

:root {
    --bg-dark: #0a0a0a;
    --bg-panel: #111111;
    --bg-panel-2: #151515;
    --bg-field: #0d0d0d;
    --border-soft: rgba(255,255,255,0.09);
    --border-strong: rgba(255,255,255,0.18);
    --border-red: rgba(211,13,13,0.42);
    --text-main: #ffffff;
    --text-muted: #b3b3b3;
    --text-body: #d2d2d2;
    --red: #d30d0d;
    --red-hot: #ff3131;
    --teal: #147b86;
    --green: #24854c;
    --gold: #96702a;
    --discord: #5865f2;
    --shadow: rgba(0,0,0,0.48);
}

html {
    min-height: 100%;
    background: var(--bg-dark);
}

body.development-page {
    min-height: 100vh;
    color: var(--text-main);
    background:
        radial-gradient(circle at top, rgba(211,13,13,0.16), transparent 38%),
        linear-gradient(-45deg, #0a0a0a, #111111, #0d0d0d, #151515);
    background-size: 160% 160%, 420% 420%;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.development-shell {
    width: min(1540px, 100%);
    margin: 0 auto;
    padding: 22px;
}

.development-topbar,
.tracker-heading,
.tracker-controls,
.staff-panel,
.board-column,
.editor-panel {
    background: rgba(17,17,17,0.94);
    border: 1px solid var(--border-soft);
    box-shadow: 0 20px 52px var(--shadow);
}

.development-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 70px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 8px;
}

.brand-mark,
.discord-login,
.account-chip,
.logout-link,
.ghost-button,
.staff-panel button,
.column-actions button,
.card-actions button,
.editor-actions button,
.icon-button,
.card-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #fff;
    text-decoration: none;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
}

.brand-mark {
    gap: 12px;
    border: 0;
}

.brand-mark img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #252525;
}

.brand-mark strong,
.brand-mark small {
    display: block;
}

.brand-mark small {
    color: var(--text-muted);
    margin-top: 2px;
}

.account-zone {
    display: flex;
    align-items: center;
    gap: 10px;
}

.discord-login,
.logout-link,
.ghost-button,
.staff-panel button,
.editor-actions button {
    min-height: 42px;
    padding: 10px 14px;
    font-weight: 800;
}

.discord-login {
    background: var(--discord);
}

.logout-link,
.ghost-button {
    background: #1a1a1a;
}

.staff-panel button,
.editor-actions button[type="submit"] {
    background: var(--red);
}

.account-chip {
    min-height: 42px;
    padding: 8px 12px;
    background: #151515;
}

.account-chip img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.account-chip small {
    color: var(--text-body);
    font-weight: 700;
}

.staff-badge,
.viewer-badge {
    padding: 5px 8px;
    border-radius: 999px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

.staff-badge {
    background: rgba(36,133,76,0.95);
}

.viewer-badge {
    background: #292929;
}

.tracker-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
    padding: 18px;
    border-color: var(--border-red);
    border-radius: 8px;
}

.tracker-kicker {
    color: var(--red-hot);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.tracker-heading h1 {
    font-size: clamp(2rem, 6vw, 4rem);
    line-height: 1;
    margin-bottom: 10px;
}

.tracker-copy {
    color: var(--text-muted);
    line-height: 1.55;
}

.tracker-status {
    min-width: 150px;
    padding: 11px 13px;
    text-align: center;
    color: var(--text-body);
    background: #151515;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
}

.tracker-status.staff {
    border-color: rgba(36,133,76,0.52);
    color: #dff8e8;
}

.tracker-status.error {
    border-color: rgba(255,49,49,0.62);
    color: #ffd7d7;
}

.tracker-controls,
.staff-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 8px;
}

.staff-panel {
    border-color: var(--border-red);
}

.search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 250px;
    min-height: 42px;
    padding: 0 12px;
    color: var(--text-muted);
    background: var(--bg-field);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
}

.search-field input {
    border: 0;
    padding: 0;
    min-height: 40px;
    background: transparent;
}

input,
select,
textarea {
    width: 100%;
    color: #fff;
    background: var(--bg-field);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    outline: none;
}

input,
select {
    min-height: 42px;
    padding: 10px 12px;
}

select {
    width: auto;
    min-width: 150px;
}

textarea {
    resize: vertical;
    padding: 11px 12px;
    line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus,
.search-field:focus-within {
    border-color: rgba(255,49,49,0.72);
    box-shadow: 0 0 0 3px rgba(211,13,13,0.18);
}

.board-wrap {
    overflow-x: auto;
    padding-bottom: 14px;
    scrollbar-color: var(--red) #141414;
}

.board {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(306px, 1fr);
    gap: 14px;
    align-items: start;
    min-width: min-content;
}

.board-column {
    display: flex;
    flex-direction: column;
    min-height: 420px;
    max-height: calc(100vh - 300px);
    border-radius: 8px;
    overflow: hidden;
}

.column-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    padding: 15px;
    border-bottom: 1px solid var(--border-soft);
    background: #101010;
}

.column-head h2 {
    font-size: 1.02rem;
    line-height: 1.25;
    margin-bottom: 5px;
}

.card-count {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.column-actions,
.card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.column-actions button,
.card-actions button,
.icon-button {
    width: 34px;
    height: 34px;
    background: #1b1b1b;
}

.column-actions button:hover,
.card-actions button:hover,
.ghost-button:hover,
.staff-panel button:hover,
.editor-actions button:hover,
.icon-button:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.cards {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    min-height: 160px;
    overflow-y: auto;
    padding: 12px;
    scrollbar-color: var(--red) #141414;
}

.cards.drag-over {
    background: rgba(211,13,13,0.1);
}

.dev-card {
    padding: 13px;
    background: linear-gradient(180deg, #1a1a1a 0%, #141414 100%);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    box-shadow: 0 14px 28px rgba(0,0,0,0.28);
}

.dev-card[draggable="true"] {
    cursor: grab;
}

.dev-card.dragging {
    opacity: 0.45;
}

.dev-card[data-priority="urgent"] {
    border-color: rgba(255,49,49,0.68);
}

.dev-card[data-priority="high"] {
    border-color: rgba(150,112,42,0.58);
}

.card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.tag {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 5px 8px;
    color: #fff;
    background: rgba(211,13,13,0.26);
    border: 1px solid rgba(211,13,13,0.34);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

.dev-card h3 {
    font-size: 0.98rem;
    line-height: 1.35;
    margin-bottom: 8px;
}

.dev-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.card-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-soft);
}

.card-meta dt {
    color: #858585;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.card-meta dd {
    min-width: 0;
    color: var(--text-body);
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.card-links a {
    min-height: 30px;
    padding: 6px 8px;
    background: #1b1b1b;
    color: var(--text-body);
    font-size: 0.76rem;
    font-weight: 800;
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 112px;
    padding: 16px;
    color: var(--text-muted);
    text-align: center;
    border: 1px dashed var(--border-strong);
    border-radius: 8px;
}

.editor-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0,0,0,0.78);
}

.editor-overlay[hidden] {
    display: none;
}

.editor-panel {
    width: min(720px, 100%);
    max-height: min(760px, 92vh);
    overflow: auto;
    padding: 18px;
    border-color: var(--border-red);
    border-radius: 8px;
}

.compact-editor {
    width: min(460px, 100%);
}

.editor-head,
.editor-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.editor-head {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
}

.editor-head h2 {
    font-size: 1.35rem;
}

.editor-panel label {
    display: grid;
    gap: 7px;
    margin-bottom: 12px;
    color: var(--text-body);
    font-size: 0.86rem;
    font-weight: 800;
}

.editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.editor-grid select {
    width: 100%;
}

.editor-actions {
    justify-content: flex-end;
    padding-top: 4px;
}

@media (max-width: 900px) {
    .development-shell {
        padding: 16px;
    }

    .development-topbar,
    .tracker-heading,
    .tracker-controls,
    .staff-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .account-zone {
        flex-wrap: wrap;
    }

    .tracker-status {
        text-align: left;
    }

    .board {
        grid-auto-columns: minmax(280px, 88vw);
    }

    .board-column {
        max-height: none;
    }

    select,
    .ghost-button,
    .staff-panel button {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .account-zone,
    .discord-login,
    .logout-link,
    .account-chip,
    .search-field,
    .editor-actions button {
        width: 100%;
    }

    .editor-grid,
    .card-meta {
        grid-template-columns: 1fr;
    }

    .editor-actions {
        flex-direction: column-reverse;
    }
}
