* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f7f5f0; --card: #ffffff; --ink: #1f1e1b; --muted: #6f6b64; --line: #e3dfd8;
  --accent: #2e5e4e; --accent-soft: #e1eee9; --warn: #b23a2e; --warn-soft: #f9e9e6;
  --ok: #1e7a4a; --ok-soft: #e2f2e9; --amber: #8a6100; --amber-soft: #fdf3d6;
  --shadow: 0 10px 30px -12px rgba(0,0,0,.12); --radius: 14px;
  --font: 'Inter', system-ui, -apple-system, sans-serif; --mono: 'IBM Plex Mono', 'SF Mono', monospace;
}
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; padding: 0 20px 60px; min-height: 100vh; }
.page { max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.masthead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 36px 0 12px; border-bottom: 1px solid var(--line); position: relative; }
.masthead::after { content: ''; position: absolute; bottom: -1px; left: 0; width: 80px; height: 3px; background: var(--accent); border-radius: 2px; }
.masthead h1 { font-size: clamp(24px, 4vw, 34px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.masthead h1 em { font-style: normal; color: var(--accent); }
.masthead p { color: var(--muted); font-size: 14.5px; margin-top: 6px; max-width: 560px; }
.topnav { display: flex; flex-wrap: wrap; gap: 8px; }
.topnav a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: 13.5px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: #f4f2ee; transition: transform .12s, box-shadow .2s; }
.topnav a:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(0,0,0,.2); }
.topnav a.current { background: var(--accent); color: #fff; border-color: var(--accent); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-body { padding: 18px 20px; }
.panel-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-header h2 { font-size: 16px; font-weight: 700; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .03em; }
.field input, .field select { font: inherit; font-size: 13.5px; color: var(--ink); background: #f4f2ee; border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; min-height: 38px; }
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: #fff; }
.field input[readonly] { opacity: .65; cursor: not-allowed; }
.field input.mono { font-family: var(--mono); }
.grow { flex: 1 1 200px; }
.btn { font: inherit; font-weight: 600; border-radius: 8px; min-height: 38px; padding: 7px 18px; cursor: pointer; border: 1px solid var(--line); background: #f4f2ee; color: var(--ink); transition: transform .12s, box-shadow .2s, opacity .15s; font-size: 13.5px; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.danger { color: var(--warn); border-color: #ecc9c4; background: var(--warn-soft); }
.btn.small { min-height: 30px; padding: 4px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(0,0,0,.2); }
.msg { font-size: 13px; margin-top: 10px; min-height: 18px; }
.msg.ok { color: var(--ok); } .msg.err { color: var(--warn); }
.banner { padding: 12px 18px; border-radius: var(--radius); font-weight: 500; font-size: 14px; }
.banner[hidden] { display: none; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.info { background: var(--amber-soft); color: var(--amber); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { padding: 10px 14px; text-align: left; border-top: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
th { font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; border-top: none; background: #fbfaf7; }
td.mono, .mono { font-family: var(--mono); font-size: 13px; direction: ltr; unicode-bidi: isolate; }
td.actions { white-space: nowrap; text-align: right; display: table-cell; }
td.actions .btn + .btn { margin-left: 6px; }
.count-pill { display: inline-block; min-width: 28px; text-align: center; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12.5px; }
.count-pill.zero { background: #f1efea; color: var(--muted); }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.hint a { color: var(--accent); font-weight: 600; }
.colophon { margin-top: 30px; padding: 24px 0 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.colophon .powered { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); opacity: .65; }
.colophon .signature { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-size: 22px; font-weight: 600; color: var(--accent); }
html, body { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
input, textarea, select { -webkit-user-select: text; user-select: text; }
body.pg-hide * { visibility: hidden !important; }
@media print { html, body { display: none !important; visibility: hidden !important; } }
