:root {
  --ink: #17251f;
  --muted: #6b7771;
  --paper: #f4f2eb;
  --surface: #fffef9;
  --line: #d9ddd7;
  --green: #225c46;
  --green-dark: #174232;
  --green-soft: #dce9e1;
  --red: #a13f35;
  --shadow: 0 18px 45px rgba(26, 45, 36, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% 0%, #e2ebe4 0, transparent 30rem), var(--paper); }
button, input { font: inherit; }
button { cursor: pointer; }
.auth-gate { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(430px, 100%); padding: 52px; text-align: center; background: var(--surface); border: 1px solid rgba(23,37,31,.09); border-radius: 18px; box-shadow: var(--shadow); }
.auth-card .brand-mark { margin: 0 auto 24px; }
.auth-card h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 500; }
.auth-card p:last-child { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.auth-gate[data-kind="error"] .loader { display: none; }
.auth-gate[data-kind="error"] #auth-status { color: var(--red); }
.site-header { height: 84px; padding: 0 clamp(24px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(34, 92, 70, .14); }
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 42px; height: 42px; color: white; background: var(--green); border-radius: 50%; font-family: Georgia, serif; font-size: 14px; letter-spacing: .06em; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 19px; letter-spacing: .02em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.account { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #4b9b69; box-shadow: 0 0 0 4px rgba(75,155,105,.12); }
main { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.hero { padding: 68px 0 46px; display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.eyebrow { margin: 0 0 13px; color: var(--green); font-size: 11px; font-weight: 750; letter-spacing: .22em; }
.hero h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 6vw, 65px); font-weight: 500; letter-spacing: -.035em; }
.hero p:not(.eyebrow) { margin: 18px 0 0; color: var(--muted); }
.metric { min-width: 130px; padding: 4px 0 8px 26px; border-left: 1px solid var(--line); }
.metric strong, .metric span { display: block; }
.metric strong { font-family: Georgia, serif; font-size: 42px; font-weight: 400; }
.metric span { color: var(--muted); font-size: 12px; }
.panel { background: var(--surface); border: 1px solid rgba(23,37,31,.09); border-radius: 18px; box-shadow: var(--shadow); }
.create-panel { padding: clamp(24px, 4vw, 42px); }
.section-heading, .section-heading > div { display: flex; align-items: center; }
.section-heading { justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-heading > div { gap: 12px; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.step { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #bfc8c2; border-radius: 50%; color: var(--green); font-size: 10px; font-weight: 700; }
.link-form { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 18px; align-items: end; }
.field-wide { grid-column: 1 / -1; }
.field { display: grid; gap: 9px; color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.field small { color: var(--muted); font-weight: 400; }
.field input { width: 100%; min-height: 48px; padding: 0 14px; color: var(--ink); background: #fbfcf9; border: 1px solid var(--line); border-radius: 9px; outline: 0; transition: border .2s, box-shadow .2s; }
.field input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(34,92,70,.1); }
.prefix-input { display: flex; align-items: center; min-height: 48px; padding-left: 14px; background: #fbfcf9; border: 1px solid var(--line); border-radius: 9px; }
.prefix-input:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(34,92,70,.1); }
.prefix-input span { color: var(--muted); }
.prefix-input input { min-height: 44px; border: 0; box-shadow: none !important; }
.button { min-height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: transparent; font-size: 12px; font-weight: 700; transition: .18s ease; }
.button:hover { border-color: #a9b4ad; background: rgba(255,255,255,.65); }
.button:disabled { cursor: wait; opacity: .55; }
.button-primary { min-height: 48px; display: inline-flex; gap: 20px; align-items: center; justify-content: center; color: #fff; background: var(--green); border-color: var(--green); }
.button-primary:hover { color: #fff; background: var(--green-dark); border-color: var(--green-dark); transform: translateY(-1px); }
.button-quiet { border-color: transparent; }
.links-section { padding: 58px 0 90px; }
.list-heading { margin-bottom: 20px; }
.notice { margin: 0 0 14px; padding: 13px 16px; color: var(--green-dark); background: var(--green-soft); border-radius: 8px; font-size: 13px; }
.notice[data-kind="error"] { color: #7a2922; background: #f4ddd9; }
.link-list { display: grid; gap: 10px; }
.link-list[aria-busy="true"] { min-height: 100px; opacity: .55; }
.link-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 24px; background: rgba(255,254,249,.78); border: 1px solid rgba(23,37,31,.09); border-radius: 12px; transition: border-color .2s, transform .2s; }
.link-card:hover { border-color: #b6c5bc; transform: translateY(-1px); }
.link-main { min-width: 0; flex: 1; }
.link-topline { display: flex; align-items: center; gap: 10px; }
.slug { color: var(--green); font-family: Georgia, serif; font-size: 21px; font-weight: 600; text-decoration: none; }
.slug:hover { text-decoration: underline; }
.badge { padding: 4px 8px; border-radius: 99px; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.badge.enabled { color: #245c3a; background: #dcebdd; }
.badge.disabled { color: #737973; background: #e7e8e4; }
.destination { max-width: 670px; margin: 8px 0 5px; overflow: hidden; color: #49564f; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.meta { margin: 0; color: #8a948f; font-size: 11px; }
.card-actions { flex: 0 0 auto; display: flex; gap: 6px; }
.button-small { min-height: 34px; padding: 0 11px; }
.button-danger { color: var(--red); }
.empty-state { padding: 55px; text-align: center; border: 1px dashed #bdc6c0; border-radius: 12px; }
.empty-state > span { display: inline-grid; place-items: center; width: 44px; height: 44px; color: white; background: var(--green); border-radius: 50%; font-size: 20px; }
.empty-state h3 { margin: 16px 0 6px; font-family: Georgia, serif; font-weight: 500; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }
dialog { width: min(560px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 24px 80px rgba(10,25,18,.25); }
dialog::backdrop { background: rgba(15,26,21,.54); backdrop-filter: blur(3px); }
.dialog-form { display: grid; gap: 22px; padding: 30px; background: var(--surface); }
.dialog-heading { display: flex; justify-content: space-between; }
.dialog-heading h2 { margin: 0; font-family: Georgia, serif; font-weight: 500; }
.icon-button { align-self: start; width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--muted); background: #eef0eb; font-size: 22px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
footer { display: flex; justify-content: space-between; padding: 24px clamp(24px, 5vw, 72px); color: var(--muted); border-top: 1px solid rgba(34,92,70,.14); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.callback-page { display: grid; place-items: center; }
.callback-card { width: min(460px, calc(100% - 40px)); padding: 52px; text-align: center; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); }
.callback-card h1 { font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
.callback-card p:last-child { color: var(--muted); font-size: 13px; }
.loader { width: 28px; height: 28px; margin: 28px auto; border: 2px solid var(--green-soft); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 800px) {
  .link-form { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .link-card { align-items: flex-start; flex-direction: column; }
  .card-actions { width: 100%; flex-wrap: wrap; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .list-heading { flex-direction: row; align-items: center; }
}

@media (max-width: 560px) {
  .site-header { height: auto; padding-top: 15px; padding-bottom: 15px; }
  #account-email, .status-dot { display: none; }
  main { width: min(100% - 24px, 1120px); }
  .hero { align-items: flex-start; flex-direction: column; padding-top: 45px; }
  .hero h1 { font-size: 41px; }
  .metric { padding-left: 0; border: 0; }
  .create-panel { padding: 22px; }
  .section-heading p { line-height: 1.6; }
  .link-card { padding: 19px; }
  footer { gap: 10px; flex-direction: column; }
}
