@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Nunito:wght@700;800&display=swap');

:root {
    --green: #176b52;
    --green-dark: #0e4d3a;
    --green-pale: #e8f2ed;
    --orange: #e07a33;
    --orange-pale: #fff0e5;
    --cream: #fff9f2;
    --ink: #17312a;
    --muted: #66756f;
    --line: #d9e4de;
    --white: #fff;
    --danger: #a63d28;
    --shadow: 0 16px 45px rgba(14, 77, 58, .09);
    font-family: "DM Sans", system-ui, sans-serif;
    color: var(--ink);
    background: var(--cream);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 92% 7%, rgba(224,122,51,.09), transparent 27rem), var(--cream); }
button, input, textarea { font: inherit; }
a { color: inherit; }
img { max-width: 100%; }

.site-header {
    min-height: 72px;
    padding: 8px max(24px, calc((100% - 1180px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: rgba(255,255,255,.88);
    border-bottom: 1px solid rgba(217,228,222,.85);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 54px; height: 54px; object-fit: cover; border-radius: 50%; }
.brand span { display: flex; flex-direction: column; }
.brand strong { font: 800 1.45rem/1 "Nunito", sans-serif; color: var(--green); }
.brand small { color: var(--muted); margin-top: 5px; }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 14px 0 48px; }
.compact-title, .manage-title { min-height: 82px; display: flex; align-items: center; justify-content: space-between; padding: 2px 20px; }
.compact-title h1, .manage-title h1 { margin: 0; font: 800 clamp(1.85rem, 4vw, 2.65rem)/1 "Nunito", sans-serif; color: var(--green-dark); letter-spacing: -.025em; }
.compact-title img, .manage-title img { width: 74px; height: 74px; object-fit: cover; border-radius: 50%; }
.manage-title h1 { margin-top: 5px; }
.back-link { color: var(--green); font-size: .84rem; font-weight: 700; }
.eyebrow { color: var(--orange); text-transform: uppercase; letter-spacing: .14em; font-weight: 700; font-size: .73rem; }

.card { background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.gallery-panel, .camps-editor { padding: clamp(20px, 4vw, 38px); margin-bottom: 28px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 26px; }
.section-heading > div, .subheading, .subheading > div { display: flex; align-items: center; gap: 13px; }
h2, h3 { font-family: "Nunito", sans-serif; color: var(--green-dark); margin: 2px 0 0; }
h2 { font-size: 1.65rem; }
.step { display: inline-grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; background: var(--orange-pale); color: var(--orange); font-weight: 800; }

.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 10px 17px; border-radius: 11px; border: 0; font-weight: 700; text-decoration: none; cursor: pointer; transition: .2s ease; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, a:focus-visible, input:focus-visible, button:focus-visible { outline: 3px solid rgba(224,122,51,.35); outline-offset: 2px; }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.button span, .text-link span { font-size: .65rem; letter-spacing: .08em; background: rgba(255,255,255,.2); padding: 3px 5px; border-radius: 4px; }
.button-primary { color: white; background: var(--green); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { color: white; background: var(--orange); }
.button-outline { color: var(--green); background: white; border: 1px solid var(--green); }
.button-quiet { color: var(--green); background: var(--green-pale); }
.text-link { color: var(--green); font-weight: 700; font-size: .86rem; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.header-actions form { margin: 0; }
.settings-button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 11px; color: var(--green); background: white; text-decoration: none; font-size: 1.35rem; }
.settings-button:hover, .settings-button.is-current { color: white; border-color: var(--green); background: var(--green); }
.download-button { white-space: nowrap; }
.download-button span { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border-radius: 50%; color: white; background: var(--green); font-size: 1rem; line-height: 1; }

.camp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.camp-card { min-height: 82px; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; background: white; transition: .2s ease; }
.camp-card:hover { border-color: var(--green); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(14,77,58,.08); }
.camp-card.is-selected { color: white; border-color: var(--green); background: var(--green); }
.camp-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--green-pale); color: var(--green); font-size: 1.25rem; }
.is-selected .camp-icon { background: rgba(255,255,255,.18); color: white; }
.camp-card > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.camp-card strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camp-card small { opacity: .72; margin-top: 3px; }

.browser-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 34px; padding-top: 30px; }
.date-browser { border-right: 1px solid var(--line); padding-right: 24px; }
.subheading { margin-bottom: 15px; }
.subheading h3 { font-size: 1.05rem; }
.date-link { display: flex; justify-content: space-between; padding: 12px 13px; margin: 5px 0; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 600; }
.date-link:hover { background: var(--green-pale); color: var(--green); }
.date-link.is-selected { background: var(--green); color: white; }
.row-between { justify-content: space-between; }
.meal-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 3px 2px 18px; }
.meal-tab { white-space: nowrap; border: 1px solid var(--line); padding: 9px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; }
.meal-tab:hover, .meal-tab.is-selected { background: var(--orange-pale); border-color: var(--orange); color: #9a4816; }
.photos-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 8px 0 16px; }
.photos-heading h3 { font-size: 1.45rem; }
.photos-heading p { margin: 3px 0 0; color: var(--muted); }

