* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #05060a;
    color: #f5f5f5;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid #222;
    background: #05060a;
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    font-weight: 700;
    letter-spacing: 0.12em;
    font-size: 14px;
    text-transform: uppercase;
    text-decoration: none;
    color: #f5f5f5;
}

nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

nav a,
.nav-form button {
    text-decoration: none;
    color: #ddd;
    font: inherit;
    font-size: 14px;
}

.nav-form {
    margin: 0;
}

.nav-form button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

nav a:hover,
.nav-form button:hover {
    color: #ffffff;
}

main {
    max-width: 960px;
    margin: 24px auto 64px;
    padding: 0 16px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    font-size: 28px;
    margin-bottom: 16px;
}

h2 {
    font-size: 18px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.eyebrow {
    margin-bottom: 6px;
    color: #f5e0a3;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.candles-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.candle-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #101118;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    border: 1px solid #1b1c25;
}

.candle-card:hover {
    border-color: #f5e0a3;
    background: #141520;
}

.candle-icon {
    font-size: 28px;
    line-height: 1;
    margin-top: 2px;
}

.candle-text {
    flex: 1;
    min-width: 0;
}

.candle-name {
    display: inline-block;
    color: inherit;
    font-weight: 600;
    margin-bottom: 4px;
    text-decoration: none;
}

a.candle-name:hover {
    color: #f5e0a3;
}

.candle-dates {
    margin-left: 0.5rem;
    font-size: 0.95em;
    letter-spacing: 0.04em;
    color: #f2dca5;
    white-space: nowrap;
}

.candle-message {
    font-size: 14px;
    color: #ccc;
    margin-bottom: 6px;
}

.candle-dt,
.muted {
    font-size: 12px;
    color: #777;
}

.candle-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #888;
}

.candle-meta span {
    padding: 2px 7px;
    border: 1px solid #262836;
    border-radius: 999px;
}

