:root{
  --paper:#EEF0E7;
  --paper-alt:#E3E6D8;
  --card:#FBFAF5;
  --ink:#1C2B39;
  --ink-soft:#4B5A66;
  --brass:#9C7A3C;
  --brass-dark:#7C632E;
  --stamp:#8B3A2A;
  --stamp-dark:#6E2C1E;
  --line: rgba(28,43,57,0.16);
  --line-strong: rgba(28,43,57,0.28);
  --white:#FBFAF6;
  --radius: 3px;
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  background:var(--paper);
  color:var(--ink);
  font-family:'Inter',system-ui,sans-serif;
  line-height:1.5;
  min-height:100vh;
}
a{color:inherit;}
button{font-family:inherit;}
.mono{font-family:'IBM Plex Mono',monospace;}

::selection{ background: var(--brass); color:var(--white); }
:focus-visible{ outline:2px solid var(--stamp); outline-offset:2px; }

.paper-bg{
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
  background-position: -1px -1px;
  opacity:0.35;
  position:fixed; inset:0; pointer-events:none; z-index:0;
}
.app{ position:relative; z-index:1; min-height:100vh; display:flex; flex-direction:column; }

header.nav{
  border-bottom:1px solid var(--line-strong);
  background: rgba(251,250,246,0.9);
  backdrop-filter: blur(4px);
  position:sticky; top:0; z-index:20;
}
.nav-inner{
  max-width:1080px; margin:0 auto; padding:16px 28px;
  display:flex; align-items:center; justify-content:space-between; gap:20px;
}
.brand{ display:flex; align-items:center; gap:12px; cursor:pointer; text-decoration:none; }
.brand img{ width:38px; height:38px; object-fit:contain; border-radius:2px; }
.brand .mark{
  width:38px;height:38px;border-radius:50%;
  border:1.5px dashed var(--brass);
  display:flex;align-items:center;justify-content:center;
  font-family:'Newsreader',serif; font-weight:600; font-size:14px; color:var(--brass-dark);
  flex-shrink:0;
}
.brand-name{ font-family:'Newsreader',serif; font-size:19px; font-weight:600; letter-spacing:0.2px; }
.brand-name span{ display:block; font-family:'IBM Plex Mono',monospace; font-size:10px; letter-spacing:1.5px; color:var(--ink-soft); font-weight:400; text-transform:uppercase; margin-top:1px;}

.nav-actions{ display:flex; align-items:center; gap:14px; font-size:14px; }
.nav-actions .who{ color:var(--ink-soft); font-family:'IBM Plex Mono',monospace; font-size:12px; }
.btn{
  font-size:14px; font-weight:600; padding:9px 18px; border-radius:var(--radius);
  border:1.5px solid var(--ink); background:transparent; color:var(--ink);
  cursor:pointer; transition: background .15s ease, color .15s ease, transform .1s ease;
  text-decoration:none; display:inline-flex; align-items:center; gap:6px;
}
.btn:hover{ background:var(--ink); color:var(--white); }
.btn:active{ transform: scale(0.98); }
.btn.primary{ background:var(--stamp); border-color:var(--stamp); color:var(--white); }
.btn.primary:hover{ background:var(--stamp-dark); border-color:var(--stamp-dark); }
.btn.ghost{ border-color:transparent; color:var(--ink-soft); padding:9px 12px; }
.btn.ghost:hover{ background:var(--paper-alt); color:var(--ink); }
.btn.small{ padding:6px 12px; font-size:12.5px; }
.btn:disabled{ opacity:0.5; cursor:not-allowed; }
.btn:disabled:hover{ background:transparent; color:var(--ink); }
.btn.danger{ border-color:var(--stamp); color:var(--stamp-dark); }
.btn.danger:hover{ background:var(--stamp); color:var(--white); }

main{ flex:1; }
.wrap{ max-width:1080px; margin:0 auto; padding:0 28px; }

