:root {
  --bg: #221a11;
  --brass: #c68e4f;
  --brass-bright: #e0ac6d;
  --brass-dim: rgba(198, 142, 79, 0.18);
  --text: #f0e8db;
  --muted: #a89a85;
  --faint: #5c5245;
  --line: rgba(198, 142, 79, 0.16);
  --card-bg: rgba(255, 255, 255, 0.035);
  --ok: #8fbf9f;
  --warn: #e3b551;
  --danger: #e08b7b;
  --r: 3px;
}

* { box-sizing: border-box; padding: 0; margin: 0; }
html { background-color: var(--bg); }
body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(198, 142, 79, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% 85%, rgba(120, 84, 48, 0.08) 0%, transparent 50%);
  background-color: var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  min-height: 100vh;
}
h1, h2 { font-weight: 600; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; height: 57px;
  background: rgba(34, 26, 17, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; letter-spacing: 0.08em; color: var(--brass-bright); }
.nav-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 0; }
.nav-pill { font-size: 0.78rem; letter-spacing: 0.06em; color: var(--muted); padding: 6px 12px; border-radius: 999px; border: 1px solid transparent; }
.nav-pill:hover { color: var(--text); border-color: var(--line); }
.nav-pill.identity { border-color: var(--line); color: var(--brass-bright); }

.page-wrap { max-width: 800px; margin: 0 auto; padding: 40px 24px 80px; }
.page-overline { font-size: 0.7rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--brass); margin-bottom: 10px; }
.page-title { font-size: clamp(1.5rem, 3.5vw, 2rem); letter-spacing: 0.04em; margin-bottom: 8px; }
.page-sub { color: var(--muted); font-size: 0.88rem; line-height: 1.6; max-width: 640px; margin-bottom: 24px; }

.anim-in { animation: fadeUp 0.3s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.panel { background: var(--card-bg); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 18px; overflow: hidden; }
.wide-panel {
  width: 92vw; max-width: 1400px;
  margin-left: 50%; transform: translateX(-50%);
}
.panel-head { padding: 12px 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.02); display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-title { font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass); }
.panel-body { padding: 14px 18px; }

.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; }
.row-link:hover { background: rgba(255,255,255,0.02); }

.lbl { display: block; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.inp {
  width: 100%; padding: 9px 12px; font-size: 0.9rem; font-family: inherit;
  background: rgba(0,0,0,0.25); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r); outline: none;
}
/* Select popups render with the browser's native (light) list background
   in most engines, regardless of the closed box's styling — but they still
   inherit our light text color, so without this every dropdown list reads
   as light-on-light. option only reliably accepts background/color. */
select.inp option, select option {
  background: var(--bg);
  color: var(--text);
}
.inp:focus { border-color: var(--brass); }
.field { margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

.btn {
  display: inline-block; padding: 9px 18px; font-size: 0.84rem; letter-spacing: 0.04em;
  background: var(--brass-dim); color: var(--brass-bright); border: 1px solid var(--brass);
  border-radius: var(--r); cursor: pointer; font-family: inherit;
}
.btn:hover:not(:disabled) { background: rgba(198,142,79,0.28); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-danger { color: var(--danger); border-color: var(--danger); background: rgba(224,139,123,0.1); }

.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.72rem; border: 1px solid var(--brass); color: var(--brass-bright); }

.faint { color: var(--faint); font-size: 0.76rem; }
.muted { color: var(--muted); }
.note { color: var(--warn); font-size: 0.85rem; margin-bottom: 16px; }
.error { color: var(--danger); font-size: 0.85rem; margin-bottom: 16px; }

.check-item { cursor: pointer; }
.check-item input { width: 18px; height: 18px; accent-color: var(--brass); flex-shrink: 0; }
.check-item .item-text { font-size: 0.88rem; }
.check-item .item-meta { display: block; font-size: 0.7rem; color: var(--faint); margin-top: 2px; }

.stamp {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, rgba(198,142,79,0.14), rgba(198,142,79,0.04));
  border: 1px solid var(--brass); border-radius: 8px; margin: 0 0 24px; padding: 16px 22px;
}
.stamp img { width: 40px; height: 40px; object-fit: contain; }
.stamp-label { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass); }
.stamp-name { font-size: 1.05rem; color: var(--text); margin-top: 2px; }

.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex: 1; }

.back-link { font-size: 0.8rem; color: var(--muted); display: inline-block; margin-bottom: 16px; }
.back-link:hover { color: var(--text); }

form.inline { display: inline; }
.inline-edit { display: flex; gap: 8px; flex: 1; min-width: 200px; }

.icon-btn {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: var(--r); padding: 6px 11px; font-size: 0.85rem; line-height: 1;
}
.icon-btn:hover:not(:disabled) { color: var(--text); border-color: var(--brass); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }
.section-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

.fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--brass-dim); border: 1px solid var(--brass);
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  color: var(--brass-bright);
}
.fab:hover { background: rgba(198,142,79,0.3); }
