:root {
  font-family: Arial, Helvetica, sans-serif;
  color-scheme: light;
  color: var(--ink);
  background: var(--canvas);
  --canvas: #e9e9e9;
  --ink: #171717;
  --muted: #545054;
  --line: #bcb9bc;
  --paper: #fafafa;
  --panel-head: #e0dee0;
  --masthead: #181618;
  --masthead-text: #eee9ed;
  --masthead-muted: #c8c0c7;
  --soft: #eeecee;
  --accent: #89162c;
  --active: #efdee3;
  --focus: #a51d39;
  --primary: #981d3c;
  --primary-hover: #6e1022;
  --primary-text: #fff;
  --field-border: #807b80;
  --media: #161416;
  --heart: #9f3851;
  --heart-border: #d9a8b3;
  --heart-bg: #faedf0;
  --comment: #f0eef0;
  --warning: #61573b;
  --warning-bg: #f1eddf;
  --success: #34543c;
  --success-bg: #e8f2e3;
  --success-border: #c9d8c1;
  --error: #8b291f;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #141314;
  --ink: #ede9ed;
  --muted: #beb6be;
  --line: #514951;
  --paper: #201d20;
  --panel-head: #2b262b;
  --masthead: #100e10;
  --soft: #302a30;
  --accent: #ed9bad;
  --active: #3b252d;
  --focus: #ed9bad;
  --primary: #9e2941;
  --primary-hover: #862137;
  --field-border: #827982;
  --media: #0d0c0d;
  --heart: #f3a1b4;
  --heart-border: #aa6c80;
  --heart-bg: #4a2d38;
  --comment: #2a252a;
  --warning: #f0dbad;
  --warning-bg: #413926;
  --success: #d1edc1;
  --success-bg: #2a4132;
  --success-border: #53715a;
  --error: #ffb5a8;
}

