@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Newsreader:opsz,wght@6..72,400;6..72,500&display=swap');

:root {
  font-family: 'DM Sans', sans-serif;
  color: #182520;
  background: #f4f5f0;
  font-synthesis: none;
  --ink: #182520;
  --muted: #78827b;
  --line: #dfe4dc;
  --lime: #c7ed69;
  --paper: #fbfcf8;
  --mono: 'DM Mono', monospace;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 82% 0%, #e8eddf 0, transparent 32rem), #f4f5f0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.shell { max-width: 1320px; margin: 0 auto; padding: 0 48px; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; }
.brand-mark { width: 29px; height: 29px; display: grid; place-items: center; color: var(--ink); background: var(--lime); font-family: 'Newsreader', serif; font-size: 20px; font-style: italic; }
.brand-light { color: var(--muted); font-weight: 400; }
.topbar-right, .footer { display: flex; align-items: center; gap: 10px; color: var(--muted); font: 10px var(--mono); letter-spacing: 0; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #68aa5a; box-shadow: 0 0 0 3px #dcead6; }
.icon-button { margin-left: 12px; border: 1px solid var(--line); background: var(--paper); width: 30px; height: 30px; }
.hidden { display: none !important; }
.login-view { min-height: calc(100vh - 77px); display: grid; grid-template-columns: 1fr minmax(330px, 420px); align-items: center; gap: 10%; padding: 80px 8%; animation: rise .45s ease-out both; }
.eyebrow, .metric-label, .section-index { color: #6e7b71; font: 10px var(--mono); }
.eyebrow { margin: 0 0 18px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 16px; font-size: clamp(32px, 4vw, 52px); font-weight: 500; line-height: 1.07; letter-spacing: 0; }
h1 em { color: #66834f; font-family: 'Newsreader', serif; font-weight: 400; }
.login-description { max-width: 380px; color: #68746c; line-height: 1.7; font-size: 15px; }
.login-form { padding-top: 16px; }
label { display: grid; gap: 8px; color: #546158; font-size: 12px; font-weight: 600; }
input, select { width: 100%; min-width: 0; height: 43px; padding: 0 12px; border: 1px solid #d9dfd6; border-radius: 2px; background: var(--paper); color: var(--ink); outline: 0; font-size: 13px; }
input:focus, select:focus { border-color: #738b62; box-shadow: 0 0 0 2px #e1e9d8; }
input::placeholder { color: #a2aaa0; }
.input-action { display: flex; gap: 8px; margin-top: 8px; }
.button { min-height: 42px; padding: 0 17px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; transition: background .15s ease, transform .15s ease; }
.button:active { transform: translateY(1px); }
.button-dark { background: var(--ink); color: white; }
.button-dark:hover { background: #34463a; }
.button-outline { border-color: #bfc9bc; color: var(--ink); background: transparent; }
.button-outline:hover { background: #e8ece4; }
.form-error { min-height: 18px; margin: 7px 0 0; color: #b34331; font-size: 12px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; padding: 42px 0 24px; animation: rise .4s ease-out both; }
.page-heading .eyebrow { margin-bottom: 11px; }
.page-heading h1 { margin: 0; font-size: 34px; }
.today { margin: 0 0 4px; color: var(--muted); font: 11px var(--mono); }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: rgba(251,252,248,.72); animation: rise .45s .05s ease-out both; }
.metric { min-height: 137px; padding: 22px 25px; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; }
.metric:last-child { border-right: 0; }
.metric-accent { background: var(--lime); }
.metric-label { margin-bottom: 14px; color: #59675d; }
.metric strong { font-size: 30px; line-height: 1; font-weight: 500; }
.metric-note { margin-top: 9px; color: #748078; font-size: 11px; }
.workspace-section { padding: 30px 0; border-bottom: 1px solid var(--line); animation: rise .4s .1s ease-out both; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 21px; }
.section-heading .eyebrow { margin-bottom: 8px; }
h2 { margin-bottom: 0; font-size: 20px; font-weight: 500; }
.section-index { padding-bottom: 3px; }
.link-form { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 15px 16px; }
.wide-field { grid-column: 1 / -1; }
.slug-input { display: flex; height: 43px; border: 1px solid #d9dfd6; background: var(--paper); }
.slug-input:focus-within { border-color: #738b62; box-shadow: 0 0 0 2px #e1e9d8; }
.slug-input span { display: grid; place-items: center; width: 32px; color: #849087; border-right: 1px solid var(--line); font-family: var(--mono); }
.slug-input input { border: 0; height: auto; background: transparent; box-shadow: none; }
.form-submit { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.form-submit > span { color: var(--muted); font-size: 11px; }
.domain-section { padding-bottom: 22px; }
.domain-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 14px; }
.domain-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.domain-chip { display: inline-flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); background: var(--paper); font-size: 11px; }
.domain-chip strong { font-weight: 600; }
.domain-chip span { color: var(--muted); }
.domain-chip button, .remove-link { border: 0; background: none; color: #8d9890; font-size: 16px; line-height: 1; }
.domain-chip button:hover, .remove-link:hover { color: #b34331; }
.links-section { padding-bottom: 20px; }
.table-wrap { overflow-x: auto; }
.load-more { display: flex; margin: 15px auto 0; }
.visitor-table { min-width: 820px; }
.visitor-time, .visitor-ip { font-family: var(--mono); font-size: 10px; white-space: nowrap; }
.visitor-agent { display: block; color: #536149; font-size: 11px; }
.visitor-device { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.privacy-note { margin: 13px 0 0; color: var(--muted); font-size: 10px; }
table { width: 100%; min-width: 760px; border-collapse: collapse; text-align: left; }
th { padding: 0 12px 11px; color: var(--muted); font: 9px var(--mono); font-weight: 400; }
th:first-child, td:first-child { padding-left: 0; }
td { padding: 13px 12px; border-top: 1px solid var(--line); vertical-align: middle; font-size: 12px; }
.link-title { display: block; margin-bottom: 3px; font-weight: 600; }
.link-subtitle { color: var(--muted); font-size: 10px; }
.short-url { display: inline-block; color: #537442; font: 11px var(--mono); text-decoration: none; }
.short-url:hover { text-decoration: underline; }
.destination { display: block; max-width: 270px; overflow: hidden; color: #718078; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.click-count { font: 12px var(--mono); }
.remove-link { padding: 8px; }
.empty-state { padding: 32px 12px; text-align: center; color: var(--muted); }
.empty-mark { color: #789263; font-size: 20px; }
.empty-state p { margin: 8px 0 4px; color: var(--ink); font-size: 13px; }
.empty-state > span:last-child { font-size: 11px; }
.footer { justify-content: space-between; padding: 21px 0 25px; font-size: 9px; }
.footer b { color: var(--ink); font-weight: 400; }
.toast { position: fixed; right: 24px; bottom: 24px; padding: 12px 16px; background: var(--ink); color: white; font-size: 12px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 760px) {
  .shell { padding: 0 20px; }
  .login-view { min-height: calc(100vh - 77px); grid-template-columns: 1fr; gap: 30px; align-content: center; padding: 45px 0; }
  .login-view h1 { font-size: 42px; }
  .page-heading { align-items: start; gap: 12px; flex-direction: column; padding-top: 30px; }
  .page-heading h1 { font-size: 30px; }
  .metrics { grid-template-columns: 1fr; }
  .metric { min-height: 108px; border-right: 0; border-bottom: 1px solid var(--line); }
  .metric:last-child { border-bottom: 0; }
  .link-form { grid-template-columns: 1fr 1fr; gap: 13px 11px; }
  .link-form > label:first-child, .wide-field, .form-submit { grid-column: 1 / -1; }
  .form-submit { align-items: stretch; flex-direction: column; }
  .form-submit .button { width: 100%; }
  .domain-form { grid-template-columns: 1fr; gap: 12px; }
  .domain-form .button { width: 100%; }
  .footer { flex-wrap: wrap; gap: 9px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
