/* Button look inspired by LittleLink (MIT, https://littlelink.io). Everything here is self-hosted: no fonts or scripts from elsewhere. */
:root {
  --bg: #f7f7fb; --card: #ffffff; --ink: #16161d; --muted: #667085; --line: #e3e4ee;
  --accent: #5b5bd6; --accent-ink: #ffffff; --danger: #c0262d; --ok: #1a7f4b;
  --radius: 14px;
  color-scheme: light dark;
}
/* The site's own look: follows the device unless a choice was stored (see theme.js). Visitors' pages keep the owner's choice. */
@media (prefers-color-scheme: dark) {
  :root:not([data-app-theme=light]) { --bg: #101116; --card: #181a22; --ink: #f1f2f7; --muted: #9aa0b4; --line: #292c39; --accent: #8b8bf5; --accent-ink: #101116; --danger: #ff6b72; --ok: #4fd08a; }
}
:root[data-app-theme=dark] { --bg: #101116; --card: #181a22; --ink: #f1f2f7; --muted: #9aa0b4; --line: #292c39; --accent: #8b8bf5; --accent-ink: #101116; --danger: #ff6b72; --ok: #4fd08a; color-scheme: dark; }
:root[data-app-theme=light] { color-scheme: light; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.9rem; line-height: 1.2; margin: .4em 0 .5em; }
h2 { font-size: 1.15rem; margin: 0 0 .8em; }
code { background: color-mix(in srgb, var(--ink) 8%, transparent); padding: .1em .35em; border-radius: 6px; font-size: .92em; word-break: break-all; }
code.big { display: inline-block; font-size: 1.2rem; padding: .5em .8em; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 480px; margin: 0 auto; padding: 8px 16px 40px; }
.prose ul { padding-left: 1.2em; } .prose li { margin: .5em 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* app chrome */
.top { border-bottom: 1px solid var(--line); background: var(--card); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brandmark { font-weight: 700; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.top nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.top nav a { color: var(--ink); text-decoration: none; }
.top nav a:hover { color: var(--accent); }
.foot { padding: 28px 0 40px; color: var(--muted); font-size: .9rem; text-align: center; }
.inline { display: inline; margin: 0; } .spaced { margin-left: 12px; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* forms and buttons */
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; } .grow { flex: 1 1 220px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .92rem; }
label small { font-weight: 400; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, .ico-opt:focus-within { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
button { font: inherit; cursor: pointer; }
.cta { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 12px; padding: 11px 18px; font-weight: 700; text-decoration: none; display: inline-block; }
.cta.small { padding: 7px 14px; } .cta.fit { align-self: flex-start; } .cta.danger { background: var(--danger); color: #fff; }
.cta:hover { filter: brightness(1.08); }
.btn-link { margin-left: 8px; font-weight: 600; }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); border-radius: 9px; padding: 6px 10px; }
.ghost:hover:not(:disabled) { border-color: var(--accent); } .ghost:disabled { opacity: .4; cursor: default; }
.ghost.danger, .danger-zone h2 { color: var(--danger); }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; }
.alert { padding: 10px 14px; border-radius: 10px; margin: 10px 0; border: 1px solid; }
.alert.err { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.alert.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.tag { background: var(--accent); color: var(--accent-ink); font-size: .7rem; padding: 1px 6px; border-radius: 99px; }

/* landing */
.hero { text-align: center; padding: 56px 0 24px; } .hero h1 { font-size: clamp(2rem, 6vw, 3.1rem); }
.lead { max-width: 560px; margin: 0 auto 1.4em; color: var(--muted); font-size: 1.1rem; }
.sample { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 0; margin: 32px 0 0; }
.sample li { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--bg); color: var(--fg); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; padding-bottom: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; } .card p { margin: 0; color: var(--muted); }

/* dashboard */
.profile-edit { display: flex; gap: 22px; flex-wrap: wrap; } .avatar-box { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 140px; text-align: center; }
.avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: var(--line); }
.avatar.ph { display: grid; place-items: center; font-size: 2.2rem; font-weight: 700; color: var(--muted); }
.linklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; overflow-anchor: none; /* rows move while dragging; the page must not scroll to compensate */ }
.linklist li.off { opacity: .6; }
.linklist li.dragging { opacity: .55; outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: 12px; }
.linkrow { display: grid; grid-template-columns: auto 26px minmax(0, 1fr) auto auto auto; gap: 6px 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; background: var(--card); }
.linkrow > img { background: #fff; border-radius: 7px; padding: 2px; }
.linkrow .fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 6px; min-width: 0; align-items: center; }
.linkrow .fields > :only-child { grid-column: 1 / -1; }
.linkrow .fields input { padding: 6px 10px; border-radius: 8px; font-size: .92rem; }
.linkrow .clicks { white-space: nowrap; text-align: right; min-width: 3.5em; }
.acts { display: flex; gap: 4px; flex-wrap: nowrap; }
.acts .ghost { padding: 5px 9px; }
.kind-badge { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--line); color: var(--muted); font-weight: 800; font-size: .8rem; }
.drag { display: none; border: 0; background: transparent; color: var(--muted); font-size: 1.2rem; line-height: 1; padding: 6px 4px; cursor: grab; touch-action: none; border-radius: 8px; }
.drag:hover, .drag:focus-visible { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.js .drag { display: inline-grid; }
.js .nojs, .js .linkrow .save { display: none; }
.js .linkrow { grid-template-columns: auto 26px minmax(0, 1fr) auto auto auto; }
.blocks { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.blocks .row { flex: 1 1 320px; flex-wrap: nowrap; }
.hint { margin: 0 0 8px; }
@media (max-width: 760px) {
  .linkrow .fields { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .linkrow { grid-template-columns: auto 26px minmax(0, 1fr); }
  .linkrow .clicks { text-align: left; }
  .linkrow .check, .linkrow .clicks, .linkrow .acts { grid-column: 3; }
}
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0 14px; }
.ico-opt { position: relative; flex-direction: row; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; font-weight: 500; font-size: .85rem; cursor: pointer; background: var(--bg); min-width: 0; }
.ico-opt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ico-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ico-opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg)); box-shadow: 0 0 0 2px var(--accent); }
.ico-opt img, .linkrow > img { flex: none; background: #fff; border-radius: 7px; padding: 3px; }
details { border-top: 1px solid var(--line); padding: 8px 0; } summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; } th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; } .scroll { overflow-x: auto; }
.plain { list-style: none; padding: 0; } .plain li { padding: 5px 0; }

