:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #263839;
  background: #f3f7f6;
  --accent: #286d65;
  --muted: #657a77;
  --border: #dbe5e2;
}
:root[data-guestbook-theme="birthday"] { --accent: #236d8c; --muted: #4b7180; --border: #d3e7ed; background: #f0f9fc; color: #183747; }
:root[data-guestbook-theme="january"] { --accent: #795b43; --muted: #796b60; --border: #e7dac9; background: #fbf4e8; color: #392f2d; }
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.65; }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-underline-offset: 4px; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
:focus-visible { outline: 3px solid #68aaa1; outline-offset: 3px; }
[hidden] { display: none !important; }
.wrap { width: min(820px, calc(100% - 40px)); margin-inline: auto; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 28px; }
.back-link, .admin-link { font-size: 14px; text-decoration: none; }
.admin-link { color: var(--muted); }
.page-title { margin: 28px 0 30px; }
.eyebrow { color: var(--accent); font-size: 12px; letter-spacing: .16em; font-weight: 650; }
h1 { margin: 6px 0 10px; font-size: clamp(28px, 5vw, 36px); line-height: 1.3; letter-spacing: -.025em; }
h2 { margin: 0; font-size: 20px; line-height: 1.4; }
.page-title p { color: var(--muted); margin: 0; }
.panel, .message-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 26px; }
.compose h2 { margin-bottom: 24px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 18px 0 8px; }
label:first-child { margin-top: 0; }
.field-hint { color: var(--muted); font-size: 13px; font-weight: 400; }
label .field-hint { margin-left: 8px; }
input, textarea { display: block; width: 100%; color: #263839; background: #fff; border: 1px solid #c7d7d2; border-radius: 8px; padding: 11px 13px; }
input { max-width: 340px; }
textarea { min-height: 140px; resize: vertical; line-height: 1.7; }
input::placeholder, textarea::placeholder { color: #8a9b98; }
.field-bottom { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-top: 6px; }
.field-bottom p { margin: 0; }
.count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 22px; }
.status { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.status.success { color: #246549; }
.status.error, .error { color: #a33938; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; border: 1px solid #c9d9d4; border-radius: 8px; padding: 8px 18px; background: #fff; color: var(--accent); font-size: 14px; text-decoration: none; white-space: nowrap; }
.button:hover { background: #f0f6f4; }
.button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.button.primary:hover { background: #215b54; }
.button.subtle { border-color: transparent; background: transparent; padding-inline: 10px; }
.button.danger { color: #a33938; border-color: #e3cecc; }
.button.danger:hover { background: #fbefee; }
.messages-section { margin-top: 0; }
.messages-section + .compose { margin-top: 40px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.list-status { color: var(--muted); margin: 12px 0 18px; font-size: 14px; }
.message-list { display: grid; gap: 16px; }
.message-top { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.message-author { font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.message-text { margin: 14px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.owner-reply { background: #f0f7f4; border-left: 3px solid #8bb9a9; border-radius: 0 8px 8px 0; margin-top: 22px; padding: 14px 16px; }
.reply-heading { display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.owner-badge { color: #286d55; font-size: 12px; font-weight: 650; }
.reply-text { margin: 7px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.load-more { margin: 22px auto; display: flex; min-width: 140px; }
.page-footer { color: var(--muted); padding-block: 36px; font-size: 12px; }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.filter { background: #fff; color: var(--muted); padding: 8px 18px; border: 1px solid var(--border); border-radius: 999px; font-size: 14px; }
.filter.active { color: #fff; border-color: var(--accent); background: var(--accent); }
.moderation-actions { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--border); margin-top: 22px; padding-top: 18px; }
.moderation-status { display: inline-block; margin-top: 12px; color: var(--muted); font-size: 12px; }
.reply-editor { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 16px; }
.reply-editor label { margin-top: 0; }
.reply-editor textarea { min-height: 100px; font-size: 14px; }
.reply-editor .button { margin-top: 10px; }
.card-status { margin-top: 12px; }
#admin-identity { overflow-wrap: anywhere; text-align: right; }
#admin-auth-error .button { margin-top: 18px; }
@media (max-width: 560px) {
  .wrap { width: calc(100% - 28px); }
  .page-header { padding-block: 20px; align-items: start; }
  .page-title { margin-top: 18px; }
  .panel, .message-card { padding: 20px; border-radius: 12px; }
  .form-footer { flex-direction: column; align-items: stretch; gap: 12px; }
  .form-footer .button { width: 100%; }
  .field-bottom { gap: 10px; }
  .message-top { flex-direction: column; gap: 2px; }
  .reply-heading { flex-wrap: wrap; gap: 2px 10px; }
  .moderation-actions .button { flex: 1 1 auto; }
  .filter { padding-inline: 16px; }
  #admin-identity { max-width: 60%; font-size: 12px; }
}
.guestbook-embedded body { padding-block: 20px 8px; }
.guestbook-embedded .page-header,
.guestbook-embedded .page-title,
.guestbook-embedded .page-footer { display: none; }
.guestbook-embedded .wrap { width: min(820px, calc(100% - 40px)); }
.guestbook-embedded .compose { padding: 22px; }
.guestbook-embedded .compose h2 { font-size: 18px; margin-bottom: 20px; }
.guestbook-embedded .messages-section { margin: 0; }
.guestbook-embedded .messages-section + .compose { margin-top: 28px; margin-bottom: 20px; }
@media (max-width: 560px) {
  .guestbook-embedded body { padding-top: 14px; }
  .guestbook-embedded .wrap { width: calc(100% - 28px); }
  .guestbook-embedded .compose { padding: 18px; }
}
