:root {
  color-scheme: light;
  --bg: #f4f5f4;
  --surface: #ffffff;
  --surface-soft: #f0f1f2;
  --surface-tint: #f8f8f7;
  --ink: #202124;
  --ink-strong: #0f1115;
  --muted: #6f767f;
  --faint: #a5abb3;
  --line: #e4e7eb;
  --line-strong: #d6dae0;
  --zeora: #4b8fbf;
  --xiami: #ee8f43;
  --accent: #2f73a8;
  --accent-soft: #e8f1f8;
  --ok: #4f9e66;
  --danger: #d15b49;
  --shadow-card: 0 1px 2px rgba(15, 17, 21, 0.05), 0 10px 24px rgba(15, 17, 21, 0.04);
  --shadow-soft: 0 1px 2px rgba(15, 17, 21, 0.04), 0 18px 36px rgba(15, 17, 21, 0.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 16px;
  --font-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 30;
  border-radius: var(--radius-sm);
  background: var(--ink-strong);
  color: #fff;
  padding: 0.75rem 1rem;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 1rem;
}

.site-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 246, 247, 0.9);
  backdrop-filter: blur(18px);
}

.brand-mark,
.top-actions {
  display: flex;
  align-items: center;
  gap: 0.72rem;
}

.brand-mark {
  color: var(--ink-strong);
  font-weight: 800;
  text-decoration: none;
}

.brand-led,
.chip-light {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #dfefff, #ffffff);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--line), 0 6px 18px rgba(47, 115, 168, 0.16);
  font-size: 0.92rem;
  font-weight: 900;
}

.chip-light {
  width: 0.72rem;
  height: 0.72rem;
  box-shadow: none;
}

.top-actions a,
.top-actions button {
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.5rem 0.7rem;
  text-decoration: none;
}

.top-actions a:hover,
.top-actions button:hover {
  background: var(--surface-soft);
  color: var(--ink-strong);
}

.public-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 280px;
  gap: clamp(1.4rem, 2.8vw, 2.35rem);
  align-items: start;
  width: min(1420px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.25rem 0 4rem;
}

.drawer-backdrop {
  display: none;
}

.left-rail,
.right-rail {
  position: sticky;
  top: 1.25rem;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  height: calc(100dvh - 2.5rem);
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(111, 118, 127, 0.34) transparent;
  -ms-overflow-style: none;
  padding: 0.65rem 0.65rem 0;
  border: 1px solid rgba(228, 231, 235, 0.7);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.left-rail::-webkit-scrollbar,
.right-rail::-webkit-scrollbar {
  width: 6px;
}

.left-rail::-webkit-scrollbar-thumb,
.right-rail::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(111, 118, 127, 0.26);
}

.left-rail {
  grid-column: 1;
}

.log-stage {
  grid-column: 2;
}

.right-rail {
  grid-column: 3;
}

.tags-card {
  flex: 0 0 auto;
}

.rail-card,
.queue-panel,
.editor-panel,
.login-panel,
.preview-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.rail-card {
  flex: 0 0 auto;
  padding: 1.1rem;
}

.left-rail > .rail-card,
.right-rail > .rail-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0.25rem 0.15rem;
}

.left-rail > .rail-card + .rail-card,
.right-rail > .rail-card + .rail-card {
  border-top: 1px solid rgba(111, 118, 127, 0.16);
  padding-top: 1rem;
}

.profile-card {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  gap: 0.75rem;
  padding: clamp(1.4rem, 2.2vw, 2rem);
  border: 0;
  background: #8b7042;
  color: #fff;
  text-align: center;
  flex-shrink: 0;
  min-height: fit-content;
}

.left-rail > .profile-card {
  overflow: visible;
  background: transparent;
  color: var(--ink);
}

.profile-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.14), transparent 40%),
              radial-gradient(circle at 80% 80%, rgba(0,0,0,0.08), transparent 35%);
  pointer-events: none;
}

.left-rail > .profile-card::before {
  display: none;
}

.profile-card > * {
  position: relative;
}

.left-rail .profile-greeting {
  background: rgba(255, 255, 255, 0.48);
  color: var(--muted);
}

.left-rail .profile-card h1 {
  color: var(--ink-strong);
}

.left-rail .profile-bio {
  color: var(--muted);
}

.left-rail .profile-avatar {
  background: rgba(255, 255, 255, 0.46);
}

