@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;600;700;800&display=swap');

:root {
    --ink: #202b26;
    --muted: #6c7872;
    --paper: #f1eee7;
    --card: #fbfaf6;
    --line: #d6d8ce;
    --accent: #e25d3f;
    --accent-dark: #b9402c;
    --mint: #d9e7d8;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: 'Manrope', sans-serif;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: '';
    opacity: .45;
    background-image: radial-gradient(#b9beb1 0.7px, transparent 0.7px);
    background-size: 18px 18px;
}

.page-shell { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 64px 0 90px; }
.site-header { position: relative; padding-bottom: 56px; border-bottom: 1px solid var(--line); }
.compact-header { padding-bottom: 40px; }
.eyebrow, .panel-number, time { color: var(--muted); font-family: 'DM Mono', monospace; font-size: 12px; letter-spacing: .08em; }
.eyebrow { margin: 0 0 24px; color: var(--accent); font-weight: 500; }
h1 { max-width: 700px; margin: 0; font-size: clamp(48px, 8vw, 94px); line-height: .95; letter-spacing: -.05em; }
h1 em { color: var(--accent); font-style: normal; }
.intro { margin: 28px 0 0; color: var(--muted); font-size: 16px; }
.admin-link, .logout-link { color: var(--ink); font-size: 13px; font-weight: 700; text-decoration: none; border-bottom: 1px solid var(--ink); }
.admin-link { position: absolute; right: 0; bottom: 60px; }
.mood-link { position: absolute; right: 0; bottom: 28px; color: var(--accent); font-size: 13px; font-weight: 700; text-decoration: none; }
.compact-header .admin-link { bottom: 44px; }
.guestbook-grid { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(0, 1.15fr); gap: 24px; padding-top: 24px; }
.site-footer { display: flex; justify-content: flex-end; align-items: center; padding-top: 24px; }
.footer-version { color: var(--muted); font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: .12em; }
.panel { padding: 28px; background: var(--card); border: 1px solid var(--line); }
.panel-heading { display: flex; align-items: baseline; gap: 14px; margin-bottom: 34px; }
.panel-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.panel-number { color: var(--accent); }
label { display: block; margin: 22px 0 9px; color: var(--muted); font-size: 12px; font-weight: 700; }
input, textarea { width: 100%; padding: 14px 0; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); outline: none; font: inherit; }
textarea { min-height: 140px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--accent); }
button { border: 0; cursor: pointer; font: inherit; }
.entry-form button, .login-form button { width: 100%; margin-top: 30px; padding: 16px 18px; color: #fff; background: var(--accent); text-align: left; font-size: 14px; font-weight: 800; }
.entry-form button span, .login-form button span { float: right; font-size: 20px; line-height: 12px; }
.entry-form button:hover, .login-form button:hover { background: var(--accent-dark); }
.entry-list { display: grid; gap: 0; }
.entry-item { position: relative; padding: 20px 0; border-top: 1px solid var(--line); }
.entry-item:first-child { border-top: 0; padding-top: 0; }
.entry-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.entry-meta strong { font-size: 14px; }
.entry-item p { margin: 0; color: #4b5650; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.empty-state { padding: 32px 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.notice { margin: -12px 0 22px; padding: 12px 14px; font-size: 13px; line-height: 1.5; }
.notice.success { color: #42614b; background: var(--mint); }
.notice.error { color: #8e3428; background: #f8d9d0; }
.login-form { width: min(100%, 520px); margin: 48px auto 0; }
.admin-shell { max-width: 900px; }
.admin-heading { align-items: center; justify-content: space-between; }
.admin-heading > div { display: flex; align-items: baseline; gap: 14px; }
.logout-link { color: var(--accent-dark); border-color: var(--accent-dark); }
.admin-entry { padding-right: 72px; }
.admin-entry form { position: absolute; top: 20px; right: 0; }
.admin-entry:first-child form { top: 0; }
.delete-button { padding: 6px 0; color: var(--accent-dark); background: transparent; font-size: 12px; font-weight: 700; }

@media (max-width: 720px) {
    .page-shell { width: min(100% - 32px, 560px); padding-top: 36px; }
    .site-header { padding-bottom: 38px; }
    h1 { font-size: clamp(48px, 15vw, 78px); }
    .admin-link, .compact-header .admin-link { position: static; display: inline-block; margin-top: 28px; }
    .mood-link { position: static; display: block; margin-top: 16px; }
    .guestbook-grid { grid-template-columns: 1fr; }
    .panel { padding: 22px; }
    .panel-heading { margin-bottom: 26px; }
}
