:root {
  --bg: #FAF5EC; --bg-alt: #F2E9D7; --surface: #FFFDF7;
  --ink: #2A1C10; --muted: #7A6A55; --line: #E4D8C2;
  --marigold: #E8A33D; --orange: #C9611E; --olive: #5C7A2E;
  --shadow: rgba(42, 28, 16, .13);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Avenir Next", "Seravek", "Segoe UI", -apple-system, sans-serif;
  line-height: 1.5; min-height: 100vh;
}
.serif { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; display: block; }
.hint { font-size: 12px; color: var(--muted); font-weight: 500; }
.error { color: #a33; font-size: 14px; margin: 10px 0 0; }
.status { margin: 0; font-size: 14px; color: var(--muted); min-height: 1.2em; }
.status.ok { color: var(--olive); }
.status.err { color: #a33; }

.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.login-card {
  width: min(400px, 100%); background: var(--surface);
  border: 1px solid var(--line); border-radius: 20px; padding: 36px 28px;
  box-shadow: 0 24px 50px -28px var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
}
.login-card > a[href="/"] { align-self: center; display: flex; justify-content: center; line-height: 0; }
.login-logo { height: 144px; width: auto; display: block; }
.login-card h1 { margin: 0; text-align: center; font-size: 28px; }
.login-card .muted { text-align: center; margin: -6px 0 8px; font-size: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
input, textarea {
  font: inherit; font-weight: 500; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--marigold); outline-offset: 1px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: none; cursor: pointer;
  font: inherit; font-weight: 700; text-decoration: none;
}
.btn.primary { background: var(--orange); color: #FFFDF7; }
.btn.ghost { background: transparent; border: 2px solid var(--ink); color: var(--ink); }
.btn.sm { padding: 8px 14px; font-size: 13.5px; }
.btn:disabled { opacity: .55; cursor: wait; }
.ghost-link { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; }
.ghost-link:hover { color: var(--orange); }

.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 920px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 44px; width: auto; }
.top-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.wrap { max-width: 920px; margin: 0 auto; padding: 24px 20px 100px; }
.tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.tab {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  padding: 10px 18px; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer;
}
.tab.active { background: var(--orange); color: #FFFDF7; border-color: var(--orange); }

fieldset {
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  padding: 18px 18px 16px; margin: 0 0 18px;
  display: flex; flex-direction: column; gap: 12px;
}
legend {
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 18px; font-weight: 700; padding: 0 6px;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } }

.list { display: flex; flex-direction: column; gap: 12px; }
.item-card {
  border: 1px dashed var(--line); border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 10px; background: var(--bg);
}
.item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.item-head strong { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.danger { background: transparent; border: none; color: #a33; font-weight: 700; cursor: pointer; font-size: 13px; }
.logo-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.logo-preview { height: 48px; width: 48px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.file-btn { font-size: 13px; }

.save-bar {
  position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); border-top: 1px solid var(--line);
  margin: 24px -20px -24px; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
