* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--surface);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface);
}

::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 100vw;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--muted);
}

:root {
  --width: 100%;
  --font-main: "Geist", system-ui, sans-serif;
  --font-heading: "Shippori Antique", sans-serif;
  --font-mono: "Geist Mono", monospace;
  --font-scale: 0.99rem;
  --space-1: 0.89rem;
  --space-2: 1.44rem;
  --space-3: 2.33rem;
  --space-4: 3.77rem;
  --radius: 0.55rem;
  
  --bg: #fbfaf7;
  --surface: #f4f2ea;
  --text: #3a3835;
  --heading: #1b1a18;
  --muted: #7c7974;
  --primary: #d96a43;
  --border: #e6e3da;
  --code-bg: #f4f2ea;
  --quote-bg: rgba(217, 106, 67, 0.05);
  
  --background-color: var(--bg);
  --heading-color: var(--heading);
  --text-color: var(--text);
  --link-color: var(--primary);
  --visited-color: var(--muted);
  --code-background-color: var(--code-bg);
  --code-color: var(--heading);
  --blockquote-color: var(--muted);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --surface: #1c1c1a;
    --text: #cdc8be;
    --heading: #f5f4f0;
    --muted: #8c887f;
    --primary: #e58563;
    --border: #2c2b28;
    --code-bg: #1c1c1a;
    --quote-bg: rgba(229, 133, 99, 0.04);
    
    --background-color: var(--bg);
    --heading-color: var(--heading);
    --text-color: var(--text);
    --link-color: var(--primary);
    --visited-color: #a8a49c;
    --code-background-color: var(--code-bg);
    --code-color: var(--heading);
    --blockquote-color: var(--muted);
  }
}

body {
  background: var(--bg);
  font-family: var(--font-main);
  font-size: var(--font-scale);
  color: var(--text);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1 {
  display: none;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

a:hover {
  color: var(--heading);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

a:visited {
  color: var(--visited-color);
}

main {
  width: 100%;
}

.container {
  background: transparent;
  padding: 0;
}

#guestbooks___guestbook-form-container {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0 0 2.5rem 0;
}

.guestbooks___input-container {
  margin-bottom: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.guestbooks___input-container label {
  font-weight: 600;
  color: var(--heading-color);
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

.guestbooks___input-container input,
.guestbooks___input-container textarea {
  padding: 0.75rem 1rem;
  font-family: var(--font-main);
  border: 1px dashed var(--border);
  color: var(--text-color);
  background-color: var(--surface);
  border-radius: var(--radius);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  font-size: 1rem;
  outline: none;
}

.guestbooks___input-container input:focus,
.guestbooks___input-container textarea:focus {
  border: 2px solid var(--primary);
  border-style: solid;
  outline: 2px dotted var(--primary);
  outline-offset: 4px;
}

.guestbooks___input-container input::placeholder,
.guestbooks___input-container textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

input[type="submit"] {
  background: var(--primary);
  cursor: pointer;
  color: #ffffff;
  font-family: var(--font-main);
  font-weight: 700;
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  font-size: 1.05rem;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  outline: none;
  border: none;
}

input[type="submit"]:hover {
  background: var(--heading);
}

input[type="submit"]:active {
  transform: scale(0.95);
}

#guestbooks___error-message {
  color: #ef4444;
  font-size: 0.9rem;
  margin-top: 10px;
}

#guestbooks___guestbook-made-with {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

hr {
  border: 0;
  border-top: 2px dashed var(--border);
  margin: var(--space-2) 0;
}

#guestbooks___guestbook-messages-header {
  margin-bottom: 2rem;
}

#guestbooks___guestbook-messages-container {
  border: none;
  background-color: transparent;
  padding: 0;
}

.guestbook-message {
  margin-bottom: 1.25rem;
  background-color: transparent;
}

.guestbook-message p {
  margin: 0 0 0.4rem 0;
  font-size: 0.99rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
  line-height: 1.2;
}

.guestbook-message p b {
  color: var(--heading);
  font-weight: 600;
}

.guestbook-message p b a {
  text-decoration: none;
  color: var(--link-color);
}

.guestbook-message p b a:hover {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.guestbook-message p small {
  font-size: 0.7rem;
  color: var(--muted);
}

.guestbook-message p b + small::before {
  content: "✦";
  margin-right: 6px;
  color: var(--primary);
  font-size: 0.6rem;
}

.guestbook-message blockquote {
  display: inline-block;
  background-color: var(--surface);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  position: relative;
  line-height: 1.5;
  max-width: 100%;
  margin: 1rem 0 0 0;
  color: var(--text);
  border: 1px dashed var(--border);
}

.guestbook-message blockquote::after {
  content: '';
  position: absolute;
  border-style: solid;
  border-width: 0 12px 12px;
  border-color: var(--surface) transparent;
  display: block;
  width: 0;
  top: -12px;
  left: 10px;
  z-index: 1;
}

.guestbook-message blockquote p {
  margin: 0;
  line-height: inherit;
}

.guestbook-message-reply {
  margin-left: 2.5rem;
  position: relative;
}

.guestbook-message-reply::before {
  content: "";
  position: absolute;
  left: -1.25rem;
  top: 0;
  bottom: 0;
  width: 2px;
  border-left: 2px dashed var(--primary);
}

.guestbook-message-reply p b {
  color: var(--primary);
}

.guestbook-message-reply p b::after {
  content: "Owner";
  display: inline-flex;
  align-items: center;
  margin-left: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--primary);
  font-family: var(--font-main);
}

.guestbook-message-reply blockquote {
  display: inline-block;
  background-color: var(--primary);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  position: relative;
  line-height: 1.5;
  max-width: 100%;
  margin: 1rem 0 0 0;
  color: #ffffff;
  border: none;
}

.guestbook-message-reply blockquote::after {
  content: '';
  position: absolute;
  border-style: solid;
  border-width: 0 12px 12px;
  border-color: var(--primary) transparent;
  display: block;
  width: 0;
  top: -12px;
  left: 10px;
  z-index: 1;
}

.guestbook-message-reply blockquote p {
  margin: 0;
  line-height: inherit;
  color: #ffffff;
}

::selection {
  background: var(--primary);
  color: #ffffff;
}

@media (max-width: 640px) {
  .guestbook-message-reply {
    margin-left: 1.5rem;
  }
  
  .guestbook-message-reply::before {
    left: -0.85rem;
  }
  
  .guestbook-message blockquote,
  .guestbook-message-reply blockquote {
    font-size: 0.9rem;
  }
}