:root {
    --forest: #2e6f40;
    --bright: #54b84d;
    --line: #d8e3da;
    --pale: #f1f6f1;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: #000;
    background: #fff;
    font: 16px/1.5 Arial, sans-serif;
}

header {
    display: flex;
    align-items: center;
    gap: 24px;
    background: var(--forest);
    color: #fff;
    padding: 28px 38px;
    border-bottom: 4px solid var(--bright);
}

header strong {
    font: 700 36px Georgia, 'Times New Roman', serif;
}

header p {
    margin: 6px 0 0;
    font-size: 14px;
}

.logo {
    height: 76px;
    width: 76px;
    border: 1px solid #a7c8ac;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-family: Georgia, serif;
}

.layout {
    display: flex;
    min-height: calc(100vh - 216px);
}

aside {
    flex: 0 0 250px;
    background: var(--pale);
    border-right: 1px solid var(--line);
    padding: 30px 20px;
}

aside nav a {
    display: block;
    padding: 12px;
    margin: 8px 0;
    border-radius: 6px;
}

a {
    color: var(--forest);
}

aside nav a:hover {
    background: #fff;
}

main {
    padding: 30px 48px 60px;
    flex: 1;
    min-width: 0;
    max-width: 1400px;
}

.eyebrow, .crumb {
    font-size: 12px;
    letter-spacing: .06em;
}

.crumb {
    margin-bottom: 22px;
}

h1 {
    font: 700 28px Georgia, serif;
    margin: 0 0 22px;
}

h2 {
    font-size: 17px;
    color: var(--forest);
    margin: 0 0 18px;
}

.section {
    border-top: 1px solid var(--line);
    padding: 24px 0;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

input, textarea {
    font: inherit;
    border: 1px solid #9bad9e;
    border-radius: 5px;
    padding: 10px 12px;
    background: #fff;
    width: 100%;
    max-width: 720px;
}

input:focus, textarea:focus, button:focus-visible, a:focus-visible {
    outline: 3px solid #91c98b;
    outline-offset: 2px;
}

input[readonly] {
    background: #f3f3f3;
    color: #444;
}

button, .button {
    font: inherit;
    border: 1px solid #aab3ac;
    border-radius: 7px;
    background: #f1f1f1;
    color: #1b3020;
    padding: 9px 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

button:hover, .button:hover {
    background: #e2e9e3;
}

button:active {
    transform: translateY(1px);
}

button.primary {
    background: var(--forest);
    color: #fff;
    border-color: var(--forest);
}

button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.row {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}

.grow {
    flex: 1;
    min-width: 240px;
    max-width: 720px;
}

.row input {
    width: 100%;
}

.hint, small {
    font-size: 13px;
    color: #46594b;
}

.notice, .error, .success {
    padding: 13px 16px;
    border-left: 4px solid var(--forest);
    background: var(--pale);
    margin: 16px 0;
}

.error {
    border-color: #a22020;
    background: #fff2f2;
}

.success {
    border-color: var(--bright);
}

.staged {
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.staged span {
    flex: 1;
    overflow-wrap: anywhere;
}

.staged button {
    font-size: 13px;
    padding: 5px 10px;
}

.staged input[type=radio] {
    width: auto;
}

.staged label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 13px;
}

.checks {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.check input {
    width: auto;
}

.check label {
    margin: 0;
}

.actions {
    display: flex;
    gap: 12px;
    padding: 24px 0;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.card {
    border: 1px solid var(--line);
    border-top: 4px solid var(--bright);
    padding: 24px;
    border-radius: 8px;
}

.badge {
    font-size: 13px;
    background: var(--pale);
    border: 1px solid var(--line);
    padding: 4px 10px;
    border-radius: 20px;
}

.verified {
    color: #22642f;
    font-weight: 700;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

td, th {
    text-align: left;
    border-bottom: 1px solid var(--line);
    padding: 12px;
}

footer {
    background: var(--forest);
    color: #fff;
    padding: 22px 38px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

footer strong {
    font-family: Georgia, serif;
}

.summary dt {
    font-weight: bold;
    margin-top: 16px;
}

.summary dd {
    margin: 3px 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

[hidden] {
    display: none!important;
}

@media (max-width: 800px) {
    header {
        padding: 20px;
    }

    header strong {
        font-size: 26px;
    }

    .layout {
        display: block;
    }

    aside {
        padding: 16px;
        border-bottom: 1px solid var(--line);
    }

    aside nav {
        display: flex;
        flex-wrap: wrap;
    }

    main {
        padding: 24px 20px;
    }

    footer {
        gap: 20px;
    }

    table {
        font-size: 14px;
    }

}

.sort-controls {
    display: flex;
    gap: 8px;
    margin: -8px 0 18px;
}

.sort-button {
    height: 23px;
    line-height: 19px;
    padding: 1px 12px;
    font-size: 12px;
    border-radius: 5px;
}

.sort-button[aria-pressed="true"] {
    background: var(--forest);
    border-color: var(--forest);
    color: #fff;
}

#plant-list[aria-busy="true"] {
    opacity: .65;
}

#botanical {
    font-style: italic;
}

/* Shared left-aligned content boundary; header and footer remain full width. */
.layout {
    max-width: 1250px;
    margin-left: 0;
    margin-right: auto;
}

/* Shared header logo: preserve the full image without cropping. */
header .logo {
    display: block;
    width: 100px;
    height: 100px;
    flex: 0 0 100px;
    object-fit: contain;
    border: 0;
    border-radius: 0;
}

/* Klåse/category explanations float over the form without moving checkboxes. */
.check-help {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.check-help-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--forest);
    font: 16px/1 Arial, sans-serif;
    touch-action: manipulation;
}

.check-help-button:hover, .check-help-button[aria-expanded="true"] {
    background: #e2e9e3;
}

.check-help-button:active {
    transform: none;
}

.check-tooltip {
    position: fixed;
    z-index: 1000;
    width: max-content;
    max-width: min(320px, calc(100vw - 16px));
    padding: 10px 12px;
    border: 1px solid var(--forest);
    border-radius: 6px;
    background: #fff;
    color: #000;
    box-shadow: 0 3px 12px #0003;
    font: 14px/1.45 Arial, sans-serif;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    overflow-y: auto;
    text-align: left;
}

@media (pointer: coarse) {
    .check-help-button {
        width: 32px;
        height: 32px;
    }

}

/* Login visibility control and optional persistent login. */
.login-password-field {
    margin: 16px 0;
    max-width: 720px;
}

.login-password-control {
    position: relative;
}

.login-password-control input {
    padding-right: 54px;
}

.password-toggle {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 40px;
    padding: 8px;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:active {
    transform: translateY(-50%);
}

.password-toggle svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-toggle .eye-slash {
    display: none;
}

.password-toggle[aria-pressed="true"] .eye-slash {
    display: block;
}

.remember-login {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

.remember-login input {
    width: auto;
    margin: 0;
}

.profile-link {
    position: relative;
    top: 5px;
    left: 3px;
}

/* Approved inline action outline height. Bottom actions are excluded. */
#plant-form .row button, #plant-form [data-edit], #plant-form [data-remove] {box-sizing:border-box;height:28px;}