.left-rail .profile-avatar .initials {
  color: var(--accent);
}

.left-rail .profile-status {
  background: var(--ink-strong);
  color: #fff;
}

.left-rail .social-btn {
  background: rgba(255, 255, 255, 0.44);
  color: var(--ink);
}

.left-rail .social-btn:hover {
  background: rgba(255, 255, 255, 0.68);
}

.profile-greeting {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.profile-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  padding: 0.35rem;
  text-decoration: none;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.85);
}

.profile-avatar .initials {
  display: inline-grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #8b7042;
  font-size: 1.6rem;
  font-weight: 900;
}

.profile-status {
  position: absolute;
  right: -0.1rem;
  bottom: 0.2rem;
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: #fff;
  color: #8b7042;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  font-size: 0.75rem;
  line-height: 1;
}

.profile-card h1 {
  margin: 0.2rem 0 0;
  color: #fff;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.profile-bio {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.88rem;
  line-height: 1.55;
}

.profile-social {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.social-btn {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  transition: background 140ms ease, transform 140ms ease, border-color 140ms ease;
}

.social-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.mission-copy {
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.65;
}

.kicker {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 0.2rem;
  color: var(--ink-strong);
  font-size: clamp(1.45rem, 2.4vw, 2.1rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

h3 {
  margin-bottom: 0.58rem;
  color: var(--ink-strong);
  font-size: clamp(1.2rem, 1.7vw, 1.58rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.icon-nav-card {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 0.35rem;
  padding: 0.55rem;
}

.icon-nav-card a {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--surface-tint);
  color: var(--muted);
  transition: background 140ms ease, color 140ms ease, transform 140ms ease, border-color 140ms ease;
}

.icon-nav-card a:hover,
.icon-nav-card a.is-active {
  background: var(--surface-soft);
  border-color: var(--line-strong);
  color: var(--ink-strong);
  transform: translateY(-1px);
}

.log-stage {
  min-width: 0;
}

.stage-heading,
.panel-title-row,
.editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.stage-heading {
  min-height: 6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 1.35rem;
}

.timeline {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.side-title {
  margin: 0 0 0.8rem;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--ink);
  padding: 0.38rem 0.58rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease;
}

.tag-chip:hover {
  background: var(--surface-soft);
  border-color: var(--line-strong);
}

.tag-chip small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.author-list {
  display: grid;
  gap: 0.25rem;
}

.author-list a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-radius: var(--radius-md);
  padding: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  transition: background 140ms ease;
}

.author-list a:hover {
  background: var(--surface-soft);
}

.author-list img,
.author-list .initials {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
}

.author-list img {
  object-fit: cover;
  background: var(--surface-soft);
}

.author-list .initials {
  display: inline-grid;
  place-items: center;
  background: var(--author-color, var(--accent));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
}

.author-list .name {
  font-weight: 800;
  font-size: 0.92rem;
}

.author-list .count {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.muted-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.signal-strip,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.author-chip,
.ghost-button,
.secondary-button,
.primary-button,
.icon-button {
  min-height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.author-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.58rem 0.78rem;
}

.author-chip:hover,
.ghost-button:hover,
.secondary-button:hover,
.primary-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 17, 21, 0.06);
}

.author-chip.is-active {
  border-color: #bdd2e5;
  background: var(--accent-soft);
  color: var(--accent);
}

.chip-light.all {
  background: #8b95a1;
}

.chip-light.me,
i.me {
  background: var(--zeora);
}

.chip-light.openclaw,
i.openclaw {
  background: var(--xiami);
}

label,
.compact-field span {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 760;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-tint);
  color: var(--ink-strong);
  padding: 0.78rem 0.86rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #b8d0e5;
  background: #fff;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

.readout-grid {
  display: grid;
  gap: 0.55rem;
  margin: 0;
}

.readout-grid div {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.readout-grid dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.readout-grid dd {
  margin: 0.18rem 0 0;
  color: var(--ink-strong);
  font-size: 1.12rem;
  font-weight: 900;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
  margin: 0;
}

.stats-grid div {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.stats-grid dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.stats-grid dd {
  margin: 0.18rem 0 0;
  color: var(--ink-strong);
  font-size: 1.12rem;
  font-weight: 900;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.calendar-month {
  color: var(--ink-strong);
  font-size: 0.9rem;
  font-weight: 800;
}

.calendar-nav {
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-tint);
  color: var(--ink);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.calendar-nav:hover {
  background: var(--surface-soft);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  text-align: center;
}

.calendar-dow,
.calendar-day {
  display: inline-grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 750;
}

.calendar-dow {
  color: var(--muted);
  font-size: 0.7rem;
}

.calendar-day {
  color: var(--ink);
}

.calendar-day.is-today {
  box-shadow: inset 0 0 0 1.5px var(--accent);
  color: var(--accent);
  font-weight: 800;
}

.calendar-day.has-post-1 {
  background: #f4f0e8;
  color: #8b7042;
  font-weight: 700;
}

.calendar-day.has-post-2 {
  background: #e8dcc6;
  color: #6d5633;
  font-weight: 800;
}

.calendar-day.has-post-3 {
  background: #dcc8a4;
  color: #5a4629;
  font-weight: 800;
}

.calendar-day.is-other {
  color: var(--faint);
}

.info-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.log-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.log-card-inner {
  padding: clamp(1rem, 2vw, 1.25rem);
}

.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.log-author {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink-strong);
  font-weight: 800;
  text-decoration: none;
}

.log-avatar,
.log-author .initials {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
}

.log-avatar {
  object-fit: cover;
  background: var(--surface-soft);
}

.log-author .initials {
  display: inline-grid;
  place-items: center;
  background: var(--author-color, var(--accent));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}

.log-header time {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.log-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.log-title-row h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.25;
}

.author-pill,
.tag-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  border-radius: 999px;
  padding: 0.25rem 0.52rem;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.author-pill {
  background: color-mix(in srgb, var(--author-color, var(--accent)) 15%, #f5f6f7);
}

.log-summary {
  max-width: 68ch;
  margin-bottom: 0.55rem;
  color: #5a626c;
  font-size: 1rem;
  line-height: 1.66;
}

.log-body {
  max-width: 70ch;
  color: #3d444d;
  line-height: 1.7;
}

.log-body p:last-child,
.log-summary:last-child {
  margin-bottom: 0;
}

.log-body h1,
.log-body h2,
.log-body h3 {
  max-width: none;
  margin-top: 1.1rem;
  font-family: var(--font-body);
  letter-spacing: -0.02em;
}

.log-body code {
  border-radius: 5px;
  background: var(--surface-soft);
  padding: 0.12rem 0.28rem;
  font-family: var(--font-mono);
}

.empty-state,
.notice {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--muted);
  padding: 1.1rem;
  line-height: 1.65;
}

.notice {
  margin-top: 0.85rem;
  border-style: solid;
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(12rem, 0.62fr) minmax(20rem, 1.12fr) minmax(13rem, 0.72fr);
  gap: clamp(1.1rem, 2.2vw, 1.9rem);
  width: min(1500px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
}

.login-panel {
  width: min(680px, calc(100% - 2.5rem));
  margin: clamp(2rem, 8vh, 5rem) auto;
  padding: clamp(1.2rem, 3vw, 1.6rem);
}

.queue-panel,
.preview-panel {
  align-self: start;
  padding: 1rem;
}

.editor-panel {
  padding: clamp(1rem, 2vw, 1.3rem);
}

.admin-shell h1,
.login-panel h1,
.admin-shell h2 {
  max-width: none;
  margin: 0;
  color: var(--ink-strong);
  font-size: 1.28rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.ghost-button,
.secondary-button,
.icon-button {
  padding: 0.62rem 0.78rem;
}

.primary-button,
.secondary-button {
  border: 0;
  padding: 0.78rem 1rem;
}

.primary-button {
  background: var(--ink-strong);
  color: #fff;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 0.62rem 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.ghost-link:hover {
  background: var(--surface-soft);
  color: var(--ink-strong);
}

.secondary-button {
  background: var(--accent);
  color: #fff;
}

.icon-button {
  min-width: 2.35rem;
  padding: 0;
}

.post-queue {
  display: grid;
  gap: 0.6rem;
  max-height: calc(100vh - 18rem);
  overflow: auto;
  padding-right: 0.2rem;
}

.queue-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-tint);
  color: var(--ink);
  cursor: pointer;
  padding: 0.82rem;
  text-align: left;
}

.queue-item:hover,
.queue-item.is-active {
  border-color: #bdd2e5;
  background: var(--accent-soft);
}

.queue-item strong {
  display: block;
  margin-bottom: 0.38rem;
  color: var(--ink-strong);
  line-height: 1.25;
}

.queue-item small {
  color: var(--muted);
  font-size: 0.78rem;
}

#post-form {
  display: grid;
  gap: 1rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.body-editor {
  min-height: 22rem;
  resize: vertical;
}

.author-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0;
  border: 0;
  padding: 0;
}

.author-switch legend {
  width: 100%;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.author-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.author-switch span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  padding: 0.66rem 0.85rem;
  font-weight: 850;
}

.author-switch input:checked + span {
  border-color: #bdd2e5;
  background: var(--accent-soft);
  color: var(--accent);
}

.status-lamp {
  border-radius: 999px;
  background: #fff5d7;
  color: #916814;
  padding: 0.42rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 850;
}

.status-lamp[data-tone="ok"] {
  background: #e9f8ed;
  color: var(--ok);
}

.status-lamp[data-tone="warn"],
.status-lamp[data-tone="busy"] {
  background: #fff5d7;
  color: #916814;
}

.status-lamp[data-tone="error"] {
  background: #fff0ed;
  color: var(--danger);
}

.preview-date {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.preview-card {
  margin-top: 1rem;
  box-shadow: none;
}

.preview-card .log-card-inner {
  display: block;
  padding: 1.15rem;
}

[hidden] {
  display: none !important;
}

/* Admin app */
.admin-app {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

.admin-topbar {
  position: fixed;
  top: 0.85rem;
  left: 50%;
  z-index: 50;
  transform: translateX(-50%);
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.admin-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.admin-tab {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0.55rem 1rem;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.admin-tab:hover {
  color: var(--ink-strong);
}

.admin-tab.is-active {
  background: #fff;
  color: var(--ink-strong);
  box-shadow: 0 1px 2px rgba(15, 17, 21, 0.06);
}

.admin-content {
  width: min(1200px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 4.5rem 0 3rem;
}

.admin-tabpanel {
  display: none;
}

.admin-tabpanel.is-active {
  display: block;
}

#tab-publish {
  display: none;
  grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.72fr);
  gap: clamp(1.1rem, 2.2vw, 1.9rem);
  align-items: start;
}

#tab-publish.is-active {
  display: grid;
}

#tab-manage.is-active,
#tab-config.is-active {
  display: block;
}

/* Login page */
.login-panel {
  display: grid;
  place-items: center;
  gap: 0.65rem;
  width: min(380px, calc(100% - 2.5rem));
  margin: clamp(3rem, 12vh, 7rem) auto;
  padding: clamp(1.6rem, 4vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink-strong);
  font-weight: 800;
  font-size: 1.05rem;
}

.login-panel h1 {
  margin: 0.4rem 0 0;
  color: var(--ink-strong);
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.login-lead {
  margin: 0.25rem 0 0.6rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.login-form {
  display: grid;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
}

.login-status {
  min-height: 1.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  text-align: center;
}

.login-status[data-tone="busy"] {
  color: #916814;
}

.login-status[data-tone="ok"] {
  color: var(--ok);
}

.login-status[data-tone="error"] {
  color: var(--danger);
}

.login-submit {
  width: 100%;
}

.login-back {
  display: inline-block;
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
  text-decoration: none;
}

.login-back:hover {
  color: var(--ink-strong);
}

/* Manage & config panels */
.manage-panel,
.config-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: clamp(1rem, 2vw, 1.3rem);
}

.manage-panel .post-queue {
  max-height: none;
}

.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.queue-item-main {
  min-width: 0;
}

.queue-item-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.queue-edit,
.queue-archive {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 0.38rem 0.62rem;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 140ms ease;
}

.queue-edit:hover,
.queue-archive:hover {
  background: var(--surface-soft);
}

.queue-archive {
  color: var(--danger);
}

.config-form {
  display: grid;
  gap: 1rem;
  max-width: 46rem;
}

.config-authors {
  display: grid;
  gap: 0.85rem;
}

.config-authors h3 {
  margin: 0;
  font-size: 1rem;
}

/* Author & Tag pages */
.author-shell {
  width: min(760px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.25rem 0 4rem;
}

.author-hero,
.tag-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1.1rem;
}

.author-hero {
  text-align: left;
}

.author-avatar {
  display: inline-grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: var(--surface-soft);
  flex-shrink: 0;
}

.author-avatar img,
.author-avatar .initials {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.author-avatar .initials {
  display: inline-grid;
  place-items: center;
  background: var(--author-color, var(--accent));
  color: #fff;
  font-size: 1.5rem;
  font-weight: 900;
}

.author-meta,
.tag-meta {
  min-width: 0;
}

.author-meta h1,
.tag-meta h1 {
  margin: 0 0 0.15rem;
  color: var(--ink-strong);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  letter-spacing: -0.02em;
}

.author-meta p {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.author-count,
.tag-count {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-strong);
  padding: 0.32rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 800;
}

.tag-hero-icon {
  display: inline-grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--accent);
  font-size: 1.8rem;
  font-weight: 900;
  flex-shrink: 0;
}

.tag-hero h1 {
  margin: 0 0 0.15rem;
  color: var(--ink-strong);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  letter-spacing: -0.02em;
}

.author-section-title {
  margin: 0 0 0.85rem;
  color: var(--ink-strong);
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

@media (max-width: 1180px) {
  .public-shell {
    grid-template-columns: 230px minmax(0, 1fr) 230px;
    gap: 1.15rem;
  }
}

@media (max-width: 980px) {
  .post-queue {
    max-height: none;
  }
}

.float-actions {
  display: none;
}

@media (max-width: 760px) {
  .public-shell {
    display: block;
    width: min(100% - 1rem, 1500px);
    padding-top: 0.75rem;
  }

  .admin-shell,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
    min-height: auto;
  }

  .left-rail,
  .right-rail {
    position: fixed;
    top: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    z-index: 30;
    display: grid;
    grid-auto-rows: max-content;
    align-content: start;
    gap: 0.75rem;
    width: min(20rem, 85vw);
    height: auto;
    max-height: calc(100dvh - 1.5rem);
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.46);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.62);
    box-shadow: var(--shadow-soft);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    padding: 0.9rem;
    transform: translateX(calc(-100% - 1rem));
    opacity: 1;
    transition: transform 220ms ease;
    pointer-events: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .left-rail::-webkit-scrollbar,
  .right-rail::-webkit-scrollbar {
    display: none;
  }

  .right-rail {
    right: 0.75rem;
    left: auto;
    transform: translateX(calc(100% + 1rem));
  }

  body.drawer-left-open,
  body.drawer-right-open {
    overflow: hidden;
  }

  body.drawer-left-open .left-rail {
    transform: translateX(0);
    pointer-events: auto;
  }

  body.drawer-right-open .right-rail {
    transform: translateX(0);
    pointer-events: auto;
  }

  .left-rail .rail-card:not(.profile-card),
  .right-rail .rail-card:not(.profile-card) {
    position: static;
    border-color: rgba(255, 255, 255, 0.25);
    background: transparent;
    box-shadow: none;
  }

  .log-stage {
    grid-column: auto;
  }

  .drawer-backdrop:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: block;
    border: 0;
    background: rgba(15, 17, 21, 0.22);
    cursor: pointer;
  }

  .float-actions {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }

  .float-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--ink-strong);
    color: #fff;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: transform 140ms ease, background 140ms ease;
  }

  .float-pill:hover {
    transform: translateY(-2px);
    background: #3a3f47;
  }

  .site-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .admin-topbar {
    top: 0.65rem;
    max-width: calc(100% - 1rem);
  }

  .admin-tabs {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .admin-tabs::-webkit-scrollbar {
    display: none;
  }

  #tab-publish.is-active {
    display: block;
  }

  .post-queue {
    grid-template-columns: 1fr;
  }

  .queue-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .queue-item-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .author-hero,
  .tag-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .author-meta {
    padding-bottom: 0;
  }
}

@media (max-width: 540px) {
  .public-shell,
  .admin-content,
  .author-shell {
    width: min(100% - 0.9rem, 1500px);
    padding-top: 0.5rem;
  }

  .login-panel {
    width: min(100% - 0.9rem, 680px);
  }

  .stage-heading,
  .panel-title-row,
  .editor-head {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .signal-strip {
    flex-wrap: wrap;
  }

  .admin-topbar .top-actions {
    width: 100%;
    justify-content: space-between;
  }
}
