:root {
    --bg: #080808;
    --surface: #141414;
    --surface-subtle: #202020;
    --text: #eeeeea;
    --muted: #a3a3a0;
    --border: #303030;
    --border-strong: #e6e6df;
    --accent: #eeeeea;
    --danger: #d66a62;
    --warning: #d39a4b;
    --soon: #beb278;
    --success: #86b898;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    position: relative;
    min-height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: -30%;
    z-index: -1;
    pointer-events: none;
}

body::before {
    background-image:
        repeating-linear-gradient(115deg, transparent 0 78px, rgba(255, 255, 255, 0.055) 79px, transparent 81px),
        repeating-linear-gradient(25deg, transparent 0 112px, rgba(255, 255, 255, 0.035) 113px, transparent 115px);
    animation: drift-lines 34s linear infinite;
}

body::after {
    background-image:
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.045), transparent),
        repeating-linear-gradient(0deg, transparent 0 96px, rgba(255, 255, 255, 0.025) 97px, transparent 99px);
    opacity: 0.7;
    animation: slide-lines 46s linear infinite;
}

@keyframes drift-lines {
    from {
        transform: translate3d(-40px, -20px, 0);
    }

    to {
        transform: translate3d(80px, 50px, 0);
    }
}

@keyframes slide-lines {
    from {
        transform: translate3d(70px, 0, 0);
    }

    to {
        transform: translate3d(-70px, 0, 0);
    }
}

a {
    color: var(--text);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

img {
    display: block;
    max-width: 100%;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
    padding: 0 32px;
    background: rgba(8, 8, 8, 0.88);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

.brand {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0;
    text-decoration: none;
}

.top-nav,
.action-row,
.compact-actions,
.card-actions,
.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.current-user {
    color: var(--muted);
    font-size: 14px;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.page-shell {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0 60px;
}

.site-footer {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 36px;
    color: var(--muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
}

.site-footer p {
    max-width: 820px;
    margin: 8px 0 0;
}

.site-footer a {
    color: var(--text);
    font-weight: 700;
}

.page-heading,
.dashboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-heading h1,
.dashboard-hero h1 {
    margin: 0;
    font-size: 32px;
    line-height: 1.25;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--accent);
    color: #080808;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-secondary {
    background: var(--surface);
    color: var(--text);
}

.button-ghost {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    border-color: var(--border);
}

.button-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #ffffff;
}

.button-small {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 13px;
}

.full-width {
    width: 100%;
}

.text-button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.flash {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    background: var(--surface);
}

.flash-success {
    border-left-color: var(--success);
}

.flash-error {
    border-left-color: var(--danger);
}

.status-pill,
.deadline-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-subtle);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.muted {
    color: var(--muted);
}

.empty-state {
    margin: 0;
    color: var(--muted);
}

.pre-line {
    white-space: pre-line;
}

.auth-page .site-header {
    justify-content: center;
}

.auth-panel {
    width: min(480px, 100%);
    margin: 54px auto;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-heading {
    margin-bottom: 22px;
}

.auth-heading h1 {
    margin: 0;
    font-size: 28px;
}

.auth-switch {
    margin: 18px 0 0;
    color: var(--muted);
    text-align: center;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(0, 0, 0, 0.86);
    overflow: hidden;
}

.lightbox[hidden] {
    display: none;
}

.lightbox img {
    max-width: min(1100px, 96vw);
    max-height: 88vh;
    border-radius: var(--radius);
    background: #111111;
    cursor: grab;
    touch-action: none;
    user-select: none;
    transform-origin: center center;
    will-change: transform;
}

.lightbox img.is-dragging {
    cursor: grabbing;
}

@media (prefers-reduced-motion: reduce) {
    body::before,
    body::after {
        animation: none;
    }
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 22px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
}

@media (max-width: 760px) {
    .site-header {
        position: static;
        align-items: flex-start;
        flex-direction: column;
        padding: 18px 16px;
    }

    .page-shell,
    .site-footer {
        width: min(100% - 24px, 1180px);
    }

    .page-heading,
    .dashboard-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .page-heading h1,
    .dashboard-hero h1 {
        font-size: 26px;
    }

    .top-nav,
    .action-row,
    .compact-actions,
    .card-actions,
    .form-actions {
        width: 100%;
    }

    .button {
        flex: 1 1 auto;
    }
}