.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.photo-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: white; }
.photo-open { width: 100%; aspect-ratio: 4/3; padding: 0; border: 0; cursor: zoom-in; background: var(--green-pale); overflow: hidden; }
.photo-open img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.photo-open:hover img { transform: scale(1.035); }
.photo-card > div { display: grid; grid-template-columns: minmax(0,1fr) auto; padding: 11px; align-items: center; }
.photo-card p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; font-weight: 600; }
.photo-card small { color: var(--muted); grid-column: 1; }
.icon-download { grid-column: 2; grid-row: 1 / 3; display: grid; place-items: center; width: 34px; height: 34px; background: var(--green-pale); color: var(--green); border-radius: 50%; font-weight: 800; text-decoration: none; }

.empty { text-align: center; padding: 55px 20px; background: var(--green-pale); border-radius: 14px; color: var(--muted); }
.empty strong { color: var(--green-dark); font: 700 1.15rem "Nunito", sans-serif; }
.empty p { margin-bottom: 0; }
.empty.compact { padding: 30px 20px; }
.alert { padding: 13px 16px; border-radius: 11px; margin: 0 0 20px; }
.alert-error { color: var(--danger); background: #fff0ec; border: 1px solid #f2c9bf; }
.alert-success { color: var(--green-dark); background: var(--green-pale); border: 1px solid #b9d8ca; }
code { font-family: ui-monospace, monospace; font-size: .88em; }

.management-list { display: grid; gap: 9px; margin: 8px 0 20px; }
.management-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.camp-name-field { min-width: 0; display: flex; flex-direction: column; }
.camp-name-field input { min-width: 0; border: 0; border-bottom: 1px solid var(--line); padding: 6px 3px; color: var(--ink); background: transparent; font-weight: 700; }
.camp-name-field input:focus { border-bottom-color: var(--green); outline: 0; }
.camp-name-field span { padding: 6px 3px; font-weight: 700; color: var(--muted); }
.camp-name-field small { padding: 3px; color: var(--muted); }
.camp-actions { display: flex; gap: 8px; }
.disable-button { color: #8a4a18; background: var(--orange-pale); border: 1px solid #efc19e; }
.disable-button:disabled { color: var(--muted); background: #f3f5f4; border-color: var(--line); }
.delete-button { color: var(--danger); background: #fff0ec; border: 1px solid #f2c9bf; }
.save-names { margin-top: 2px; }
.add-section { max-width: 760px; }
.add-camp { max-width: 620px; margin: 0 0 22px; }
.add-camp label { display: block; font-weight: 700; margin-bottom: 7px; }
.add-camp > div { display: flex; gap: 8px; }
.add-camp input, .login-card input { width: 100%; min-height: 46px; border: 1px solid #bdccc5; border-radius: 10px; padding: 10px 12px; background: white; }
.add-camp small { display: block; color: var(--muted); margin-top: 6px; }

.login-shell { min-height: calc(100vh - 230px); display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 7vw; max-width: 980px; margin: 0 auto; }
.login-illustration { position: relative; text-align: center; }
.login-illustration::before { content: ""; position: absolute; inset: 8%; background: var(--orange-pale); border-radius: 45% 55% 50% 50%; transform: rotate(-7deg); }
.login-illustration img { width: 390px; border-radius: 50%; position: relative; }
.login-card { padding: clamp(25px, 5vw, 45px); }
.login-card h1 { font: 800 2.25rem/1.08 "Nunito", sans-serif; color: var(--green-dark); margin: 10px 0; }
.login-card > p { color: var(--muted); line-height: 1.55; margin-bottom: 24px; }
.login-card label { display: block; font-weight: 700; margin-bottom: 16px; }
.login-card input { display: block; margin-top: 7px; }
.login-card .button { width: 100%; margin-top: 3px; }

.lightbox { width: min(1100px, calc(100% - 28px)); max-height: 92vh; border: 0; border-radius: 16px; padding: 0; background: #10231e; box-shadow: 0 30px 90px rgba(0,0,0,.45); }
.lightbox::backdrop { background: rgba(6,20,16,.82); backdrop-filter: blur(5px); }
.lightbox img { display: block; max-width: 100%; max-height: 88vh; margin: auto; object-fit: contain; }
.lightbox button { position: absolute; z-index: 2; right: 10px; top: 10px; width: 42px; height: 42px; border: 0; border-radius: 50%; color: white; background: rgba(0,0,0,.55); font-size: 1.7rem; cursor: pointer; }

@media (max-width: 850px) {
    .camp-grid { grid-template-columns: repeat(2, 1fr); }
    .browser-grid { grid-template-columns: 1fr; }
    .date-browser { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 22px; }
    .date-browser .date-link { display: inline-flex; gap: 12px; margin-right: 3px; }
    .photo-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
    .site-header { min-height: 72px; padding: 9px 16px; }
    .brand img { width: 50px; height: 50px; }
    .brand small { display: none; }
    .button-quiet { font-size: 0; width: 44px; padding: 0; }
    .button-quiet::after { content: "↪"; font-size: 1.2rem; }
    main { width: min(100% - 24px, 1180px); padding-top: 18px; }
    .section-heading, .photos-heading { align-items: stretch; flex-direction: column; }
    .section-heading > .button, .photos-heading > .button { width: 100%; }
    .camp-grid { grid-template-columns: 1fr; }
    .browser-grid { gap: 24px; }
    .photo-grid { grid-template-columns: 1fr; }
    .row-between { align-items: flex-start; gap: 12px; }
    .login-shell { grid-template-columns: 1fr; min-height: auto; }
    .login-illustration { display: none; }
    .login-card { margin: 25px 0; }
    .add-camp > div { flex-direction: column; }
    .management-row { grid-template-columns: 1fr; gap: 10px; }
    .camp-actions .button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
