:root {
    --brand-primary: #522e91;
    --brand-light: #8c6bc6;
    --brand-accent: #faa74a;
    --brand-grey: #f1f1f1;
    --brand-white: #ffffff;
    --brand-black: #000000;
    --font-heading: "Source Serif Pro", Georgia, serif;
    --font-body: "Hind", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--brand-primary);
    color: var(--brand-white);
    font-family: var(--font-body);
    line-height: 1.5;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--brand-white);
    font-weight: 600;
    margin: 0 0 0.5rem;
}

a {
    color: var(--brand-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.site-header {
    padding: 1.25rem 2rem;
    border-bottom: 2px solid var(--brand-light);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-title h1 {
    font-size: clamp(1.15rem, 1rem + 1vw, 1.6rem);
    margin: 0;
}

.site-title h1 a {
    color: var(--brand-white);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-name {
    font-weight: 600;
}

.site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem 3rem;
}

.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.25;
    padding: 0.5rem 1.1rem;
    margin: 0;
    border-radius: 9999px;
    border: 2px solid transparent;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    appearance: none;
}

.btn-accent {
    background-color: var(--brand-accent);
    color: var(--brand-black);
}

.btn-accent:hover {
    filter: brightness(1.08);
    text-decoration: none;
}

.btn-outline {
    background-color: transparent;
    color: var(--brand-white);
    border-color: var(--brand-light);
}

.btn-outline:hover {
    background-color: var(--brand-light);
    text-decoration: none;
}

.login-card {
    max-width: 380px;
    margin: 3rem auto;
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--brand-light);
    border-radius: 12px;
    padding: 2rem;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.login-card .field label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.login-card .field input {
    width: 100%;
}

.login-note {
    color: var(--brand-light);
    font-size: 0.9rem;
}

.error {
    color: var(--brand-accent);
    font-weight: 600;
}

.messages {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.messages li {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background-color: var(--brand-light);
}

.messages li.success {
    background-color: #2e7d32;
}

.messages li.error {
    background-color: #b3261e;
}

.placeholder {
    color: var(--brand-light);
    font-style: italic;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]),
select,
textarea {
    background-color: rgba(255, 255, 255, 0.92);
    color: var(--brand-black);
    border: 1px solid var(--brand-light);
    border-radius: 6px;
    padding: 0.45rem 0.6rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]),
select {
    height: 2.2rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--brand-accent);
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 1.9rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23522e91' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.45rem center;
    background-size: 0.75rem;
}

select option {
    background-color: #ffffff;
    color: #222222;
}

input:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.6;
    background-color: rgba(255, 255, 255, 0.65);
}

.login-card form .btn {
    align-self: flex-start;
    margin-top: 0.5rem;
}

@media (max-width: 720px) {
    .site-header {
        padding: 0.7rem 1rem;
    }

    .header-inner {
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .site-title {
        flex: 1 1 auto;
        min-width: 0;
    }

    .site-title h1 {
        font-size: 1rem;
        line-height: 1.2;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .header-user {
        gap: 0.4rem;
        flex-shrink: 0;
    }

    .btn {
        padding: 0.5rem 0.9rem;
    }
}

.user-link {
    color: var(--brand-white);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--brand-light);
    text-underline-offset: 3px;
}

.user-link:hover {
    color: var(--brand-accent);
    text-decoration-color: var(--brand-accent);
}

.burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 2.6rem;
    height: 2.4rem;
    padding: 0.4rem 0.55rem;
    background: transparent;
    border: 2px solid var(--brand-light);
    border-radius: 8px;
    cursor: pointer;
}

.burger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--brand-white);
    border-radius: 2px;
}

.burger:hover {
    border-color: var(--brand-accent);
}

.header-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 11rem;
    background: var(--brand-white);
    color: var(--brand-black);
    border: 1px solid var(--brand-light);
    border-radius: 10px;
    padding: 0.4rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 60;
}

.header-menu a,
.header-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--brand-black);
    font-family: var(--font-body);
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
}

.header-menu a:hover,
.header-menu button:hover {
    background: var(--brand-grey);
    text-decoration: none;
}

.band-switcher {
    display: block;
    border-bottom: 1px solid var(--brand-grey);
    padding-bottom: 0.3rem;
    margin-bottom: 0.3rem;
}

.band-switcher .menu-label {
    display: block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6a6a6a;
}