.hero{ padding:64px 0 40px; }
.hero-top{ display:flex; gap:32px; align-items:flex-start; flex-wrap:wrap; }
.hero-logo img{ width:104px; height:104px; object-fit:contain; background:var(--card); border:1px solid var(--line-strong); border-radius:6px; padding:10px; }
.hero-logo .mark-lg{
  width:104px;height:104px;border-radius:50%;
  border:2px dashed var(--brass);
  display:flex;align-items:center;justify-content:center;
  font-family:'Newsreader',serif; font-weight:600; font-size:34px; color:var(--brass-dark);
}
.eyebrow{
  font-family:'IBM Plex Mono',monospace; text-transform:uppercase; letter-spacing:2px;
  font-size:11.5px; color:var(--stamp); font-weight:500; margin-bottom:10px; display:block;
}
h1.title{ font-family:'Newsreader',serif; font-size:44px; font-weight:600; line-height:1.08; margin:0 0 6px; }
.about-text{ max-width:620px; font-size:16.5px; color:var(--ink-soft); margin-top:14px; white-space:pre-wrap; }
.edit-row{ margin-top:14px; display:flex; gap:10px; flex-wrap:wrap; }

.areas{ padding:20px 0 70px; }
.areas h2{ font-family:'Newsreader',serif; font-size:15px; font-weight:500; letter-spacing:0.3px; color:var(--ink-soft); margin:0 0 22px; border-bottom:1px solid var(--line); padding-bottom:12px; }
.area-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
@media (max-width:760px){ .area-grid{ grid-template-columns:1fr; } .hero-top{flex-direction:column;} }

.area-card{
  background:var(--card); border:1px solid var(--line-strong); border-radius:6px;
  padding:26px 22px; text-align:left; cursor:pointer; position:relative; overflow:hidden;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  display:flex; flex-direction:column; gap:14px; min-height:150px;
}
.area-card:hover{ transform: translateY(-3px); box-shadow:0 8px 18px rgba(28,43,57,0.10); border-color:var(--ink-soft); }
.stamp-badge{
  width:56px; height:56px; border-radius:50%;
  border:2px dashed var(--stamp);
  display:flex; align-items:center; justify-content:center;
  color:var(--stamp); font-family:'IBM Plex Mono',monospace; font-weight:600; font-size:11px; letter-spacing:0.5px;
  flex-shrink:0;
}
.area-card:nth-child(1) .stamp-badge{ transform:rotate(-7deg); }
.area-card:nth-child(2) .stamp-badge{ transform:rotate(4deg); }
.area-card:nth-child(3) .stamp-badge{ transform:rotate(-3deg); }
.area-card h3{ font-family:'Newsreader',serif; font-size:21px; margin:0; font-weight:600; }
.area-card p{ margin:0; font-size:13.5px; color:var(--ink-soft); }
.area-card .go{ margin-top:auto; font-size:12.5px; font-family:'IBM Plex Mono',monospace; color:var(--stamp); }

footer{ border-top:1px solid var(--line-strong); padding:22px 0; margin-top:auto; }
footer .wrap{ display:flex; justify-content:space-between; align-items:center; font-size:12.5px; color:var(--ink-soft); flex-wrap:wrap; gap:8px; }

.login-wrap{ max-width:440px; margin:0 auto; padding:60px 28px 80px; }
.login-wrap h1{ font-family:'Newsreader',serif; font-size:30px; margin:0 0 8px; }
.login-wrap > p{ color:var(--ink-soft); font-size:14.5px; margin:0 0 28px; }

