:root {
    --page: #f5f2ec;
    --surface: #ffffff;
    --surface-soft: #faf8f4;
    --ink: #27322d;
    --muted: #66736d;
    --line: #e7dfd3;
    --brand: #2f4a3d;
    --brand-hover: #243a30;
    --accent: #b45f3a;
    --accent-hover: #944b2f;
    --star: #d9982f;
    --shadow: 0 18px 50px rgba(39, 50, 45, 0.12);
}

/* Interactive flavour wheel prototype */
.flavour-wheel-page {
    padding: 28px 0 44px;
}

.flavour-wheel-intro {
    max-width: 760px;
    margin-bottom: 28px;
}

.flavour-wheel-intro h1 {
    margin: 4px 0 10px;
    font-size: clamp(2rem, 5vw, 3.8rem);
    line-height: .98;
}

.flavour-wheel-intro > p:last-child {
    max-width: 660px;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.section-kicker {
    margin: 0;
    color: var(--text-highlight, #a85037);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.flavour-wheel-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 330px);
    gap: 22px;
    align-items: start;
}

.flavour-wheel-stage,
.flavour-selection-panel {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 16px 50px rgba(67, 45, 29, .07);
}

.flavour-wheel-stage {
    padding: 22px;
}

.flavour-wheel-toolbar {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 20px;
}

.flavour-wheel-toolbar h2,
.flavour-selection-panel h2 {
    margin: 0 0 5px;
}

.flavour-wheel-toolbar p {
    margin: 0;
    color: var(--muted);
}

.flavour-clear {
    min-width: 76px;
}

.flavour-clear:disabled {
    opacity: .4;
    cursor: default;
}

.flavour-wheel-canvas {
    position: relative;
    width: min(100%, 760px);
    margin: 10px auto 0;
    aspect-ratio: 1;
}

.flavour-wheel {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.flavour-segment {
    stroke: #fffdf8;
    stroke-width: 3px;
    transition: opacity .16s ease, filter .16s ease, transform .16s ease;
    cursor: pointer;
}

.flavour-wheel g:hover .flavour-segment,
.flavour-wheel g:focus .flavour-segment {
    filter: saturate(1.18) brightness(1.04);
}

.flavour-wheel g.is-category .flavour-segment {
    cursor: default;
}

.flavour-wheel g.is-category:hover .flavour-segment {
    filter: none;
}

.flavour-wheel g:focus {
    outline: none;
}

.flavour-wheel g:focus .flavour-segment {
    stroke: #2d2119;
    stroke-width: 5px;
}

.flavour-wheel g.is-selected .flavour-segment {
    stroke: #2d2119;
    stroke-width: 7px;
    filter: saturate(1.12);
}

.flavour-label {
    fill: #241913;
    font-family: inherit;
    font-weight: 700;
    pointer-events: none;
}

.flavour-label-group {
    font-size: 17px;
}

.flavour-label-detail {
    font-size: 13px;
}

.flavour-wheel-centre {
    position: absolute;
    inset: 50% auto auto 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 19%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #fffdf8;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 20px rgba(67, 45, 29, .12);
    pointer-events: none;
}

.flavour-wheel-centre span,
.flavour-wheel-centre small {
    color: var(--muted);
    font-size: clamp(.55rem, 1.2vw, .8rem);
}

.flavour-wheel-centre strong {
    font-size: clamp(1rem, 2.7vw, 1.8rem);
    line-height: 1;
}

.flavour-selection-panel {
    position: sticky;
    top: 18px;
    padding: 24px;
}

.flavour-selection-hint {
    margin: 10px 0 20px;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.45;
}

.flavour-empty {
    padding: 28px 15px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
}

.flavour-empty-mark {
    display: block;
    margin-bottom: 6px;
    font-size: 2rem;
}

.flavour-empty p {
    margin: 0;
}

.flavour-selections {
    display: grid;
    gap: 8px;
}

.flavour-chip {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1px 10px;
    padding: 10px 12px 10px 15px;
    border: 0;
    border-left: 5px solid var(--flavour-colour);
    border-radius: 9px;
    background: #f7f3ec;
    color: var(--text);
    text-align: left;
}

.flavour-chip span {
    font-weight: 700;
}

.flavour-chip small {
    grid-column: 1;
    color: var(--muted);
}

.flavour-chip b {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    font-size: 1.2rem;
}

.flavour-demo-save {
    width: 100%;
    margin-top: 18px;
}

.flavour-demo-save:disabled {
    opacity: .45;
    cursor: default;
}

.flavour-save-status {
    min-height: 1.4em;
    margin: 10px 0 0;
    color: #55743e;
    font-size: .88rem;
}

.flavour-mobile-picker {
    display: none;
}

@media (max-width: 820px) {
    .flavour-wheel-layout {
        grid-template-columns: 1fr;
    }

    .flavour-selection-panel {
        position: static;
    }
}

@media (max-width: 640px) {
    .flavour-wheel-page {
        padding-top: 12px;
    }

    .flavour-wheel-stage {
        padding: 18px 14px;
    }

    .flavour-wheel-toolbar {
        padding: 0;
    }

    .flavour-wheel-canvas {
        display: none;
    }

    .flavour-mobile-picker {
        display: grid;
        gap: 14px;
        margin-top: 20px;
    }

    .flavour-mobile-group {
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 13px;
        background: #fff;
    }

    .flavour-mobile-group h3 {
        margin: 0;
        padding: 11px 13px;
        border-left: 7px solid var(--group-colour);
        background: color-mix(in srgb, var(--group-colour) 9%, white);
        font-size: 1rem;
    }

    .flavour-mobile-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 10px;
    }

    .flavour-mobile-option {
        min-height: 46px;
        padding: 9px 10px;
        border: 1px solid var(--line);
        border-radius: 9px;
        background: #fff;
        color: var(--ink);
        font: inherit;
        font-size: .9rem;
        font-weight: 600;
        line-height: 1.2;
        text-align: left;
    }

    .flavour-mobile-option.is-selected {
        border-color: var(--group-colour);
        background: color-mix(in srgb, var(--group-colour) 18%, white);
        box-shadow: inset 4px 0 0 var(--group-colour);
    }

    .flavour-selection-panel {
        padding: 20px;
    }

    .flavour-chip {
        min-height: 48px;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 32px clamp(16px, 5vw, 72px);
    background:
        radial-gradient(circle at top left, rgba(180, 95, 58, 0.08), transparent 32%),
        var(--page);
    color: var(--ink);
    font-family: 'Ubuntu', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

a {
    color: var(--brand);
    font-weight: 700;
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin-top: 0;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1160px;
    margin: 0 auto 18px;
}

.headline {
    display: inline-block;
    margin: 0;
    color: var(--brand);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0;
}

.headline:hover {
    color: var(--accent-hover);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.primary-navigation {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
    margin-right: 22px;
}

.primary-navigation a {
    color: var(--muted);
    font-size: 14px;
}

.primary-navigation a:hover {
    color: var(--accent-hover);
}

.learn-hero {
    padding: clamp(36px, 7vw, 76px) clamp(24px, 7vw, 84px);
    background: var(--brand);
    color: #fff;
}

.learn-hero h1 {
    max-width: 720px;
    margin-bottom: 16px;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.02;
}

.learn-hero > p:last-child {
    max-width: 660px;
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    line-height: 1.6;
}

.learn-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
}

.learn-card {
    display: flex;
    flex-direction: column;
    min-height: 260px;
    padding: 34px;
    background: var(--surface);
}

.learn-card h2 {
    margin-bottom: 12px;
    font-size: 25px;
}

.learn-card > p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.65;
}

.learn-link {
    margin-top: auto;
}

.learn-article {
    max-width: 780px;
    margin: 0 auto;
    padding: clamp(34px, 7vw, 80px) clamp(22px, 6vw, 64px);
}

.learn-article header {
    padding-bottom: 32px;
    border-bottom: 1px solid var(--line);
}

.learn-back {
    display: inline-block;
    margin-bottom: 44px;
}

.learn-article h1 {
    margin-bottom: 18px;
    font-size: clamp(36px, 6vw, 58px);
    line-height: 1.05;
}

.learn-summary {
    color: var(--muted);
    font-size: 20px;
    line-height: 1.55;
}

.article-meta {
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.article-body {
    padding: 34px 0;
    font-size: 18px;
    line-height: 1.75;
}

.article-body p {
    margin-bottom: 1.35em;
}

.article-footer {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.article-footer p {
    color: var(--muted);
}

.navbar-actions form {
    margin: 0;
}

.navbar-actions a,
.navbar-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid rgba(47, 74, 61, 0.18);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.56);
    color: var(--brand);
    font-size: 14px;
}

.navbar-actions .account-icon-button {
    width: 34px;
    min-height: 34px;
    padding: 0;
}

.account-icon-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.container {
    max-width: 1160px;
    min-height: 72vh;
    margin: 0 auto 72px;
    overflow: hidden;
    background-color: var(--surface);
    border: 1px solid rgba(47, 74, 61, 0.08);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

@media screen and (min-width: 1100px) {
    .container:has(> .list-tabs) {
        max-width: 1380px;
    }
}

.container > form {
    margin: 0;
}

.messages {
    display: grid;
    gap: 10px;
    padding: 16px 24px 0;
}

.message {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid rgba(47, 74, 61, 0.18);
    border-radius: 6px;
    background: #eef6f1;
    color: var(--brand);
    font-weight: 700;
}

.message-error {
    border-color: rgba(155, 47, 36, 0.24);
    background: #fff1ed;
    color: #9b2f24;
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 80px;
    padding: 18px 24px;
    background: var(--brand);
    color: #fff;
}

.header-bar > div {
    display: grid;
    gap: 4px;
}

.header-bar .eyebrow {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
}

.header-bar h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.1;
}

.section-header {
    align-items: flex-start;
    min-height: 120px;
    padding: 24px 30px;
}

.section-header h1 {
    font-size: 32px;
}

.section-header .header-description {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 16px;
    line-height: 1.4;
}

.section-header > .button,
.section-header > .header-actions,
.section-header > .header-back-link {
    align-self: center;
}

.header-action-form {
    margin: 0;
}

.header-bar > .header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.header-bar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 6px;
    color: #fff;
}

.header-bar .header-back-link {
    justify-self: start;
    min-height: 0;
    margin-bottom: 8px;
    padding: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
}

.header-bar .header-back-link:hover {
    color: #fff;
}

.header-bar .button,
.header-bar input[type="submit"] {
    min-height: 36px;
    padding: 8px 12px;
    border-color: rgba(255, 255, 255, 0.24);
    background-color: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.header-bar a:hover,
.header-bar .button:hover,
.header-bar input[type="submit"]:hover {
    background-color: rgba(255, 255, 255, 0.13);
    color: #fff;
}

.card-body {
    padding: 24px;
}

.bean-editor-body {
    display: grid;
    gap: 22px;
    background: linear-gradient(180deg, #fff, var(--surface-soft));
}

.form-section {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.form-section-header {
    margin-bottom: 18px;
}

.form-section-header h2 {
    margin: 0;
    color: var(--brand);
    font-size: 18px;
}

.form-section-header p:last-child {
    margin: 8px 0 0;
}

.section-tabs {
    display: none;
}

.tabs-enabled .section-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.section-tabs button {
    min-width: 0;
    min-height: 38px;
    padding: 8px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.section-tabs button[aria-selected="true"] {
    background: var(--brand);
    color: #fff;
}

.section-tabs button:focus-visible {
    outline: 3px solid rgba(180, 95, 58, 0.3);
    outline-offset: 1px;
}

.tabs-enabled .bean-editor-tab-panel[hidden] {
    display: none;
}

.tabs-enabled .bean-detail-tab-panel[hidden] {
    display: none;
}

#bean-core-panel.is-active {
    display: grid;
    gap: 22px;
}

.package-detail-panel {
    width: 100%;
}

.package-reader {
    border-color: rgba(180, 95, 58, 0.28);
    background: #fffaf6;
}

.package-reader-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.package-website-reader {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.package-website-reader > label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-weight: 700;
}

.package-website-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.package-website-controls input,
.package-website-controls .button {
    min-height: 40px;
}

.package-photo-picker {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    margin: 0;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--brand);
    font-weight: 700;
    cursor: pointer;
}

.package-photo-picker:hover {
    border-color: rgba(47, 74, 61, 0.34);
    background: var(--surface-soft);
}

.package-photo-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.package-photo-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.package-photo-choice-grid[hidden] {
    display: none;
}

.package-photo-choice {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.package-photo-choice > img {
    display: block;
    width: 100%;
    height: 220px;
    border-radius: 6px;
    background: var(--surface-soft);
    object-fit: contain;
}

.package-photo-choice fieldset,
.package-photo-mode-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin: 9px 0 0;
    padding: 0;
    border: 0;
}

.package-photo-choice legend,
.package-photo-mode-picker legend {
    width: 100%;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.package-photo-choice label,
.package-photo-mode-picker label {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin: 0;
    font-size: 13px;
    cursor: pointer;
}

.package-original-warning {
    display: none;
    margin: 8px 0 0;
    color: #9a3412;
    font-size: 12px;
}

.package-photo-choice.shows-original .package-original-warning,
.saved-package-photo.shows-original .package-original-warning {
    display: block;
}

.package-extraction-status {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
}

.package-extraction-status p:last-child,
.package-extraction-status ul:last-child,
.package-extraction-status details:last-child {
    margin-bottom: 0;
}

.package-suggestion-details {
    margin-top: 8px;
}

.package-suggestion-details summary {
    color: var(--brand);
    font-weight: 700;
    cursor: pointer;
}

.package-extraction-status ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.package-extraction-status li {
    display: grid;
    grid-template-columns: minmax(90px, auto) minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    padding: 6px 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.58);
}

.package-extraction-status li span:nth-child(2) {
    min-width: 0;
    overflow-wrap: anywhere;
}

.package-confidence {
    padding: 2px 5px;
    border-radius: 999px;
    background: rgba(47, 74, 61, 0.1);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.package-confidence.is-low {
    background: rgba(180, 95, 58, 0.14);
    color: #8b462b;
}

.package-extraction-status.is-success {
    border-color: rgba(47, 74, 61, 0.3);
    background: #eef6f1;
}

.package-extraction-status.is-error {
    border-color: rgba(155, 47, 36, 0.28);
    background: #fff1ed;
    color: #8c2c22;
}

.package-extraction-status.is-working,
.package-extraction-status.is-warning {
    background: #fff8df;
}

input.is-extracted,
textarea.is-extracted,
select.is-extracted {
    border-color: var(--accent);
    background-color: #fff8f2;
    box-shadow: 0 0 0 3px rgba(180, 95, 58, 0.12);
}

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

.form-field {
    min-width: 0;
}

.form-field-full {
    grid-column: 1 / -1;
}

.form-field-wide {
    grid-column: span 2;
}

.form-field-narrow {
    grid-column: span 1;
}

.form-field label,
.rating-form-field label {
    margin-top: 0;
}

.form-field input,
.form-field select,
.form-field textarea {
    display: block;
    width: 100%;
}

.form-field ul.errorlist,
.rating-form-field ul.errorlist {
    margin: 8px 0 0;
    padding-left: 18px;
    color: #9b2f24;
    font-size: 14px;
    font-weight: 700;
}

.rating-form-field {
    margin: 0 0 22px;
}

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

.rating-form-field-full {
    grid-column: 1 / -1;
}

.brew-method-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.brew-method-options > div {
    display: contents;
}

.brew-method-options > div,
.brew-method-options li {
    list-style: none;
}

.brew-method-options ul {
    display: contents;
    margin: 0;
    padding: 0;
}

.brew-method-options label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

.brew-method-options input[type="checkbox"] {
    flex: 0 0 auto;
    accent-color: var(--accent);
}

.method-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.method-suggestions span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
    font-weight: 700;
}

.method-suggestions small {
    color: var(--muted);
    font-size: 12px;
}

.landing-panel {
    display: grid;
    align-content: center;
    gap: 28px;
    min-height: 520px;
    padding: clamp(32px, 7vw, 84px);
    background:
        linear-gradient(135deg, rgba(47, 74, 61, 0.08), transparent 42%),
        var(--surface);
}

.not-found-page {
    display: grid;
    align-content: center;
    gap: 20px;
    min-height: 520px;
    padding: clamp(32px, 7vw, 84px);
    background:
        linear-gradient(135deg, rgba(180, 95, 58, 0.09), transparent 46%),
        var(--surface);
}

.not-found-page h1 {
    max-width: 720px;
    margin-bottom: 0;
    font-size: clamp(34px, 6vw, 58px);
    line-height: 1.04;
}

.landing-panel h1 {
    max-width: 680px;
    margin-bottom: 16px;
    font-size: clamp(34px, 6vw, 64px);
    line-height: 1.04;
}

.landing-copy {
    max-width: 560px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.secondary-button {
    border-color: var(--line);
    background-color: #fff;
    color: var(--brand);
}

.secondary-button:hover {
    border-color: rgba(47, 74, 61, 0.28);
    background-color: var(--surface-soft);
    color: var(--brand-hover);
}

.eyebrow {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

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

.bean-detail {
    display: grid;
    gap: 24px;
}

.bean-detail-title-group {
    min-width: 0;
}

.package-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 180px));
    gap: 10px;
    margin-bottom: 18px;
}

.package-photo-grid a,
.package-photo-grid img {
    display: block;
    width: 100%;
}

.package-photo-grid img {
    aspect-ratio: 4 / 5;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    object-fit: cover;
}

.package-photo-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(80px, 110px));
    margin: 10px 0 14px;
}

.package-summary {
    display: grid;
    grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
    align-items: start;
    gap: 20px;
}

.package-gallery {
    display: grid;
    gap: 8px;
}

.package-photo-main,
.package-photo-main img,
.package-photo-thumbnails a,
.package-photo-thumbnails img {
    display: block;
    width: 100%;
}

.package-photo-trigger {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: zoom-in;
}

.package-photo-trigger:focus-visible {
    outline: 3px solid rgba(180, 95, 58, 0.45);
    outline-offset: 2px;
}

.package-photo-main img {
    aspect-ratio: 4 / 5;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
}

.package-photo-open-label {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 5px 8px;
    border-radius: 99px;
    background: rgba(29, 40, 34, 0.82);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.package-photo-thumbnails {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.package-photo-thumbnails img {
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    object-fit: cover;
}

.package-photo-viewer {
    width: min(94vw, 920px);
    max-width: none;
    height: min(92dvh, 820px);
    max-height: none;
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #18231e;
    color: #fff;
}

.package-photo-viewer::backdrop {
    background: rgba(12, 17, 14, 0.82);
    backdrop-filter: blur(3px);
}

.package-photo-viewer-shell {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 18px 64px;
}

.package-photo-viewer figure {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px;
    min-width: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

.package-photo-viewer figure img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    min-height: 0;
    border-radius: 8px;
    object-fit: contain;
    touch-action: pan-y;
}

.package-photo-viewer figcaption {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    text-align: center;
}

.package-photo-viewer button {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.package-photo-viewer button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.package-photo-viewer-close {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
}

.package-photo-viewer-nav {
    position: absolute;
    z-index: 2;
    top: 50%;
    width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 50%;
    font-size: 20px;
    transform: translateY(-50%);
}

.package-photo-viewer-nav.is-previous {
    left: 12px;
}

.package-photo-viewer-nav.is-next {
    right: 12px;
}

.has-open-photo-viewer {
    overflow: hidden;
}

.package-facts {
    align-content: start;
}

.saved-package-photos {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.saved-package-photos h3 {
    margin-bottom: 0;
    color: var(--brand);
    font-size: 15px;
}

.saved-package-photo {
    display: grid;
    gap: 7px;
}

.saved-package-photo label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.saved-package-photo input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    margin: 0;
}

.package-photo-remove-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #8c2c22;
    font-size: 14px;
}

.package-photo-remove-option input {
    width: auto;
    margin: 0;
}

.bean-detail-header h1 {
    margin-bottom: 0;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.1;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: 18px;
}

.detail-section {
    min-height: 132px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background-color: var(--surface-soft);
}

.detail-section h2 {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.rating-summary .star-rating {
    font-size: 24px;
}

.rating-total,
.calculated-rating {
    margin-bottom: 10px;
    color: var(--muted);
    font-weight: 700;
}

.rating-breakdown {
    margin-top: 16px;
    padding-left: 16px;
    border-left: 2px solid var(--line);
}

.rating-breakdown summary {
    color: var(--brand);
    cursor: pointer;
    font-weight: 700;
}

.sub-rating-fields {
    margin-top: 12px;
}

.sub-rating-fields p {
    margin-bottom: 12px;
}

.sub-rating-list {
    display: grid;
    gap: 10px;
    margin: 14px 0 0;
}

.sub-rating-list div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.sub-rating-list dt {
    color: var(--muted);
    font-weight: 700;
}

.sub-rating-list dd {
    margin: 0;
}

.bean-facts dl {
    display: grid;
    gap: 12px;
    margin: 0;
}

.bean-facts div {
    display: grid;
    gap: 3px;
}

.bean-facts dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.bean-facts dd {
    margin: 0;
}

.personal-brew-details {
    display: grid;
    gap: 18px;
    margin: 0 0 22px;
}

.personal-brew-details div {
    display: grid;
    gap: 6px;
}

.personal-brew-details dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.personal-brew-details dd {
    margin: 0;
}

.average-brew-methods {
    margin-top: 18px;
}

.average-brew-methods h3,
.personal-rating h3 {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.personal-rating {
    grid-column: 1 / -1;
}

.personal-rating-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: 18px;
}

.personal-rating-main {
    display: grid;
    gap: 16px;
}

.personal-rating-main p {
    margin-bottom: 0;
    line-height: 1.55;
}

.personal-rating-side {
    display: grid;
    align-content: start;
    gap: 18px;
}

.personal-rating-total {
    display: grid;
    gap: 6px;
}

.personal-rating .rating-breakdown {
    margin-top: 20px;
}

.readonly-slider {
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr) auto;
    gap: 10px;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
}

.readonly-slider input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

.readonly-slider input[type="range"]:disabled {
    cursor: default;
    opacity: 0.85;
}

.bean-reviews {
    grid-column: 1 / -1;
}

.bean-reviews details {
    margin: 0;
}

.bean-reviews summary {
    color: var(--brand);
    cursor: pointer;
    font-weight: 700;
}

.review-list {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.review-item {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.review-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.36fr);
    gap: 16px;
    align-items: start;
}

.review-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.review-copy p {
    margin-bottom: 0;
    line-height: 1.55;
}

.review-rating-breakdown {
    margin-top: 0;
}

.review-detail-stack {
    display: grid;
    gap: 10px;
}

.review-brew-details {
    gap: 8px;
    margin: 14px 0 0;
}

.compact-form-heading {
    margin: 8px 0 0;
}

.compact-form-heading h3 {
    margin: 0;
    color: var(--brand);
    font-size: 16px;
}

.compact-form-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

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

.recipe-form-grid p {
    margin: 0;
}

.recipe-form-grid input {
    width: 100%;
}

.brew-tracker {
    width: 100%;
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.brew-tracker-page {
    display: grid;
    gap: 22px;
}

.brew-tracker-intro {
    width: min(100%, 1120px);
    max-width: 1120px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.6;
}

.brew-method-label {
    padding: 0 !important;
    background: transparent !important;
    color: inherit !important;
    text-align: center !important;
}

.brew-method-icon {
    display: inline-block;
    width: 25px;
    height: 25px;
    color: var(--brand);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
}

.brew-method-legend {
    width: min(100%, 1120px);
    margin: 0 auto;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
}

.brew-method-legend summary {
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.brew-method-legend-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 18px;
    margin-top: 14px;
}

.brew-method-legend-grid span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.brew-method-legend-grid .brew-method-icon {
    flex: 0 0 auto;
}

.brew-icon-alternatives {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.brew-icon-alternatives > div {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.brew-icon-alternatives strong {
    width: 100%;
    color: var(--brand);
    font-size: 12px;
}

.brew-icon-alternatives span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}

.brew-tracker-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.brew-tracker-heading p {
    margin: 4px 0 0;
}

.brew-attempt-list {
    --brew-tracker-columns: 150px 82px 52px 54px 70px 54px 54px 70px 44px 72px;
    display: grid;
    gap: 10px;
    width: min(100%, 1120px);
    margin: 0 auto;
    overflow-x: auto;
}

.brew-attempt,
.brew-attempt-columns {
    display: grid;
    grid-template-columns: var(--brew-tracker-columns);
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 820px;
}

.brew-attempt-columns a {
    color: inherit;
}

.brew-sort-shortcuts {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: min(100%, 1120px);
    margin: -8px auto 0;
    color: var(--muted);
    font-size: 13px;
}

.brew-sort-shortcuts a {
    padding: 5px 8px;
    border-radius: 5px;
    color: var(--muted);
}

.brew-sort-shortcuts a.is-active {
    background: var(--surface-soft);
    color: var(--brand);
}

.brew-bean-filter {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 auto 0 0;
}

.brew-bean-filter label {
    margin: 0;
    font-size: 12px;
}

.brew-bean-filter select {
    width: min(230px, 38vw);
    min-height: 32px;
    padding: 4px 28px 4px 8px;
    font-size: 13px;
}

.best-column {
    color: var(--accent);
    text-align: center;
}

.brew-attempt {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-soft);
}

.brew-attempt-columns {
    padding: 0 16px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.brew-attempt-columns span,
.brew-attempt > span,
.brew-attempt > time,
.brew-attempt > a,
.brew-attempt > form {
    min-width: 0;
    text-align: left;
}

.brew-attempt-columns span:last-child {
    text-align: center;
}

.brew-attempt > span,
.brew-attempt > time {
    white-space: nowrap;
}

.brew-attempt > span:nth-child(3) {
    overflow: hidden;
    text-overflow: ellipsis;
}

.brew-attempt-bean {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.brew-attempt-bean a,
.brew-attempt-note {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.current-best-label {
    padding: 3px 7px;
    border-radius: 99px;
    background: rgba(180, 95, 58, 0.12);
    color: var(--accent-hover);
    font-size: 11px;
    font-weight: 700;
}

.current-best-dot {
    flex: 0 0 auto;
    color: var(--accent);
    font-size: 11px;
    white-space: nowrap;
}

.brew-attempt > time {
    color: var(--muted);
    font-size: 12px;
}

.row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 23px;
    padding: 2px 6px;
    border: 1px solid rgba(47, 74, 61, 0.2);
    border-radius: 5px;
    background: #fff;
    white-space: nowrap;
    font-size: 11px;
}

.brew-attempt-actions {
    display: grid;
    align-self: center;
    gap: 3px;
}

.brew-attempt .brew-attempt-actions form {
    width: 100%;
    margin: 0;
}

.brew-attempt-actions .row-action {
    width: 100%;
}

.brew-attempt-actions button.row-action {
    color: #a43d32;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}

.row-action:hover {
    border-color: rgba(180, 95, 58, 0.45);
    background: var(--surface-soft);
}

.brew-attempt.is-current-best {
    border-color: rgba(180, 95, 58, 0.4);
}

.brew-attempt-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.brew-attempt-title span {
    padding: 3px 7px;
    border-radius: 99px;
    background: rgba(180, 95, 58, 0.12);
    color: var(--accent-hover);
    font-size: 11px;
    font-weight: 700;
}

.brew-attempt-title time {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
}

.brew-attempt dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.brew-attempt dl div {
    display: grid;
    gap: 3px;
}

.brew-attempt dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.brew-attempt dd {
    margin: 0;
}

.brew-attempt > p {
    margin: 14px 0 0;
    line-height: 1.55;
}

.brew-attempt form {
    margin-top: 12px;
}

.brew-attempt-form-grid input:not([type="checkbox"]),
.brew-attempt-form-grid select,
.brew-attempt-form-grid textarea {
    width: 100%;
}

.settings-section + .settings-section {
    margin-top: 30px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.settings-section h2 {
    color: var(--brand);
}

.brew-attempt-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 26px;
    align-items: start;
}

.brew-attempt-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brew-attempt-field > label {
    display: flex;
    align-items: flex-end;
    min-height: 44px;
    margin-top: 0;
}

.brew-attempt-field .helptext {
    min-height: 42px;
}

.brew-attempt-field-notes {
    grid-column: 1 / -1;
}

.brew-attempt-field-is_current_best {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
}

.brew-attempt-field-is_current_best > label {
    min-height: 0;
    margin: 0;
}

.brew-attempt-field-is_current_best input {
    order: -1;
    width: auto;
}

.review-brew-details .readonly-slider {
    grid-template-columns: 44px minmax(90px, 150px) 30px;
    gap: 8px;
    justify-content: start;
}

.review-brew-details .readonly-slider span:first-child {
    text-align: right;
}

.review-rating-breakdown .sub-rating-list {
    gap: 4px;
    margin-top: 8px;
}

.review-rating-breakdown .sub-rating-list div {
    gap: 8px;
}

.review-rating-breakdown .star-rating {
    letter-spacing: -1px;
}

.button,
button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: 6px;
    background-color: var(--brand);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 10px 14px;
    text-decoration: none;
}

.button:hover,
button:hover,
input[type="submit"]:hover {
    background-color: var(--brand-hover);
    color: #fff;
}

.button.danger-button,
.danger-link {
    border-color: rgba(185, 28, 28, 0.28);
    background-color: #b91c1c;
    color: #fff;
}

.button.danger-button:hover,
.danger-link:hover {
    background-color: #991b1b;
    color: #fff;
}

#search-add-wrapper {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    background-color: var(--surface-soft);
    border-bottom: 1px solid var(--line);
}

.list-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    background-color: var(--surface-soft);
    border-bottom: 1px solid var(--line);
}

.list-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background-color: #fff;
    color: var(--muted);
}

.list-tabs a:hover {
    border-color: rgba(47, 74, 61, 0.28);
    color: var(--brand);
}

.list-tabs a.active {
    border-color: var(--brand);
    background-color: var(--brand);
    color: #fff;
    box-shadow: 0 8px 18px rgba(47, 74, 61, 0.18);
}

.list-tabs a.active:hover {
    color: #fff;
}

@media screen and (max-width: 900px) {
    .navbar {
        flex-wrap: wrap;
        gap: 10px 14px;
    }

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

    .navbar-actions {
        flex: 0 0 auto;
        margin-left: auto;
    }

    .primary-navigation {
        order: 3;
        flex-wrap: wrap;
        width: 100%;
        margin: 0;
    }

    .list-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }

    .list-tabs a {
        justify-content: center;
        min-width: 0;
        text-align: center;
        white-space: normal;
    }
}

#bean-search-form {
    display: flex;
    align-items: end;
    flex: 1;
    gap: 10px;
    margin: 0;
}

.search-field {
    position: relative;
    display: flex;
    align-items: center;
    width: min(460px, 100%);
}

.search-field input,
.roast-filter select {
    height: 40px;
    min-height: 40px;
}

.search-field input,
.roast-filter select {
    padding-top: 7px;
    padding-bottom: 7px;
}

.roast-filter {
    display: grid;
    flex: 0 0 180px;
    gap: 3px;
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.roast-filter select {
    min-height: 40px;
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 14px;
    letter-spacing: normal;
    text-transform: none;
}

.bean-duplicate-warning {
    margin-top: 9px;
    padding: 10px 12px;
    border: 1px solid #d6a55c;
    border-radius: 6px;
    background: #fff6e8;
    color: var(--ink);
    font-size: 13px;
}

.bean-duplicate-warning ul {
    margin: 7px 0 0;
    padding-left: 20px;
}

.brew-method-picker {
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-soft);
}

.brew-method-picker summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    padding: 10px 12px;
    color: var(--brand);
    cursor: pointer;
    font-weight: 700;
}

