:root {
  color-scheme: light;
  --forest: #12372b;
  --forest-hover: #1b4a38;
  --forest-overlay: #12372b99;
  --emerald: #13754f;
  --nav-active: #8bd6aa;
  --ink: #18352b;
  --muted: #55675e;
  --line: #d4dfd6;
  --paper: #f6f8f5;
  --white: #fff;
  --red: #a72e37;
  --alert-bg: #fbeaec;
  --alert-border: #dcaeb2;
  --amber: #795308;
  --green-soft: #e5f4eb;
  --resource-soft: #e8f0e7;
  --available: #167348;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  font-weight: 400;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 14px; line-height: 1.55; }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
a { color: var(--emerald); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--emerald);
  outline-offset: 3px;
}
::selection { background: var(--green-soft); color: var(--forest); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, .app-title { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h1 { margin-bottom: 8px; font-size: clamp(32px, 3.1vw, 42px); line-height: 1.12; letter-spacing: -.035em; }
h2 { margin-bottom: 5px; font-size: 22px; line-height: 1.2; }
h3 { margin-bottom: 8px; font-size: 19px; }
.muted { color: var(--muted); }

.wordmark { color: white; text-decoration: none; font-size: 22px; line-height: 1; font-weight: 700; letter-spacing: -.04em; }
.masthead {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 52px;
  padding: 0 max(34px, calc((100vw - 1320px) / 2));
  background: var(--forest);
  color: #e5f4eb;
}
.masthead nav { display: flex; align-items: stretch; gap: 30px; min-height: 76px; }
.nav-item {
  display: inline-flex;
  align-items: center;
  color: var(--green-soft);
  text-decoration: none;
  font-size: 14px;
  border-bottom: 2px solid transparent;
}
.nav-item.active, .nav-item:hover { color: white; border-color: var(--nav-active); }
.text-button { margin-left: auto; border: 0; background: transparent; color: #e5f4eb; padding: 10px 0; }
.text-button:hover { color: white; text-decoration: underline; text-underline-offset: 4px; }

main { width: min(1320px, calc(100% - 72px)); margin: 0 auto; }
.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding: 42px 0 28px; }
.page-intro .muted { margin: 0; max-width: 65ch; }
.breadcrumb { margin-bottom: 17px; color: var(--muted); font-size: 12px; }
.breadcrumb span { padding: 0 7px; color: var(--emerald); }
.primary, .secondary, .danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 650;
  white-space: nowrap;
}
.primary { background: var(--forest); color: white; }
.primary:hover { background: var(--forest-hover); }
.secondary { background: white; color: var(--ink); border-color: var(--line); }
.secondary:hover { background: var(--green-soft); }
.danger { background: var(--red); color: white; }

.summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 30px;
  min-height: 60px;
  padding: 12px 0;
  border-block: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.summary strong { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; margin-right: 3px; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--muted); }
.dot.up { background: var(--available); }
.dot.down { background: var(--red); }
.dot.unknown { background: var(--muted); }