.band-switcher .current-band {
    font-weight: 600;
    color: var(--brand-primary);
}

.header-user {
    position: relative;
}

.btn-danger {
    background-color: #b3261e;
    color: var(--brand-white);
}

.btn-danger:hover {
    filter: brightness(1.1);
    text-decoration: none;
}

.btn-sm {
    padding: 0.25rem 0.6rem;
    font-size: 0.85rem;
}

.inline-form {
    display: inline-block;
    margin: 0 0.15rem;
}

.tombstone a,
.tombstone td {
    text-decoration: line-through;
    color: var(--brand-light);
}

.list-meta-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 480px;
    margin-bottom: 1.5rem;
}

.list-meta-form label {
    font-weight: 600;
    font-size: 0.85rem;
}

.list-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.list-add-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    flex-wrap: wrap;
}

.piece-pick-results {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 20rem;
    max-height: 16rem;
    overflow-y: auto;
    background: var(--brand-white);
    border: 1px solid var(--brand-light);
    border-radius: 8px;
    z-index: 50;
    padding: 0.25rem;
}

.piece-pick-results a {
    display: block;
    padding: 0.4rem 0.6rem;
    color: var(--brand-black);
    border-radius: 6px;
}

.piece-pick-results a:hover {
    background: var(--brand-grey);
    text-decoration: none;
}

.share-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.share-form label {
    font-weight: 600;
    font-size: 0.85rem;
}

.list-notes-display {
    max-width: 640px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    padding: 0;
    background: transparent;
    border: 1px solid var(--brand-light);
    border-radius: 6px;
    color: var(--brand-primary);
    cursor: pointer;
}

.icon-btn:hover:not(:disabled) {
    border-color: var(--brand-accent);
    color: var(--brand-accent);
}

.icon-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.icon-btn-danger {
    border-color: #b3261e;
    color: #f2b8b5;
}

.icon-btn-danger:hover:not(:disabled) {
    border-color: #ff8a80;
    color: #ff8a80;
}

.entry-actions {
    white-space: nowrap;
}

.entry-actions .inline-form {
    margin: 0 0.1rem;
}

.pick-note {
    display: block;
    padding: 0.4rem 0.6rem;
    color: var(--brand-light);
    font-size: 0.9rem;
    font-style: italic;
}

.piece-pick-results a.pick-new {
    border-bottom: 1px solid var(--brand-light);
    margin-bottom: 0.25rem;
    padding-bottom: 0.5rem;
    color: var(--brand-primary);
    font-weight: 600;
}

.piece-pick-results a.pick-new:hover {
    color: var(--brand-accent);
}

.btn .bi {
    vertical-align: -0.125em;
    margin-right: 0.35rem;
}

.entry-ref {
    white-space: nowrap;
    color: var(--brand-light);
    font-variant-numeric: tabular-nums;
}

.access-icon {
    color: var(--brand-light);
    font-size: 0.9rem;
    margin-left: 0.4rem;
    vertical-align: 0.05em;
}

.basket-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    font-size: 1.25rem;
    color: var(--brand-white);
    border: 2px solid var(--brand-light);
    border-radius: 10px;
}

.basket-link:hover {
    color: var(--brand-accent);
    border-color: var(--brand-accent);
    text-decoration: none;
}


.basket-link {
    position: relative;
}

.basket-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-accent);
    color: var(--brand-black);
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

.basket-select-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.col-select {
    width: 2rem;
    text-align: center;
}

.col-select input {
    width: auto;
}

.move-stack {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    vertical-align: middle;
}

.move-stack .icon-btn {
    width: 1.5rem;
    height: 1.1rem;
    border: none;
    background: transparent;
    padding: 0;
}

.move-stack .icon-btn .bi {
    font-size: 0.85rem;
    line-height: 1;
}

/* Plain icon button for the bin: no box */
.icon-btn-plain {
    border: none;
    background: transparent;
    padding: 0;
    width: auto;
    height: auto;
}

.icon-btn-plain .bi {
    font-size: 0.95rem;
}

.row-select,
.col-select input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--brand-primary);
    cursor: pointer;
}

.bulk-form .field {
    margin-bottom: 0.9rem;
}

.bulk-form label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.bulk-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    max-width: 480px;
}

.bulk-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 400 !important;
    font-size: 0.95rem !important;
}

.bulk-confirm {
    border: 1px solid var(--brand-light);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
