:root {
  color-scheme: light;
  --forest: #18352b;
  --forest-deep: #10271f;
  --forest-soft: #285343;
  --lime: #d9f99d;
  --lime-bright: #c9f17d;
  --ink: #1c2823;
  --muted: #6c7771;
  --subtle: #96a09a;
  --canvas: #f4f6f2;
  --surface: #ffffff;
  --line: #e4e9e3;
  --danger: #b6423c;
  --danger-soft: #fff0ed;
  --blue: #426b88;
  --shadow-sm: 0 1px 2px rgba(20, 43, 33, .03), 0 5px 18px rgba(20, 43, 33, .025);
  --shadow-lg: 0 24px 70px rgba(16, 39, 31, .16);
  --radius: 18px;
  --sidebar-width: 260px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif; font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
input, textarea, select { color: var(--ink); }
textarea { resize: vertical; }
::selection { color: var(--forest-deep); background: var(--lime); }
:focus-visible { outline: 3px solid rgba(87, 125, 73, .3); outline-offset: 3px; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.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; }

.brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; font-size: 27px; font-weight: 750; letter-spacing: -1.4px; line-height: 1; }
.brand-light { color: #fff; }
.brand-dark { color: var(--forest); }
.brand-dot { color: #9dcc55; }
.brand-mark { display: flex; align-items: flex-end; gap: 3px; width: 26px; height: 27px; transform: rotate(-5deg); }
.brand-mark i { display: block; width: 6px; border-radius: 6px; background: var(--lime-bright); }
.brand-mark i:nth-child(1) { height: 22px; }
.brand-mark i:nth-child(2) { height: 16px; }
.brand-mark i:nth-child(3) { height: 26px; }
.brand-dark .brand-mark i { background: var(--forest); }
.brand-dark .brand-mark i:nth-child(2) { background: #79a848; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 0 19px; border: 1px solid transparent; border-radius: 11px; font-size: 14px; font-weight: 700; transition: transform .18s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease; }
.button:not(:disabled):hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--forest); box-shadow: 0 5px 12px rgba(24, 53, 43, .12); }
.button-primary:not(:disabled):hover { background: #244a3c; box-shadow: 0 7px 18px rgba(24, 53, 43, .17); }
.button-secondary { color: #45534c; background: #fff; border-color: #dce2dc; box-shadow: none; }
.button-secondary:not(:disabled):hover { background: #f6f8f5; border-color: #cbd4cb; }
.button-danger { color: #fff; background: var(--danger); }
.button-danger:not(:disabled):hover { background: #973630; }
.button-small { min-height: 39px; padding: 0 15px; border-radius: 10px; font-size: 13px; }
.button-small .icon { width: 17px; height: 17px; }
.button-full { width: 100%; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 9px; background: transparent; transition: color .18s, background .18s; }
.icon-button:hover { background: rgba(24, 53, 43, .07); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 43px; height: 43px; border-radius: 13px; font-size: 12px; font-weight: 800; letter-spacing: .2px; }
.avatar-small { width: 37px; height: 37px; border: 3px solid #2a483c; border-radius: 50%; font-size: 9px; }
.avatar-tone-1 { color: #3c5430; background: #deedc8; }
.avatar-tone-2 { color: #38566b; background: #d9e8f1; }
.avatar-tone-3 { color: #765144; background: #f1dfd4; }
.avatar-tone-4 { color: #5c4b71; background: #e7def0; }
.avatar-tone-5 { color: #6c5730; background: #f2e7c7; }
.avatar-more { color: #e9f4de; background: #456053; }

/* Authentication */
.auth-shell { display: grid; grid-template-columns: minmax(420px, .94fr) 1.06fr; min-height: 100vh; background: #fff; }
.auth-visual { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: 44px 52px 32px; overflow: hidden; color: #fff; background: var(--forest); isolation: isolate; }
.auth-visual::before { position: absolute; z-index: -1; inset: 0; content: ""; opacity: .18; background-image: radial-gradient(rgba(217, 249, 157, .35) .8px, transparent .8px); background-size: 25px 25px; mask-image: linear-gradient(to bottom right, transparent, #000 60%, transparent); }
.auth-visual::after { position: absolute; z-index: -1; right: -140px; bottom: 60px; width: 490px; height: 490px; border: 1px solid rgba(217, 249, 157, .13); border-radius: 50%; content: ""; box-shadow: 0 0 0 75px rgba(217, 249, 157, .025), 0 0 0 150px rgba(217, 249, 157, .018); }
.auth-orb { position: absolute; z-index: -1; border-radius: 50%; filter: blur(1px); pointer-events: none; }
.auth-orb-one { top: -210px; right: -130px; width: 500px; height: 500px; background: radial-gradient(circle, rgba(115, 153, 80, .23), transparent 68%); }
.auth-orb-two { bottom: -230px; left: -180px; width: 550px; height: 550px; background: radial-gradient(circle, rgba(112, 146, 85, .2), transparent 70%); }
.auth-visual-content { width: 100%; max-width: 570px; margin: auto 0; padding: 60px 0 45px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #65736b; font-size: 10px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; }
.eyebrow > span { width: 6px; height: 6px; border-radius: 50%; background: #8cb655; box-shadow: 0 0 0 4px rgba(140, 182, 85, .1); }
.eyebrow-light { color: #d7e4dc; }
.eyebrow-light > span { background: var(--lime-bright); box-shadow: 0 0 0 4px rgba(201, 241, 125, .1); }
.auth-visual h1 { max-width: 610px; margin: 23px 0 24px; color: #f7faf5; font-size: clamp(43px, 4.2vw, 67px); font-weight: 580; letter-spacing: -3.3px; line-height: 1.07; }
.auth-visual h1 em { color: var(--lime); font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -2.8px; }
.auth-visual-content > p { max-width: 495px; margin: 0; color: #b8c9bf; font-size: 16px; line-height: 1.75; }
.community-preview { display: flex; align-items: center; gap: 18px; margin-top: 46px; }
.avatar-stack { display: flex; padding-left: 1px; }
.avatar-stack .avatar { margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.community-preview > div:last-child { display: flex; flex-direction: column; gap: 3px; }
.community-preview strong { color: #eaf0eb; font-size: 13px; font-weight: 650; }
.community-preview div > span { color: #8fa99a; font-size: 12px; }
.auth-visual-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #809b8c; font-size: 11px; }
.auth-visual-footer span:last-child { display: flex; align-items: center; gap: 7px; }
.auth-visual-footer .icon { width: 13px; height: 13px; }
.auth-panel { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 45px 55px; background: #fbfcfa; }
.login-container { width: 100%; max-width: 430px; }
.mobile-auth-brand { display: none; }
.login-heading { margin-bottom: 33px; }
.login-icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; margin-bottom: 23px; color: var(--forest); border: 1px solid #e0e8d9; border-radius: 13px; background: #edf4e4; }
.login-icon .icon { width: 21px; height: 21px; }
.login-heading h2 { margin: 0 0 9px; color: var(--forest-deep); font-size: 35px; font-weight: 700; letter-spacing: -1.5px; line-height: 1.15; }
.login-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.field-group { margin-bottom: 20px; }
.field-group label, .label-row label { display: block; margin-bottom: 8px; color: #3e4b44; font-size: 12px; font-weight: 700; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.label-row > span { margin-bottom: 8px; color: #9aa39e; font-size: 10px; }
.input-wrap { position: relative; }
.field-group input, .field-group select, .field-group textarea, #member-form > input, .directory-filters select { width: 100%; border: 1px solid #dce3dd; border-radius: 11px; outline: 0; background: #fff; transition: border-color .18s, box-shadow .18s; }
.field-group input, .field-group select { height: 48px; padding: 0 14px; }
.field-group textarea { min-height: 120px; padding: 13px 14px; line-height: 1.65; }
.field-group input::placeholder, .field-group textarea::placeholder { color: #aab2ad; }
.field-group input:focus, .field-group select:focus, .field-group textarea:focus, .directory-filters select:focus { border-color: #86a575; box-shadow: 0 0 0 3px rgba(115, 153, 93, .1); }
.password-wrap input { padding-right: 50px; }
.password-toggle { position: absolute; top: 5px; right: 5px; color: #8c9690; }
.password-toggle .icon { width: 18px; height: 18px; }
.login-button { justify-content: space-between; min-height: 51px; margin-top: 5px; padding: 0 19px 0 22px; }
.login-button .icon { width: 19px; }
.form-error { margin: 12px 0; padding: 10px 12px; color: #a03d38; border: 1px solid #f0d4cf; border-radius: 9px; background: var(--danger-soft); font-size: 12px; }

/* Application shell */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; display: flex; flex-direction: column; justify-content: space-between; width: var(--sidebar-width); padding: 31px 20px 20px; overflow-y: auto; color: #d6e1da; background: var(--forest); }
.sidebar .brand { margin-left: 10px; font-size: 25px; }
.sidebar .brand-mark { transform: scale(.9) rotate(-5deg); }
.space-label { display: flex; align-items: center; gap: 7px; margin: 27px 10px 37px; color: #8da799; font-size: 10px; letter-spacing: .4px; }
.space-label .icon { width: 12px; height: 12px; }
.nav-label { display: block; margin: 0 12px 12px; color: #6f8e7e; font-size: 9px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; }
.main-nav { display: flex; flex-direction: column; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 45px; padding: 0 12px; color: #a9bdb1; text-align: left; border: 0; border-radius: 10px; background: transparent; font-size: 12px; font-weight: 550; transition: color .18s, background .18s; }
.nav-item .icon { width: 18px; height: 18px; }
.nav-item:hover { color: #edf5ee; background: rgba(255, 255, 255, .05); }
.nav-item.active { color: var(--forest-deep); background: var(--lime); font-weight: 700; }
.nav-badge { margin-left: auto; padding: 2px 6px; color: #b8d69a; border: 1px solid rgba(201, 241, 125, .17); border-radius: 5px; font-size: 8px; text-transform: uppercase; }
.nav-item.active .nav-badge { color: var(--forest); border-color: rgba(24, 53, 43, .18); }
.kindness-card { margin: 0 2px 25px; padding: 18px; border: 1px solid rgba(217, 249, 157, .1); border-radius: 14px; background: rgba(255, 255, 255, .035); }
.kindness-card > .icon { width: 17px; height: 17px; margin-bottom: 10px; color: #b3d486; }
.kindness-card p { margin: 0 0 8px; color: #d9e5dc; font-family: Georgia, serif; font-size: 15px; line-height: 1.45; }
.kindness-card span { color: #779587; font-size: 8px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-user .avatar { width: 37px; height: 37px; border-radius: 11px; font-size: 10px; }
.sidebar-user-info { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.sidebar-user-info strong { overflow: hidden; color: #f0f5f0; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-info span { color: #87a192; font-size: 9px; text-transform: capitalize; }
.logout-button { width: 30px; height: 30px; color: #8ca699; }
.logout-button:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.logout-button .icon { width: 16px; height: 16px; }
.app-main { min-height: 100vh; margin-left: var(--sidebar-width); }
.app-topbar { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; height: 70px; padding: 0 38px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .91); backdrop-filter: blur(14px); }
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 18px; }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #a0a8a3; font-size: 11px; }
.breadcrumb strong { color: #536159; font-weight: 650; }
.privacy-pill { display: inline-flex; align-items: center; gap: 6px; color: #758078; font-size: 10px; }
.privacy-pill .icon { width: 12px; height: 12px; }
.menu-toggle, .mobile-app-brand { display: none; }
.main-content { max-width: 1490px; margin: 0 auto; padding: 37px 38px 55px; }
.view-panel { animation: view-in .3s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.welcome-block { margin-bottom: 30px; }
.date-line { margin: 0 0 8px; color: #8a958e; font-size: 9px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; }
.welcome-block h2, .admin-heading h2 { margin: 0 0 6px; color: var(--forest-deep); font-size: 31px; font-weight: 680; letter-spacing: -1.35px; line-height: 1.2; }
.welcome-dot { color: #8bb34f; }
.welcome-block > p:last-child, .admin-heading > div > p:last-child { margin: 0; color: #7c8880; font-size: 12px; }
.feed-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; align-items: start; gap: 25px; }
.feed-column { min-width: 0; }
.feed-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 29px 1px 14px; }
.feed-toolbar > div { display: flex; align-items: baseline; gap: 8px; }
.feed-toolbar h3 { margin: 0; color: #36453d; font-size: 13px; font-weight: 700; }
.count-label { color: #a1aaa4; font-size: 9px; }
.search-box { display: flex; align-items: center; gap: 7px; min-width: 158px; height: 36px; padding: 0 11px; color: #98a29b; border: 1px solid #e0e6df; border-radius: 9px; background: #fff; transition: border-color .18s, box-shadow .18s; }
.search-box:focus-within { border-color: #91aa83; box-shadow: 0 0 0 3px rgba(115, 153, 93, .08); }
.search-box .icon { width: 14px; height: 14px; }
.search-box input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; font-size: 10px; }
.search-box input::placeholder { color: #a0aaa3; }
.search-box input::-webkit-search-cancel-button { cursor: pointer; }
.feed-list { display: flex; flex-direction: column; gap: 13px; }
.role-badge { display: inline-flex; align-items: center; width: max-content; padding: 3px 7px; border-radius: 5px; font-size: 8px; font-weight: 750; letter-spacing: .3px; text-transform: capitalize; white-space: nowrap; }
.role-former { color: #7b7770; background: #efede8; }
.role-member { color: #65746b; background: #edf1ec; }
.role-moderator { color: #42687e; background: #e5f0f5; }
.role-admin { color: #77602c; background: #f6edcf; }
.role-tooltip { cursor: help; }
.role-permission-tooltip { position: fixed; z-index: 80; width: 245px; max-width: calc(100vw - 24px); padding: 11px 13px; color: #f2f7f1; border: 1px solid rgba(255, 255, 255, .1); border-radius: 9px; background: #18352b; box-shadow: 0 10px 30px rgba(16, 39, 31, .22); font-size: 10px; font-weight: 500; line-height: 1.6; pointer-events: none; }
[data-theme="dark"] .role-permission-tooltip { color: #18352b; border-color: #d9f99d; background: #d9f99d; }
.loading-state { padding: 50px 20px; color: #8c9890; text-align: center; border: 1px dashed #d8dfd7; border-radius: var(--radius); font-size: 12px; }
.loading-spinner { display: inline-block; width: 18px; height: 18px; margin-bottom: 10px; border: 2px solid #dce5d8; border-top-color: #6c9257; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { padding: 48px 25px; color: #8c9890; text-align: center; }
.empty-state > .icon { width: 28px; height: 28px; margin-bottom: 10px; color: #9bae92; }
.empty-state h3 { margin: 0 0 5px; color: #4c5b52; font-size: 14px; }
.empty-state p { margin: 0; font-size: 11px; }
.right-rail { display: flex; flex-direction: column; gap: 16px; }
.community-stats-card { padding: 21px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.card-heading h3 { margin: 8px 0 0; color: #2f4037; font-family: Georgia, serif; font-size: 19px; font-weight: 400; }
.community-pulse { width: 8px; height: 8px; margin-top: 3px; border-radius: 50%; background: #8db55f; box-shadow: 0 0 0 5px #eff5e9; }
.community-numbers { display: grid; grid-template-columns: repeat(3, 1fr); margin: 22px 0 17px; }
.community-numbers > div { display: flex; flex-direction: column; border-right: 1px solid #e8ece6; text-align: center; }
.community-numbers > div:first-child { text-align: left; }
.community-numbers > div:last-child { border: 0; text-align: right; }
.community-numbers strong { color: #2f4037; font-size: 22px; font-weight: 650; letter-spacing: -.8px; }
.community-numbers span { color: #99a39c; font-size: 8px; }
.community-stats-card > p { margin: 0; padding-top: 14px; color: #8b968f; border-top: 1px solid #edf0eb; font-size: 9px; line-height: 1.65; }
.guidelines-card { position: relative; padding: 23px 21px 17px; overflow: hidden; }
.guidelines-icon { position: absolute; top: 20px; right: 20px; color: #9eb88e; }
.guidelines-icon .icon { width: 17px; height: 17px; }
.guidelines-card h3 { margin: 0 0 5px; color: #34463c; font-size: 12px; }
.guidelines-card > p { max-width: 190px; margin: 0; color: #98a29b; font-size: 9px; line-height: 1.6; }
.guidelines-card ol { display: flex; flex-direction: column; gap: 16px; margin: 22px 0 0; padding: 0; list-style: none; }
.guidelines-card li { display: flex; align-items: flex-start; gap: 11px; }
.guidelines-card li > span { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: 0 0 auto; color: #6d875f; border-radius: 8px; background: #edf3e8; font-size: 8px; font-weight: 750; }
.guidelines-card li div { display: flex; flex-direction: column; }
.guidelines-card li strong { color: #546159; font-size: 10px; font-weight: 650; }
.guidelines-card li small { color: #a0a9a3; font-size: 8px; }
.role-note { display: flex; align-items: flex-start; gap: 11px; padding: 5px 7px; color: #8d9991; }
.role-note > .icon { width: 16px; height: 16px; margin-top: 2px; color: #79966a; }
.role-note strong { display: block; margin-bottom: 3px; color: #64756a; font-size: 10px; }
.role-note p { margin: 0; font-size: 9px; line-height: 1.6; }

/* Administration */
.admin-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 29px; }
.admin-heading .eyebrow { margin-bottom: 10px; }
.admin-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 23px; }
.admin-stat { display: flex; align-items: center; gap: 13px; padding: 18px; }
.stat-icon { display: inline-flex; align-items: center; justify-content: center; width: 39px; height: 39px; flex: 0 0 auto; border-radius: 11px; }
.stat-icon .icon { width: 18px; height: 18px; }
.stat-icon-green { color: #527442; background: #eaf2e3; }
.stat-icon-blue { color: #426b88; background: #e5f0f5; }
.stat-icon-gold { color: #8b6d30; background: #f7edce; }
.stat-icon-purple { color: #725a85; background: #eee7f3; }
.admin-stat > div { display: flex; flex-direction: column; }
.admin-stat span:not(.stat-icon) { color: #8d9991; font-size: 9px; }
.admin-stat strong { color: #2c3e34; font-size: 24px; font-weight: 650; letter-spacing: -.8px; line-height: 1.15; }
.directory-card { overflow: hidden; }
.directory-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.directory-header h3 { margin: 0 0 2px; color: #34443b; font-size: 13px; }
.directory-header p { margin: 0; color: #98a29b; font-size: 9px; }
.directory-filters { display: flex; align-items: center; gap: 9px; }
.directory-filters select { width: auto; height: 36px; padding: 0 29px 0 10px; color: #6e7a72; outline: 0; font-size: 10px; }
.table-wrap { overflow-x: auto; }
.member-table { width: 100%; border-collapse: collapse; }
.member-table th { padding: 12px 17px; color: #98a29b; background: #fafbf9; border-bottom: 1px solid var(--line); text-align: left; font-size: 8px; font-weight: 750; letter-spacing: .8px; text-transform: uppercase; white-space: nowrap; }
.member-table th:first-child, .member-table td:first-child { padding-left: 22px; }
.member-table th:last-child, .member-table td:last-child { padding-right: 20px; text-align: right; }
.member-table td { padding: 14px 17px; color: #66736b; border-bottom: 1px solid #edf0ec; font-size: 10px; vertical-align: middle; }
.member-table tr:last-child td { border-bottom: 0; }
.member-table tbody tr { transition: background .15s; }
.member-table tbody tr:hover { background: #fbfcfa; }
.member-identity { display: flex; align-items: center; gap: 11px; min-width: 180px; }
.member-identity .avatar { width: 35px; height: 35px; border-radius: 10px; font-size: 9px; }
.member-identity > div { display: flex; min-width: 0; flex-direction: column; }
.member-identity strong { color: #3c4c43; font-size: 10px; font-weight: 700; }
.member-identity small { color: #9ba49e; font-size: 8px; }
.you-label { margin-left: 5px; color: #88a178; font-size: 7px; font-weight: 600; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 9px; }
.status-badge::before { width: 6px; height: 6px; border-radius: 50%; content: ""; }
.status-active { color: #60824f; }
.status-active::before { background: #7ca464; box-shadow: 0 0 0 3px #edf4e9; }
.status-inactive { color: #929b95; }
.status-inactive::before { background: #b2b9b4; }
.member-actions { display: inline-flex; gap: 3px; }
.member-actions .icon-button { width: 29px; height: 29px; color: #8f9b93; }
.member-actions .icon { width: 14px; height: 14px; }
.member-actions .delete-user:hover { color: var(--danger); background: var(--danger-soft); }
.member-actions .icon-button:disabled { opacity: .25; }

/* Dialogs and notifications */
.modal { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 27px; overflow-y: auto; color: var(--ink); border: 1px solid rgba(255, 255, 255, .7); border-radius: 20px; background: #fff; box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(12, 29, 23, .55); backdrop-filter: blur(5px); }
.modal[open] { animation: modal-in .2s ease both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.modal-kicker { display: block; margin-bottom: 5px; color: #829478; font-size: 8px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.modal-header h2 { margin: 0; color: var(--forest-deep); font-size: 23px; letter-spacing: -.8px; }
.modal-close { width: 32px; height: 32px; margin: -5px -5px 0 0; color: #8f9992; }
.modal-close .icon { width: 17px; height: 17px; }
.field-meta { display: flex; justify-content: space-between; margin-top: 7px; color: #9ca59f; font-size: 9px; }
.field-help { display: block; margin-top: 6px; color: #96a099; font-size: 9px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.toggle-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px; border: 1px solid #e2e7e1; border-radius: 11px; cursor: pointer; }
.toggle-row > span:first-child { display: flex; flex-direction: column; }
.toggle-row strong { color: #49574f; font-size: 11px; }
.toggle-row small { color: #99a29c; font-size: 9px; }
.toggle-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle-control { position: relative; width: 37px; height: 21px; flex: 0 0 auto; border-radius: 20px; background: #cbd2cc; transition: background .2s; }
.toggle-control::after { position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; content: ""; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); transition: transform .2s; }
.toggle-row input:checked + .toggle-control { background: #668c51; }
.toggle-row input:checked + .toggle-control::after { transform: translateX(16px); }
.toggle-row input:focus-visible + .toggle-control { outline: 3px solid rgba(87, 125, 73, .25); outline-offset: 3px; }
.modal-confirm { width: min(420px, calc(100vw - 32px)); text-align: center; }
.confirm-icon { display: flex; align-items: center; justify-content: center; width: 47px; height: 47px; margin: 0 auto 17px; color: var(--danger); border-radius: 14px; background: var(--danger-soft); }
.confirm-icon .icon { width: 22px; height: 22px; }
.modal-confirm h2 { margin: 0 0 9px; color: var(--forest-deep); font-size: 22px; letter-spacing: -.6px; }
.modal-confirm > p:not(.form-error) { margin: 0; color: #7e8a82; font-size: 12px; line-height: 1.7; }
.modal-confirm .modal-actions { justify-content: center; }
.toast-region { position: fixed; z-index: 100; right: 24px; bottom: 24px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 360px; padding: 13px 16px; color: #eef6ef; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; background: #203d31; box-shadow: 0 12px 35px rgba(16, 39, 31, .22); font-size: 11px; animation: toast-in .25s ease both; }
.toast .icon { width: 16px; height: 16px; color: var(--lime); }
.toast-error { background: #7f3732; }
.toast-error .icon { color: #ffd8cf; }
.toast.leaving { animation: toast-out .2s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

@media (min-width: 1500px) {
  .main-content { padding-right: 48px; padding-left: 48px; }
  .feed-layout { grid-template-columns: minmax(0, 1fr) 310px; gap: 30px; }
}

@media (max-width: 1150px) {
  .auth-visual { padding-right: 38px; padding-left: 38px; }
  .auth-visual h1 { font-size: 48px; }
  .auth-panel { padding-right: 38px; padding-left: 38px; }
  .feed-layout { grid-template-columns: minmax(0, 1fr); }
  .right-rail { display: grid; grid-template-columns: 1fr 1fr; }
  .role-note { display: none; }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 250px; }
  .auth-shell { grid-template-columns: minmax(340px, .85fr) 1.15fr; }
  .auth-visual { padding: 32px; }
  .auth-visual h1 { font-size: 41px; letter-spacing: -2.5px; }
  .auth-visual-content > p { font-size: 14px; }
  .community-preview { align-items: flex-start; flex-direction: column; }
  .auth-panel { padding: 35px 28px; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 15px 0 45px rgba(12, 29, 23, .15); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { position: fixed; z-index: 25; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(12, 29, 23, .4); backdrop-filter: blur(2px); }
  .app-main { margin-left: 0; }
  .menu-toggle { display: inline-flex; margin-left: -8px; }
  .app-topbar { padding: 0 25px; }
  .main-content { padding: 32px 25px 45px; }
}

@media (max-width: 700px) {
  .auth-shell { display: block; background: #f8faf6; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; padding: 32px 24px; }
  .login-container { max-width: 440px; }
  .mobile-auth-brand { display: inline-flex; margin-bottom: 55px; }
  .login-icon { display: none; }
  .login-heading h2 { font-size: 32px; }
  .app-topbar { height: 64px; padding: 0 18px; }
  .breadcrumb { display: none; }
  .mobile-app-brand { display: inline-flex; font-size: 22px; }
  .mobile-app-brand .brand-mark { transform: scale(.75) rotate(-5deg); margin-right: -3px; }
  .topbar-left { gap: 9px; }
  .topbar-actions { gap: 10px; }
  .privacy-pill { display: none; }
  .main-content { padding: 26px 17px 40px; }
  .welcome-block h2, .admin-heading h2 { font-size: 27px; }
  .feed-toolbar { align-items: flex-start; flex-direction: column; }
  .feed-toolbar .search-box { width: 100%; }
  .right-rail { grid-template-columns: 1fr; }
  .admin-heading { align-items: flex-start; flex-direction: column; }
  .directory-header { align-items: flex-start; flex-direction: column; }
  .directory-filters { width: 100%; }
  .directory-filters .search-box { flex: 1; }
  .member-table th:nth-child(4), .member-table td:nth-child(4), .member-table th:nth-child(5), .member-table td:nth-child(5) { display: none; }
  .member-table th, .member-table td { padding-right: 10px; padding-left: 10px; }
  .member-table th:first-child, .member-table td:first-child { padding-left: 16px; }
  .member-identity { min-width: 150px; }
}

@media (max-width: 480px) {
  .auth-panel { padding: 26px 19px; }
  .mobile-auth-brand { margin-bottom: 45px; }
  .topbar-actions .button { width: 37px; min-height: 37px; padding: 0; }
  .topbar-actions .button span { display: none; }
  .admin-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .admin-stat { align-items: flex-start; flex-direction: column; gap: 8px; padding: 14px; }
  .stat-icon { width: 32px; height: 32px; }
  .admin-stat strong { font-size: 21px; }
  .directory-filters { align-items: stretch; flex-direction: column; }
  .directory-filters select { width: 100%; }
  .member-table th:nth-child(3), .member-table td:nth-child(3) { display: none; }
  .member-identity { min-width: 140px; }
  .member-identity .avatar { display: none; }
  .member-table .role-badge { max-width: 65px; overflow: hidden; text-overflow: ellipsis; }
  .modal { padding: 22px 19px; }
  .modal-actions .button { flex: 1; }
  .toast-region { right: 15px; bottom: 15px; left: 15px; align-items: stretch; }
  .toast { max-width: none; }
}

/* Test manual library */
.library-welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.quick-start { display: flex; align-items: center; gap: 15px; padding: 18px 20px; background: linear-gradient(105deg, #f9fcf5, #fff); border-color: #dfe7d8; }
.quick-start-icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex: 0 0 auto; color: #55773f; border-radius: 12px; background: #e8f1dc; }
.quick-start-icon .icon { width: 20px; height: 20px; }
.quick-start > div { flex: 1; }
.quick-start h3 { margin: 0 0 3px; color: #35473a; font-size: 12px; }
.quick-start p { margin: 0; color: #89968b; font-size: 9px; line-height: 1.6; }
.library-toolbar { align-items: center; }
.library-filters { display: flex; align-items: center; gap: 8px; }
.library-filters .search-box { width: 215px; }
.library-filters select { height: 36px; padding: 0 27px 0 10px; color: #6e7a72; border: 1px solid #e0e6df; border-radius: 9px; outline: 0; background: #fff; font-size: 10px; }
.library-filters select:focus { border-color: #91aa83; box-shadow: 0 0 0 3px rgba(115, 153, 93, .08); }
.manual-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.manual-grid > .empty-state, .manual-grid > .loading-state { grid-column: 1 / -1; }
.manual-card { display: flex; min-width: 0; min-height: 285px; flex-direction: column; padding: 20px; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.manual-card:hover { transform: translateY(-2px); border-color: #d4dfd1; box-shadow: 0 9px 26px rgba(20, 43, 33, .06); }
.manual-card-draft { border-top-color: #ddc893; }
.manual-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.manual-card-top > span:last-child { color: #9ca69f; font-size: 8px; }
.manual-status { display: inline-flex; align-items: center; gap: 5px; width: max-content; padding: 3px 7px; border-radius: 5px; font-size: 8px; font-weight: 750; letter-spacing: .3px; }
.manual-status::before { width: 5px; height: 5px; border-radius: 50%; content: ""; }
.status-published { color: #557744; background: #edf4e7; }
.status-published::before { background: #7ca464; }
.status-draft { color: #8a6b30; background: #f8efda; }
.status-draft::before { background: #c39a4c; }
.manual-title-button { display: block; width: 100%; padding: 0; text-align: left; border: 0; background: transparent; }
.manual-title-button h3 { margin: 0; color: #283b31; font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 500; letter-spacing: -.35px; line-height: 1.3; overflow-wrap: anywhere; transition: color .18s; }
.manual-title-button:hover h3 { color: #66864f; }
.manual-excerpt { display: -webkit-box; margin: 11px 0 15px; overflow: hidden; color: #7d8981; font-size: 10px; line-height: 1.75; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.manual-sections { display: flex; gap: 5px; margin-bottom: 17px; overflow: hidden; }
.manual-sections span { max-width: 120px; padding: 3px 7px; overflow: hidden; color: #7b897f; border: 1px solid #e5eae3; border-radius: 5px; background: #fafbf9; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.manual-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; border-top: 1px solid #edf0eb; }
.manual-author { display: flex; align-items: center; gap: 8px; min-width: 0; }
.manual-author .avatar { width: 30px; height: 30px; border-radius: 9px; font-size: 8px; }
.manual-author > div { display: flex; min-width: 0; flex-direction: column; }
.manual-author strong { overflow: hidden; color: #59685e; font-size: 9px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.manual-author div span { color: #9da69f; font-size: 8px; }
.manual-card-actions { display: flex; gap: 1px; }
.manual-card-actions .icon-button { width: 27px; height: 27px; color: #93a097; }
.manual-card-actions .icon { width: 13px; height: 13px; }
.open-manual-arrow { color: #6d8d5c !important; }

/* Focused manual editor */
.editor-page-header, .reader-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.back-button { display: inline-flex; align-items: center; gap: 8px; padding: 0; color: #6e7c73; border: 0; background: transparent; font-size: 11px; font-weight: 650; }
.back-button:hover { color: var(--forest); }
.back-button .icon { width: 16px; height: 16px; }
.save-state { display: inline-flex; align-items: center; gap: 6px; color: #8a978e; font-size: 9px; }
.save-state .icon { width: 13px; height: 13px; color: #7f9c6d; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 245px; align-items: start; gap: 20px; }
.editor-document { min-width: 0; overflow: hidden; }
.document-title-wrap { position: relative; padding: 28px 32px 21px; }
.document-title-wrap > span { display: block; margin-bottom: 8px; color: #92a087; font-size: 8px; font-weight: 800; letter-spacing: 1.5px; }
.document-title-wrap input { width: 100%; padding: 0; color: #20372b; border: 0; outline: 0; background: transparent; font-family: Georgia, "Times New Roman", serif; font-size: 30px; line-height: 1.3; }
.document-title-wrap input::placeholder { color: #b2bbb3; }
.editor-tabs { display: flex; align-items: center; justify-content: space-between; padding: 0 25px; border-top: 1px solid #edf0eb; border-bottom: 1px solid #e5eae4; background: #fafbf9; }
.editor-tabs > div { display: flex; gap: 5px; }
.editor-tabs button { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 9px; color: #929d95; border: 0; background: transparent; font-size: 10px; font-weight: 650; }
.editor-tabs button::after { position: absolute; right: 7px; bottom: -1px; left: 7px; height: 2px; content: ""; background: transparent; }
.editor-tabs button.active { color: #4f6f40; }
.editor-tabs button.active::after { background: #75965f; }
.editor-tabs button .icon { width: 14px; height: 14px; }
.editor-tabs > span { color: #a3aca5; font-size: 8px; }
.format-toolbar { display: flex; align-items: center; gap: 3px; padding: 9px 24px; overflow-x: auto; border-bottom: 1px solid #edf0eb; }
.format-toolbar button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 29px; flex: 0 0 auto; color: #76837a; border: 0; border-radius: 6px; background: transparent; font-size: 12px; }
.format-toolbar button:hover { color: #35503f; background: #edf3e9; }
.format-toolbar button .icon { width: 15px; height: 15px; }
.format-toolbar > span { width: 1px; height: 17px; margin: 0 5px; flex: 0 0 auto; background: #e2e7e0; }
.format-numbered { font-size: 11px; }
#manual-content { display: block; width: 100%; min-height: 610px; padding: 26px 32px; color: #3f5046; border: 0; outline: 0; background: #fff; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12px; line-height: 1.9; resize: vertical; tab-size: 2; }
#manual-content::placeholder { color: #adb6ae; }
#preview-panel { min-height: 610px; padding: 30px 34px; }
.editor-document-footer { display: flex; align-items: center; gap: 18px; padding: 11px 25px; color: #9aa49c; border-top: 1px solid #edf0eb; background: #fafbf9; font-size: 8px; }
.editor-document-footer span:last-child { margin-left: auto; }
.editor-sidebar { display: flex; flex-direction: column; gap: 14px; }
.editor-settings, .outline-card { padding: 19px; }
.editor-settings h3, .outline-card h3 { margin: 0 0 15px; color: #46574d; font-size: 11px; }
.editor-settings .field-group { margin-bottom: 17px; }
.editor-settings .field-group select { height: 41px; padding: 0 9px; font-size: 9px; }
.document-owner { display: flex; align-items: center; gap: 9px; padding-top: 14px; border-top: 1px solid #edf0eb; }
.document-owner .avatar { width: 30px; height: 30px; border-radius: 9px; font-size: 8px; }
.document-owner > div { display: flex; flex-direction: column; }
.document-owner div span { color: #9aa49d; font-size: 8px; }
.document-owner strong { color: #5d6b62; font-size: 9px; }
.side-card-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.side-card-heading > .icon { width: 14px; height: 14px; color: #98a78f; }
#manual-outline { display: flex; max-height: 245px; flex-direction: column; gap: 3px; overflow-y: auto; }
#manual-outline > p { margin: 0; color: #a0aaa2; font-size: 9px; line-height: 1.6; }
#manual-outline button { display: block; width: 100%; padding: 5px 7px; overflow: hidden; color: #76857a; text-align: left; text-overflow: ellipsis; white-space: nowrap; border: 0; border-radius: 5px; background: transparent; font-size: 9px; }
#manual-outline button:hover { color: #46633a; background: #f0f5eb; }
#manual-outline .outline-level-2 { padding-left: 15px; }
#manual-outline .outline-level-3 { padding-left: 24px; font-size: 8px; }
.template-button { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 15px; color: #587347; text-align: left; border: 1px solid #dce7d3; border-radius: 12px; background: #f1f6eb; }
.template-button:hover { border-color: #bdceb1; background: #ebf3e3; }
.template-button > .icon { width: 16px; height: 16px; margin-top: 1px; }
.template-button > span { display: flex; flex-direction: column; }
.template-button strong { font-size: 9px; }
.template-button small { margin-top: 3px; color: #8d9d85; font-size: 7px; line-height: 1.5; }
.editor-tip { display: flex; align-items: flex-start; gap: 9px; padding: 4px 6px; color: #8b998e; }
.editor-tip > .icon { width: 15px; height: 15px; margin-top: 2px; color: #86a074; }
.editor-tip strong { color: #6e7e72; font-size: 9px; }
.editor-tip p { margin: 3px 0 0; font-size: 8px; line-height: 1.6; }
.editor-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* Manual reading and rendered content */
.reader-topbar { max-width: 900px; margin-right: auto; margin-left: auto; }
.reader-document { max-width: 900px; margin: 0 auto; overflow: hidden; }
.reader-header { padding: 37px 48px 28px; border-bottom: 1px solid #e9ede7; background: linear-gradient(145deg, #fbfdf8, #fff); }
.reader-label { display: flex; align-items: center; gap: 7px; color: #86967c; font-size: 8px; font-weight: 800; letter-spacing: 1.3px; }
.reader-label > .icon { width: 15px; height: 15px; }
.reader-label .manual-status { margin-left: 8px; letter-spacing: 0; }
.reader-header h2 { margin: 16px 0 22px; color: #21372b; font-family: Georgia, "Times New Roman", serif; font-size: 36px; font-weight: 500; letter-spacing: -1px; line-height: 1.2; overflow-wrap: anywhere; }
.reader-meta { display: flex; align-items: center; gap: 10px; }
.reader-meta .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 9px; }
.reader-meta > div { display: flex; flex-direction: column; }
.reader-meta strong { color: #59695e; font-size: 10px; }
.reader-meta div span { color: #9aa49d; font-size: 8px; }
.reader-time { margin-left: auto; color: #8f9b92; font-size: 9px; }
#reader-content { padding: 38px 48px 45px; }
.manual-rendered { color: #46564c; font-size: 13px; line-height: 1.85; overflow-wrap: anywhere; }
.manual-rendered h2, .manual-rendered h3, .manual-rendered h4 { color: #263c30; font-family: Georgia, "Times New Roman", serif; font-weight: 500; line-height: 1.35; }
.manual-rendered h2 { margin: 34px 0 13px; font-size: 27px; }
.manual-rendered h3 { margin: 30px 0 11px; padding-bottom: 8px; border-bottom: 1px solid #edf0eb; font-size: 21px; }
.manual-rendered h4 { margin: 24px 0 9px; font-size: 17px; }
.manual-rendered > :first-child { margin-top: 0; }
.manual-rendered p { margin: 11px 0; }
.manual-rendered strong { color: #334a3c; font-weight: 700; }
.manual-rendered ul, .manual-rendered ol { margin: 12px 0 18px; padding-left: 25px; }
.manual-rendered li { margin: 6px 0; padding-left: 3px; }
.manual-rendered ol > li::marker { color: #789466; font-weight: 700; }
.manual-rendered blockquote { margin: 18px 0; padding: 12px 17px; color: #60745f; border-left: 3px solid #9eba88; background: #f5f8f1; }
.manual-rendered code { padding: 2px 5px; color: #506d5a; border-radius: 4px; background: #edf2eb; font-family: "SFMono-Regular", Consolas, monospace; font-size: .9em; }
.manual-rendered hr { margin: 28px 0; border: 0; border-top: 1px solid #e4eae2; }
.manual-rendered .rendered-checklist { padding: 0; list-style: none; }
.rendered-checklist li { display: flex; align-items: flex-start; gap: 9px; }
.rendered-checklist input { width: 14px; height: 14px; margin: 6px 0 0; accent-color: #6f9159; }
.rendered-checklist input:checked + span { color: #8b978e; text-decoration: line-through; }
.preview-empty { color: #9da79f; font-style: italic; }
.reader-footer { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 15px; color: #96a198; border-top: 1px solid #edf0eb; background: #fafbf9; font-size: 8px; }
.reader-footer .icon { width: 12px; height: 12px; }

@media (max-width: 1150px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr) 225px; }
  .manual-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Image uploads and visual resizing */
.add-picture-button { width: auto !important; gap: 6px; padding: 0 8px !important; color: #57764a !important; }
.add-picture-button > span { font-size: 9px; font-weight: 700; white-space: nowrap; }
.editor-document { position: relative; }
.editor-document.drag-active::after { position: absolute; z-index: 15; inset: 0; display: flex; align-items: center; justify-content: center; padding: 30px; color: #35552a; border: 3px dashed #86a971; border-radius: var(--radius); background: rgba(239, 247, 231, .94); content: "Drop pictures to upload and convert to WebP"; font-size: 14px; font-weight: 700; pointer-events: none; }
.upload-spinner { width: 12px; height: 12px; margin: 0; vertical-align: middle; }
.manual-image { position: relative; max-width: 100%; margin: 25px auto; text-align: center; }
.manual-image img { display: block; width: 100%; height: auto; border: 1px solid #e1e7df; border-radius: 10px; background: #f5f7f3; box-shadow: 0 4px 15px rgba(25, 50, 39, .05); }
.manual-image figcaption { margin-top: 8px; color: #8c998f; font-size: 10px; font-style: italic; line-height: 1.5; }
#manual-preview .manual-image { cursor: pointer; }
#manual-preview .manual-image img { transition: outline-color .15s, box-shadow .15s; outline: 2px solid transparent; outline-offset: 3px; }
#manual-preview .manual-image:hover img { outline-color: #c1d3b5; }
#manual-preview .manual-image.selected img { outline-color: #759b5e; box-shadow: 0 7px 22px rgba(62, 91, 48, .12); }
.manual-image-controls { position: absolute; z-index: 5; bottom: calc(100% + 10px); left: 50%; display: none; align-items: center; gap: 3px; width: max-content; padding: 6px; color: #dce9df; border-radius: 9px; background: #213d30; box-shadow: 0 7px 22px rgba(20, 43, 33, .2); transform: translateX(-50%); cursor: default; }
.manual-image.selected .manual-image-controls { display: flex; }
.manual-image-controls > span { padding: 0 6px; color: #b5c8ba; font-size: 8px; white-space: nowrap; }
.manual-image-controls button { min-width: 35px; height: 26px; padding: 0 6px; color: #d9e5dc; border: 0; border-radius: 5px; background: transparent; font-size: 8px; }
.manual-image-controls button:hover, .manual-image-controls button.active { color: #203829; background: var(--lime); }
.manual-image-controls .image-width-value { min-width: 35px; padding-left: 5px; color: var(--lime); font-size: 8px; text-align: right; }
.image-resize-handle { position: absolute; z-index: 4; right: -8px; bottom: -8px; display: none; align-items: center; justify-content: center; width: 25px; height: 25px; padding: 0; color: #24432f; border: 2px solid #fff; border-radius: 7px; background: var(--lime); box-shadow: 0 3px 10px rgba(20, 43, 33, .18); cursor: nwse-resize; touch-action: none; }
.manual-image.selected .image-resize-handle { display: flex; }
.image-resize-handle .icon { width: 14px; height: 14px; }
.manual-image:has(figcaption) .image-resize-handle { bottom: 18px; }
.manual-image-width-5 { width: 5%; }
.manual-image-width-10 { width: 10%; }
.manual-image-width-15 { width: 15%; }
.manual-image-width-20 { width: 20%; }
.manual-image-width-25 { width: 25%; }
.manual-image-width-30 { width: 30%; }
.manual-image-width-35 { width: 35%; }
.manual-image-width-40 { width: 40%; }
.manual-image-width-45 { width: 45%; }
.manual-image-width-50 { width: 50%; }
.manual-image-width-55 { width: 55%; }
.manual-image-width-60 { width: 60%; }
.manual-image-width-65 { width: 65%; }
.manual-image-width-70 { width: 70%; }
.manual-image-width-75 { width: 75%; }
.manual-image-width-80 { width: 80%; }
.manual-image-width-85 { width: 85%; }
.manual-image-width-90 { width: 90%; }
.manual-image-width-95 { width: 95%; }
.manual-image-width-100 { width: 100%; }

@media (max-width: 800px) {
  .library-welcome { align-items: flex-start; }
  .library-toolbar { align-items: stretch; }
  .library-filters { width: 100%; }
  .library-filters .search-box { width: auto; flex: 1; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-sidebar { display: grid; grid-template-columns: 1fr 1fr; }
  .editor-tip { display: none; }
  #manual-content, #preview-panel { min-height: 480px; }
}

@media (max-width: 600px) {
  .library-welcome { flex-direction: column; }
  .library-welcome > .button { width: 100%; }
  .quick-start { align-items: flex-start; flex-wrap: wrap; }
  .quick-start > div { min-width: calc(100% - 60px); }
  .quick-start > .button { width: 100%; }
  .library-filters { align-items: stretch; flex-direction: column; }
  .library-filters select { width: 100%; }
  .manual-grid { grid-template-columns: 1fr; }
  .manual-card { min-height: 260px; }
  .document-title-wrap { padding: 23px 20px 17px; }
  .document-title-wrap input { font-size: 25px; }
  .editor-tabs { padding: 0 14px; }
  .format-toolbar { padding: 8px 13px; }
  #manual-content { padding: 21px 20px; font-size: 11px; }
  #preview-panel { padding: 23px 20px; }
  .editor-sidebar { grid-template-columns: 1fr; }
  .editor-document-footer { gap: 10px; padding: 10px 16px; }
  .editor-form-actions .button { flex: 1; }
  .reader-header { padding: 27px 23px 22px; }
  .reader-header h2 { font-size: 29px; }
  #reader-content { padding: 27px 23px 35px; }
  .reader-label { flex-wrap: wrap; }
  .reader-label .manual-status { margin-left: 0; }
  .reader-time { font-size: 8px; }
}

/* Personal favorites */
.favorites-topbar-button { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px; color: #7c7967; border: 1px solid #e5e4d9; border-radius: 9px; background: #fffdf6; font-size: 10px; font-weight: 700; }
.favorites-topbar-button:hover { color: #8a6c24; border-color: #d8cda7; background: #fffaf0; }
.favorites-topbar-button .icon { width: 15px; height: 15px; color: #b2913f; }
.favorites-topbar-button b { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 4px; color: #725a23; border-radius: 6px; background: #f4e9c6; font-size: 8px; }
.favorite-manual.active { color: #b18a31 !important; background: #fff7df !important; }
.favorite-manual.active .icon, #reader-favorite-button.active .icon { fill: #d1aa4c; stroke: #a98229; }
#reader-favorite-button.active { color: #806423; border-color: #ddcea6; background: #fff8e5; }
.reader-actions { display: flex; align-items: center; gap: 9px; }
.reader-actions .icon { width: 15px; height: 15px; }

.favorites-page-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.favorites-page-heading { margin-bottom: 32px; }
.favorites-page-toolbar { margin-bottom: 18px; }
.favorites-page-toolbar .search-box { width: 240px; }
.favorites-page-grid .empty-state { min-height: 260px; }
.favorites-page-grid .empty-state .button { margin-top: 18px; }
.favorites-topbar-button.active { color: #806423; border-color: #d8c591; background: #fff5d9; }
.nav-count { display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 18px; margin-left: auto; padding: 0 5px; color: #b9cbbf; border-radius: 6px; background: rgba(255, 255, 255, .07); font-size: 8px; }
.nav-item.active .nav-count { color: #3d5b31; background: rgba(24, 53, 43, .09); }

/* Privacy, account rights, and cookie notice */
.login-assurance { display: flex; align-items: flex-start; gap: 10px; margin-top: 28px; padding: 14px 16px; color: #7d8c81; border: 1px solid #e1e8dc; border-radius: 11px; background: #f3f7ef; }
.login-assurance > .icon { width: 16px; height: 16px; margin-top: 2px; color: #6f8f5c; }
.login-assurance p { margin: 0; font-size: 10px; line-height: 1.7; }
.login-assurance a { color: #4d6f3d; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.account-button { padding: 0; text-align: left; border: 0; background: transparent; cursor: pointer; }
.account-button:hover strong { color: var(--lime); }
.account-modal { width: min(620px, calc(100vw - 32px)); }
.account-role-label { margin: 5px 0 0; color: #8d9990; font-size: 9px; }
.account-section { padding: 20px 0; border-bottom: 1px solid #e8ede6; }
.account-section:last-child { padding-bottom: 0; border-bottom: 0; }
.account-section-heading { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 17px; }
.account-section-heading > .icon { width: 17px; height: 17px; margin-top: 2px; color: #769366; }
.account-section-heading h3 { margin: 0 0 3px; color: #3c4e42; font-size: 12px; }
.account-section-heading p { margin: 0; color: #939e96; font-size: 9px; line-height: 1.6; }
.account-section .field-group { margin-bottom: 14px; }
.account-section .field-group input { height: 43px; font-size: 12px; }
.account-password-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.account-data-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.account-data-actions .icon { width: 15px; height: 15px; }
.account-danger-section { margin: 20px -12px 0; padding: 18px 12px; border: 1px solid #f0dcd6; border-radius: 12px; background: #fffafa; }
.account-danger-section .account-section-heading > .icon { color: #b26a5d; }
.account-danger-section .account-section-heading h3 { color: #91493f; }

.privacy-page { color: #34453b; background: #f4f6f2; }
.privacy-topbar { display: flex; align-items: center; justify-content: space-between; max-width: 1160px; height: 82px; margin: 0 auto; padding: 0 30px; }
.privacy-container { max-width: 1100px; margin: 0 auto; padding: 45px 30px 70px; }
.privacy-hero { max-width: 720px; margin-bottom: 42px; }
.privacy-hero h1 { margin: 16px 0 14px; color: var(--forest-deep); font-family: Georgia, "Times New Roman", serif; font-size: 46px; font-weight: 500; letter-spacing: -1.8px; line-height: 1.1; }
.privacy-hero > p { max-width: 650px; margin: 0 0 13px; color: #75827a; font-size: 14px; line-height: 1.75; }
.privacy-updated { color: #96a198; font-size: 10px; }
.privacy-layout { display: grid; grid-template-columns: 265px minmax(0, 1fr); align-items: start; gap: 25px; }
.privacy-summary { position: sticky; top: 25px; padding: 23px; }
.privacy-summary h2 { margin: 0 0 15px; color: #354a3d; font-size: 14px; }
.privacy-summary ul { margin: 0 0 22px; padding: 0; list-style: none; }
.privacy-summary li { position: relative; margin: 12px 0; padding-left: 19px; color: #718077; font-size: 10px; line-height: 1.5; }
.privacy-summary li::before { position: absolute; top: 5px; left: 0; width: 7px; height: 7px; border-radius: 50%; content: ""; background: #9cbc80; box-shadow: 0 0 0 3px #edf3e8; }
.privacy-summary .button { font-size: 10px; }
.privacy-content { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.privacy-content section { padding: 28px 31px; border-bottom: 1px solid #e8ede6; }
.privacy-content section:last-child { border-bottom: 0; }
.privacy-content h2 { margin: 0 0 13px; color: #2d4437; font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 500; }
.privacy-content p, .privacy-content li { color: #69776e; font-size: 11px; line-height: 1.85; }
.privacy-content p { margin: 10px 0; }
.privacy-content ul { margin: 10px 0; padding-left: 20px; }
.privacy-content li { margin: 7px 0; }
.privacy-content strong { color: #405449; }
.privacy-content a, .privacy-footer a { color: #527c3e; font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.privacy-content code { padding: 2px 4px; color: #4e6755; border-radius: 4px; background: #edf2e9; font-size: 10px; }
.privacy-table { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.privacy-table > div { display: flex; flex-direction: column; padding: 13px 15px; border: 1px solid #e5eae2; border-radius: 9px; background: #fafbf8; }
.privacy-table strong { font-size: 11px; }
.privacy-table span { margin: 3px 0 6px; color: #7a877e; font-size: 10px; }
.privacy-table b { color: #718566; font-size: 9px; font-weight: 650; }
.privacy-note { padding: 13px 15px; border-left: 3px solid #a0b78e; background: #f5f8f1; }
.privacy-footer { max-width: 1100px; margin: 0 auto; padding: 25px 30px 35px; color: #8e9991; border-top: 1px solid #e0e6de; font-size: 10px; text-align: center; }

@media (max-width: 800px) {
  .privacy-layout { grid-template-columns: 1fr; }
  .privacy-summary { position: static; }
  .privacy-hero h1 { font-size: 38px; }
}

@media (max-width: 520px) {
  .favorites-topbar-button { padding: 0 8px; }
  .favorites-topbar-button > span { display: none; }
  .reader-actions { gap: 6px; }
  .reader-actions .button { padding: 0 10px; font-size: 10px; }
  .account-password-grid { grid-template-columns: 1fr; gap: 0; }
  .account-data-actions { flex-direction: column; }
  .account-data-actions .button { width: 100%; }
  .privacy-topbar { height: 72px; padding: 0 18px; }
  .privacy-topbar .brand { font-size: 22px; }
  .privacy-topbar .button { padding: 0 10px; font-size: 10px; }
  .privacy-container { padding: 30px 17px 45px; }
  .privacy-hero h1 { font-size: 34px; }
  .privacy-content section { padding: 23px 20px; }
}

@media (max-width: 1150px) {
  .favorites-page-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .favorites-page-grid { grid-template-columns: 1fr; }
  .favorites-page-toolbar .search-box { width: 100%; }
}

/* Theme controls and dark mode */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 35px; padding: 0 11px; color: #69776e; border: 1px solid #dfe5dc; border-radius: 9px; background: #fff; font-size: 10px; font-weight: 700; }
.theme-toggle:hover { color: #35533f; background: #f2f6ed; }
.theme-toggle .icon { width: 15px; height: 15px; }
.auth-theme-toggle { position: absolute; top: 25px; right: 28px; }
.auth-panel { position: relative; }
.icon-theme-toggle { width: 36px; padding: 0; }
.privacy-topbar-actions { display: flex; align-items: center; gap: 9px; }

:root[data-theme="dark"] {
  --canvas: #101611;
  --surface: #19221b;
  --line: #2d3a30;
  --ink: #e2eae3;
  --muted: #a2afa5;
  --subtle: #819087;
  --forest-deep: #e6efe7;
  --dark-text: #e2eae3;
  --dark-muted: #a0ada3;
  --dark-soft: #222e25;
  color-scheme: dark;
}
[data-theme="dark"] body, [data-theme="dark"] .privacy-page { color: var(--dark-text); background: var(--canvas); }
[data-theme="dark"] .auth-panel { background: #121913; }
[data-theme="dark"] .card,
[data-theme="dark"] .modal,
[data-theme="dark"] .privacy-content,
[data-theme="dark"] .privacy-summary { color: var(--dark-text); border-color: var(--line); background: var(--surface); box-shadow: 0 8px 25px rgba(0, 0, 0, .12); }
[data-theme="dark"] .app-topbar { border-color: var(--line); background: rgba(20, 28, 22, .92); }
[data-theme="dark"] .nav-item.active { color: #18352b; }
[data-theme="dark"] .community-numbers strong,
[data-theme="dark"] .admin-stat strong { color: var(--dark-text); }
[data-theme="dark"] .brand-dark,
[data-theme="dark"] .welcome-block h2,
[data-theme="dark"] .admin-heading h2,
[data-theme="dark"] .login-heading h2,
[data-theme="dark"] .modal-header h2,
[data-theme="dark"] .modal-confirm h2,
[data-theme="dark"] .manual-title-button h3,
[data-theme="dark"] .reader-header h2,
[data-theme="dark"] .privacy-hero h1,
[data-theme="dark"] .privacy-content h2,
[data-theme="dark"] .document-title-wrap input,
[data-theme="dark"] .card-heading h3 { color: var(--dark-text); }
[data-theme="dark"] .brand-dark .brand-mark i { background: #a8cc7d; }
[data-theme="dark"] .login-heading p,
[data-theme="dark"] .welcome-block > p:last-child,
[data-theme="dark"] .admin-heading > div > p:last-child,
[data-theme="dark"] .privacy-hero > p,
[data-theme="dark"] .privacy-content p,
[data-theme="dark"] .privacy-content li,
[data-theme="dark"] .manual-excerpt,
[data-theme="dark"] .manual-rendered,
[data-theme="dark"] .account-section-heading p { color: var(--dark-muted); }
[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .button-secondary,
[data-theme="dark"] .search-box,
[data-theme="dark"] .directory-filters select,
[data-theme="dark"] .library-filters select,
[data-theme="dark"] .favorites-topbar-button { color: #bdc9bf; border-color: #39473c; background: #1b251d; }
[data-theme="dark"] .theme-toggle:hover,
[data-theme="dark"] .button-secondary:hover { color: #e5eee6; background: #29372b; }
[data-theme="dark"] .button-primary { color: #18352b; background: #c9e99a; box-shadow: none; }
[data-theme="dark"] .button-primary:not(:disabled):hover { background: #daf5ae; }
[data-theme="dark"] .field-group input,
[data-theme="dark"] .field-group select,
[data-theme="dark"] .field-group textarea,
[data-theme="dark"] .directory-filters select { color: var(--dark-text); border-color: #39473c; background: #141c16; }
[data-theme="dark"] .field-group label,
[data-theme="dark"] .label-row label { color: #bdc9bf; }
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder,
[data-theme="dark"] .document-title-wrap input::placeholder { color: #69796d; }
[data-theme="dark"] .login-assurance { color: #9fac9f; border-color: #354334; background: #1d291e; }
[data-theme="dark"] .login-assurance a { color: #b8d99b; }
[data-theme="dark"] .quick-start { border-color: #354334; background: linear-gradient(105deg, #1d291e, #19221b); }
[data-theme="dark"] .quick-start h3,
[data-theme="dark"] .feed-toolbar h3,
[data-theme="dark"] .guidelines-card h3,
[data-theme="dark"] .editor-settings h3,
[data-theme="dark"] .outline-card h3,
[data-theme="dark"] .directory-header h3,
[data-theme="dark"] .account-section-heading h3,
[data-theme="dark"] .privacy-summary h2 { color: #d4dfd5; }
[data-theme="dark"] .quick-start p,
[data-theme="dark"] .community-stats-card > p,
[data-theme="dark"] .guidelines-card > p,
[data-theme="dark"] .manual-card-top > span:last-child,
[data-theme="dark"] .reader-meta div span,
[data-theme="dark"] .role-note,
[data-theme="dark"] .date-line { color: #8f9e92; }
[data-theme="dark"] .quick-start-icon,
[data-theme="dark"] .guidelines-card li > span,
[data-theme="dark"] .stat-icon-green { background: #293a28; }
[data-theme="dark"] .manual-card:hover { border-color: #465b48; box-shadow: 0 9px 26px rgba(0, 0, 0, .2); }
[data-theme="dark"] .manual-card-draft { border-top-color: #766039; }
[data-theme="dark"] .manual-card-footer,
[data-theme="dark"] .reader-header,
[data-theme="dark"] .reader-footer,
[data-theme="dark"] .editor-document-footer,
[data-theme="dark"] .document-owner,
[data-theme="dark"] .account-section,
[data-theme="dark"] .directory-header,
[data-theme="dark"] .privacy-content section { border-color: #303d32; }
[data-theme="dark"] .manual-sections span { color: #9baa9e; border-color: #344136; background: #1d271f; }
[data-theme="dark"] .manual-author strong,
[data-theme="dark"] .reader-meta strong,
[data-theme="dark"] .document-owner strong,
[data-theme="dark"] .member-identity strong { color: #bdc9bf; }
[data-theme="dark"] .status-published { color: #b4d59d; background: #263824; }
[data-theme="dark"] .status-draft { color: #dec084; background: #39301f; }
[data-theme="dark"] .role-former { color: #b8b2a8; background: #35332e; }
[data-theme="dark"] .role-member { color: #b3c0b6; background: #303a32; }
[data-theme="dark"] .role-moderator { color: #a8c9dc; background: #263640; }
[data-theme="dark"] .role-admin { color: #ddc58c; background: #39321f; }
[data-theme="dark"] .document-title-wrap > span,
[data-theme="dark"] .reader-label { color: #9eb38f; }
[data-theme="dark"] .editor-tabs,
[data-theme="dark"] .editor-document-footer,
[data-theme="dark"] .member-table th,
[data-theme="dark"] .reader-footer { border-color: #303d32; background: #161e18; }
[data-theme="dark"] .format-toolbar,
[data-theme="dark"] .editor-tabs { border-color: #303d32; }
[data-theme="dark"] .format-toolbar button { color: #a9b7ab; }
[data-theme="dark"] .format-toolbar button:hover,
[data-theme="dark"] #manual-outline button:hover { color: #d8e8d2; background: #2a392b; }
[data-theme="dark"] #manual-content { color: #c7d4c9; background: #19221b; }
[data-theme="dark"] #manual-outline button { color: #9eada0; }
[data-theme="dark"] .template-button { color: #b5d59b; border-color: #3b5136; background: #22311f; }
[data-theme="dark"] .template-button:hover { background: #2a3c26; }
[data-theme="dark"] .reader-header { background: linear-gradient(145deg, #1c281e, #19221b); }
[data-theme="dark"] .manual-rendered h2,
[data-theme="dark"] .manual-rendered h3,
[data-theme="dark"] .manual-rendered h4,
[data-theme="dark"] .manual-rendered strong { color: #dce8dd; }
[data-theme="dark"] .manual-rendered h3 { border-color: #344136; }
[data-theme="dark"] .manual-rendered blockquote { color: #b6c9ae; background: #222f22; }
[data-theme="dark"] .manual-rendered code { color: #b9d0bd; background: #29362b; }
[data-theme="dark"] .manual-image img { border-color: #364338; background: #151d17; }
[data-theme="dark"] .member-table td { color: #aab8ad; border-color: #303d32; }
[data-theme="dark"] .member-table tbody tr:hover { background: #1d281f; }
[data-theme="dark"] .member-table th { color: #8f9e92; }
[data-theme="dark"] .member-identity small,
[data-theme="dark"] .directory-header p { color: #87968a; }
[data-theme="dark"] .toggle-row { border-color: #39473c; background: #182019; }
[data-theme="dark"] .toggle-row strong { color: #c6d2c8; }
[data-theme="dark"] .account-danger-section { border-color: #593d38; background: #2a201e; }
[data-theme="dark"] .account-danger-section .account-section-heading h3 { color: #e0a99f; }
[data-theme="dark"] .form-error { color: #efafa5; border-color: #633f39; background: #342320; }
[data-theme="dark"] .privacy-table > div { border-color: #344136; background: #1b251d; }
[data-theme="dark"] .privacy-table strong,
[data-theme="dark"] .privacy-content strong { color: #cbd8cd; }
[data-theme="dark"] .privacy-table span { color: #98a79b; }
[data-theme="dark"] .privacy-note { background: #222f22; }
[data-theme="dark"] .privacy-footer { border-color: #303d32; }
[data-theme="dark"] .empty-state h3 { color: #d0ddd2; }
[data-theme="dark"] .loading-state { border-color: #39473c; }
[data-theme="dark"] .favorites-topbar-button.active,
[data-theme="dark"] #reader-favorite-button.active { color: #dfc47e; border-color: #675831; background: #342d1d; }
[data-theme="dark"] .modal::backdrop { background: rgba(3, 9, 5, .72); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
