:root {
  --bg: #f4f1ea;
  --paper: #fffdf8;
  --ink: #1c1914;
  --muted: #6b6458;
  --line: #ddd6c8;
  --accent: #1f4d3a;
  --accent-2: #c45c26;
  --ok: #1f4d3a;
  --warn: #8a5a12;
  --err: #8b1e1e;
  --sel: #e8efe9;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 15px/1.45 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #efe6d4 0%, transparent 55%),
    var(--bg);
}
button, .btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  display: inline-block;
}
button.secondary, .btn.secondary {
  background: #ece7dc;
  color: var(--ink);
}
button.danger, .btn.danger { background: var(--err); color: #fff; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.linklike, a.linklike {
  background: none;
  color: var(--accent);
  padding: 0;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  font: inherit;
}
input[type="email"],
input[type="password"],
input[type="text"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid #1f4d3a55;
  border-color: var(--accent);
}
label.field { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 10px;
}
.hint { font-size: 12px; color: var(--muted); margin-top: 14px; }
.err-text { color: var(--err); font-size: 13px; margin-top: 12px; }
.ok-text { color: var(--ok); font-size: 13px; margin-top: 12px; }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 18px 48px rgba(28, 25, 20, 0.08);
}
.gate {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.gate .card { width: min(440px, 100%); }
.gate h1 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -0.03em;
}
.gate .lede { margin: 0 0 18px; color: var(--muted); }
.stack { display: grid; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.appbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: end;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
}
.appbar h1 { margin: 0; font-size: 18px; letter-spacing: -0.03em; }
.appbar .sub { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.brand { min-width: 180px; flex: 1; }
.session {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.page {
  padding: 22px 24px 48px;
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th, table.data td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data th { font-size: 11px; color: var(--muted); font-weight: 700; }
.badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  line-height: 18px;
  display: inline-block;
}
.badge.on { background: var(--sel); border-color: var(--accent); color: var(--accent); }
.badge.off { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.mono { font: 12px/1.35 ui-monospace, Consolas, monospace; word-break: break-all; }
.hidden { display: none !important; }
.pw-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }
.pw-row button { min-width: 4.5rem; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}
.check { display: flex; gap: 8px; align-items: center; padding-bottom: 2px; }
.check input { width: 16px; height: 16px; }
.notice {
  background: #f7f3ea;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted);
}
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(28, 25, 20, 0.55);
  place-items: center;
  padding: 24px;
}
.modal.open { display: grid; }
.modal-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  width: min(460px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  box-shadow: 0 16px 48px rgba(28, 25, 20, 0.28);
}
.modal-card h2 {
  margin: 0 0 14px;
  font-size: 20px;
  letter-spacing: -0.03em;
}
input[readonly] { background: #f4f1ea; color: var(--muted); }
