:root {
  color-scheme: light;
  --bg: #f4f2ed;
  --surface: #fffefa;
  --ink: #191b1d;
  --muted: #687078;
  --line: #dedbd2;
  --accent: #176b52;
  --accent-dark: #0f4c3a;
  --danger: #a3332b;
  --warning: #8a5a12;
  --shadow: 0 16px 40px rgba(30, 36, 33, 0.07);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  min-height: 64px;
  padding: 0 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 250, 0.92);
  backdrop-filter: blur(12px);
}
.brand { color: var(--ink); font-size: 18px; font-weight: 780; letter-spacing: -0.02em; }
.container { width: min(1180px, 92vw); margin: 44px auto 80px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
h1, h2 { margin: 0; line-height: 1.18; letter-spacing: -0.035em; }
h1 { font-size: clamp(30px, 5vw, 52px); }
h2 { font-size: 19px; margin-bottom: 18px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: 0.14em; margin: 0 0 8px; }
.muted { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: grid; gap: 16px; }
.auth-card { width: min(430px, 100%); margin: 10vh auto; padding: 36px; }
.auth-card h1 { font-size: 36px; }
label { display: grid; gap: 6px; color: #444a4f; font-size: 13px; font-weight: 650; }
input, select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #c9c6bd;
  border-radius: 9px;
  background: white;
  color: var(--ink);
  font: inherit;
}
input:focus, select:focus { outline: 3px solid rgba(23, 107, 82, 0.15); border-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.wide { grid-column: 1 / -1; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font: 650 14px/1 ui-sans-serif, system-ui, sans-serif;
  text-decoration: none;
}
.button:hover { text-decoration: none; }
.button.primary { color: white; background: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button.ghost { color: var(--ink); background: transparent; border-color: var(--line); }
.button.danger { color: white; background: var(--danger); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.compact-list, .attachment-list { margin: 18px 0 0; padding: 0; list-style: none; }
.compact-list li, .attachment-list li { padding: 9px 0; border-top: 1px solid var(--line); }
.status-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: #999; margin-right: 9px; }
.status-dot.active { background: #2d9f70; box-shadow: 0 0 0 4px rgba(45,159,112,.12); }
.notice { margin-bottom: 20px; padding: 13px 16px; border-radius: 10px; border: 1px solid; }
.notice.success { color: #14543f; background: #e9f5ef; border-color: #b8ddcd; }
.notice.error { color: #7c251f; background: #faecea; border-color: #e8bbb7; }
.notice.warning { color: #67430d; background: #fff5dc; border-color: #ead4a0; }
.section-heading { display: flex; align-items: center; gap: 10px; padding: 20px 24px; }
.section-heading h2 { margin: 0; }
.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 24px; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.truncate { max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.empty { color: var(--muted); text-align: center; padding: 42px; }
.pill, .badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #ebe9e2; color: #535a60; font-size: 12px; }
.badge.active { color: #13553f; background: #e2f2eb; }
.badge.expired, .badge.disabled { color: #74312b; background: #f7e9e7; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.secret-list { display: grid; gap: 14px; }
.secret-item { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(300px, 2fr) auto; gap: 12px; align-items: center; }
.message-meta dl { display: grid; grid-template-columns: 100px 1fr; gap: 8px 18px; margin: 0; }
.message-meta dt { color: var(--muted); }
.message-meta dd { margin: 0; overflow-wrap: anywhere; }
.message-body { margin-top: 20px; }
.message-body pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }
.attachment-list li { display: flex; justify-content: space-between; gap: 20px; }

@media (max-width: 760px) {
  .grid.two, .form-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .page-heading { align-items: start; flex-direction: column; }
  .secret-item { grid-template-columns: 1fr; }
  .container { margin-top: 28px; }
  th, td { padding: 12px 16px; }
}

