:root {
  /* Warm, airy neutrals; soft violet accent (dashboard-style, not heavy chrome). */
  --bg: #f4f1ed;
  --surface: #fffcfa;
  --text: #2a2622;
  --muted: #6f6a64;
  --border: #e6e1db;
  --accent: #6760d6;
  --accent-hover: #5852c4;
  --danger: #b44a4a;
  --err-bg: #fcefef;
  --ok-bg: #e8f4ec;
  --space: 1rem;
  --radius: 10px;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
  --font: var(--font-sans);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

code,
kbd,
samp,
pre,
.verbatim {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

pre {
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--border) 45%, var(--surface));
  border: 1px solid var(--border);
  overflow-x: auto;
}

code {
  padding: 0.12em 0.35em;
  border-radius: 4px;
  background: color-mix(in srgb, var(--border) 40%, var(--surface));
}

pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.verbatim {
  overflow-wrap: anywhere;
  word-break: break-word;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.main {
  max-width: 52rem;
  margin: 0 auto;
  padding: 2rem var(--space);
}

.main.narrow {
  max-width: 24rem;
}

.site-header {
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0.75rem var(--space);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space);
  flex-wrap: wrap;
}

.logo {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav__user {
  color: var(--muted);
  font-size: 0.9rem;
}

.nav__logout {
  margin: 0;
  display: inline;
}

.page-head {
  margin-bottom: 1.5rem;
}

.page-head h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 600;
}

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

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  margin-bottom: 1.25rem;
}

.panel__title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.row--align-end {
  align-items: flex-end;
}

.row--actions {
  align-items: center;
}

.grow {
  flex: 1 1 12rem;
  min-width: 0;
}

.grow--handle {
  flex: 1 1 10rem;
  min-width: 0;
  max-width: 100%;
}

.grow--url {
  flex: 1 1 18rem;
  min-width: 0;
}

@media (min-width: 40rem) {
  .grow--handle {
    flex: 0 1 12rem;
    max-width: 16rem;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.field__label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

/* Default type is text, but omitting `type` means no [type="text"] match — browsers then use UA styles. */
input:not([type]),
input[type="text"],
input[type="search"],
input[type="url"],
input[type="password"] {
  font: inherit;
  line-height: 1.5;
  padding: 0.5rem 0.65rem;
  min-height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

/* Browsers style search inputs differently; match other text fields. */
input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}

input[type="url"],
input[name="handle"] {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.button {
  font: inherit;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
}

.button:hover {
  background: var(--accent-hover);
}

.button--secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.button--secondary:hover {
  background: var(--bg);
}

.button--small {
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
}

.link-button {
  font: inherit;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
}

.link-button--danger {
  color: var(--danger);
}

.inline-form {
  display: inline;
  margin: 0;
}

.muted {
  color: var(--muted);
}

.flash {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.flash--err {
  background: var(--err-bg);
  color: #7a3838;
}

.flash--ok {
  background: var(--ok-bg);
  color: #2d6a45;
}

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  margin-bottom: 1rem;
  background: var(--surface);
}

.link-card__delete {
  margin-top: 0.75rem;
}

.invite-list {
  margin: 0;
  padding-left: 1.25rem;
}

.site-footer {
  max-width: 52rem;
  margin: 0 auto;
  padding: 2rem var(--space) 1.5rem;
}

.site-footer__version {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
  text-align: right;
}