.field{ margin-bottom:14px; }
.field label{ display:block; font-size:12.5px; font-weight:600; margin-bottom:6px; color:var(--ink-soft); text-transform:uppercase; letter-spacing:0.4px; }
.field input, .field select{
  width:100%; padding:11px 12px; border:1.5px solid var(--line-strong); border-radius:var(--radius);
  font-size:14.5px; background:var(--card); color:var(--ink); font-family:inherit;
}
.field input:focus, .field select:focus{ border-color:var(--ink); }
.hint{ font-size:12px; color:var(--ink-soft); font-family:'IBM Plex Mono',monospace; background:var(--paper-alt); padding:10px 12px; border-radius:var(--radius); margin-top:18px; line-height:1.6; }
.error-msg{ background:#FCEEE9; border:1px solid var(--stamp); color:var(--stamp-dark); padding:9px 12px; border-radius:var(--radius); font-size:13px; margin-bottom:14px; }
.ok-msg{ background:#EAF2E7; border:1px solid #5C7A4A; color:#3E5732; padding:9px 12px; border-radius:var(--radius); font-size:13px; margin-bottom:14px; }

.breadcrumb{ font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--ink-soft); padding:22px 0 0; }
.breadcrumb a{ text-decoration:none; }
.breadcrumb a:hover{ text-decoration:underline; }
.page-hero{ padding:20px 0 60px; display:flex; gap:30px; align-items:flex-start; flex-wrap:wrap; }
.page-hero .stamp-badge{ width:88px; height:88px; font-size:14px; }
.page-body{ flex:1; min-width:260px; }
.page-body h1{ font-family:'Newsreader',serif; font-size:36px; margin:0 0 14px; }
.page-body .about-text{ max-width:640px; }
.page-logo img{ width:88px; height:88px; object-fit:contain; background:var(--card); border:1px solid var(--line-strong); border-radius:6px; padding:8px; }

.edit-panel{
  background:var(--card); border:1.5px dashed var(--brass); border-radius:6px;
  padding:20px; margin-top:18px; max-width:640px;
}
.edit-panel h4{ margin:0 0 12px; font-family:'IBM Plex Mono',monospace; font-size:11.5px; text-transform:uppercase; letter-spacing:1px; color:var(--brass-dark); }
.edit-panel textarea{
  width:100%; min-height:120px; padding:11px 12px; border:1.5px solid var(--line-strong); border-radius:var(--radius);
  font-size:14.5px; font-family:'Inter',sans-serif; color:var(--ink); resize:vertical; margin-bottom:12px;
}
.edit-panel input[type=text]{ width:100%; padding:10px 12px; border:1.5px solid var(--line-strong); border-radius:var(--radius); margin-bottom:12px; font-size:14.5px; }
.file-row{ display:flex; align-items:center; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
.file-row input[type=file]{ font-size:13px; }
.panel-actions{ display:flex; gap:10px; }

.toast{
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(20px);
  background:var(--ink); color:var(--white); padding:11px 20px; border-radius:var(--radius);
  font-size:13.5px; font-weight:500; opacity:0; pointer-events:none; transition: all .25s ease; z-index:100;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

.placeholder-page{ padding:60px 0 90px; max-width:680px; }
.placeholder-page h1{ font-family:'Newsreader',serif; font-size:32px; margin:0 0 12px; }
.placeholder-page p{ color:var(--ink-soft); }

.users-table{ width:100%; border-collapse:collapse; margin-top:20px; font-size:14px; }
.users-table th, .users-table td{ text-align:left; padding:10px 12px; border-bottom:1px solid var(--line); }
.users-table th{ font-family:'IBM Plex Mono',monospace; font-size:11px; text-transform:uppercase; letter-spacing:0.5px; color:var(--ink-soft); }
.role-tag{ font-family:'IBM Plex Mono',monospace; font-size:11px; padding:3px 8px; border-radius:20px; border:1px solid var(--line-strong); }
.new-user-form{ display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; margin-top:20px; background:var(--card); border:1px solid var(--line-strong); border-radius:6px; padding:18px; }
.new-user-form .field{ margin-bottom:0; flex:1; min-width:140px; }

[hidden]{ display:none !important; }

@media (prefers-reduced-motion: reduce){
  *{ transition:none !important; }
}