.applications-section { padding-top: 35px; scroll-margin-top: 24px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 19px; }
.section-heading h2 { margin-bottom: 5px; }
.section-heading p { margin-bottom: 0; font-size: 12px; }
.coolify-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 16px; padding: 13px 15px; border: 1px solid var(--line); background: var(--green-soft); }
.coolify-panel strong { color: var(--forest); font-size: 12px; }
.coolify-panel p { margin: 3px 0 0; font-size: 12px; }
.coolify-panel button { min-height: 38px; font-size: 12px; }
.count-pill { margin-left: 5px; color: var(--emerald); font: 600 12px/1.4 ui-sans-serif, system-ui, sans-serif; vertical-align: middle; }
.search-label { margin: 0; }
.search-label input { width: min(310px, 32vw); }
input, textarea {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  color: var(--ink);
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.list-labels, .app-entry {
  display: grid;
  grid-template-columns: minmax(250px, 2.1fr) minmax(135px, 1fr) minmax(88px, .65fr) minmax(155px, 1.1fr) minmax(190px, 1.35fr);
  align-items: center;
  column-gap: 20px;
}
.list-labels {
  padding: 0 12px 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.app-entry {
  position: relative;
  min-height: 106px;
  padding: 17px 12px;
  border-top: 1px solid var(--line);
}
.app-entry:last-child { border-bottom: 1px solid var(--line); }
.app-entry-project { min-width: 0; }
.app-title { display: inline-block; max-width: 100%; color: var(--ink); font-size: 19px; line-height: 1.25; text-decoration: none; overflow-wrap: anywhere; }
.external-link-icon { width: 13px; height: 13px; margin-left: 6px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vertical-align: .02em; }
.app-title:hover { color: var(--emerald); text-decoration: underline; text-underline-offset: 3px; }
.app-url { margin: 3px 0 2px; color: var(--muted); font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.app-description { margin: 0; color: var(--muted); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.app-source { margin: 4px 0 0; color: var(--emerald); font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 8px; width: max-content; max-width: 100%; color: var(--muted); font-size: 12px; font-weight: 650; }
.badge::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.badge.up { color: var(--available); }
.badge.up::before { background: var(--available); }
.badge.down { color: var(--red); }
.badge.down::before { background: var(--red); }
.badge.error { color: var(--amber); }
.badge.error::before { background: var(--amber); }
.app-measure { color: var(--muted); font-size: 12px; }
.app-measure strong { display: block; margin-top: 3px; color: var(--ink); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 13px; }
.card-actions button { min-height: 34px; padding: 4px 0; border: 0; background: transparent; color: var(--emerald); font-size: 12px; }
.card-actions button:hover { text-decoration: underline; text-underline-offset: 3px; }
.card-actions .delete { color: var(--red); }
.app-error, .app-notes { grid-column: 1 / -1; margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.app-error { color: var(--red); }
.app-notes { color: var(--muted); }
.app-notes summary { width: max-content; cursor: pointer; color: var(--emerald); }
.app-notes p { max-width: 75ch; margin: 7px 0 0; white-space: pre-wrap; }
.empty-state { padding: 42px 18px; text-align: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.empty-state h3 { font: 500 22px/1.2 Georgia, "Times New Roman", serif; }
.empty-state p { max-width: 48ch; margin: 0 auto 20px; color: var(--muted); }

.resources-section { margin-top: 46px; padding: 23px 25px 18px; background: var(--resource-soft); scroll-margin-top: 24px; }
.resources-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.resources-heading h2 { margin-bottom: 4px; }
.resources-heading p { margin-bottom: 0; font-size: 12px; }
.metrics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 18px; }
.metric-card { padding: 0 20px; border-left: 1px solid var(--line); }
.metric-card:first-child { padding-left: 0; border-left: 0; }
.metric-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; }
.metric-heading strong { color: var(--forest); font: 500 24px/1.15 Georgia, "Times New Roman", serif; font-variant-numeric: tabular-nums; }
.metric-card small { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
progress { display: block; width: 100%; height: 5px; margin-top: 11px; border: 0; border-radius: 4px; overflow: hidden; appearance: none; background: var(--green-soft); }
progress::-webkit-progress-bar { background: var(--green-soft); }
progress::-webkit-progress-value { background: var(--emerald); border-radius: 4px; }
progress::-moz-progress-bar { background: var(--emerald); border-radius: 4px; }
.resource-note { margin: 16px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
footer { display: flex; justify-content: space-between; gap: 15px; padding: 25px 0 30px; font-size: 12px; }
.banner { padding: 12px 15px; background: var(--alert-bg); border: 1px solid var(--alert-border); color: var(--red); }

.login-screen { min-height: 100dvh; display: grid; place-items: center; padding: 28px; background: var(--forest); }
.login-card { width: min(470px, 100%); padding: 42px; background: var(--paper); border-top: 5px solid var(--emerald); }
.login-card .wordmark { display: inline-block; margin-bottom: 54px; color: var(--forest); }
.login-card h1 { max-width: 10ch; font-size: 32px; }
.login-card > p { font-size: 14px; }
.login-card .primary { width: 100%; margin: 19px 0 14px; }
.login-card small { color: var(--muted); font-size: 12px; }
label { display: block; margin: 16px 0 7px; font-size: 12px; font-weight: 650; }
.field-help { margin: 8px 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.error-text { margin: 12px 0; color: var(--red); font-size: 12px; }
.error-text:empty { margin: 0; }

dialog { width: min(540px, calc(100% - 30px)); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 28px; border: 1px solid var(--line); color: var(--ink); background: var(--paper); }
dialog::backdrop { background: var(--forest-overlay); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { margin-bottom: 0; }
.icon-button { border: 0; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 23px; }
.toast { position: fixed; right: 25px; bottom: 25px; z-index: 10; max-width: calc(100% - 50px); padding: 13px 18px; background: var(--forest); color: white; border: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1100px) {
  main { width: min(100% - 48px, 1320px); }
  .masthead { gap: 35px; padding-inline: 24px; }
  .masthead nav { gap: 20px; }
  .list-labels, .app-entry { grid-template-columns: minmax(210px, 1.8fr) minmax(125px, 1fr) 84px minmax(130px, 1fr); column-gap: 14px; }
  .list-labels span:last-child { display: none; }
  .card-actions { grid-column: 2 / -1; justify-self: end; }
}
@media (max-width: 760px) {
  .masthead { min-height: 65px; gap: 22px; padding-inline: 20px; }
  .masthead nav { min-height: 65px; gap: 16px; }
  .nav-item { font-size: 12px; }
  .text-button { font-size: 12px; }
  main { width: calc(100% - 40px); }
  .page-intro { align-items: start; padding: 31px 0 22px; }
  .page-intro .primary { padding-inline: 12px; font-size: 12px; }
  .summary { gap: 10px 20px; }
  .list-labels { display: none; }
  .app-entry { grid-template-columns: minmax(0, 1fr) minmax(110px, .7fr); gap: 10px 16px; padding: 17px 5px; }
  .app-entry-project { grid-column: 1 / -1; }
  .app-entry .badge { grid-column: 1; }
  .app-measure { grid-column: 2; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
  .app-measure strong { margin-top: 0; text-align: right; }
  .card-actions { grid-column: 1 / -1; justify-self: stretch; padding-top: 5px; }
  .resources-section { padding: 19px; }
}
@media (max-width: 560px) {
  .masthead { flex-wrap: wrap; gap: 0 17px; padding: 14px 18px 0; }
  .masthead .wordmark { margin: 0 auto 0 0; }
  .masthead nav { order: 3; width: 100%; min-height: 45px; justify-content: space-between; gap: 10px; }
  .nav-item { font-size: 12px; }
  .text-button { margin-left: 0; padding-block: 7px; }
  main { width: calc(100% - 36px); }
  .page-intro { display: block; }
  .page-intro .primary { width: 100%; margin-top: 18px; }
  h1 { font-size: 32px; }
  .summary { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; padding: 13px 0; }
  .section-heading { align-items: start; flex-wrap: wrap; gap: 14px; }
  .coolify-panel { align-items: flex-start; flex-direction: column; }
  .search-label, .search-label input { width: 100%; }
  .app-entry { grid-template-columns: minmax(0, 1fr); }
  .app-entry-project, .app-entry .badge, .app-measure, .card-actions, .app-error, .app-notes { grid-column: 1; }
  .app-measure { justify-content: start; gap: 12px; }
  .app-measure strong { text-align: left; }
  .card-actions { gap: 8px 17px; }
  .resources-section { margin-top: 34px; padding: 17px 15px; }
  .resources-heading { align-items: start; }
  .resources-heading h2 { font-size: 22px; }
  .metrics-grid { grid-template-columns: 1fr; margin-top: 14px; }
  .metric-card, .metric-card:first-child { padding: 11px 0; border-left: 0; border-top: 1px solid var(--line); }
  .metric-card:first-child { border-top: 0; }
  .metric-heading strong { font-size: 22px; }
  footer { flex-direction: column; gap: 6px; }
  .login-card { padding: 30px 25px; }
  .login-card .wordmark { margin-bottom: 42px; }
  .login-card h1 { font-size: 32px; }
  dialog { padding: 21px; }
  .dialog-actions { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: no-preference) {
  button, a { transition: background-color .16s ease, color .16s ease, border-color .16s ease; }
}
