:root {
    font-family: Monaco, ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
    color: #f5f5f0;
    background-color: #07080c;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
video {
    max-width: 100%;
    height: auto;
}

body {
    margin: 0;
    background: radial-gradient(circle at top right, #2b6cff 0%, #07080c 55%);
    min-height: 100vh;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    position: sticky;
    top: 0;
    background: rgba(10, 11, 17, 0.8);
    gap: 1rem;
}

.site-title {
    font-weight: 600;
    letter-spacing: 0.12rem;
    font-size: 1.50rem;
    line-height: 1.2;
    margin: 0;
}

.site-title a {
    color: inherit;
    text-decoration: none;
}

nav a {
    margin-left: 1.5rem;
    color: inherit;
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: 0.08rem;
    white-space: nowrap;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(1.25rem, 3vw, 3rem);
}

.hero {
    padding: 3rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero h1 {
    margin: 0 0 0.75rem;
    font-size: 2.5rem;
    line-height: 1.2;
}

.hero p {
    margin: 0 0 1.5rem;
    max-width: 36rem;
}

.hero-actions .primary {
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #f8b82b, #ff6b6b);
    color: #07080c;
    font-weight: 600;
    text-decoration: none;
}

.panels {
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.panels article {
    padding: 1.75rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.panels article h2 {
    margin-top: 0;
}

.info-card,
.error-card {
    margin-top: 2rem;
    padding: 2rem;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.site-footer {
    text-align: center;
    padding: 2rem;
    color: rgba(245, 245, 240, 0.7);
}

.footer-links {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 0.75rem;
    margin: 0;
    padding: 0;
}

.footer-links .footer-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(248, 184, 43, 0.45);
    padding-bottom: 0.1rem;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-links .footer-link:hover,
.footer-links .footer-link:focus-visible {
    color: #f8b82b;
    border-bottom-color: #f8b82b;
}

.site-footer a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(248, 184, 43, 0.45);
    padding-bottom: 0.1rem;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: #f8b82b;
    border-bottom-color: #f8b82b;
}

code {
    color: #f8b82b;
}

.notes-hero,
.note-form-card,
.note-detail,
.notes-grid {
    background: rgba(255, 255, 255, 0.02);
}

.notes-hero {
    margin: 2rem 0;
    padding: 2rem 2.5rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "intro actions"
        "search search"
        "status status";
    align-items: end;
    gap: 1.25rem;
}

.notes-hero > :nth-child(1) {
    grid-area: intro;
    min-width: 0;
}

.notes-hero > :nth-child(2) {
    grid-area: actions;
    justify-self: end;
}

.notes-hero > :nth-child(3) {
    grid-area: search;
}

.notes-hero > :nth-child(4) {
    grid-area: status;
}

.notes-hero h1 {
    margin: 0 0 0.5rem;
    font-size: 2.25rem;
}

.notes-hero .subtitle {
    max-width: 28rem;
    margin: 0;
    color: rgba(245, 245, 240, 0.8);
}

.eyebrow {
    letter-spacing: 0.3rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    color: rgba(245, 245, 240, 0.6);
}

.notes-hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.notes-search {
    margin-bottom: 1.5rem;
}

.search-input {
    width: 100%;
    min-width: 0;
    padding: 0.95rem 1.2rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    font-size: 1rem;
    letter-spacing: 0.02rem;
}

a.primary,
button.primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.75rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #f8b82b, #ff6b6b);
    color: #07080c;
    text-transform: uppercase;
    letter-spacing: 0.08rem;
    font-weight: 600;
    border: none;
    text-decoration: none;
}

a.ghost,
button.ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(245, 245, 240, 0.4);
    padding: 0.75rem 1.5rem;
    color: inherit;
    text-decoration: none;
    background: transparent;
}

.status-pill {
    margin-bottom: 1rem;
    padding: 0.85rem 1.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

#notes-status.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    max-width: 100%;
    width: fit-content;
    border-radius: 12px;
    padding: 0.65rem 0.9rem;
    background: linear-gradient(135deg, rgba(248, 184, 43, 0.16), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(248, 184, 43, 0.38);
}

#notes-status.status-pill::before {
    content: "Status";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(248, 184, 43, 0.45);
    color: #f8b82b;
    font-size: 0.68rem;
    letter-spacing: 0.14rem;
    text-transform: uppercase;
    line-height: 1;
    padding: 0.22rem 0.5rem;
    white-space: nowrap;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.note-card {
    padding: 1.5rem;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    overflow: hidden;
}

.note-category {
    font-size: 0.75rem;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    color: rgba(245, 245, 240, 0.7);
}

.note-card h3 {
    margin: 0.5rem 0 0.25rem;
    font-size: 1.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-title-link {
    color: inherit;
    text-decoration: none;
    display: inline;
}

.note-title-link:hover,
.note-card h3:hover .note-title-link,
.note-card h3:focus-within .note-title-link {
    text-decoration: underline;
    text-underline-offset: 0.2rem;
}

.note-title-link:focus-visible {
    outline: 2px solid rgba(245, 245, 240, 0.6);
    outline-offset: 0.2rem;
    border-radius: 6px;
}

.note-meta {
    margin: 0;
    color: rgba(245, 245, 240, 0.6);
    font-size: 0.85rem;
}

.note-summary {
    flex: 1;
    margin: 1rem 0;
    color: rgba(245, 245, 240, 0.85);
}

.note-card-footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0;
    margin-top: 1rem;
}

.note-card-footer .ghost {
    width: 7.5rem;
    flex: 0 0 auto;
    justify-content: center;
    white-space: nowrap;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    line-height: 1.1;
}

.note-detail,
.note-form-card {
    padding: 2rem;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 2rem;
}

/* Make detail view behave like a card: column layout, fixed min-height, actions stick to the bottom */
.note-detail,
.note-form-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 220px; /* match card min-height so content starts at top and actions sit at bottom */
}

.note-detail-header h1,
.note-form-card h1 {
    margin-top: 0.25rem;
    font-size: 2rem;
}

/* Ensure form actions sit at the bottom of the form card */
.note-form-card .form-actions {
    margin-top: auto;
}

.note-content {
    margin-top: 1.5rem;
    line-height: 1.7;
    color: rgba(245, 245, 240, 0.9);

    /* Prevent long unbroken text (base64, long tokens) from overflowing the card */
    overflow-wrap: anywhere; /* modern wrapping */
    word-break: break-word;  /* legacy/broad browser support */
    white-space: pre-wrap;   /* preserve user line breaks while allowing wrapping */
    max-width: 100%;
}

.note-detail-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto; /* push actions to bottom */
    flex-wrap: wrap;
}

.profile-avatar {
    width: clamp(110px, 24vw, 220px);
    aspect-ratio: 1 / 1;
    margin: 1rem 0 1.5rem;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.profile-avatar .avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-save-message {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 12px;
    padding: 0.65rem 0.95rem;
}

.profile-save-message.is-success {
    background: rgba(87, 217, 142, 0.14);
    border-color: rgba(87, 217, 142, 0.4);
    color: #d4ffe6;
}

.profile-save-message.is-error {
    background: rgba(255, 107, 107, 0.16);
    border-color: rgba(255, 107, 107, 0.48);
    color: #ffdede;
}

.form-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.form-field label {
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    letter-spacing: 0.08rem;
    text-transform: uppercase;
    color: rgba(245, 245, 240, 0.6);
}

.form-field input,
.form-field textarea {
    padding: 0.9rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
    color: inherit;
    font-size: 1rem;
}

.form-actions {
    margin-top: 1.25rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .site-header {
        padding: 1rem 1.25rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem 1rem;
    }

    nav a {
        margin-left: 0;
        letter-spacing: 0.06rem;
    }

    .notes-hero {
        padding: 1.5rem;
        grid-template-columns: 1fr;
        grid-template-areas:
            "intro"
            "actions"
            "search"
            "status";
        align-items: start;
    }

    .notes-hero > :nth-child(2) {
        justify-self: start;
    }

    .notes-hero h1 {
        font-size: 2rem;
    }
}

@media (max-width: 540px) {
    .site-title {
        letter-spacing: 0.08rem;
        text-align: center;
        width: 100%;
    }

    .hero {
        padding: 1.5rem;
        border-radius: 22px;
    }

    .hero h1 {
        font-size: 2.1rem;
    }

    .notes-grid {
        grid-template-columns: 1fr;
    }

    .note-card {
        min-height: auto;
    }

    .note-detail,
    .note-form-card {
        padding: 1.5rem;
        border-radius: 22px;
    }

    .profile-avatar {
        width: clamp(96px, 40vw, 150px);
        border-radius: 18px;
    }

    a.primary,
    button.primary,
    a.ghost,
    button.ghost {
        width: 100%;
    }
}

.validation {
	    color: #ff6b6b;
	    font-size: 0.75rem;
	    margin-top: 0.25rem;
	}

	/* Confirm state applies only to the delete control now */
a.ghost.delete-confirm,
button.ghost.delete-confirm {
    background: #f8b82b;
    color: #07080c;
    border-color: rgba(7, 8, 12, 0.06);
}

a.ghost.delete-confirm:hover,
a.ghost.delete-confirm:focus,
button.ghost.delete-confirm:hover,
button.ghost.delete-confirm:focus {
    background: #ffd65a;
    color: #07080c;
}

	a.ghost {
	    transition: background 120ms ease, color 120ms ease;
}
