:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --text: #18201f;
  --muted: #66706b;
  --line: #d8ded8;
  --accent: #116b5b;
  --accent-strong: #0a4c41;
  --amber: #8a5a00;
  --red: #a52727;
  --green: #17663a;
  --blue: #284f8f;
  --shadow: 0 16px 38px rgba(25, 35, 30, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 22px 140px 22px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  position: sticky;
  top: 0;
  z-index: 5;
}

h1,
h2 {
  margin: 0;
  line-height: 1.1;
}

.language-switch {
  position: absolute;
  top: 22px;
  right: 32px;
  display: grid;
  grid-template-columns: repeat(2, 40px);
  height: 36px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}
.language-switch span { display: grid; place-items: center; border-radius: 3px; }
.language-switch .selected { color: #fff; background: var(--accent-strong); }
.language-switch:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 14px;
}

.nav-link.active,
.nav-link:hover {
  color: var(--accent-strong);
  border-color: var(--line);
  background: #f2faf6;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
  padding: 24px 32px 40px;
  max-width: 1280px;
  margin: 0 auto;
}

.two-column {
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
}

.dashboard-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.wide {
  grid-column: 1 / -1;
}

.section-heading {
  margin-bottom: 18px;
}

.field[hidden] { display: none; }

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 12px;
}

.field span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--text);
  background: #fbfcfa;
  font: inherit;
}

textarea {
  resize: vertical;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.boundary-note {
  margin: -4px 0 16px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  border-radius: 7px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.status-card,
.empty-state,
.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: #fbfcfa;
}

.status-card.success {
  color: var(--green);
  background: #eef9f1;
  border-color: #bcdcc5;
}

.status-card.warning {
  color: var(--amber);
  background: #fff8e8;
  border-color: #ead7a0;
}

.status-card.danger {
  color: var(--red);
  background: #fff1f1;
  border-color: #efb9b9;
}

.code-block {
  min-height: 340px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #151b1a;
  color: #e8f2ed;
  font-size: 12px;
  line-height: 1.55;
}

.credential-view {
  min-height: 128px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 14px 0;
  background: #f4f7f7;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.result-card {
  display: grid;
  gap: 8px;
}

.label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

code {
  overflow-wrap: anywhere;
}

.protected-view {
  min-height: 360px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfa;
  position: relative;
}

.protected-view pre {
  white-space: pre-wrap;
  line-height: 1.6;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.watermark {
  margin-bottom: 14px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-panel h2 {
  font-size: 32px;
}

.table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: var(--muted);
  font-weight: 800;
  background: #fbfcfa;
}

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.pill.allow {
  color: var(--green);
  background: #e6f6ed;
}

.pill.deny {
  color: var(--red);
  background: #ffe8e8;
}

.pill.info {
  color: var(--blue);
  background: #edf4ff;
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 122px 18px 18px;
  }
  .language-switch { top: 18px; right: 18px; }

  .layout,
  .two-column,
  .dashboard-layout {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .metadata-grid {
    grid-template-columns: 1fr;
  }
}
/* Recipient selection stays independent of translated labels and search state. */
#recipientPicker { border: 1px solid #ccd4d0; padding: 16px; min-width: 0; margin-bottom: 20px; }
#recipientList { max-height: 240px; overflow: auto; }
#recipientList .recipient-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px; overflow-wrap: anywhere; cursor: pointer; }
#recipientList .recipient-row:focus-within { outline: 2px solid var(--accent-strong); outline-offset: -2px; }
#recipientList .recipient-row:has(input:checked) { background: #e6f2ec; }
#recipientList .recipient-row[hidden] { display: none; }
#recipientList input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 20px; padding: 0; margin: 0; cursor: pointer; }
.admin-fields { border: 0; padding: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-page .panel, .admin-page .field, .admin-fields, #adminWorkspace { min-width: 0; }
.admin-page select { min-width: 0; max-width: 100%; }
.admin-page .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-fields input[type="checkbox"], .admin-choice input { width: 20px; height: 20px; padding: 0; flex: 0 0 20px; }
.admin-choices { border: 1px solid var(--line); min-width: 0; }
.admin-choice { display: flex; align-items: center; min-height: 44px; gap: 10px; overflow-wrap: anywhere; }
@media (max-width: 640px) { .admin-fields, .admin-page .form-grid { grid-template-columns: minmax(0, 1fr); } }
.runtime-notice { padding: 16px 20px; border-left: 4px solid #a77327; background: #fff8e9; color: #26332e; }
.runtime-notice h2 { font-size: 18px; }
.runtime-notice p, .runtime-notice li { overflow-wrap: anywhere; }
.runtime-notice ul { padding-left: 20px; line-height: 1.6; }