:root[data-custom-accent] {
  --accent: color-mix(in srgb, var(--picked-accent) 40%, var(--ink));
  --focus: var(--accent);
  --active: color-mix(in srgb, var(--picked-accent) 19%, var(--paper));
  --primary: color-mix(in srgb, var(--picked-accent) 40%, #231c22);
  --primary-hover: color-mix(in srgb, var(--picked-accent) 32%, #231c22);
}

:root[data-theme="dark"][data-custom-accent] {
  --primary: color-mix(in srgb, var(--picked-accent) 38%, #f4edf2);
  --primary-hover: color-mix(in srgb, var(--picked-accent) 26%, #f4edf2);
  --primary-text: #211b20;
}

*, *::before, *::after { box-sizing: border-box; }
body { min-width: 280px; margin: 0; font-size: .9375rem; line-height: 1.45; }
button, input, textarea { font: inherit; }
a { color: inherit; }
button { cursor: pointer; }
h1, h2, p, ul { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wordmark {
  flex: none;
  text-decoration: none;
  font-family: Consolas, "Courier New", monospace;
  font-size: 1.2rem;
  font-weight: bold;
}
.wordmark:hover { text-decoration: underline; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}
.primary { background: var(--primary); color: var(--primary-text); }
.primary:hover { background: var(--primary-hover); }
.secondary { background: var(--paper); border-color: var(--line); color: var(--ink); }
.secondary:hover { background: var(--soft); }
.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }

.auth-layout { width: min(100%, 410px); margin: clamp(28px, 8vh, 80px) auto; padding: 0 14px; }
.auth-form { border: 1px solid var(--line); background: var(--paper); }
.auth-form h1, .page-heading h1 {
  font-size: 1.4rem;
  font-weight: bold;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.auth-form h1 { padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel-head); font-size: 1rem; }
.auth-form .form-stack { justify-items: start; padding: 14px; }
.auth-form .field { width: 100%; }
.auth-alternate { padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.auth-alternate a { color: var(--accent); text-underline-offset: 2px; }

.site-width, .workspace { width: min(100%, 1040px); margin-inline: auto; padding-inline: 18px; }
.masthead { border-top: 3px solid var(--primary); background: var(--masthead); color: var(--masthead-text); }
.masthead :focus-visible { outline-color: var(--masthead-text); }
.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
}
.masthead-account { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: .8125rem; }
.account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.masthead-account form { flex: none; }
.signout { min-height: 36px; padding: 0; border: 0; background: none; color: var(--masthead-muted); text-decoration: underline; text-underline-offset: 2px; }
.nav-bar { border-block: 1px solid var(--line); background: var(--panel-head); }
.nav { display: flex; align-items: stretch; flex-wrap: wrap; }
.nav a {
  display: flex;
  align-items: center;
  min-height: 37px;
  padding: 6px 12px 4px;
  border-bottom: 2px solid transparent;
  color: var(--ink);
  text-decoration: none;
  font-weight: bold;
  font-size: .875rem;
  white-space: nowrap;
}
.nav a:hover { background: var(--paper); }
.nav a[aria-current] { border-bottom-color: var(--accent); background: var(--active); color: var(--accent); }
.nav .nav-post { margin-left: auto; color: var(--accent); }
.person { display: inline-flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.person:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.person strong, .person-text { min-width: 0; overflow-wrap: anywhere; }
.person-text { display: grid; gap: 3px; }
.person small { color: var(--muted); font-size: .74rem; }
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  color: var(--accent);
  font: bold .875rem Consolas, "Courier New", monospace;
}

.workspace { min-width: 0; padding-block: 22px 40px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.page-heading p { margin-top: 4px; color: var(--muted); font-size: .875rem; }
.feed-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 18px; align-items: start; }
.post-list, .feed-aside, .connection-panels { display: grid; gap: 20px; min-width: 0; }
.post-list { gap: 32px; }
.circle-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.circle-heading { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--line); background: var(--panel-head); }
.circle-heading h2 { font-size: .875rem; }
.circle-heading > span { color: var(--muted); font-size: .8125rem; }
.circle-card > :not(.circle-heading, .aside-link) { margin-inline: 10px; }
.circle-card p { color: var(--muted); font-size: .8125rem; }
.circle-person { font-size: .9rem; }
.aside-link { padding: 8px 10px; border-top: 1px solid var(--line); color: var(--accent); font-size: .8125rem; text-underline-offset: 2px; }
.request-callout { display: block; padding: 10px; border: 1px solid var(--line); background: var(--paper); text-decoration: none; }
.request-callout:hover { border-color: var(--field-border); }
.request-callout small { display: block; margin-top: 5px; color: var(--muted); }

.post-card, .empty, .content-panel { min-width: 0; border: 1px solid var(--line); background: var(--paper); }
.post-card { overflow: hidden; scroll-margin-top: 20px; }
.post-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 11px; border-bottom: 1px solid var(--line); background: var(--panel-head); }
.post-meta { display: grid; flex: none; gap: 5px; justify-items: end; }
.post-date, .post-actions, .comment-actions { color: var(--muted); font-size: .78rem; }
.post-date { font-family: Consolas, "Courier New", monospace; text-decoration: none; }
.post-date:hover { text-decoration: underline; }
.post-actions, .comment-actions { display: flex; gap: 10px; }
.post-actions a, .comment-actions a { text-underline-offset: 3px; }
.post-media { display: flex; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory; background: var(--media); }
.post-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; }
.post-slide :is(img, video) { display: block; width: 100%; height: min(58vh, 560px); object-fit: contain; }
.post-download { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 6px 11px; border-bottom: 1px solid var(--line); background: var(--paper); }
.post-original { display: inline-flex; align-items: center; align-self: stretch; color: var(--accent); font-size: .8125rem; text-underline-offset: 2px; }
.post-media:focus-visible { outline-offset: -3px; }
.gallery-bar { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 9px 12px; color: var(--muted); font-size: .8rem; }
.gallery-bar button { min-width: 33px; min-height: 32px; border: 1px solid var(--line); border-radius: 2px; background: var(--paper); color: var(--ink); }
.gallery-bar button:disabled { opacity: .45; cursor: default; }
.caption { padding: 10px 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.reactions { padding: 8px 11px; border-top: 1px solid var(--line); }
.reaction { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 38px; min-height: 34px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 2px; background: var(--paper); color: var(--ink); font-size: .85rem; }
.heart-icon { color: var(--heart); font-size: 1.45rem; line-height: 1; }
.reaction:hover, .reaction[aria-pressed="true"] { border-color: var(--heart-border); background: var(--heart-bg); }
.reaction[aria-pressed="true"] { font-weight: 700; }
.comments { display: grid; gap: 8px; padding: 0 11px 11px; scroll-margin-top: 16px; }
.comment-list { display: grid; list-style: none; margin: 0; padding: 0; }
.comment { padding: 7px 9px; border-top: 1px solid var(--line); background: var(--comment); font-size: .85rem; overflow-wrap: anywhere; }
.comment p { margin-top: 3px; white-space: pre-wrap; line-height: 1.45; }
.comment-actions { margin-top: 6px; }
.all-comments { width: fit-content; color: var(--muted); font-size: .83rem; text-underline-offset: 3px; }
.comment-compose { display: flex; align-items: flex-end; gap: 8px; }
.comment-compose textarea { font-size: .9rem; }
.delete-description, .trash-post { overflow-wrap: anywhere; }
.delete-description { white-space: pre-wrap; }
.danger { background: #a22e43; color: #fff; }
.danger:hover { background: #822337; }
.trash-post { display: grid; flex: 1 1 12rem; min-width: 0; gap: 4px; }
.trash-post small { color: var(--muted); }
.empty { display: grid; gap: 6px; padding: 14px; }
.empty h2 { font-size: 1rem; }
.empty p { color: var(--muted); }
.empty .button-row { margin-top: 6px; }

.content-panel { width: min(100%, 760px); padding: 14px; }
.content-panel h2 { margin: 0 0 8px; font-size: 1rem; }
.profile-heading { align-items: center; }
.profile-identity { display: flex; align-items: center; gap: 15px; min-width: 0; max-width: 100%; }
.profile-identity > div { min-width: 0; }
.profile-banner {
  position: relative;
  width: 100%;
  max-width: 760px;
  aspect-ratio: 3 / 1;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--active);
}
.profile-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.settings-banner { max-width: 430px; margin: 0; }
.banner-form input[type="file"] { width: 100%; min-width: 0; }
.profile-identity .avatar { width: 44px; height: 44px; font-size: 1.15rem; }
.profile-identity p { margin-top: 3px; }
.profile-posts { max-width: 760px; }
.profile-tabs {
  display: flex;
  width: min(100%, 760px);
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.profile-tabs a {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 12px 4px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 650;
  text-decoration: none;
}
.profile-tabs a:hover { background: var(--paper); color: var(--ink); }
.profile-tabs a[aria-current] { border-bottom-color: var(--accent); background: var(--active); color: var(--accent); }
.settings-panels { display: grid; gap: 16px; }
.theme-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 430px; margin-top: 14px; }
.theme-option {
  display: grid;
  gap: 10px;
  padding: 9px 9px 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font-size: .875rem;
  font-weight: 650;
  text-align: left;
}
.theme-option:hover { background: var(--soft); }
.theme-option[aria-pressed="true"] { border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus); }
.theme-sample {
  display: grid;
  grid-template-rows: 8px 1fr;
  gap: 4px;
  min-height: 44px;
  padding: 4px;
  border: 1px solid var(--sample-border);
  background: var(--sample-bg);
}
.theme-sample-light { --sample-bg: #e9e9e9; --sample-border: #bcb9bc; --sample-card: #fafafa; --sample-head: #181618; --sample-accent: #981d3c; }
.theme-sample-dark { --sample-bg: #141314; --sample-border: #514951; --sample-card: #201d20; --sample-head: #100e10; --sample-accent: #9e2941; }
.theme-sample i:first-child { border-top: 2px solid var(--sample-accent); background: var(--sample-head); }
.theme-sample i:last-child { border: 1px solid var(--sample-border); background: var(--sample-card); }
.accent-form { display: grid; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.accent-form label { font-size: .875rem; font-weight: 650; }
.accent-controls { display: flex; align-items: center; gap: 10px; }
.accent-controls input[type="color"] {
  width: 56px;
  height: 38px;
  padding: 4px;
  cursor: pointer;
}
.accent-controls input::-webkit-color-swatch-wrapper { padding: 0; }
.accent-controls input::-webkit-color-swatch { border: 1px solid var(--line); }
.accent-controls input::-moz-color-swatch { border: 1px solid var(--line); }
.accent-controls output { color: var(--muted); font-family: ui-monospace, monospace; font-size: .85rem; }
.settings-links { padding: 0; list-style: none; }
.settings-links li + li { border-top: 1px solid var(--line); }
.settings-links a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; font-size: .92rem; text-decoration: none; }
.settings-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.settings-links span { color: var(--muted); }
.row-list { list-style: none; padding: 0; }
.row-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-height: 63px; padding-block: 10px; border-bottom: 1px solid var(--line); }
.row-list li:last-child { border-bottom: 0; }
.row-list .person { flex: 0 1 auto; }
.row-action { margin-left: auto; }
.status { padding: 3px 6px; background: var(--warning-bg); color: var(--warning); font-size: .74rem; font-weight: 650; }
.status.approved { background: var(--success-bg); color: var(--success); }
.search { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.search input { flex: 1 1 150px; }
.account-directory { margin-top: 24px; }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 13px; padding-top: 14px; font-size: .85rem; color: var(--muted); }
.notices { display: grid; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.notices li { padding: 8px 11px; border: 1px solid var(--success-border); background: var(--success-bg); font-size: .9rem; }

.form-stack { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field label { font-size: .87rem; font-weight: 700; }
.field-help { color: var(--muted); font-size: .8rem; line-height: 1.5; }
.field-help ul { padding-left: 18px; }
input:not([type="file"], [type="hidden"]), textarea {
  min-width: 0;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--field-border);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
}
textarea { resize: vertical; }
.upload-zone { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); background: var(--comment); }
.upload-zone input { width: 100%; color: var(--ink); font-size: .86rem; }
.upload-zone input::file-selector-button { margin-right: 9px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 2px; background: var(--paper); color: var(--ink); font-weight: 650; cursor: pointer; }
.upload-zone p, .upload-zone output { color: var(--muted); font-size: .82rem; line-height: 1.45; overflow-wrap: anywhere; }
.upload-zone output:empty { display: none; }
.upload-previews { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); gap: 10px; margin-top: 4px; }
.upload-previews figure { min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.upload-previews :is(img, video) { display: block; width: 100%; height: clamp(135px, 24vw, 245px); object-fit: contain; background: var(--media); }
.upload-previews figure p, .upload-previews figcaption { padding: 8px 10px; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 8px 8px; }
.factor-key, .recovery-codes code { overflow-wrap: anywhere; }
.errorlist { padding-left: 20px; color: var(--error); font-size: .84rem; line-height: 1.5; }

@media (max-width: 700px) {
  .feed-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .site-width, .workspace { padding-inline: 12px; }
  .workspace { padding-top: 16px; }
  .nav a { padding-inline: 8px; }
  .post-slide :is(img, video) { height: min(48vh, 370px); }
  .button, .reaction, .nav a, .signout, .profile-tabs a, .gallery-bar button { min-height: 44px; }
  input:not([type="file"], [type="hidden"]), textarea, .comment-compose textarea { font-size: 1rem; }
}

@media (max-width: 380px) {
  .comment-compose { flex-direction: column; align-items: stretch; }
  .comment-compose button { align-self: end; }
}
