:root {
  --parchment: #f1e3c1;
  --parchment-dark: #e2cd98;
  --parchment-darker: #d3ba7d;
  --ink: #2b1d0e;
  --wood: #5b3a21;
  --wood-dark: #37220f;
  --gold: #a9761b;
  --gold-light: #d9ac3d;
  --wine: #7a1f2b;
  --wine-dark: #4d0f18;
  --wine-light: #a4364a;
  --ok-green: #3c5a30;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: Georgia, 'Palatino Linotype', 'Book Antiqua', 'Times New Roman', serif;
  color: var(--ink);
  background-color: var(--parchment-darker);
  background-image:
    radial-gradient(ellipse at top left, rgba(255, 255, 255, 0.25), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(0, 0, 0, 0.18), transparent 55%),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.02) 0, rgba(0, 0, 0, 0.02) 2px, transparent 2px, transparent 6px),
    linear-gradient(var(--parchment), var(--parchment-dark));
  min-height: 100vh;
  line-height: 1.55;
  padding: 24px 14px 60px;
}

a {
  color: var(--wine);
}
a:hover {
  color: var(--wine-light);
}

h1, h2, h3 {
  font-family: Georgia, 'Trajan Pro', 'Times New Roman', serif;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  color: var(--wood-dark);
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.35);
  margin: 0 0 0.5em;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
}

.banner {
  text-align: center;
  margin-bottom: 22px;
}
.banner .crest {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 6px;
  filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, 0.3));
}
.banner h1 {
  font-size: 1.9rem;
  margin-bottom: 2px;
}
.banner .subtitle {
  font-style: italic;
  color: var(--wood);
  opacity: 0.85;
}

.divider {
  text-align: center;
  color: var(--gold);
  margin: 18px 0;
  letter-spacing: 0.5em;
  font-size: 0.9rem;
  opacity: 0.8;
}

.scroll {
  background: linear-gradient(var(--parchment) 0%, #f5ead0 100%);
  border: 3px double var(--wood);
  border-radius: 6px;
  box-shadow:
    0 0 0 6px rgba(169, 118, 27, 0.15),
    0 10px 30px rgba(0, 0, 0, 0.35),
    inset 0 0 40px rgba(91, 58, 33, 0.12);
  padding: 28px 26px;
  position: relative;
  margin-bottom: 24px;
}

.scroll::before,
.scroll::after {
  content: '\2766';
  position: absolute;
  color: var(--gold);
  font-size: 1.1rem;
  opacity: 0.7;
}
.scroll::before { top: 8px; left: 12px; }
.scroll::after { top: 8px; right: 12px; }

.lede {
  font-size: 1.05rem;
}
.lede::first-letter {
  font-size: 2.6rem;
  float: left;
  line-height: 0.85;
  padding: 4px 8px 0 0;
  color: var(--wine);
  font-family: Georgia, serif;
}

.notice {
  border-left: 4px solid var(--gold);
  background: rgba(169, 118, 27, 0.12);
  padding: 10px 14px;
  margin: 16px 0;
  border-radius: 3px;
}
.notice.warn {
  border-left-color: var(--wine);
  background: rgba(122, 31, 43, 0.1);
}
.notice.ok {
  border-left-color: var(--ok-green);
  background: rgba(60, 90, 48, 0.1);
}

label {
  display: block;
  font-weight: bold;
  margin: 14px 0 6px;
  color: var(--wood-dark);
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--parchment-dark);
  border: 2px solid var(--wood);
  border-radius: 4px;
  color: var(--ink);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}
input[type="text"]:focus,
input[type="password"]:focus {
  outline: 2px solid var(--gold-light);
  outline-offset: 1px;
}

.pin-input {
  font-size: 2rem;
  letter-spacing: 0.6em;
  text-align: center;
  font-family: 'Courier New', monospace;
  padding-left: 0.6em;
}

