:root {
  color-scheme: light;
  --ink: #24313f;
  --muted: #607284;
  --soft: #eef5f3;
  --paper: #fffdf8;
  --white: #ffffff;
  --line: #d9e5e2;
  --teal: #0f766e;
  --teal-dark: #0a5f59;
  --coral: #c65b66;
  --gold: #c9932f;
  --violet: #7667ad;
  --shadow: 0 18px 42px rgba(28, 42, 55, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
  background: transparent;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
}

body {
  overflow-x: hidden;
}

.guestbook-teaser {
  width: 100%;
  min-height: 150px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(14px, 2.4vw, 28px);
  padding: clamp(14px, 2.4vw, 22px) clamp(16px, 3vw, 34px);
  background:
    linear-gradient(90deg, rgba(248, 252, 250, 0.92), rgba(255, 253, 248, 0.88)),
    url("/notebook.jpg") center / cover no-repeat,
    var(--paper);
  border: 1px solid rgba(36, 49, 63, 0.12);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.teaser-visual {
  display: block;
  line-height: 0;
  border-radius: 12px;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.teaser-visual:hover {
  filter: saturate(1.05);
  transform: translateY(-1px);
}

.teaser-visual img {
  width: clamp(150px, 20vw, 250px);
  height: auto;
  display: block;
  border-radius: 12px;
}

.teaser-copy {
  min-width: 0;
}

.teaser-copy h1 {
  font-size: clamp(24px, 3vw, 38px);
}

.teaser-copy p:last-child {
  max-width: 620px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}

.teaser-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}

.teaser-button:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

.guestbook-band {
  width: 100%;
  min-height: 300px;
  padding: clamp(12px, 2vw, 20px);
  background:
    linear-gradient(90deg, rgba(248, 252, 250, 0.9), rgba(255, 253, 248, 0.86)),
    url("/notebook.jpg") center / cover no-repeat,
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(36, 49, 63, 0.045) 32px 33px),
    var(--paper);
  border: 1px solid rgba(36, 49, 63, 0.12);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.guestbook-page {
  width: 100%;
  min-height: 100vh;
  padding: clamp(18px, 3vw, 34px);
  background:
    linear-gradient(90deg, rgba(248, 252, 250, 0.72), rgba(255, 253, 248, 0.66)),
    url("/notebook.jpg") center / cover no-repeat,
    var(--paper);
}

.page-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.page-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 2.4vw, 28px);
  padding: clamp(12px, 2vw, 18px) 0 clamp(16px, 2.5vw, 24px);
}

.page-logo img {
  width: clamp(150px, 18vw, 240px);
  height: auto;
  display: block;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: clamp(18px, 3vw, 30px);
  align-items: stretch;
}

.band-inner {
  width: min(1120px, 100%);
  min-height: 252px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(320px, 1.18fr);
  gap: clamp(16px, 2.4vw, 28px);
  align-items: stretch;
}

.guestbook-intro {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.site-logo {
  width: fit-content;
  max-width: min(260px, 100%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--teal-dark);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
}

.site-logo img {
  width: min(235px, 100%);
  height: auto;
  max-height: 58px;
  object-fit: contain;
}

.logo-fallback {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), #18a394);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.24);
  font-size: 21px;
  font-weight: 900;
}

.site-logo img + .logo-fallback {
  display: none;
}

.intro-copy {
  margin: clamp(10px, 1.8vw, 16px) 0 12px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 7px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 0.98;
  letter-spacing: 0;
}

.lead {
  max-width: 470px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.38;
}

.sign-form {
  width: min(520px, 100%);
  margin-top: auto;
  padding-top: 6px;
}

#website {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input {
  width: 100%;
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-size: 14px;
  outline: none;
}

textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 14px;
  line-height: 1.42;
  outline: none;
}

input:focus {
  border-color: rgba(15, 118, 110, 0.72);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

textarea:focus {
  border-color: rgba(15, 118, 110, 0.72);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.message-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.sign-form > label {
  margin-top: 8px;
}

.full-form {
  margin: 0;
  padding: clamp(14px, 2vw, 20px);
  border: 1px solid rgba(36, 49, 63, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(1px);
  box-shadow: 0 12px 28px rgba(28, 42, 55, 0.1);
}

.full-form > label {
  margin-top: 12px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
}

.helper {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.send-button,
.refresh-button,
.more-button {
  border: 0;
  color: #fff;
  background: var(--teal);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.send-button {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 8px;
  padding: 0 15px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}

.refresh-button {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.send-button:hover,
.refresh-button:hover,
.more-button:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

.guestbook-panel {
  min-width: 0;
  min-height: 248px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: clamp(12px, 1.8vw, 16px);
  border: 1px solid rgba(36, 49, 63, 0.1);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.08), transparent 32%),
    var(--white);
  box-shadow: 0 12px 28px rgba(28, 42, 55, 0.1);
}

.full-panel {
  min-height: 430px;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.07), transparent 36%),
    rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(1px);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(36, 49, 63, 0.09);
}

.panel-kicker {
  margin-bottom: 3px;
  color: var(--teal-dark);
}

.status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.status.error {
  color: #a6424c;
}

.messages {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  overflow-y: auto;
  padding: 10px 4px 2px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 118, 110, 0.45) transparent;
}

.full-messages {
  grid-template-columns: 1fr;
  align-content: start;
}

.full-messages .entry {
  min-height: 0;
}

.entry {
  min-height: 86px;
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 1px solid rgba(36, 49, 63, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 255, 255, 0.96));
}

.entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.entry strong {
  min-width: 0;
  overflow: hidden;
  color: var(--teal-dark);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.entry p {
  margin: 0;
  color: #334354;
  font-size: 13px;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.entry small {
  display: inline-block;
  margin-top: auto;
  padding-top: 6px;
  color: var(--violet);
  font-size: 11px;
  font-weight: 700;
}

.more-button {
  width: fit-content;
  min-height: 30px;
  margin: 8px 0 0 auto;
  padding: 0 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.send-button:disabled,
.refresh-button:disabled,
.more-button:disabled {
  opacity: 0.58;
  cursor: progress;
  transform: none;
}

@media (max-width: 760px) {
  .guestbook-band {
    min-height: 0;
    padding: 14px;
    border-radius: 0;
  }

  .band-inner {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .site-logo img {
    max-height: 72px;
  }

  .sign-form {
    margin-top: 0;
  }

  .guestbook-panel {
    min-height: 300px;
  }
}

@media (max-width: 820px) {
  .guestbook-teaser,
  .page-hero,
  .page-grid {
    grid-template-columns: 1fr;
  }

  .teaser-visual img {
    width: min(250px, 100%);
  }

  .teaser-button {
    width: fit-content;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .field-pair,
  .messages {
    grid-template-columns: 1fr;
  }

  .message-field {
    grid-template-columns: 1fr;
  }

  .send-button {
    width: 100%;
  }

  .teaser-button {
    width: 100%;
  }
}
