:root {
  --ink: #16203a;
  --muted: #6d7891;
  --line: #e8ebf2;
  --paper: #f8f9fc;
  --white: #ffffff;
  --blue: #3144d6;
  --blue-dark: #222f9d;
  --yellow: #f8cf4d;
  --deep: #0b1020;
  --coral: #ff6c5e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.brand { font-family: Georgia, "Times New Roman", serif; font-size: 2rem; font-weight: 700; letter-spacing: -.09em; }
.eyebrow { margin: 0 0 .7rem; color: var(--blue); font-size: .68rem; font-weight: 800; letter-spacing: .15em; }
.muted { color: var(--muted); line-height: 1.5; }

.top-nav { height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 5vw, 80px); background: var(--deep); color: #fff; }
.top-nav .brand { font-size: 1.7rem; }
.nav-actions, .top-nav form { display: flex; align-items: center; gap: 18px; margin: 0; }
.nav-actions > a { color: #bfc7e9; font-weight: 700; font-size: .9rem; }
.user-chip { padding: 7px 11px; border: 1px solid #3b4667; border-radius: 100px; font-size: .8rem; }
.link-button { appearance: none; border: 0; background: none; color: #c5cce5; font-size: .9rem; padding: 0; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, 1.1fr) minmax(380px, .9fr); }
.login-intro { position: relative; overflow: hidden; padding: clamp(35px, 6vw, 90px); color: #fff; background: var(--deep); display: flex; flex-direction: column; justify-content: center; }
.login-intro::before, .login-intro::after { content: ""; position: absolute; border-radius: 50%; filter: blur(1px); opacity: .8; }
.login-intro::before { width: 520px; height: 520px; right: -250px; top: -180px; background: radial-gradient(circle at 35% 45%, var(--yellow) 0 11%, var(--coral) 12% 29%, transparent 30%); }
.login-intro::after { width: 320px; height: 320px; left: -155px; bottom: -130px; background: #3144d6; }
.login-intro > * { position: relative; z-index: 1; }
.login-intro .brand { position: absolute; top: clamp(28px, 5vw, 65px); letter-spacing: -.09em; }
.login-intro .eyebrow { margin-top: 3rem; color: #aab7fa; }
.login-intro h1 { max-width: 620px; margin: 0; font-family: Georgia, serif; font-size: clamp(3.2rem, 6vw, 6.4rem); line-height: .96; letter-spacing: -.07em; }
.login-intro > p:not(.eyebrow) { max-width: 440px; margin: 2rem 0; color: #c3cae2; font-size: 1.1rem; line-height: 1.7; }
.privacy-note { display: flex; gap: 12px; align-items: center; color: #e2e6f6; font-size: .9rem; }
.privacy-note span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #283768; color: var(--yellow); }
.login-card { align-self: center; width: min(420px, calc(100% - 48px)); margin: auto; padding: 3.25rem 0; }
.login-card h2 { margin: 0; font-family: Georgia, serif; font-size: 2.5rem; letter-spacing: -.055em; }
.login-card .muted { margin: .5rem 0 2.2rem; }
.stack-form, .member-form { display: grid; gap: 1.1rem; }
label { display: grid; gap: .5rem; color: #3c4862; font-weight: 700; font-size: .85rem; }
input, textarea { width: 100%; border: 1px solid #d9deea; border-radius: 10px; color: var(--ink); outline: none; background: #fff; transition: border .15s, box-shadow .15s; }
input { height: 48px; padding: 0 13px; }
textarea { min-height: 94px; padding: 13px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #dce1ff; }
.primary-button { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: 0 18px; gap: 12px; border: 0; border-radius: 9px; color: #fff; background: var(--blue); font-weight: 800; transition: transform .15s, background .15s; }
.primary-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.primary-button span { font-size: 1.2rem; }
.login-footnote { margin: 1.6rem 0 0; color: var(--muted); font-size: .82rem; text-align: center; }
.alert { padding: 10px 12px; border-radius: 8px; color: #a73831; background: #fff0ee; font-size: .88rem; }

.app-shell { max-width: 1360px; min-height: calc(100vh - 70px); margin: 0 auto; display: grid; grid-template-columns: 255px minmax(0, 720px); justify-content: center; gap: clamp(30px, 6vw, 100px); padding: 45px 30px 70px; }
.side-panel { padding-top: 4px; color: var(--muted); }
.side-brand .brand { color: var(--ink); font-size: 2rem; }
.side-brand p { margin: .6rem 0 2.8rem; max-width: 160px; font-size: .85rem; line-height: 1.5; }
.side-section { padding-top: 1rem; border-top: 1px solid var(--line); }
.side-label { margin: 0 0 .8rem; color: #9da5b5; font-size: .65rem; font-weight: 800; letter-spacing: .13em; }
.side-current { display: flex; gap: 12px; align-items: center; width: 100%; padding: 11px 12px; border-radius: 8px; color: var(--blue); background: #e9ebff; font-weight: 800; font-size: .92rem; }
.side-current span { font-size: 1.2rem; }
.side-tip { margin: 2.2rem 0; padding: 15px; border-radius: 10px; background: #fff3cb; color: #596078; font-size: .75rem; line-height: 1.55; }
.side-tip-icon { display: block; color: #c48c00; font-size: 1.4rem; }
.side-tip p { margin: .4rem 0 0; }
.side-tip strong { color: #29334f; }
.member-count { display: flex; gap: 9px; align-items: center; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .68rem; line-height: 1.45; }
.member-count strong { color: #4d5871; }

.feed-header { display: flex; justify-content: space-between; align-items: end; margin-bottom: 24px; }
.feed-header h1, .admin-heading h1 { margin: 0; font-family: Georgia, serif; color: var(--ink); font-size: clamp(2.25rem, 4vw, 3.5rem); line-height: 1; letter-spacing: -.065em; }
.live-pill { display: inline-flex; gap: 7px; align-items: center; padding: 8px 10px; border-radius: 20px; color: #708062; background: #f0f6e9; font-size: .67rem; font-weight: 800; white-space: nowrap; }
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: #73ab4b; }
.composer, .post-card, .panel { border: 1px solid var(--line); border-radius: 14px; background: var(--white); box-shadow: 0 7px 18px rgb(23 32 58 / 3%); }
.composer { display: flex; gap: 14px; padding: 18px; }
.avatar { flex: 0 0 auto; display: grid; place-items: center; width: 37px; height: 37px; border-radius: 50%; color: #fff; background: linear-gradient(140deg, #f59467, #cf497c); font-size: .88rem; font-weight: 800; }
.avatar.small { width: 31px; height: 31px; font-size: .72rem; background: linear-gradient(140deg, #6375e8, #36409e); }
.composer-form { width: 100%; }
.composer-form > input:not([type="hidden"]) { height: auto; padding: 2px 0 7px; border: 0; border-radius: 0; font-weight: 800; }
.composer-form > input:not([type="hidden"]):focus { box-shadow: none; }
.composer textarea { min-height: 68px; padding: 4px 0; border: 0; border-radius: 0; box-shadow: none; color: #4c5770; font-size: .95rem; }
.composer textarea:focus { box-shadow: none; }
.composer-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; padding-top: 9px; border-top: 1px solid #f0f1f5; }
.media-picker { display: inline-flex; grid-template-columns: none; gap: 6px; align-items: center; color: #647092; font-size: .75rem; cursor: pointer; }
.media-picker span { color: var(--blue); font-size: 1.2rem; }
.media-picker input { display: none; }
.file-status { flex: 1; overflow: hidden; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.compact { min-height: 34px; padding: 0 12px; margin-left: auto; font-size: .77rem; }
.feed-label { display: flex; align-items: center; gap: 12px; margin: 32px 0 12px; color: #8992a7; font-size: .64rem; font-weight: 800; letter-spacing: .13em; }
.feed-label i { height: 1px; flex: 1; background: var(--line); }
.post-feed { display: grid; gap: 14px; }
.post-card { padding: 19px; }
.post-header { display: flex; align-items: center; gap: 10px; }
.post-avatar { width: 35px; height: 35px; }
.post-header strong { display: block; color: #2c3651; font-size: .84rem; }
time { display: block; margin-top: 3px; color: #98a0b0; font-size: .67rem; }
.delete-form { margin-left: auto; }
.delete-form button { width: 25px; height: 25px; border: 0; border-radius: 50%; color: #9ea5b3; background: transparent; font-size: 1.25rem; line-height: 1; }
.delete-form button:hover { color: #bd443a; background: #fff0ee; }
.post-content { padding-left: 45px; }
.post-content h2 { margin: 16px 0 6px; color: #27314c; font-size: 1rem; }
.post-body { margin: 0 0 14px; color: #505b74; font-size: .9rem; line-height: 1.6; }
.media-frame { overflow: hidden; margin-top: 15px; border-radius: 10px; background: #e9ebf2; }
.media-frame img, .media-frame video { display: block; width: 100%; max-height: 560px; object-fit: contain; background: #151927; }
.empty-state { padding: 55px 20px; border: 1px dashed #d8ddea; border-radius: 14px; color: var(--muted); text-align: center; }
.empty-state h2 { margin: 7px 0; color: #3b4662; font-family: Georgia, serif; font-size: 1.5rem; }
.empty-state p { margin: 0; font-size: .86rem; }
.empty-icon { color: var(--yellow); font-size: 2rem; }

.admin-shell { width: min(100% - 48px, 980px); margin: 0 auto; padding: 55px 0 80px; }
.back-link { color: var(--blue); font-size: .84rem; font-weight: 800; }
.admin-heading { margin: 50px 0 28px; }
.admin-heading > p:last-child { color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: minmax(280px, .78fr) minmax(350px, 1.22fr); gap: 20px; align-items: start; }
.panel { padding: 22px; }
.panel h2 { margin: 0 0 8px; font-size: 1.05rem; }
.member-form .muted { margin: 0 0 9px; font-size: .82rem; }
.member-list { padding: 0; overflow: hidden; }
.member-list-head { display: flex; align-items: center; justify-content: space-between; padding: 22px; border-bottom: 1px solid var(--line); }
.member-list-head h2 { margin: 0; }.member-list-head span { color: var(--muted); font-size: .76rem; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 15px 22px; border-bottom: 1px solid #f0f1f5; }.member-row:last-child { border: 0; }
.member-name { flex: 1; }.member-name strong, .member-name span { display: block; }.member-name strong { font-size: .83rem; }.member-name span { margin-top: 2px; color: var(--muted); font-size: .68rem; }
.danger-button { border: 0; color: #bd443a; background: #fff0ee; border-radius: 6px; padding: 7px 9px; font-size: .7rem; font-weight: 800; }
.error-shell { width: min(100% - 48px, 600px); margin: 15vh auto; text-align: center; }.error-shell h1 { font-family: Georgia, serif; font-size: 2.6rem; letter-spacing: -.05em; }.error-shell p:not(.eyebrow) { margin: 0 auto 25px; color: var(--muted); line-height: 1.6; }.inline-button { width: auto; }

@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }.login-intro { min-height: 370px; padding: 100px 28px 42px; }.login-intro h1 { font-size: 3.3rem; }.login-intro > p:not(.eyebrow) { margin: 1.2rem 0; font-size: .95rem; }.login-card { padding: 3rem 0; }
  .app-shell { display: block; padding: 25px 16px 45px; }.side-panel { display: none; }.feed-header h1 { font-size: 2.6rem; }.feed-header { align-items: end; }.post-content { padding-left: 0; }.post-card { padding: 15px; }.admin-shell { width: min(100% - 32px, 980px); padding-top: 30px; }.admin-grid { grid-template-columns: 1fr; }.top-nav { padding: 0 18px; }.nav-actions { gap: 10px; }.nav-actions > a, .user-chip { display: none; }
}

@media (max-width: 390px) { .live-pill { display: none; }.composer { padding: 13px; gap: 9px; }.composer .avatar { width: 31px; height: 31px; }.file-status { flex-basis: 100%; order: 3; }.compact { margin-left: auto; } }