.btn {
  display: inline-block;
  font-family: Georgia, serif;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 1rem;
  padding: 11px 22px;
  border-radius: 4px;
  border: 2px solid var(--wood-dark);
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: var(--wood-dark);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--wood-dark), 0 6px 10px rgba(0, 0, 0, 0.3);
  text-decoration: none;
  transition: transform 0.08s ease;
}
.btn:hover {
  filter: brightness(1.06);
}
.btn:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--wood-dark), 0 2px 4px rgba(0, 0, 0, 0.3);
}
.btn.primary {
  background: linear-gradient(180deg, var(--wine-light), var(--wine));
  color: #f5ead0;
  border-color: var(--wine-dark);
  box-shadow: 0 3px 0 var(--wine-dark), 0 6px 10px rgba(0, 0, 0, 0.3);
}
.btn.small {
  padding: 6px 14px;
  font-size: 0.85rem;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.dropzone {
  border: 3px dashed var(--wood);
  border-radius: 8px;
  padding: 34px 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.18);
  margin: 16px 0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dropzone.drag-over {
  background: rgba(217, 172, 61, 0.25);
  border-color: var(--gold-light);
}
.dropzone .dz-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 8px;
}
.dropzone input[type="file"] {
  display: none;
}

.file-list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-item {
  border: 2px solid var(--wood);
  border-radius: 6px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.35);
}
.file-item .file-name {
  font-weight: bold;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
  margin-bottom: 6px;
}
.file-item .file-status {
  font-size: 0.85rem;
  margin-top: 6px;
}
.file-item.status-error .file-status {
  color: var(--wine);
  font-weight: bold;
}
.file-item.status-done .file-status {
  color: var(--ok-green);
  font-weight: bold;
}

.progress-track {
  height: 16px;
  border-radius: 8px;
  background: var(--parchment-dark);
  border: 1px solid var(--wood);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), #e0641f, var(--wine-light));
  background-size: 200% 100%;
  animation: torch-flicker 1.4s linear infinite;
  transition: width 0.15s ease;
}
@keyframes torch-flicker {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

.stat-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 10px 0 18px;
}
.stat-pill {
  background: rgba(91, 58, 33, 0.12);
  border: 1px solid var(--wood);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.88rem;
}
.stat-pill b {
  color: var(--wine);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: bold;
  font-variant: small-caps;
}
.badge.open {
  background: rgba(60, 90, 48, 0.2);
  color: var(--ok-green);
  border: 1px solid var(--ok-green);
}
.badge.closed {
  background: rgba(122, 31, 43, 0.15);
  color: var(--wine);
  border: 1px solid var(--wine);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.gallery-card {
  border: 3px solid var(--wood);
  border-radius: 6px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
  position: relative;
}
.gallery-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
  background: var(--parchment-dark);
}
.gallery-card .meta {
  font-size: 0.72rem;
  margin-top: 5px;
  color: var(--wood-dark);
  overflow-wrap: anywhere;
}
.gallery-card form {
  margin-top: 6px;
}
.gallery.guest .gallery-card:nth-child(odd) {
  transform: rotate(-1.2deg);
}
.gallery.guest .gallery-card:nth-child(even) {
  transform: rotate(1.2deg);
}
.gallery.guest .gallery-card:hover {
  transform: rotate(0deg) scale(1.03);
  z-index: 2;
}

footer {
  text-align: center;
  margin-top: 32px;
  font-size: 0.82rem;
  color: var(--wood);
  opacity: 0.75;
}

code, pre {
  font-family: 'Courier New', monospace;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 3px;
}
code {
  padding: 1px 5px;
}
pre {
  padding: 12px 14px;
  overflow-x: auto;
  border: 1px solid var(--wood);
}

table.api-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 26px;
  font-size: 0.92rem;
}
table.api-table th,
table.api-table td {
  border: 1px solid var(--wood);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
table.api-table th {
  background: rgba(91, 58, 33, 0.15);
}
.method {
  font-weight: bold;
  font-family: 'Courier New', monospace;
  padding: 2px 6px;
  border-radius: 3px;
  color: #fff;
  font-size: 0.8rem;
}
.method.get { background: var(--ok-green); }
.method.post { background: var(--gold); color: var(--wood-dark); }
.method.delete { background: var(--wine); }

nav.docs-nav {
  margin-bottom: 20px;
}
nav.docs-nav a {
  margin-right: 14px;
  font-variant: small-caps;
}

@media (max-width: 480px) {
  .scroll { padding: 20px 16px; }
  .banner h1 { font-size: 1.5rem; }
}
