:root {
    --canvas: #f7f7f1;
    --paper: #ffffff;
    --ink: #233d35;
    --muted: #63736a;
    --line: #dce3d9;
    --green: #285447;
    --soft: #e9efe5;
    --peach: #e7ae8d;
    --danger: #a33d35;
    --radius: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.6; }
a { color: inherit; text-underline-offset: 4px; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid #a66b36; outline-offset: 4px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.2rem, 4.5vw, 3.5rem); line-height: 1.13; font-weight: 400; letter-spacing: -.045em; margin-bottom: 18px; }
h2 { font-size: 1.15rem; line-height: 1.4; font-weight: 600; letter-spacing: -.02em; }
h3 { font-size: 1.3rem; line-height: 1.35; letter-spacing: -.025em; }
.muted { color: var(--muted); }
.accent { color: #b87550; }
.eyebrow, .sidebar-title { font-size: .66rem; font-weight: 700; letter-spacing: .15em; }
.eyebrow { display: block; margin-bottom: 20px; color: #627a64; }
.site-header, .app-main, .site-footer { width: min(1240px, calc(100% - 96px)); margin-inline: auto; }
.site-header { min-height: 105px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 1.5rem; font-weight: 650; letter-spacing: -.07em; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 39px; height: 39px; border-radius: 11px; background: var(--green); color: var(--canvas); font-family: Georgia, serif; font-size: 2rem; line-height: 1; padding-bottom: 6px; }
.brand-dot { color: #b9c5b7; font-weight: 400; margin-left: -8px; }
.top-nav { display: flex; align-items: center; gap: 30px; font-size: .82rem; font-weight: 550; }
.top-nav a { text-decoration: none; }
.top-nav a, .top-nav .text-button { display: inline-flex; align-items: center; min-height: 32px; }
.top-nav a:hover, .text-button:hover { text-decoration: underline; }
.top-nav form { margin: 0; }
.private-label { font-size: .75rem; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.status-dot { width: 7px; height: 7px; background: #6a8d63; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.app-main { min-height: 65vh; padding-block: 58px 72px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 30px; margin-bottom: 48px; }
.page-heading .eyebrow { margin-bottom: 13px; }
.page-heading h1 { margin-bottom: 13px; }
.page-heading p { margin-bottom: 0; }
.button { border: 1px solid transparent; border-radius: 8px; padding: 12px 20px; display: inline-flex; align-items: center; justify-content: center; gap: 18px; background: var(--green); color: white; text-decoration: none; font-size: .83rem; font-weight: 600; line-height: 1.5; white-space: nowrap; min-height: 45px; }
.button:hover { background: #1d4438; }
.button.secondary { background: transparent; color: var(--green); border-color: #bacbb8; }
.button.secondary:hover { background: var(--soft); }
.button.small { min-height: 40px; padding: 9px 15px; }
.button.full { width: 100%; justify-content: space-between; }
.button.danger { background: var(--danger); }
.text-button { border: 0; padding: 0; background: none; color: inherit; font-size: inherit; line-height: inherit; }
.library-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 48px; }
.library-sidebar { padding-top: 6px; }
.sidebar-title { color: var(--muted); padding-left: 12px; margin-bottom: 14px; }
.tag-heading { margin-top: 35px; }
.collection { display: flex; justify-content: space-between; align-items: center; text-decoration: none; font-size: .82rem; padding: 10px 12px; border-radius: 7px; gap: 8px; }
.collection > span:first-child { overflow-wrap: anywhere; min-width: 0; }
.collection:hover { background: #eef1e9; }
.collection.selected { background: #e4ecdf; font-weight: 600; }
.count { color: #5c7160; font-size: .72rem; background: #dce6d7; border-radius: 5px; padding: 0 6px; flex-shrink: 0; }
.hash { color: #8a9d83; }
.tag-list { margin: 0; padding: 0; list-style: none; }
.sidebar-note { margin-top: 52px; padding: 20px 13px; border-top: 1px solid var(--line); font-size: .72rem; color: var(--muted); }
.sidebar-note strong { margin-left: 8px; color: var(--ink); font-weight: 500; }
.sidebar-note p { margin: 10px 0 0; }
.filter-panel { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fdfdf8; }
.field.search-row { display: flex; flex-direction: row; align-items: center; gap: 12px; }
.search-row input { background: white; min-width: 0; flex: 1; }
.search-row .button { flex-shrink: 0; }
.filter-row { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(100px, 1fr) minmax(100px, 1fr) auto; gap: 12px; align-items: end; padding-top: 14px; }
.filter-row label { font-size: .67rem; }
.filter-row input, .filter-row select { min-width: 0; font-size: .75rem; padding: 8px; min-height: 38px; }
.clear-filters { font-size: .73rem; align-self: end; margin-bottom: 10px; color: var(--muted); }
.results-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin: 32px 0 16px; }
.results-heading h2 { font-size: .9rem; margin: 0; }
.results-heading > span { font-size: .72rem; }
.link-list { display: grid; gap: 14px; }
.link-card, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.link-card { padding: 24px 28px 18px; }
.link-meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .73rem; margin-bottom: 12px; overflow-wrap: anywhere; }
.host-mark { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; background: #f0eee6; color: #727562; font-size: .64rem; font-weight: 600; flex-shrink: 0; }
.meta-divider { color: #b9c3b4; margin-inline: 4px; }
.link-type { font-size: .56rem; letter-spacing: .08em; flex-shrink: 0; }
.link-card h3 { margin-bottom: 9px; overflow-wrap: anywhere; }
.link-card h3 a { text-decoration: none; }
.link-card h3 a:hover { text-decoration: underline; }
.external-arrow { color: #8b9e84; font-size: 1rem; margin-left: 10px; }
.link-description { color: var(--muted); font-size: .83rem; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 12px; }
.link-url { color: var(--muted); font-size: .72rem; overflow-wrap: anywhere; margin-bottom: 12px; }
.link-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { display: inline-block; border-radius: 5px; padding: 3px 8px; color: #54704e; background: #edf2e7; text-decoration: none; font-size: .65rem; overflow-wrap: anywhere; }
a.tag:hover { background: #e2eada; }
.tag.inactive { background: #f2f0ec; color: #77746d; }
.card-bottom { border-top: 1px solid #eef0e9; margin-top: 19px; padding-top: 13px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.timestamps { display: flex; flex-direction: column; font-size: .6rem; color: var(--muted); line-height: 1.8; }
.card-actions { display: flex; gap: 17px; font-size: .7rem; white-space: nowrap; }
.card-actions a { text-decoration: none; }
.card-actions a, .card-actions .text-button { padding-block: 5px; min-height: 26px; }
.card-actions a:hover { text-decoration: underline; }
.delete-link { color: var(--danger); }
.empty-state { text-align: center; padding: 55px 25px; }
.empty-state h2 { font-family: Georgia, serif; font-size: 1.7rem; font-weight: 400; }
.empty-state p { max-width: 350px; margin: 0 auto 24px; }
.empty-mark { display: inline-flex; border-radius: 15px; background: var(--soft); font-size: 2rem; padding: 0 17px; margin-bottom: 25px; color: var(--green); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 20px; padding-top: 28px; font-size: .8rem; }
.site-footer { border-top: 1px solid var(--line); padding-block: 25px; display: flex; justify-content: space-between; gap: 18px; color: var(--muted); font-size: .66rem; }
.auth-main { width: min(540px, calc(100% - 40px)); margin: 65px auto 80px; min-height: 57vh; }
.auth-card { padding: 40px; background: white; border: 1px solid var(--line); border-radius: 20px; }
.auth-card h1 { font-size: 2.7rem; }
.auth-card .muted { font-size: .86rem; margin-bottom: 28px; }
.stack { display: grid; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label { font-size: .79rem; font-weight: 550; }
input, textarea, select { width: 100%; color: var(--ink); background: #fff; border: 1px solid #cbd6c7; border-radius: 7px; padding: 11px 12px; min-height: 45px; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #859181; opacity: 1; }
input[aria-invalid="true"] { border-color: var(--danger); }
.hint { font-size: .73rem; color: var(--muted); margin-bottom: 0; }
.security-note { margin: 27px 0 0; text-align: center; font-size: .69rem; color: var(--muted); }
.cancel-form { text-align: center; margin-top: 25px; font-size: .8rem; }
.qr-panel { display: flex; justify-content: center; margin-bottom: 22px; }
.qr-panel img { max-width: 100%; height: auto; }
.enrollment-steps { padding-left: 20px; font-size: .85rem; }
.enrollment-steps li { margin-bottom: 10px; }
details { margin-bottom: 24px; font-size: .8rem; }
summary { cursor: pointer; text-underline-offset: 3px; text-decoration: underline; }
.secret-key { display: block; overflow-wrap: anywhere; margin-top: 12px; background: var(--soft); padding: 12px; font-size: .8rem; }
.panel { padding: 34px; }
.form-page { max-width: 720px; margin: 0 auto; }
.back-link { display: inline-block; margin-bottom: 25px; text-decoration: none; font-size: .8rem; }
.form-page h1, .recovery-panel h1 { font-size: 2.7rem; }
.form-page > p { margin-bottom: 30px; }
.optional, .required-label { float: right; color: var(--muted); font-size: .69rem; font-weight: 400; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.notice { border: 1px solid var(--line); padding: 15px 19px; border-radius: 10px; margin-bottom: 25px; font-size: .83rem; }
.notice p, .notice ul { margin-bottom: 0; }
.notice.success { background: #e6efdf; border-color: #c9d9bb; }
.notice.error { background: #fcf0e9; border-color: #dfbeb0; color: #843e2e; }
.notice.warning { background: #faf3dd; border-color: #e1d6ad; color: #6c5e2a; }
.field-error { color: var(--danger); font-size: .75rem; margin: 0; }
.recovery-panel { max-width: 850px; margin: auto; }
.recovery-codes { padding-left: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 30px; margin-block: 28px; }
.recovery-codes code { font-size: .75rem; overflow-wrap: anywhere; }
.settings-grid { display: grid; gap: 24px; }
.settings-grid .panel > p { max-width: 650px; }
.settings-grid .stack { max-width: 450px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; margin: 20px 0; font-size: .8rem; }
th { color: var(--muted); font-size: .68rem; font-weight: 550; }
td, th { padding: 15px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
td small { display: block; color: var(--muted); font-size: .69rem; white-space: nowrap; }
.code-note { padding: 20px; background: #f3f5ee; border-radius: 10px; font-size: .8rem; }
.code-note code { display: block; overflow-wrap: anywhere; font-size: .78rem; }
.code-note .hint { margin-top: 15px; }
.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; }
.skip-link { position: absolute; left: 20px; top: -80px; background: white; padding: 12px; z-index: 10; }
.skip-link:focus { top: 12px; }
@media (max-width: 1000px) {
    .site-header, .app-main, .site-footer { width: calc(100% - 48px); }
    .library-layout { grid-template-columns: 160px minmax(0, 1fr); gap: 26px; }
    .link-card { padding: 22px 21px 17px; }
    .card-bottom { align-items: start; flex-direction: column; gap: 12px; }
    .card-actions { width: 100%; justify-content: flex-end; }
}
@media (max-width: 720px) {
    .site-header, .app-main, .site-footer { width: calc(100% - 32px); }
    .site-header { min-height: 80px; gap: 16px; }
    .top-nav { gap: 16px; font-size: .75rem; }
    .brand { font-size: 1.3rem; gap: 8px; }
    .brand-mark { width: 32px; height: 32px; font-size: 1.7rem; }
    .app-main { padding-block: 35px 48px; }
    .page-heading { flex-direction: column; align-items: flex-start; gap: 22px; margin-bottom: 32px; }
    .page-heading .eyebrow { font-size: .59rem; }
    .page-heading p { font-size: .85rem; }
    .library-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .library-sidebar { display: none; }
    .filter-panel { padding: 13px; }
    .filter-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .clear-filters { justify-self: start; align-self: center; margin: 24px 0 0 4px; }
    .results-heading { margin-top: 25px; }
    .results-heading > span { font-size: .65rem; }
    .link-card { padding: 20px 18px 16px; }
    .link-card h3 { font-size: 1.2rem; }
    .site-footer { flex-direction: column; gap: 7px; font-size: .62rem; }
    .auth-main { margin-block: 35px 45px; }
    .auth-card { padding: 28px 23px; }
    .auth-card h1 { font-size: 2.3rem; }
    .private-label { font-size: .65rem; }
    .panel { padding: 26px 22px; }
    .form-page h1, .recovery-panel h1 { font-size: 2.2rem; }
    .recovery-codes { grid-template-columns: minmax(0, 1fr); }
    .recovery-panel .button { white-space: normal; }
    .pagination { gap: 12px; }
    .code-note { padding: 15px; }
}
@media (prefers-reduced-motion: no-preference) {
    .button, .collection, .tag { transition: background-color .15s ease; }
}
