:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #1c302d;
  background: #f4f6f5;
  --ink: #1c302d;
  --muted: #566762;
  --line: #d9e2dd;
  --canvas: #f4f6f5;
  --teal: #126052;
  --deep: #104e44;
  --tint: #e6f1ec;
  --shadow: 0 2px 5px rgb(27 60 47 / 4%);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 1rem; line-height: 1.5; }
a { color: var(--teal); text-underline-offset: .19em; }
a:hover { color: var(--deep); }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button { border: 0; }
:focus-visible { outline: 3px solid #0d7971; outline-offset: 3px; }
main:focus:not(:focus-visible) { outline: none; }
h1, h2, h3, p, dl, dd, ul, ol { margin: 0; }
h1, h2, h3 { text-wrap: pretty; }
h1 { font-size: clamp(1.9rem, 3.5vw, 2.7rem); line-height: 1.12; letter-spacing: -.046em; font-weight: 680; }
h2 { font-size: 1.17rem; line-height: 1.35; letter-spacing: -.025em; font-weight: 650; }
h3 { font-size: 1.045rem; line-height: 1.4; letter-spacing: -.015em; }
.icon { width: 1.15rem; height: 1.15rem; flex: none; vertical-align: middle; }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus { position: fixed; z-index: 10; top: .75rem; left: .75rem; padding: .7rem 1rem; border-radius: .5rem; background: white; }
.muted, .lead { color: var(--muted); }
.lead { margin-top: .65rem; font-size: 1rem; line-height: 1.55; }

.shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  padding: 1.55rem 1rem 1rem;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none; }
.sidebar > .brand { align-self: flex-start; margin-inline: .6rem; }
.brand-mark { display: grid; place-items: center; width: 2.45rem; height: 2.45rem; flex: none; border-radius: .72rem; background: var(--deep); color: #fff; }
.brand-mark svg { width: 78%; height: 78%; }
.brand-name { font-size: 1.1rem; font-weight: 710; letter-spacing: -.045em; }
.main-nav { margin-top: 3.45rem; }
.nav-caption { display: block; margin: 0 .85rem .7rem; color: var(--muted); font-size: .71rem; letter-spacing: .085em; font-weight: 700; text-transform: uppercase; }
.nav-link {
  display: flex;
  align-items: center;
  gap: .76rem;
  width: 100%;
  min-height: 2.75rem;
  padding: .6rem .84rem;
  border-radius: .55rem;
  background: transparent;
  color: #495953;
  font-size: .925rem;
  font-weight: 550;
  text-align: left;
  text-decoration: none;
}
.nav-link:hover { background: var(--canvas); color: var(--ink); }
.nav-link.active, .nav-link[aria-current="page"] { background: var(--tint); color: var(--deep); font-weight: 650; }
.desktop-account { margin-top: auto; padding-top: 2rem; }
.account { padding-top: 1rem; border-top: 1px solid var(--line); }
.identity { display: flex; gap: .72rem; align-items: center; padding: .15rem .65rem .95rem; }
.avatar { display: grid; place-items: center; flex: none; width: 2.35rem; height: 2.35rem; border: 1px solid #cddfd5; border-radius: 50%; background: #eff5f1; color: var(--deep); font-weight: 650; }
.identity-label { display: block; color: var(--muted); font-size: .75rem; }
.identity strong { display: block; font-size: .9rem; overflow-wrap: anywhere; }
.account-nav .nav-link { font-size: .87rem; }
.work-area { min-width: 0; }
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 4.5rem;
  padding: .9rem clamp(1.2rem, 3.75vw, 4rem);
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-width: 0; color: var(--muted); font-size: .84rem; }
.breadcrumbs .icon { width: .85rem; height: .85rem; color: #74817a; }
.breadcrumbs a, .breadcrumbs [aria-current] { overflow-wrap: anywhere; }
.breadcrumbs a { color: inherit; }
.breadcrumbs [aria-current] { color: var(--ink); font-weight: 620; }
.mobile-menu, .mobile-brand { display: none; }
.main-content { width: 100%; max-width: 94rem; margin-inline: auto; padding: clamp(2.1rem, 3.7vw, 4rem) clamp(1.2rem, 3.75vw, 4rem) 4rem; overflow-wrap: anywhere; }
.page-heading, .panel-header, .directory-header, .access-footer, .search-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 1.4rem;
}
.page-heading { align-items: end; margin-bottom: clamp(1.45rem, 2.45vw, 2.5rem); }
.page-heading > div { min-width: 0; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .56rem;
  min-height: 2.75rem;
  padding: .58rem .98rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  font-size: .9rem;
  font-weight: 630;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
}
.button.primary { color: #fff; background: var(--teal); border-color: var(--teal); box-shadow: var(--shadow); }
.button.primary:hover { color: #fff; background: var(--deep); border-color: var(--deep); }
.button.secondary { color: #324a41; background: #fff; border-color: #bccbc2; }
.button.secondary:hover { color: var(--deep); background: #f1f6f3; border-color: #97ada1; }
.button .icon { width: 1.04rem; height: 1.04rem; }

.panel { min-width: 0; border: 1px solid var(--line); border-radius: .95rem; background: #fff; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 1.5rem; }
.panel-header, .directory-header { padding: 1.15rem clamp(1rem, 2.2vw, 1.8rem); }
.panel-header { border-bottom: 1px solid var(--line); }
.section-title { display: flex; gap: .65rem; align-items: center; min-width: 0; }
.section-icon, .empty-icon { display: inline-grid; place-items: center; flex: none; color: var(--teal); background: var(--tint); }
.section-icon { width: 2.1rem; height: 2.1rem; border-radius: .55rem; }
.count { min-width: 1.65rem; padding: .12rem .46rem; border: 1px solid #dae2dc; border-radius: 2rem; background: #f5f7f5; color: #4f6257; font-size: .75rem; font-weight: 650; text-align: center; }
.directory-header { padding-block: 1.35rem; }
.search-form { display: flex; align-items: center; gap: .45rem; max-width: 100%; }
.search-field { position: relative; min-width: 0; }
.search-field > .icon { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); width: 1.05rem; height: 1.05rem; color: var(--muted); pointer-events: none; }
.search-field input { width: min(18vw, 18rem); min-width: 12rem; height: 2.75rem; padding: .45rem .6rem .45rem 2.35rem; border: 1px solid #bdcbc3; border-radius: .55rem; background: #fff; font-size: .9rem; }
input::placeholder { color: #596c62; opacity: 1; }
.search-summary { justify-content: flex-start; gap: .25rem .9rem; padding: .7rem clamp(1rem, 2.2vw, 1.8rem); border-top: 1px solid var(--line); background: #f6faf7; font-size: .9rem; }
.project-list { list-style: none; padding: 0; }
.project-grid {
  display: grid;
  grid-template-columns: minmax(9rem, 2fr) minmax(5.25rem, .8fr) minmax(6rem, .9fr) 1rem;
  gap: 1.1rem;
  align-items: center;
  padding-inline: clamp(1rem, 2.2vw, 1.8rem);
}
.project-grid.with-access { grid-template-columns: minmax(9rem, 2fr) minmax(5.25rem, .85fr) minmax(4rem, .65fr) minmax(6rem, .9fr) 1rem; }
.list-head { padding-block: .68rem; border-block: 1px solid var(--line); color: var(--muted); background: #f7f9f7; font-size: .72rem; letter-spacing: .045em; font-weight: 650; text-transform: uppercase; }
.project-row { min-height: 5rem; padding-block: .95rem; color: var(--ink); text-decoration: none; }
.project-list li + li { border-top: 1px solid var(--line); }
.project-list li:last-child .project-row { border-radius: 0 0 .95rem .95rem; }
.project-row:hover { background: #f5faf7; color: var(--deep); }
.project-row:focus-visible { position: relative; outline-offset: -3px; }
.project-identity { display: flex; gap: .8rem; align-items: center; min-width: 0; }
.project-initial { display: grid; place-items: center; flex: none; width: 2.55rem; height: 2.55rem; border: 1px solid #d8e4dd; border-radius: .65rem; background: #edf4ef; color: #3a6553; font-size: 1.06rem; font-weight: 630; }
.project-text { display: grid; gap: .14rem; min-width: 0; }
.project-text strong { font-size: .97rem; font-weight: 650; }
.project-text > span, .access-count, .update-date { color: var(--muted); font-size: .86rem; }
.project-row:hover .project-text strong { text-decoration: underline; text-underline-offset: .19em; }
.access-count { display: flex; align-items: center; gap: .45rem; font-variant-numeric: tabular-nums; }
.access-count .icon { width: 1rem; height: 1rem; }
.update-date { font-variant-numeric: tabular-nums; }
.mobile-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.row-arrow { display: flex; justify-content: end; color: #688071; }
.row-arrow .icon { width: .95rem; height: .95rem; }
.status, .kind { display: inline-flex; align-items: center; gap: .38rem; padding: .18rem .54rem; border-radius: 1rem; background: #eff1f2; color: #4e5c61; font-size: .775rem; font-weight: 620; }
.status::before { content: ""; flex: none; width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; }
.status-active { background: #e5f3e9; color: #2a6a45; }
.status-planned { background: #eaf0f9; color: #3c607f; }
.status-paused { background: #fbefd9; color: #79511e; }
.empty-state { display: grid; place-items: center; padding: clamp(2.75rem, 6vw, 5.25rem) 1.25rem; text-align: center; }
.directory .empty-state { border-top: 1px solid var(--line); }
.empty-icon { width: 3rem; height: 3rem; margin-bottom: .9rem; border-radius: .85rem; }
.empty-icon .icon { width: 1.48rem; height: 1.48rem; }
.empty-state p { max-width: 30rem; margin-top: .3rem; color: var(--muted); font-size: .9rem; }

.project-byline, .access-heading, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .85rem; }
.project-byline { margin-top: .75rem; color: var(--muted); font-size: .9rem; }
.data-grid { display: grid; gap: 1.25rem 2rem; }
.data-grid > div { min-width: 0; }
.data-grid dt { margin-bottom: .25rem; color: var(--muted); font-size: .8rem; font-weight: 570; }
.data-grid dd { font-size: .95rem; }
.project-data { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 1.5rem clamp(1rem, 2.2vw, 1.8rem); }
.notes { grid-column: 1 / -1; }
.notes dd { white-space: pre-wrap; }
.resource-link .icon { width: .85rem; height: .85rem; }
.access-item { padding: 1.45rem clamp(1rem, 2.2vw, 1.8rem); }
.access-item + .access-item { border-top: 1px solid var(--line); }
.kind { background: #eef3f0; color: #425c50; }
.access-data { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(3rem, .45fr); margin-block: 1.1rem 1.25rem; }
.technical, .secret-value { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.access-footer { gap: .65rem 1rem; font-size: .8rem; }
.actions { gap: .5rem; }

.edit-form, .reveal-panel, .retire-panel { max-width: 56rem; }
.form-body, .secret-body, .retire-body { padding: 1.55rem clamp(1rem, 2.2vw, 1.8rem); }
.retire-panel { max-width: 40rem; }
.retire-body p { margin-top: 1rem; }
.retire-link { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.75rem; padding: .5rem .65rem; color: #923e34; font-size: .86rem; }
.retire-link:hover { color: #66271f; }
.retire-link .icon { width: 1rem; height: 1rem; }
.section-icon.danger-icon { color: #8d382e; background: #faece8; }
.button.danger { color: #fff; background: #9e4135; }
.button.danger:hover { background: #83352b; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem 1.4rem; align-items: start; }
.wide-field, .form-errors { grid-column: 1 / -1; }
.field-stack { display: grid; gap: 1.2rem; }
.edit-form:has(.field-stack) { max-width: 40rem; }
.form-field { display: grid; gap: .38rem; min-width: 0; }
.form-field label, .form-field legend { color: #2e4338; font-size: .89rem; font-weight: 620; }
.form-field fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.optional { color: var(--muted); font-size: .79rem; font-weight: 400; }
.form-field input:not([type="checkbox"]):not([type="radio"]), .form-field select, .form-field textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 2.85rem;
  padding: .58rem .74rem;
  border: 1px solid #afc0b5;
  border-radius: .5rem;
  background: #fff;
  font-size: 1rem;
  line-height: 1.45;
}
.form-field select { padding-right: 1.3rem; }
.form-field textarea { resize: vertical; }
.field-help { color: var(--muted); font-size: .82rem; }
.field-help ul { padding-left: 1.2rem; }
.field-help li + li { margin-top: .16rem; }
.errorlist { padding: 0; list-style: none; color: #9c342e; font-size: .875rem; }
.form-field.has-error :is(input, select, textarea) { border-color: #b34036; }
.form-errors, .notice { padding: .85rem 1rem; border: 1px solid #c6d9ce; border-radius: .55rem; background: #eef6f1; }
.notice { margin-bottom: 1.15rem; }
.notice.error, .form-errors { background: #fff3f0; border-color: #e8c3bd; color: #84362b; }
.notice.warning { background: #fbf4e6; border-color: #ddcfac; }
.form-footer { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: 1.1rem clamp(1rem, 2.2vw, 1.8rem); border-top: 1px solid var(--line); }
.secret-body .muted { margin-top: .75rem; font-size: .86rem; }
.secret-value { max-width: 100%; margin: 0; padding: 1rem; border: 1px solid #bfcec4; border-radius: .55rem; background: #f1f6f3; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; font-size: 1rem; line-height: 1.65; }
.secret-value code { font: inherit; }

.login-page { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: clamp(1rem, 5vw, 4rem); }
.login-frame {
  display: grid;
  grid-template-columns: .92fr 1.13fr;
  width: min(100%, 59rem);
  min-height: 28rem;
  border: 1px solid #cddad1;
  border-radius: 1.25rem;
  background: #fff;
  box-shadow: 0 12px 42px rgb(21 62 45 / 8%);
  overflow-wrap: anywhere;
}
.login-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  padding: clamp(1.6rem, 3.5vw, 3.2rem);
  border-radius: 1.18rem 0 0 1.18rem;
  background: var(--deep);
  color: #fff;
}
.login-intro .brand { color: #fff; }
.login-intro .brand-mark { background: #e1f1e8; color: var(--deep); }
.login-intro h2 { font-size: clamp(1.75rem, 3.25vw, 2.6rem); line-height: 1.15; letter-spacing: -.05em; }
.intro-rule { display: block; width: 2.1rem; height: 3px; margin-bottom: 1rem; background: #9bceac; }
.login-intro p { max-width: 26ch; margin-top: .85rem; color: #e0efe6; font-size: 1rem; }
.login-form { align-self: center; min-width: 0; padding: clamp(1.8rem, 4vw, 3.65rem); }
.login-form h1 { font-size: 2.15rem; }
.login-form .lead { margin-top: .4rem; font-size: .94rem; }
.login-form form { margin-top: 1.7rem; }
.login-submit { justify-content: space-between; width: 100%; margin-top: .3rem; }

@media (max-width: 72rem) {
  .shell { grid-template-columns: 13.5rem minmax(0, 1fr); }
  .main-content, .topbar { padding-inline: 1.65rem; }
  .project-grid { gap: .7rem; }
}

@media (max-width: 60rem) {
  .shell { display: block; }
  .sidebar { display: none; }
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .7rem; padding-block: .75rem; }
  .mobile-brand { display: inline-flex; justify-self: start; }
  .mobile-brand .brand-mark { width: 2rem; height: 2rem; border-radius: .55rem; }
  .breadcrumbs { grid-row: 2; grid-column: 1 / -1; }
  .mobile-menu { display: block; grid-row: 1; grid-column: 2; }
  .mobile-menu summary { display: flex; align-items: center; gap: .4rem; min-height: 2.75rem; padding: .45rem .75rem; border: 1px solid var(--line); border-radius: .5rem; font-size: .9rem; font-weight: 620; list-style: none; }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .mobile-menu[open] summary { background: var(--tint); }
  .menu-panel { position: absolute; z-index: 2; right: 1.65rem; top: 3.65rem; width: min(19rem, calc(100% - 2rem)); max-height: 75vh; overflow-y: auto; padding: .65rem; border: 1px solid var(--line); border-radius: .7rem; background: #fff; box-shadow: 0 8px 25px rgb(27 60 47 / 12%); }
  .menu-panel .account { margin-top: .35rem; }
  .search-field input { width: 15rem; }
}

@media (max-width: 44rem) {
  .main-content { padding: 1.65rem 1rem 3rem; }
  .topbar { padding-inline: 1rem; }
  .menu-panel { right: 1rem; }
  .page-heading { align-items: start; gap: .9rem; }
  .page-heading .lead { font-size: .94rem; }
  .directory-header { align-items: stretch; flex-direction: column; padding-block: 1rem; }
  .search-field { flex: 1; }
  .search-field input { width: 100%; min-width: 0; font-size: 1rem; }
  .list-head { display: none; }
  .directory .project-list { border-top: 1px solid var(--line); }
  .project-row, .project-row.with-access {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "identity arrow" "status status" "date date";
    gap: .65rem .5rem;
    padding: 1rem;
  }
  .project-row.with-access { grid-template-areas: "identity arrow" "status count" "date date"; }
  .project-identity { grid-area: identity; }
  .project-status { grid-area: status; }
  .row-arrow { grid-area: arrow; }
  .access-count { grid-area: count; justify-self: end; }
  .update-date { grid-area: date; font-size: .8rem; }
  .mobile-label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .data-grid, .form-grid { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .access-footer { align-items: flex-start; flex-direction: column; }
  .login-frame { grid-template-columns: minmax(0, 1fr); max-width: 28rem; min-height: 0; }
  .login-intro { gap: 1.7rem; padding: 1.55rem; border-radius: 1.18rem 1.18rem 0 0; }
  .login-intro h2 { font-size: 1.75rem; }
  .login-intro p { max-width: 34ch; font-size: .94rem; margin-top: .4rem; }
  .intro-rule { display: none; }
  .login-form { padding: 1.55rem; }
}

@media (max-width: 25rem) {
  .main-content, .topbar { padding-inline: .8rem; }
  .page-heading > .button, .panel-header > .button { width: 100%; }
  .actions { align-items: stretch; width: 100%; }
  .actions > *, .actions .button { width: 100%; }
}

@media print {
  body, .work-area { background: #fff; }
  .shell { display: block; }
  .sidebar, .topbar, .skip-link, .button, .search-form { display: none; }
  .main-content { max-width: none; padding: 0; }
  .panel { box-shadow: none; }
}
