:root {
  --paper: #f6f3ec; --card: #fffdf9; --ink: #20302c; --soft: #63716c; --line: #ded9cd;
  --brand: #c8412b; --brand-ink: #fff; --green: #2c6a5b;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #171c1a; --card: #202725; --ink: #eef0ea; --soft: #a3afa9; --line: #37413d; --brand: #ee7a5f; --brand-ink: #231009; --green: #7cc4b0; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 system-ui, sans-serif; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
main { max-width: 620px; margin: 0 auto; padding: 12px; outline: none; }
h1 { font: 700 1.6rem/1.2 Georgia, serif; margin: .3em 0; }
h2 { font: 700 1.15rem/1.3 Georgia, serif; margin: 1.2em 0 .4em; }
a { color: var(--green); }
img { display: block; max-width: 100%; }
button, .button { font: inherit; display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 8px 14px; min-height: 44px; cursor: pointer; text-decoration: none; }
button:disabled { opacity: .55; cursor: default; }
.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.danger { color: var(--brand); border-color: var(--brand); }
.link { border: 0; background: none; color: var(--soft); padding: 4px 8px; }
.wide { width: 100%; margin-top: 12px; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
input, textarea { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
input[type=checkbox] { width: 22px; height: 22px; flex: none; }
label { display: block; margin: 12px 0; font-weight: 600; }
label input, label textarea { margin-top: 4px; font-weight: 400; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.two > label { flex: 1; margin-top: 0; }
.grow { flex: 1; }
.muted { color: var(--soft); }
.center { text-align: center; }
.label { font-weight: 600; margin: 12px 0 4px; }
.error { color: var(--brand); min-height: 1.5em; margin: 8px 0; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.empty { text-align: center; padding: 48px 16px; color: var(--soft); display: grid; gap: 12px; justify-items: center; }
.top { display: flex; justify-content: space-between; align-items: center; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs { position: fixed; inset: auto 0 0; display: flex; justify-content: center; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabs a { flex: 1; max-width: 155px; display: grid; justify-items: center; gap: 2px; padding: 9px 0; min-height: 60px; color: var(--soft); text-decoration: none; font-size: .78rem; }
.tabs a[aria-current] { color: var(--brand); font-weight: 600; }
.tab-icon { position: relative; }
.badge { position: absolute; top: -6px; left: 14px; background: var(--brand); color: var(--brand-ink); border-radius: 10px; padding: 0 6px; font-size: .7rem; font-weight: 700; }
.avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--green); color: var(--card); display: grid; place-items: center; font-weight: 700; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.name { font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.cards { display: grid; gap: 16px; }
.card, .work { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.card header, .by { display: flex; align-items: center; gap: 10px; padding: 12px; }
.card time, .by time { margin-left: auto; color: var(--soft); font-size: .85rem; }
.cover { display: block; position: relative; aspect-ratio: 4/3; background: var(--line); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.count { position: absolute; right: 8px; bottom: 8px; background: rgb(0 0 0 / .65); color: #fff; border-radius: 8px; padding: 2px 8px; font-size: .78rem; }
.body { padding: 10px 14px; }
.body h2 { margin: 0; }
.body h2 a { color: inherit; text-decoration: none; }
.meta, .tags { margin: 2px 0; color: var(--soft); }
h1, h2, .grid span { overflow-wrap: anywhere; }
.card footer { display: flex; gap: 8px; align-items: center; padding: 4px 10px 10px; }
.like, .chat { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--soft); text-decoration: none; padding: 8px; min-height: 44px; }
.like[aria-pressed=true] { color: var(--brand); }
.like[aria-pressed=true] .icon { fill: currentColor; }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; background: #111; }
.gallery img { flex: 0 0 100%; scroll-snap-align: center; object-fit: contain; max-height: 75vh; min-height: 200px; }
.comments, .people, .invites, .thumbs { list-style: none; padding: 0; margin: 0; }
.comments li { display: flex; gap: 10px; padding: 8px 0; }
.comments li > div { flex: 1; min-width: 0; }
.comments p { margin: 0; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.person .name { flex: 1; min-width: 0; }
.person .row { justify-content: flex-end; }
.invites li { padding: 12px 0; display: grid; gap: 6px; }
.profile { text-align: center; display: grid; justify-items: center; }
.profile .avatar { width: 88px; height: 88px; font-size: 2rem; }
.profile .row { justify-content: center; }
.stats { display: flex; justify-content: space-around; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin: 8px 0 14px; text-align: center; }
.stats strong { display: block; font: 700 1.35rem Georgia, serif; }
.filters { margin: 8px 0; }
.filters button[aria-pressed=true] { background: var(--green); color: var(--card); border-color: var(--green); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.grid a { color: var(--ink); text-decoration: none; font-size: .85rem; }
.grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--line); }
.grid small { display: block; color: var(--soft); }
.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.thumbs li { position: relative; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.thumbs .row { position: absolute; top: 4px; right: 4px; gap: 4px; }
.thumbs button { min-height: 34px; padding: 2px 10px; }
.add-photo { border: 2px dashed var(--line); border-radius: 14px; padding: 22px; text-align: center; cursor: pointer; color: var(--green); }
#fotos:focus-visible + .add-photo { outline: 3px solid var(--green); }
details { border-top: 1px solid var(--line); margin-top: 12px; }
summary { padding: 12px 0; cursor: pointer; font-weight: 600; }
.auth { max-width: 400px; margin: 6vh auto; }
.brand { text-align: center; }
.brand h1 { font-size: 2.2rem; color: var(--brand); }
.notes { list-style: none; padding: 0; }
.notes li a { display: flex; gap: 10px; align-items: center; padding: 10px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.notes li.new a { background: var(--card); box-shadow: inset 4px 0 var(--brand); }
.notes time { margin-left: auto; color: var(--soft); font-size: .8rem; white-space: nowrap; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch input { margin: 0; }
dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); max-width: 360px; }
dialog .row { justify-content: flex-end; margin-top: 12px; }
dialog::backdrop { background: rgb(0 0 0 / .5); }
.toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 12px; z-index: 10; width: max-content; max-width: 90vw; }
.likers { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; } .liker { display: inline-flex; gap: 6px; align-items: center; } .liker .avatar { width: 26px; height: 26px; font-size: .8rem; }
main[aria-busy=true] { opacity: .6; }