/* public profile */
body.profile { --pbg: #f4f4f8; --pcard: #fff; --pink: #16161d; --pmuted: #667085; --pline: #dcdde8; --paccent: #5b5bd6; background: var(--pbg); color: var(--pink); min-height: 100vh; }
html[data-theme=dark] body.profile, html[data-theme=auto] body.profile { color-scheme: light; }
html[data-theme=dark] body.profile { --pbg: #0f1015; --pcard: #181a22; --pink: #f1f2f7; --pmuted: #9aa0b4; --pline: #2b2e3b; --paccent: #8b8bf5; color-scheme: dark; }
@media (prefers-color-scheme: dark) { html[data-theme=auto] body.profile { --pbg: #0f1015; --pcard: #181a22; --pink: #f1f2f7; --pmuted: #9aa0b4; --pline: #2b2e3b; --paccent: #8b8bf5; color-scheme: dark; } }
.pf { display: flex; justify-content: center; padding: 36px 16px 48px; }
.pf-card { width: 100%; max-width: 460px; text-align: center; }
.avatar.big { width: 112px; height: 112px; margin: 0 auto 10px; display: block; } .avatar.big.ph { display: grid; font-size: 2.8rem; background: var(--pline); color: var(--pmuted); }
.pf h1 { font-size: 1.6rem; margin: .2em 0 0; } .handle { margin: .1em 0 .8em; color: var(--pmuted); } .bio { margin: 0 auto 1.4em; max-width: 380px; color: var(--pink); white-space: pre-line; overflow-wrap: anywhere; }
.buttons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.lbtn { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 14px; text-decoration: none; font-weight: 700; transition: transform .15s ease, filter .15s ease; min-height: 54px; overflow-wrap: anywhere; }
.lbtn span { flex: 1; text-align: center; padding-right: 28px; } .lbtn .ico { flex: none; } .lbtn:hover { transform: translateY(-1px); filter: brightness(.92); }
.mono { width: 24px; height: 24px; display: inline-grid; place-items: center; font-size: .72rem; font-weight: 800; border: 2px solid currentColor; border-radius: 6px; }
.style-brand .lbtn { background: var(--bg); color: var(--fg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 18%, transparent); }
.style-solid .lbtn { background: var(--paccent); color: var(--pbg); }
.style-outline .lbtn { background: transparent; color: var(--pink); border: 2px solid var(--pline); } .style-outline .lbtn:hover { border-color: var(--bg); }
.style-outline .lbtn .ico { color: var(--pink); }
.pf-foot { margin-top: 28px; font-size: .85rem; color: var(--pmuted); } .pf-foot a { color: var(--pmuted); }
@media (max-width: 520px) { .profile-edit { justify-content: center; } }

/* wide editor with a live preview */
.wrap.wide { max-width: 1180px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.center { text-align: center; }
.editor-grid { display: block; }
.preview { display: none; }
@media (min-width: 1020px) {
  .editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
  .editor-main { min-width: 0; }
  .preview { display: block; position: sticky; top: 16px; }
}
.phone-frame { border: 10px solid #20222d; border-radius: 38px; background: #20222d; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.phone-frame iframe { display: block; width: 100%; height: 640px; border: 0; background: #fff; border-radius: 26px; }

/* share, QR, colours, stats */
.share-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.share-row input { flex: 1 1 240px; }
.as-btn { text-decoration: none; display: inline-block; }
.qr summary { color: var(--muted); font-weight: 500; }
.qr img { display: block; margin: 10px 0 4px; border-radius: 8px; background: #fff; }
.colours { gap: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field .lbl { font-weight: 600; font-size: .92rem; }
.colour-pick { display: flex; align-items: center; gap: 10px; }
.colour-pick input[type=color] { width: 48px; height: 36px; padding: 2px; border-radius: 8px; cursor: pointer; }
.chart { width: 100%; height: 96px; display: block; color: var(--accent); }
.chart .bar { fill: var(--accent); } .chart .bar.zero { fill: var(--line); }
.axis { display: flex; justify-content: space-between; margin: 4px 0 8px; }
.stat-total { margin: 0 0 8px; font-size: 1.05rem; } .stat-total b { font-size: 1.5rem; }
.toplinks { list-style: none; margin: 8px 0; padding: 0; } .toplinks li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }

/* site theme switch */
.theme-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.theme-toggle[hidden] { display: none; }
.theme-toggle button { background: transparent; border: 0; color: var(--muted); padding: 4px 9px; font-size: .8rem; }
.theme-toggle button[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

/* home page example */
.hero-grid { display: grid; gap: 36px; align-items: center; }
.hero-text { text-align: center; }
.phone { justify-self: center; width: 290px; border: 9px solid #20222d; border-radius: 40px; background: #20222d; box-shadow: 0 18px 44px rgba(0, 0, 0, .22); transform: rotate(1.5deg); }
.demo { --pbg: #0f1015; --pink: #f1f2f7; --pmuted: #9aa0b4; --pline: #2b2e3b; background: var(--pbg); color: var(--pink); border-radius: 30px; padding: 26px 16px 22px; text-align: center; }
.demo .avatar.big { width: 76px; height: 76px; font-size: 2rem; margin-bottom: 6px; background: var(--pline); color: var(--pmuted); }
.demo-name { font-weight: 800; font-size: 1.15rem; margin: 2px 0 0; }
.demo .handle { color: var(--pmuted); margin: 0 0 .5em; font-size: .85rem; } .demo .bio { font-size: .82rem; margin: 0 auto 1em; max-width: 240px; }
.demo .buttons { gap: 8px; } .demo .lbtn { min-height: 42px; padding: 8px 12px; font-size: .85rem; border-radius: 12px; }
.demo .lbtn span { padding-right: 22px; }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.15fr .85fr; }
  .hero-text { text-align: left; }
  .hero-text .lead { margin-left: 0; }
}

/* headings and dividers on a public page */
.pf-head h2 { margin: 10px 0 0; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--pmuted); font-family: inherit; font-weight: 700; }
.pf-div { height: 0; border-top: 1px solid var(--pline); margin: 6px 12px; }
.style-solid .lbtn { color: var(--paccent-ink, var(--pbg)); }
body.profile.pac .avatar.big { box-shadow: 0 0 0 3px var(--paccent); }
body.profile.pac.style-outline .lbtn { border-color: var(--paccent); }
body.profile.pac .pf-foot a { color: var(--paccent); }

/* feedback */
.badge { background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700; padding: 1px 6px; border-radius: 99px; vertical-align: 1px; }
.fb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.fb-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card); }
.fb-item.fresh { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.fb-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.fb-msg { margin: 6px 0; white-space: pre-line; overflow-wrap: anywhere; }
.fb-reply { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 0 8px 8px 0; }
.fb-reply .fb-msg { margin-bottom: 0; }
.fb-status { margin-left: auto; font-size: .75rem; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.fb-status.s-new { color: var(--accent); border-color: var(--accent); }
.fb-status.s-done { color: var(--ok); border-color: var(--ok); }
.fb-item form.stack { margin: 8px 0 6px; gap: 6px; } .fb-item textarea { font-size: .92rem; }
.card code { font-size: .82em; word-break: normal; overflow-wrap: anywhere; }

/* bug tracker */
.wrap.wide { max-width: 1100px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; }
.push { margin-left: auto; }
.chip { display: inline-block; font-size: .75rem; padding: 1px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); background: transparent; text-decoration: none; white-space: nowrap; }
a.chip:hover, .chip.on { border-color: var(--accent); color: var(--accent); }
.chip.st-new { color: var(--accent); border-color: var(--accent); }
.chip.st-in_progress { color: #b45309; border-color: #b45309; }
.chip.st-fixed { color: var(--ok); border-color: var(--ok); }
.chip.pr-high { color: #b45309; border-color: #b45309; }
.chip.pr-critical { color: var(--danger); border-color: var(--danger); font-weight: 700; }
.tag.warn { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.tk-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 14px; }
.tk-counts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tk-thread { display: flex; flex-direction: column; gap: 12px; }
.tk-msg { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card); }
.tk-msg.from-staff { border-left: 3px solid var(--accent); }
.tk-msg.internal { border-style: dashed; background: color-mix(in srgb, #f59e0b 10%, var(--card)); }
.tk-msg header { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.tk-msg h3 { font-size: .85rem; margin: 10px 0 0; color: var(--muted); }
.tk-ctx { margin-top: 10px; font-size: .85rem; } .tk-ctx dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 6px 0 0; } .tk-ctx dt { color: var(--muted); } .tk-ctx dd { margin: 0; overflow-wrap: anywhere; }
.pics { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; padding: 0; margin: 8px 0 0; }
.pics img { display: block; max-width: 160px; max-height: 120px; border-radius: 8px; border: 1px solid var(--line); object-fit: cover; }
.tk-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 860px) { .tk-cols { grid-template-columns: 1fr; } }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.tk-table td, .tk-table th { vertical-align: top; } .tk-table tr.unread td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.pager { display: flex; gap: 14px; align-items: center; justify-content: center; }
.similar { border: 1px dashed var(--accent); border-radius: 10px; padding: 8px 12px; font-size: .9rem; }
.similar ul { margin: 4px 0 0; padding-left: 18px; }
.small { font-size: .85rem; } ul.plain.small li { margin: 3px 0; }

/* account security, extras */
.codes { columns: 2; list-style: none; padding: 0; } .codes li { margin: 4px 0; }
.qrbox { background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--line); }
.more { margin: 4px 0 10px 36px; font-size: .9rem; } .more summary { cursor: pointer; color: var(--muted); } .more .row { margin: 8px 0; }
.lthumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; vertical-align: middle; flex: none; }
.road { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: start; } .road .panel { margin: 0; }
.chart { width: 100%; height: auto; } .chart .bar { fill: var(--accent); } .chart .axis { fill: var(--muted); font-size: 10px; }

code.key { display: block; font-size: 1.05rem; letter-spacing: .04em; overflow-wrap: anywhere; padding: 10px 12px; }

/* 1.4: groups, statistics, passkeys */
.pf-group { list-style: none; }
.pf-group summary { cursor: pointer; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--pmuted); font-weight: 700; padding: 10px 4px; }
.pf-group summary:focus-visible { outline: 2px solid var(--paccent, currentColor); outline-offset: 2px; }
.pf-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
input.short { width: 9em; }
button.wide { width: 100%; }