.brew-method-picker-value {
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brew-method-picker-options {
    padding: 4px 12px 12px;
    border-top: 1px solid var(--line);
}

.brew-method-picker-options > div {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    padding-top: 10px;
}

.brew-method-picker-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
}

.brew-method-picker-options input[type="checkbox"] {
    flex: 0 0 auto;
    width: 17px;
    min-height: 17px;
    margin: 0;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background-color: #fff;
    color: var(--ink);
    font: inherit;
    padding: 11px 12px;
    outline: none;
}

select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 12px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 34px;
}

.helptext {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
}

.password-help ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.password-help li + li {
    margin-top: 4px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.rating-delete-action {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.form-footer-link {
    margin: 16px 0 0;
    color: var(--muted);
}

.form-errors,
.field-errors {
    margin-top: 8px;
    color: #9b2f24;
    font-size: 14px;
    font-weight: 700;
}

.field-errors ul,
.form-errors ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

.grind-slider {
    accent-color: var(--accent);
    padding-right: 0;
    padding-left: 0;
}

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

input[type="search"] {
    min-height: 40px;
    padding-top: 8px;
    padding-bottom: 8px;
    padding-right: 38px;
}

input[type="search"]::-webkit-search-cancel-button {
    appearance: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(47, 74, 61, 0.52);
    box-shadow: 0 0 0 3px rgba(47, 74, 61, 0.12);
}

.search-clear {
    position: absolute;
    right: 8px;
    width: 26px;
    height: 26px;
    min-height: 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: transparent;
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
}

.search-clear:hover {
    background-color: rgba(47, 74, 61, 0.1);
    color: var(--ink);
}

.search-clear[hidden] {
    display: none;
}

#add-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    min-height: 38px;
    margin-bottom: 1px;
    padding: 0 12px;
    border-radius: 6px;
    background-color: var(--accent);
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
}

#add-link:hover {
    background-color: var(--accent-hover);
    color: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.task-item-wrapper th,
.task-item-wrapper td {
    padding: 15px 16px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
}

.task-item-wrapper th {
    height: 64px;
    padding-top: 10px;
    padding-bottom: 10px;
    background-color: #fff;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.2;
    text-transform: uppercase;
}

.task-item-wrapper th a {
    color: inherit;
}

.task-item-wrapper tbody tr {
    background-color: #fff;
    transition: background-color 120ms ease;
}

.task-item-wrapper tbody tr:hover {
    background-color: #fbf2ec;
}

@media screen and (min-width: 769px) and (max-width: 1199px) {
    .task-item-wrapper {
        table-layout: auto;
    }

    .task-item-wrapper colgroup,
    .task-item-wrapper th:nth-child(4),
    .task-item-wrapper td:nth-child(4) {
        display: none;
    }

    .task-item-wrapper th,
    .task-item-wrapper td {
        padding-right: 10px;
        padding-left: 10px;
    }
}

.task-title {
    min-width: 0;
}

.bean-title-cell {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.bean-title-cell > a {
    flex: 0 1 auto;
    min-width: 0;
}

.bean-new-badge {
    flex: 0 0 auto;
    padding: 3px 6px;
    border-radius: 4px;
    background: #f7dfd2;
    color: #7d351b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    text-transform: uppercase;
}

.favorite-form {
    flex: 0 0 auto;
    margin: 0;
}

.favorite-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border-color: var(--line);
    border-radius: 50%;
    background: #fff;
    color: #9b8f7e;
    line-height: 1;
}

.favorite-icon {
    display: block;
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    background: url("favicon.svg") center / contain no-repeat;
    filter: grayscale(1) opacity(0.48);
}

.favorite-button:hover,
.favorite-button.is-active {
    border-color: rgba(180, 95, 58, 0.34);
    background: #fff5ed;
    color: var(--accent);
}

.favorite-button:hover .favorite-icon,
.favorite-button.is-active .favorite-icon {
    filter: none;
}

.favorite-button.is-active {
    border-color: var(--accent);
    background: #f7dfd2;
    box-shadow: inset 0 0 0 2px rgba(180, 95, 58, 0.16);
}

.task-title a,
.task-item-wrapper td a,
.table-truncate {
    display: block;
    overflow: hidden;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-item-wrapper td a:hover {
    color: var(--accent-hover);
}

.star-rating {
    color: var(--star);
    font-size: 18px;
    white-space: nowrap;
}

.star {
    margin-right: 1px;
    color: #d7d0c5;
}

.star.filled {
    color: var(--star);
}

.compact-stars {
    font-size: 16px;
}

.fractional-stars {
    position: relative;
    display: inline-block;
    color: #d7d0c5;
    font-size: 24px;
    line-height: 1;
    white-space: nowrap;
}

.fractional-stars-fill {
    position: absolute;
    inset: 0 auto 0 0;
    overflow: hidden;
    color: var(--star);
    white-space: nowrap;
}

.fractional-stars.compact-stars {
    font-size: 18px;
}

.star-select {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.star-input-row {
    display: grid;
    grid-template-columns: 150px minmax(180px, 1fr);
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.star-input-row label {
    margin: 0;
}

.star-input {
    display: inline-flex;
    gap: 2px;
}

.star-choice {
    min-height: 0;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: #d7d0c5;
    font-size: 26px;
    line-height: 1;
}

.star-choice:hover,
.star-choice:focus,
.star-choice.is-selected {
    background: transparent;
    color: var(--star);
}

.pagination {
    padding: 18px 24px 24px;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.pagination .step-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.pagination a {
    margin-right: 0;
}

.pagination .page-number {
    display: inline-flex;
    min-width: 34px;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    text-decoration: none;
}

.pagination .page-number.is-current {
    border-color: var(--accent);
    color: var(--accent-hover);
    font-weight: 700;
}

.page-size-control {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.page-size-control select {
    min-width: 64px;
    padding: 6px 8px;
}

.legal-page {
    display: grid;
    gap: 28px;
    max-width: 820px;
    line-height: 1.65;
}

.legal-page section {
    display: grid;
    gap: 10px;
}

.legal-page h2 {
    margin: 0;
    color: var(--brand);
    font-size: 20px;
}

.legal-page p {
    margin-bottom: 0;
}

.legal-definition-list {
    display: grid;
    gap: 14px;
    margin: 0;
}

.legal-definition-list div {
    display: grid;
    gap: 4px;
}

.legal-definition-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.legal-definition-list dd {
    margin: 0;
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 48px 18px;
    text-align: center;
}

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

.empty-state p {
    max-width: 520px;
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

label {
    display: block;
    margin: 14px 0 6px;
    color: var(--muted);
    font-weight: 700;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    max-width: 1160px;
    margin: 0 auto;
    padding: 72px 0 32px;
    color: var(--muted);
    font-size: 13px;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 42px;
}

.site-footer a {
    color: var(--muted);
}

.task-complete-icon,
.task-incomplete-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.task-complete-icon {
    background-color: var(--brand);
}

.task-incomplete-icon {
    border: 1px solid var(--line);
    background-color: #fff;
}

.delete-link:hover {
    color: #a43d32;
}

@media screen and (max-width: 768px) {
    body {
        padding: 12px;
    }

    .navbar {
        margin-bottom: 12px;
    }

    .headline {
        font-size: 24px;
    }

    .primary-navigation {
        order: 3;
        width: 100%;
        margin: 4px 0 0;
    }

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

    .recipe-form-grid {
        grid-template-columns: 1fr;
    }

    .brew-tracker-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .brew-attempt-form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .brew-tracker-page {
        padding-right: 14px;
        padding-left: 14px;
    }

    .brew-attempt-list {
        width: 100%;
        min-width: 0;
        margin: 0;
        padding-bottom: 0;
        overflow: visible;
    }

    .brew-method-legend-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .brew-icon-alternatives {
        grid-template-columns: 1fr;
    }

    .brew-attempt-columns {
        display: none;
    }

    .brew-attempt {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "bean bean"
            "method grinder"
            "in out"
            "ratio time"
            "temperature best"
            "actions actions";
        gap: 12px 16px;
        width: 100%;
        min-width: 0;
        padding: 14px;
    }

    .brew-attempt-bean {
        grid-area: bean;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--line);
        font-size: 18px;
    }

    .brew-attempt > span {
        display: grid;
        gap: 4px;
        white-space: normal;
    }

    .brew-attempt > span::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .brew-attempt > span:nth-child(2) {
        grid-area: method;
    }

    .brew-attempt > .brew-method-label {
        justify-items: start;
        text-align: left !important;
    }

    .brew-attempt > span:nth-child(3) {
        grid-area: grinder;
        overflow: visible;
        text-overflow: clip;
    }

    .brew-attempt > span:nth-child(4) {
        grid-area: in;
    }

    .brew-attempt > span:nth-child(5) {
        grid-area: out;
    }

    .brew-attempt > span:nth-child(6) {
        grid-area: ratio;
    }

    .brew-attempt > span:nth-child(7) {
        grid-area: time;
    }

    .brew-attempt > span:nth-child(8) {
        grid-area: temperature;
    }

    .brew-attempt > span:nth-child(9) {
        grid-area: best;
    }

    .brew-sort-shortcuts {
        flex-wrap: wrap;
        justify-content: flex-start;
        margin-top: 0;
    }

    .brew-bean-filter {
        width: 100%;
    }

    .brew-bean-filter select {
        width: 100%;
    }

    .brew-attempt-actions {
        grid-area: actions;
        align-self: stretch;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        padding-top: 10px;
        border-top: 1px solid var(--line);
    }

    .brew-attempt .brew-attempt-actions form {
        display: flex;
        height: 100%;
        margin: 0;
    }

    .brew-attempt-actions .row-action,
    .brew-attempt-actions button.row-action {
        min-height: 40px;
        padding: 8px 6px;
        font-size: 13px;
        line-height: 1;
    }

    .brew-attempt-actions button.row-action {
        height: 100%;
    }

    .brew-attempt-field-notes,
    .brew-attempt-field-is_current_best {
        grid-column: auto;
    }

    .brew-attempt-field > label,
    .brew-attempt-field .helptext {
        min-height: 0;
    }

    .container {
        min-height: 68vh;
        margin-bottom: 56px;
    }

    .header-bar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        min-height: 76px;
        padding: 18px;
    }

    .header-bar:has(> a:first-child:last-child),
    .header-bar:has(> a:first-child + a:last-child),
    .header-bar:has(> a:first-child + input:last-child),
    .header-bar:has(> a:first-child + .header-actions:last-child) {
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 10px;
    }

    .header-bar > a,
    .header-bar input[type="submit"] {
        min-height: 40px;
    }

    .header-bar h1 {
        font-size: 22px;
    }

    .section-header {
        align-items: flex-start;
        flex-direction: row;
        min-height: 112px;
        padding: 20px 18px;
    }

    .section-header h1 {
        font-size: 26px;
    }

    .package-photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .package-summary {
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 14px;
    }

    .package-photo-main img {
        border-radius: 7px;
    }

    .package-photo-thumbnails {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .package-photo-viewer {
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
    }

    .package-photo-viewer-shell {
        padding: 58px 48px 16px;
    }

    .package-photo-viewer-nav {
        width: 36px;
        min-height: 44px;
    }

    .package-photo-viewer-nav.is-previous {
        left: 6px;
    }

    .package-photo-viewer-nav.is-next {
        right: 6px;
    }

    .package-facts {
        gap: 9px;
    }

    .section-header .header-description {
        font-size: 14px;
    }

    .section-header > .button {
        flex: 0 0 auto;
        min-height: 36px;
        padding: 8px 10px;
        font-size: 13px;
    }

    .card-body {
        padding: 18px;
    }

    .bean-editor-body {
        gap: 16px;
    }

    #bean-core-panel.is-active {
        gap: 16px;
    }

    .section-tabs button {
        min-height: 36px;
        padding: 7px 8px;
        font-size: 13px;
    }

    .form-section {
        padding: 16px;
    }

    .package-reader-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .package-photo-picker,
    .package-reader-controls .button {
        justify-content: center;
        width: 100%;
    }

    .package-website-controls {
        grid-template-columns: 1fr;
    }

    .package-website-controls .button {
        width: 100%;
    }

    .package-extraction-status ul {
        grid-template-columns: 1fr;
    }

    .package-extraction-status li {
        grid-template-columns: minmax(76px, auto) minmax(0, 1fr) auto;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .form-grid > .form-field,
    .form-grid > .form-field-full,
    .form-grid > .form-field-wide,
    .form-grid > .form-field-narrow {
        grid-column: 1 / -1;
        width: 100%;
    }

    .tasting-form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .landing-panel,
    .not-found-page {
        min-height: 470px;
        padding: 28px 18px;
    }

    .landing-panel h1,
    .not-found-page h1 {
        font-size: 36px;
    }

    .landing-copy {
        font-size: 16px;
    }

    #search-add-wrapper {
        align-items: stretch;
        flex-direction: column;
        padding: 16px 18px;
    }

    #bean-search-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }

    .roast-filter {
        width: 100%;
    }

    .brew-method-picker-options > div {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .brew-method-picker-value {
        max-width: 58%;
    }

    .list-tabs {
        padding-right: 18px;
        padding-left: 18px;
    }

    .list-tabs a {
        white-space: normal;
    }

    .search-field {
        width: 100%;
    }

    #add-link {
        align-self: flex-end;
        justify-content: center;
        width: auto;
        height: 38px;
        min-height: 38px;
        margin-bottom: 0;
        padding: 7px 11px;
        font-size: 13px;
    }

    .task-item-wrapper,
    .task-item-wrapper thead,
    .task-item-wrapper tbody,
    .task-item-wrapper tr,
    .task-item-wrapper td {
        display: block;
        width: 100%;
    }

    .task-item-wrapper thead {
        display: none;
    }

    .task-item-wrapper tr {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin: 8px 10px 0;
        width: auto;
        padding: 6px;
        border: 1px solid var(--line);
        border-radius: 8px;
        overflow: hidden;
    }

    .task-item-wrapper td {
        display: flex;
        align-items: flex-start;
        flex-direction: column;
        justify-content: flex-start;
        gap: 2px;
        width: auto;
        min-width: 0;
        padding: 5px 7px;
        border-bottom: 0;
        font-size: 13px;
        white-space: normal;
    }

    .task-item-wrapper td::before {
        content: attr(data-label);
        flex: none;
        color: var(--muted);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.04em;
        line-height: 1.1;
        text-transform: uppercase;
    }

    .task-item-wrapper .bean-location {
        display: none;
    }

    .task-item-wrapper .task-title {
        grid-column: 1 / -1;
        padding: 6px 7px 8px;
        border-bottom: 1px solid var(--line);
        font-size: 16px;
    }

    .task-item-wrapper .task-title::before {
        display: none;
    }

    .task-item-wrapper td[colspan] {
        grid-column: 1 / -1;
        display: block;
    }

    .task-item-wrapper td[colspan]::before {
        display: none;
    }

    .task-title a,
    .task-item-wrapper td a {
        min-width: 0;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .bean-title-cell {
        justify-content: flex-start;
        flex-wrap: wrap;
        width: 100%;
        text-align: left;
    }

    .favorite-button {
        width: 28px;
        min-width: 28px;
        height: 28px;
        min-height: 28px;
    }

    .favorite-icon {
        width: 16px;
        height: 16px;
    }

    .fractional-stars.compact-stars {
        font-size: 15px;
    }

    .site-footer {
        align-items: center;
        flex-direction: column;
        flex-wrap: wrap;
        justify-content: center;
        gap: 22px;
        margin-top: 0;
        padding: 56px 0 32px;
        text-align: center;
    }

    .site-footer nav {
        justify-content: center;
        gap: 28px;
        width: 100%;
    }

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

    .personal-rating-grid {
        grid-template-columns: 1fr;
    }

    .review-content {
        grid-template-columns: 1fr;
    }

    .review-rating-breakdown {
        padding-top: 12px;
        padding-left: 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .star-input-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .star-input {
        justify-content: space-between;
        width: 100%;
    }

    .star-choice {
        font-size: 30px;
    }

    .brew-method-options label {
        width: 100%;
    }
}
.signup-honeypot {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.staff-tools {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.security-dashboard {
    padding: 36px 48px 56px;
}

.security-periods {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.security-periods a {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
}

.security-periods a.active {
    border-color: var(--brand);
    background: var(--brand);
    color: white;
}

.security-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.security-insights-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.security-insights-grid article {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border-left: 4px solid var(--accent);
    border-radius: 0 12px 12px 0;
    background: var(--surface-soft);
}

.security-insights-grid span,
.security-insights-grid small {
    color: var(--muted);
}

.security-insights-grid strong {
    overflow-wrap: anywhere;
    color: var(--brand);
    font-size: 1.3rem;
}

.security-summary-grid article,
.security-panel {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.security-summary-grid article {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
}

.security-summary-grid span,
.security-summary-grid small {
    color: var(--muted);
}

.security-summary-grid strong {
    color: var(--brand);
    font-size: 2rem;
}

.security-dashboard-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 20px;
}

.security-secondary-grid {
    margin-top: 20px;
}

.security-unconfirmed-panel {
    margin-top: 20px;
}

.security-trend-panel,
.security-unconfirmed-panel,
.traffic-overview-panel {
    margin-bottom: 20px;
}

.traffic-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.traffic-summary-grid > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    border-radius: 10px;
    background: var(--surface);
}

.traffic-summary-grid span {
    color: var(--muted);
}

.traffic-summary-grid strong {
    color: var(--brand);
    font-size: 1.4rem;
}

.traffic-bar span {
    background: var(--brand);
}

.traffic-detail-grid {
    margin-bottom: 20px;
}

.security-panel-heading h2,
.security-panel-heading p {
    margin-bottom: 0;
}

.security-trend {
    display: grid;
    grid-template-columns: repeat(14, minmax(22px, 1fr));
    gap: 8px;
    align-items: end;
    min-height: 170px;
    margin-top: 20px;
}

.security-trend > div {
    display: grid;
    grid-template-rows: 22px 100px 20px;
    gap: 5px;
    min-width: 0;
    text-align: center;
}

.security-trend-value,
.security-trend small {
    color: var(--muted);
    font-size: .72rem;
}

.security-trend-bar {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    border-radius: 7px;
    background: var(--surface);
}

.security-trend-bar span {
    width: 100%;
    min-height: 2px;
    border-radius: 7px 7px 0 0;
    background: var(--accent);
}

.security-account-list {
    display: grid;
}

.security-account-list > div {
    display: grid;
    grid-template-columns: minmax(180px, 1.2fr) minmax(150px, .8fr) minmax(150px, .8fr);
    gap: 18px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.security-account-list span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.security-account-list span:not(:first-child) {
    color: var(--muted);
}

.security-panel {
    min-width: 0;
    padding: 24px;
}

.security-panel h2 {
    margin-top: 0;
}

.security-stat-row {
    margin-top: 16px;
}

.security-stat-row > div,
.security-ranking li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.security-stat-bar {
    display: block;
    height: 7px;
    margin-top: 7px;
    overflow: hidden;
    border-radius: 99px;
    background: var(--line);
}

.security-stat-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.security-ranking {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.security-ranking span,
.security-events-list p {
    min-width: 0;
    overflow-wrap: anywhere;
}

.security-events-panel {
    margin-top: 20px;
}

.security-events-list {
    display: grid;
    gap: 0;
}

.security-events-list article {
    display: grid;
    grid-template-columns: minmax(180px, .8fr) minmax(0, 1.5fr);
    gap: 24px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.security-events-list article > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.security-events-list article span,
.security-events-list p {
    color: var(--muted);
}

.security-event-details dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 20px;
    margin: 0;
}

.security-event-details dl > div {
    min-width: 0;
}

.security-event-details dt {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.security-event-details dd {
    margin: 3px 0 0;
    overflow-wrap: anywhere;
}

.security-event-details details {
    margin-top: 12px;
}

.security-event-details summary {
    color: var(--brand);
    cursor: pointer;
    font-weight: 700;
}

.security-event-details details p {
    margin: 8px 0 0;
    overflow-wrap: anywhere;
}

@media (max-width: 800px) {
    .security-dashboard {
        padding: 24px 18px 40px;
    }

    .security-summary-grid,
    .security-dashboard-grid,
    .security-insights-grid {
        grid-template-columns: 1fr 1fr;
    }

    .security-dashboard-grid .security-panel:first-child {
        grid-column: 1 / -1;
    }

    .security-secondary-grid .security-panel:first-child {
        grid-column: auto;
    }

    .security-trend {
        gap: 4px;
    }

    .security-trend small {
        font-size: .6rem;
        transform: rotate(-45deg);
    }

    .security-account-list > div {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}

@media (max-width: 520px) {
    .security-summary-grid,
    .security-dashboard-grid,
    .security-insights-grid {
        grid-template-columns: 1fr;
    }

    .security-dashboard-grid .security-panel:first-child {
        grid-column: auto;
    }

    .security-events-list article {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .security-event-details dl {
        grid-template-columns: 1fr;
    }

    .traffic-summary-grid {
        grid-template-columns: 1fr;
    }
}
