:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #17281f;
  background: #eff3f0;
  --ink: #17281f;
  --muted: #526359;
  --line: #d5e1da;
  --green: #205840;
  --paper: #fcfefc;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.topbar { background: #143829; color: #f5fff8; }
.topbar-content {
  max-width: 76rem; min-height: 4.5rem; margin: auto; padding: .75rem clamp(1rem, 4vw, 2.5rem);
  display: flex; align-items: center; gap: clamp(1rem, 3vw, 3rem); flex-wrap: wrap;
}
.brand, .account, nav { display: flex; gap: .65rem; align-items: center; }
.brand { font-weight: 700; white-space: nowrap; }
.brand-mark, .app-icon {
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: .65rem;
  color: #1a4b34; background: #caebd6; font-weight: 750;
}
.account { margin-left: auto; font-size: .9rem; }
.topbar button { background: transparent; color: inherit; border-color: transparent; }
.topbar button:hover, .topbar button[aria-current] { background: #2a5340; }
main { max-width: 76rem; margin: auto; padding: clamp(1rem, 4vw, 2.5rem); }
h1 { font-size: clamp(1.65rem, 4vw, 2.5rem); margin: 0; letter-spacing: -.035em; }
h2 { font-size: 1.15rem; margin: 0; }
p { line-height: 1.5; }
.muted { color: var(--muted); margin: .45rem 0 0; }
.heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.5rem; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 1rem; padding: 1.4rem; }
.sign-in { width: min(100%, 27rem); margin: clamp(1rem, 8vh, 6rem) auto; padding: clamp(1.2rem, 4vw, 2rem); }
.sign-in h1 { margin-bottom: 1.25rem; }
form { display: grid; gap: .85rem; }
label { display: grid; gap: .35rem; font-size: .92rem; font-weight: 600; }
input, select, textarea, button, .button { font: inherit; }
input:not([type="checkbox"]), select, textarea {
  width: 100%; min-width: 0; padding: .62rem .75rem; border: 1px solid #aabeb1; border-radius: .45rem;
  background: white; color: var(--ink);
}
.password-group { display: grid; gap: .35rem; }
.password-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.password-field { position: relative; flex: 1 1 8rem; min-width: 0; }
.password-field input, .password-mask { font: 1rem / 1.25 monospace; }
.password-field input::placeholder { color: var(--muted); }
.password-field input::-ms-reveal { display: none; }
.password-mask {
  position: absolute;
  inset: 1px calc(.75rem + 1px);
  align-content: center;
  overflow: hidden;
  white-space: pre;
  pointer-events: none;
}
.password-field input:has(+ .password-mask:not([hidden])) {
  color: transparent;
  caret-color: var(--ink);
}
.password-field input:has(+ .password-mask:not([hidden]))::selection { color: transparent; }
@media (forced-colors: active) {
  .password-mask { display: none; }
  .password-field input:has(+ .password-mask:not([hidden])) { color: FieldText; }
}
input[type="checkbox"] { margin: 0; width: 1rem; height: 1rem; accent-color: var(--green); }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
:focus-visible { outline: 3px solid #5397b6; outline-offset: 3px; }
button, .button {
  display: inline-block; padding: .55rem .85rem; border: 1px solid #a9c0b1; border-radius: .5rem;
  text-align: center; background: #f0f7f2; color: #194b34; text-decoration: none; cursor: pointer;
}
button:hover, .button:hover { background: #dcefe3; }
.primary { color: #fff; background: var(--green); border-color: var(--green); }
.primary:hover { background: #15452f; }
button:disabled { opacity: .6; cursor: wait; }
.app-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.app-card { display: flex; flex-direction: column; gap: .8rem; align-items: start; }
.app-card p { margin: 0 0 .25rem; color: var(--muted); white-space: pre-line; }
.app-card a { margin-top: auto; }
.empty { color: var(--muted); margin: 0; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.records { margin-top: .8rem; }
.record { border-top: 1px solid var(--line); }
.record summary { padding: .75rem 0; cursor: pointer; font-weight: 600; }
.record[open] { padding-bottom: 1rem; }
fieldset { border: 1px solid var(--line); border-radius: .5rem; padding: .65rem; margin: 0; min-width: 0; }
fieldset div { display: flex; flex-wrap: wrap; gap: .65rem 1rem; }
legend { font-size: .9rem; }
.app-fields { display: grid; gap: .75rem; grid-template-columns: 1fr 2fr; }
.secondary-form { margin: 1rem 0 .65rem; }
[data-activity] { margin: 0 0 .75rem; }
.audit { padding-left: 1.2rem; line-height: 1.55; overflow-wrap: anywhere; }
#feedback { padding: .7rem .95rem; background: #d9eee0; border-radius: .5rem; margin: 0 0 1rem; }
#feedback.error { color: #7b2423; background: #f8e2df; }
@media (max-width: 42rem) {
  .admin-grid { grid-template-columns: 1fr; }
  .topbar-content { gap: .5rem; }
  nav { order: 3; flex-basis: 100%; }
}
