:root {
  --lu-green: #67cb2a;
  --lu-green-bright: #7de03a;
  --lu-dark: #0a0a0a;
  --lu-muted: #6b6b6b;
  --lu-border: #e5e5e5;
  --lu-bg: #f3f4f6;
  --radius: 1rem;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Syne", var(--font-sans);
  --font-logo: "Montserrat", var(--font-sans);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--lu-dark);
  background: var(--lu-bg);
  line-height: 1.55;
}

h1, h2 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.5rem;
}

a { color: inherit; }

.shell {
  max-width: 980px;
  padding: 1.25rem;
  margin: 1.25rem auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
}

.brand {
  font-family: var(--font-logo);
  font-weight: 800;
  text-decoration: none;
  font-size: 1.2rem;
  color: inherit;
}

.brand span { color: var(--lu-green); margin-left: 0.15rem; }

.top-nav { display: flex; gap: 0.75rem; align-items: center; }

.link-quiet {
  color: var(--lu-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.link-quiet.is-active { color: var(--lu-dark); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--lu-muted);
  margin: 0 0 0.4rem;
}

.lede { color: var(--lu-muted); margin: 0 0 1.25rem; }

.card-page {
  background: #fff;
  border-radius: 1.25rem;
  padding: 2rem;
  max-width: 32rem;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
}

.page-login .shell,
.page-404 .shell {
  max-width: 36rem;
}

.card-narrow { margin-top: 2rem; }

.field { margin-bottom: 1rem; }
.field-full { grid-column: 1 / -1; }

.field label,
.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--lu-border);
  border-radius: 0.75rem;
  padding: 0.7rem 0.85rem;
  font: inherit;
  background: #fff;
}

.field textarea { resize: vertical; }

.field input[type="file"] {
  padding: 0.55rem;
}

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
  border-color: #d12c2c;
  background: #fff6f6;
}

.field-error {
  color: #d12c2c;
  font-size: 0.82rem;
  margin: 0.35rem 0 0;
}

.hint { color: var(--lu-muted); font-size: 0.8rem; margin: 0.35rem 0 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary { background: var(--lu-green); color: var(--lu-dark); }
.btn-ghost { background: #eee; color: var(--lu-dark); font-size: 0.85rem; }
.btn-danger { background: #1a1a1a; color: #fff; }

.banner {
  padding: 0.8rem 1rem;
  border-radius: 0.8rem;
  margin-bottom: 1rem;
}

.banner-ok { background: #e8f8dc; color: #24580f; }

.status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: #eee;
  white-space: nowrap;
}

.status-file { background: #d8f5c4; }
.status-redirect { background: #d6e4ff; }

.admin-main { padding-top: 0.5rem; }

.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.admin-head h1 { margin-bottom: 0.25rem; }
.admin-head .lede { margin: 0; }

.crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--lu-muted);
}
.crumb a {
  color: var(--lu-muted);
  text-decoration: none;
}
.crumb a:hover { color: var(--lu-dark); }
.crumb span[aria-hidden="true"] { color: #c4c4c4; }

.search-form {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
  margin: 0 0 1rem;
}
.search-form .field {
  flex: 1;
  margin: 0;
}
.search-form .btn { height: 2.85rem; }

.link-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }

.link-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
  background: #fff;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
}

.link-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.link-url {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin: 0.3rem 0 0;
  color: var(--lu-muted);
  font-size: 0.88rem;
  word-break: break-all;
}

.btn-copy {
  border: 0;
  background: #f0f0f0;
  color: var(--lu-dark);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
}

.link-meta {
  margin: 0.25rem 0 0;
  color: var(--lu-muted);
  font-size: 0.85rem;
  word-break: break-all;
}

.link-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 7rem;
  text-align: right;
}

.link-stats strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

.link-stats span { color: var(--lu-muted); font-size: 0.78rem; }
.link-last { margin-top: 0.2rem; }

.post-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.admin-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
  background: #fff;
  padding: 1.25rem;
  border-radius: 1.25rem;
}

.form-actions, .delete-form { grid-column: 1 / -1; margin-top: 0.5rem; }
.form-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.delete-form {
  background: #fff;
  padding: 1.25rem;
  border-radius: 1.25rem;
  margin-top: 1rem;
}

.slug-input {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--lu-border);
  border-radius: 0.75rem;
  background: #fff;
  overflow: hidden;
}

.slug-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.2rem 0 0.85rem;
  color: var(--lu-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.slug-input input {
  border: 0;
  border-radius: 0;
  padding-left: 0;
}

.field.is-invalid .slug-input {
  border-color: #d12c2c;
  background: #fff6f6;
}

.type-picks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.type-pick {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.9rem;
  border: 1.5px solid var(--lu-border);
  border-radius: 0.9rem;
  cursor: pointer;
  font-weight: 500;
}

.type-pick input { width: auto; margin-top: 0.2rem; }
.type-pick strong { display: block; font-size: 0.95rem; }
.type-pick span { color: var(--lu-muted); font-size: 0.82rem; line-height: 1.4; }
.type-pick:has(input:checked) {
  border-color: #9ee06a;
  background: #f3fbe9;
}

.check-label { display: flex; gap: 0.5rem; align-items: flex-start; font-weight: 600; }
.check-label input { width: auto; margin-top: 0.2rem; }

.empty { background: #fff; padding: 1.5rem; border-radius: 1rem; color: var(--lu-muted); }

@media (max-width: 860px) {
  .shell { padding: 1rem; margin: 0; }
  .admin-form, .link-row, .type-picks { grid-template-columns: 1fr; }
  .link-stats { align-items: flex-start; text-align: left; }
  .admin-head { flex-direction: column; align-items: flex-start; }
  .search-form { flex-direction: column; align-items: stretch; }
}