.candle-page {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.candle-big-icon {
    font-size: 64px;
    margin-bottom: 12px;
}

.candle-title {
    font-size: 1.9rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.candle-name-main {
    display: block;
}

.candle-dates-main {
    display: block;
    margin-top: 0.4rem;
    font-size: 1.1rem;
    letter-spacing: 0.06em;
    color: #f2dca5;
}

.candle-message-full {
    margin-top: 8px;
    white-space: pre-wrap;
    color: #ddd;
}

.candle-dt-full {
    margin-top: 8px;
    font-size: 13px;
    color: #888;
}

.candle-links {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid #f5e0a3;
    background: #101118;
    color: #f5e0a3;
    text-decoration: none;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.btn:hover,
.btn.primary {
    background: #f5e0a3;
    color: #101118;
}

.btn.danger {
    border-color: rgba(248, 113, 113, 0.75);
    background: rgba(127, 29, 29, 0.18);
    color: #fecaca;
}

.btn.danger:hover {
    background: #fecaca;
    color: #450a0a;
}

.auth-shell {
    display: flex;
    justify-content: center;
}

.auth-panel {
    width: min(860px, 100%);
}

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

.auth-box,
.profile-strip {
    background: #101118;
    border: 1px solid #1b1c25;
    border-radius: 8px;
    padding: 18px;
}

.auth-box p {
    color: #ccc;
}

.qr-placeholder {
    width: 160px;
    height: 160px;
    display: grid;
    place-items: center;
    margin: 16px 0;
    border: 1px dashed #f5e0a3;
    color: #f5e0a3;
    letter-spacing: 0.2em;
}

.stacked-form {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

label {
    display: grid;
    gap: 6px;
    color: #ddd;
    font-size: 14px;
}

input,
textarea,
select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #303241;
    background: #07080d;
    color: #f5f5f5;
    font: inherit;
}

input,
select {
    min-height: 40px;
}

.life-dates-fieldset {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 14px;
    border: 1px solid #303241;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.life-dates-fieldset legend {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 6px;
    color: #f5e0a3;
    font-weight: 700;
}

.tooltip-trigger {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(245, 224, 163, 0.65);
    background: #101118;
    color: #f5e0a3;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
}

.tooltip-trigger:focus-visible {
    outline: 2px solid #f5e0a3;
    outline-offset: 2px;
}

.tooltip-bubble {
    position: absolute;
    z-index: 5;
    left: 0;
    top: calc(100% + 8px);
    width: min(360px, calc(100vw - 48px));
    padding: 10px 12px;
    border: 1px solid rgba(245, 224, 163, 0.45);
    border-radius: 8px;
    background: #101118;
    color: #f5f1e6;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.life-dates-fieldset legend:hover .tooltip-bubble,
.life-dates-fieldset legend:focus-within .tooltip-bubble {
    opacity: 1;
    transform: translateY(0);
}

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

.life-date-group {
    display: grid;
    gap: 8px;
}

.life-date-title {
    color: #ddd;
    font-size: 13px;
    font-weight: 700;
}

.life-date-selects {
    display: grid;
    grid-template-columns: minmax(68px, 0.75fr) minmax(110px, 1.35fr) minmax(86px, 1fr);
    gap: 8px;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.notice {
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: #1b1a12;
    border: 1px solid #4d4120;
    color: #f5e0a3;
}

.notice.error {
    background: #221215;
    border-color: #65313a;
    color: #ffb4c0;
}

.dev-link {
    display: inline-block;
    margin-top: 12px;
    color: #aaa;
    font-size: 13px;
}

.profile-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.account-head {
    align-items: flex-start;
}

.account-tabs {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.account-tab-button {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid #343646;
    background: #0d0f16;
    color: #d8d8df;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px transparent;
}

.account-tab-button:hover {
    border-color: #f5e0a3;
    color: #f5e0a3;
}

.account-tab-button.is-active {
    background: #f5e0a3;
    color: #101118;
    border-color: #f5e0a3;
    box-shadow: 0 0 0 3px rgba(245, 224, 163, 0.18);
    font-weight: 700;
}

.account-tab-panel {
    display: none;
}

.account-tab-panel.is-active {
    display: block;
}

.account-section {
    margin-bottom: 18px;
    scroll-margin-top: 90px;
}

.account-create {
    padding: 22px;
}

.account-candles {
    margin-top: 22px;
}

.section-heading {
    margin-bottom: 12px;
}

.inline-action {
    margin: 0;
}

.account-candle-card {
    padding: 18px;
}

.candle-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.status-badge,
.status-action {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 5px 12px;
    border: 1px solid #303241;
    border-radius: 999px;
    background: #101118;
    color: #d8d8df;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.status-action {
    cursor: pointer;
}

.candle-action-button {
    min-height: 32px;
}

.status-badge.private {
    border-color: #86a7d8;
    background: #111b2d;
    color: #cfe2ff;
}

.status-badge.pending {
    border-color: #8b7535;
    background: #221d10;
    color: #f5e0a3;
}

.status-badge.published {
    border-color: #6fbf91;
    background: #12301f;
    color: #9df2bf;
    box-shadow: 0 0 0 3px rgba(111, 191, 145, 0.14);
}

.status-badge.rejected {
    border-color: #80424c;
    background: #241216;
    color: #ffb4c0;
}

.status-action.publish {
    border-color: #f5e0a3;
    color: #f5e0a3;
    background: #171409;
}

.status-action.publish:hover {
    background: #f5e0a3;
    color: #101118;
}

.status-action.hide {
    border-color: #86a7d8;
    color: #cfe2ff;
    background: #111827;
}

.status-action.hide:hover {
    background: #cfe2ff;
    color: #101118;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}


.account-filter-heading {
    margin-bottom: 10px;
}

.status-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 22px;
}

.status-filter-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 234, 170, 0.28);
    background: rgba(255, 255, 255, 0.03);
    color: #f5f1e6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.status-filter-tab:hover {
    background: rgba(255, 234, 170, 0.08);
    border-color: rgba(255, 234, 170, 0.55);
    color: #ffe6a3;
}

.status-filter-tab.active {
    background: #ffe6a3;
    border-color: #ffe6a3;
    color: #05060a;
}

@media (max-width: 640px) {
    .life-dates-grid {
        grid-template-columns: 1fr;
    }

    .life-date-selects {
        grid-template-columns: 1fr;
    }

    .status-filter-tabs {
        gap: 8px;
        margin-bottom: 18px;
    }

    .status-filter-tab {
        padding: 7px 11px;
        font-size: 13px;
    }
}

.profile-strip strong {
    display: block;
    margin-top: 4px;
}

.empty {
    color: #bbb;
}

footer {
    border-top: 1px solid #222;
    padding: 12px 24px;
    font-size: 12px;
    color: #777;
    text-align: center;
}

@media (min-width: 768px) {
    .candle-name-main {
        display: inline;
    }

    .candle-dates-main {
        display: inline;
        margin-left: 0.8rem;
    }
}

@media (max-width: 720px) {
    header,
    .page-head,
    .profile-strip {
        align-items: flex-start;
        flex-direction: column;
    }

    nav {
        gap: 10px;
    }

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

    .candle-dates {
        display: block;
        margin-left: 0;
        margin-top: 2px;
    }
}

.qr-frame {
    display: flex;
    justify-content: center;
    margin: 16px 0;
}

.login-qr {
    width: 220px;
    height: 220px;
    max-width: 100%;
    background: #fff;
    padding: 12px;
    border-radius: 12px;
    box-sizing: border-box;
}
