:root {
  --green-900: #245214; --green-800: #2f6d1c; --green-700: #3a8324; --green-500: #58c200; --green-050: #f2fbeb;
  --ink: #1a1c19; --body: #333333; --muted: #677489; --muted-strong: #4b5563;
  --line: #e6e8e6; --line-strong: #d3d7d2; --gray: #f8f8f8; --white: #ffffff;
  --danger: #a32e22; --danger-wash: #fdf2f1; --warn: #8a5a00;
  --display: Manrope, Inter, system-ui, sans-serif; --sans: Inter, system-ui, sans-serif; --utility: Roboto, Inter, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--gray); color: var(--body); font-family: var(--sans); font-size: 15px; line-height: 1.5; }
a { color: var(--green-700); }
a:hover { color: var(--green-800); }
h1, h2, h3 { font-family: var(--display); color: var(--ink); margin: 0; line-height: 1.18; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 800; }
:focus-visible { outline: 3px solid var(--green-800); outline-offset: 2px; }

.layout { display: flex; flex-wrap: wrap; min-height: 100vh; }
.nav { flex: 1 1 220px; max-width: 260px; min-width: 200px; background: var(--ink); color: var(--white); padding: 24px 16px; display: flex; flex-direction: column; gap: 6px; }
.nav .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 24px; font-family: var(--display); font-weight: 800; font-size: 17px; }
.nav a { min-height: 44px; display: flex; align-items: center; padding: 0 12px; border-radius: 8px; color: #b9c2b4; text-decoration: none; font-size: 14px; }
.nav a:hover { color: var(--white); background: rgba(255,255,255,0.06); }
.nav a.active { background: rgba(88, 194, 0, 0.16); color: var(--white); font-weight: 600; }
.nav .who { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid rgba(255,255,255,0.1); font-size: 13px; color: #b9c2b4; display: flex; flex-direction: column; gap: 8px; }
.nav .who button { align-self: flex-start; }
@media (max-width: 700px) {
  .nav { max-width: none; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; }
  .nav .brand { padding: 0 8px 0 0; }
  .nav .who { margin: 0; border: 0; padding: 0; flex-direction: row; align-items: center; margin-left: auto; }
}
.main { flex: 999 1 560px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 700px) { .main { padding: 20px 16px; } }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.row .grow { flex-grow: 1; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; }
.card.pad { padding: 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--danger); background: var(--danger-wash); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.notice { color: var(--green-900); background: var(--green-050); border-radius: 8px; padding: 10px 12px; font-size: 14px; }

.btn { min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--white); color: var(--body); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--green-700); border-color: var(--green-700); color: var(--white); }
.btn.primary:hover { background: var(--green-800); border-color: var(--green-800); }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn.link { border: 0; background: none; padding: 0 4px; min-height: 36px; color: var(--green-700); }
.btn:disabled { opacity: 0.6; cursor: default; }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
label.field .hint { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=url], input[type=tel], input[type=search], select, textarea {
  min-height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--body); background: var(--white); width: 100%;
}
textarea { padding: 10px 12px; resize: vertical; min-height: 70px; }
.search { display: flex; align-items: center; gap: 8px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 16px; background: var(--white); }
.search input { border: 0; min-height: 40px; padding: 0; outline: none; }
.search input:focus-visible { outline: none; }
.search:focus-within { border: 2px solid var(--green-700); padding: 0 15px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--green-050); color: var(--green-900); white-space: nowrap; }
.chip.gray { background: var(--gray); color: var(--muted-strong); border: 1px solid var(--line); }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick label { display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; cursor: pointer; background: var(--white); }
.pick label:has(input:checked) { background: var(--green-700); border-color: var(--green-700); color: var(--white); font-weight: 600; }
.pick input { accent-color: var(--green-700); margin: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted-strong); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td .title { font-weight: 600; color: var(--ink); }
.status-active { color: var(--green-900); font-weight: 600; font-size: 13px; }
.status-off { color: var(--muted); font-weight: 600; font-size: 13px; }

.results { display: flex; flex-direction: column; gap: 10px; }
.result { text-decoration: none; color: inherit; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.result:hover { border-color: var(--green-700); }
.result .t { font-weight: 600; color: var(--ink); }
.result .d { font-size: 14px; color: var(--muted); }

dialog { border: 0; border-radius: 16px; padding: 0; overflow: auto; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 18px 44px rgba(26,28,25,0.2); }
dialog::backdrop { background: rgba(26,28,25,0.45); }
dialog form { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.rule { display: grid; grid-template-columns: 150px minmax(0,1fr) minmax(0,1.4fr) auto; gap: 8px; align-items: center; }
@media (max-width: 560px) { .rule { grid-template-columns: 1fr; } }
.section-label { font-family: var(--utility); font-weight: 700; font-size: 11px; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }

.signin { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.signin .card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 16px; }
.code { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.code input { text-align: center; font-size: 20px; font-weight: 600; min-height: 52px; padding: 0; }
.empty { padding: 32px; text-align: center; color: var(--muted); }
.bar { height: 8px; border-radius: 4px; background: var(--green-700); min-width: 2px; }
