:root {
  color-scheme: light;
  --theme-duration: 260ms;
  --theme-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --layout-max-width: 1240px;

  --bg-top: #e8e2d8;
  --bg-bottom: #dce6ee;
  --shape-one: #ffd7a8;
  --shape-two: #9ed3d6;
  --panel: #ffffff;
  --panel-muted: #f7fafc;
  --text: #172126;
  --subtle: #4b5a63;
  --line: #bccbd6;
  --accent: #0d6861;
  --accent-strong: #08534d;
  --danger: #a6342f;
  --danger-strong: #8b2a26;
  --shadow: 0 14px 34px rgba(20, 48, 64, 0.12);
  --surface-separation: 0 0 0 1px rgba(20, 48, 64, 0.05);
  --input-shadow: 0 1px 1px rgba(20, 48, 64, 0.08);
  --placeholder: #60717c;

  --flash-bg: #ffffff;
  --flash-success-bg: #ebfaf5;
  --flash-success-line: #8dc6b8;
  --flash-info-bg: #eef6ff;
  --flash-info-line: #a4c3db;
  --muted-surface: #f4f8fb;

  --input-bg: #ffffff;
  --focus-ring: rgba(15, 118, 110, 0.24);
  --focus-ring-strong: rgba(15, 118, 110, 0.4);
  --card-hover-bg: #fff9df;
  --card-hover-glow: 0 0 0 1px rgba(188, 148, 39, 0.2), 0 18px 34px rgba(119, 95, 21, 0.14);
  --button-primary-bg: var(--accent);
  --button-primary-hover: var(--accent-strong);
  --button-primary-border: rgba(8, 73, 68, 0.22);
  --button-primary-shadow: 0 7px 18px rgba(8, 74, 68, 0.2);
  --button-text: #ffffff;
  --subtle-button-bg: #d4e2e8;
  --subtle-button-hover: #c5d6de;
  --subtle-button-text: #122d37;

  --error-bg: #fff2f1;
  --error-line: #e9b8b6;
  --error-text: #8b2a26;

  --draft-badge-bg: #e9eef5;
  --draft-badge-text: #274158;
  --draft-links-bg: #f8fbff;
  --draft-links-line: #bfd0de;
  --rendered-text: #24333b;
  --code-bg: #0f1721;
  --code-text: #f2f7fa;
  --draft-note: #274158;
  --tag-bg: #e5eff8;
  --tag-text: #1b3f5b;

  --theme-toggle-bg: #f4f8fb;
  --theme-toggle-hover: #e6edf3;
  --theme-toggle-line: #c6d4df;
  --theme-toggle-text: #22333d;
  --theme-overlay: rgba(205, 223, 236, 0.2);
}

html[data-theme="dark"] {
  color-scheme: dark;

  --bg-top: #10161f;
  --bg-bottom: #18242f;
  --shape-one: #8c5420;
  --shape-two: #155860;
  --panel: #17202a;
  --panel-muted: #1a2733;
  --text: #e7eef6;
  --subtle: #9fb2c1;
  --line: #304252;
  --accent: #4bc0b2;
  --accent-strong: #35a79a;
  --danger: #d2635f;
  --danger-strong: #b84f4b;
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
  --surface-separation: 0 0 0 1px rgba(168, 197, 221, 0.08);
  --input-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  --placeholder: #90a5b7;

  --flash-bg: #1b2530;
  --flash-success-bg: #173127;
  --flash-success-line: #2e7b64;
  --flash-info-bg: #1a2d3f;
  --flash-info-line: #3f6f92;
  --muted-surface: #223243;

  --input-bg: #121a23;
  --focus-ring: rgba(75, 192, 178, 0.3);
  --focus-ring-strong: rgba(75, 192, 178, 0.46);
  --card-hover-bg: #1f2f3d;
  --card-hover-glow: 0 0 0 1px rgba(99, 220, 205, 0.28), 0 20px 38px rgba(2, 10, 16, 0.5);
  --button-primary-bg: #56d0c2;
  --button-primary-hover: #6ad9cc;
  --button-primary-border: rgba(125, 233, 220, 0.45);
  --button-primary-shadow: 0 10px 24px rgba(4, 12, 18, 0.42);
  --button-text: #072127;
  --subtle-button-bg: #233342;
  --subtle-button-hover: #2b4152;
  --subtle-button-text: #cfe2f2;

  --error-bg: #3a2021;
  --error-line: #7f4244;
  --error-text: #ffbab7;

  --draft-badge-bg: #243447;
  --draft-badge-text: #c6d9ee;
  --draft-links-bg: #1a2632;
  --draft-links-line: #3f556a;
  --rendered-text: #d4e0ea;
  --code-bg: #0a1018;
  --code-text: #eaf3fa;
  --draft-note: #c6d9ee;
  --tag-bg: #2b3f51;
  --tag-text: #d3e8ff;

  --theme-toggle-bg: #223243;
  --theme-toggle-hover: #2d4053;
  --theme-toggle-line: #3b5164;
  --theme-toggle-text: #d8e6f2;
  --theme-overlay: rgba(205, 223, 236, 0.2);
}

* {
  box-sizing: border-box;
}

body,
.panel,
.flash,
.manage-link,
input,
select,
textarea,
.button,
.button-subtle,
.form-error,
.draft-badge,
.draft-links,
.tag-list li,
.rendered-jot pre,
.theme-toggle,
.theme-toggle-state,
.auth-lightbox-panel,
.vote-button,
.toolbar-button,
.markdown-toolbar {
  transition:
    background-color var(--theme-duration) var(--theme-ease),
    color var(--theme-duration) var(--theme-ease),
    border-color var(--theme-duration) var(--theme-ease),
    box-shadow var(--theme-duration) var(--theme-ease);
}

.bg-shape,
.theme-transition-overlay {
  transition:
    opacity var(--theme-duration) var(--theme-ease),
    background-color var(--theme-duration) var(--theme-ease),
    transform var(--theme-duration) var(--theme-ease);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  line-height: 1.5;
}

body.lightbox-open {
  overflow: hidden;
}

.auth-lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-lightbox[hidden] {
  display: none;
}

.auth-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 20, 29, 0.46);
  backdrop-filter: blur(5px) saturate(130%);
  -webkit-backdrop-filter: blur(5px) saturate(130%);
}

.auth-lightbox-panel {
  position: relative;
  width: min(34rem, 100%);
  max-height: min(88vh, 42rem);
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: linear-gradient(
    150deg,
    rgba(255, 255, 255, 0.7),
    rgba(247, 252, 255, 0.4)
  );
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 30px 58px rgba(4, 18, 30, 0.34);
}

html[data-theme="dark"] .auth-lightbox-panel {
  border-color: rgba(139, 167, 190, 0.46);
  background: linear-gradient(
    155deg,
    rgba(24, 34, 45, 0.78),
    rgba(20, 30, 42, 0.52)
  );
}

.auth-lightbox-inner {
  padding: 1.1rem 1rem 1rem;
}

.auth-lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.auth-lightbox-head h2 {
  margin: 0;
  font-size: 1.4rem;
}

.auth-lightbox-close {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--subtle-button-bg);
  color: var(--subtle-button-text);
  padding: 0.35rem 0.7rem;
  line-height: 1;
  cursor: pointer;
}

.auth-lightbox-close:hover {
  background: var(--subtle-button-hover);
}

.auth-lightbox-copy {
  margin: 0.55rem 0 0.75rem;
  color: var(--subtle);
}

.external-link-panel {
  width: min(36rem, 100%);
}

.external-link-head {
  background: #fff3b8;
  border: 1px solid #e2c96e;
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
}

.external-link-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.external-link-icon {
  width: 2rem;
  height: 1.6rem;
  flex: 0 0 auto;
}

.external-link-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

html[data-theme="dark"] .external-link-head {
  background: #5c4f1e;
  border-color: #8d7b34;
}

.external-link-subhead {
  margin: 0.55rem 0 0.2rem;
  color: var(--subtle);
  overflow-wrap: anywhere;
}

#external-link-address {
  color: var(--text);
  font-weight: 700;
}

.auth-lightbox-form {
  display: grid;
  gap: 0.7rem;
}

.theme-transition-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-105%);
  background: linear-gradient(120deg, transparent 0%, var(--theme-overlay) 40%, transparent 72%);
  z-index: 2;
}

.theme-transition-overlay.is-active {
  opacity: 1;
  transform: translateX(105%);
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(72px);
  pointer-events: none;
  z-index: -1;
}

.bg-shape-one {
  width: 30rem;
  height: 30rem;
  background: var(--shape-one);
  top: -8rem;
  left: -6rem;
}

.bg-shape-two {
  width: 26rem;
  height: 26rem;
  background: var(--shape-two);
  bottom: -8rem;
  right: -8rem;
}

.site-header {
  width: 100%;
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: 2.25rem 1.25rem 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.3rem;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quick-nav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.quick-nav form {
  margin: 0;
}

.quick-nav a {
  text-decoration: none;
  color: var(--subtle);
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: 8px;
  padding: 0.2rem 0.42rem;
}

.quick-nav a:hover {
  color: var(--text);
  background: var(--panel-muted);
}

.quick-nav a:focus-visible {
  outline: 2px solid transparent;
  color: var(--text);
  background: var(--panel-muted);
  box-shadow: 0 0 0 3px var(--focus-ring-strong);
}

.account-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: var(--draft-links-bg);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
}

.brand-block {
  display: grid;
  gap: 0.3rem;
}

.brand {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text);
}

.brand-text {
  display: grid;
  gap: 0.3rem;
}

.brand-wordmark-row {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.brand-wordmark {
  font-size: clamp(2rem, 3vw, 2.35rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
}

.brand-beta {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  background: var(--panel-muted);
  color: var(--accent-strong);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.brand-mark {
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 0.8rem;
  display: inline-grid;
  place-items: center;
  box-shadow: 0 12px 28px rgba(16, 34, 45, 0.24);
  flex: 0 0 auto;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tagline {
  display: block;
  color: var(--subtle);
  font-size: 0.98rem;
  line-height: 1.2;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--theme-toggle-line);
  border-radius: 999px;
  background: var(--theme-toggle-bg);
  color: var(--theme-toggle-text);
  cursor: pointer;
  padding: 0.42rem 0.72rem;
  font-weight: 600;
  font-size: 0.88rem;
}

.theme-toggle:hover {
  background: var(--theme-toggle-hover);
}

.theme-toggle:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px var(--focus-ring-strong);
}

.theme-toggle-icons {
  position: relative;
  width: 1.05rem;
  height: 1.05rem;
  display: inline-grid;
  place-items: center;
}

.theme-icon {
  width: 1.05rem;
  height: 1.05rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-icon-sun {
  display: block;
}

html[data-theme="dark"] .theme-icon-moon {
  display: none;
}

.theme-toggle-state {
  padding-left: 0.45rem;
  border-left: 1px solid var(--theme-toggle-line);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  opacity: 0.9;
}

.page-shell {
  max-width: var(--layout-max-width);
  width: 100%;
  flex: 1 0 auto;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: auto;
  padding: 1rem 1.25rem 1.6rem;
}

.site-footer-inner {
  max-width: var(--layout-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.site-footer-copy {
  margin: 0;
  color: var(--subtle);
  font-size: 0.88rem;
}

.site-footer-nav {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.site-footer-nav a {
  color: var(--subtle);
  font-size: 0.88rem;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.14rem 0.34rem;
}

.site-footer-nav a:hover {
  color: var(--text);
  text-decoration: underline;
}

.site-footer-nav a:focus-visible {
  outline: 2px solid transparent;
  color: var(--text);
  text-decoration: none;
  background: var(--panel-muted);
  box-shadow: 0 0 0 3px var(--focus-ring-strong);
}

.legal-panel {
  display: grid;
  gap: 0.35rem;
}

.legal-panel h2 {
  margin: 0.55rem 0 0.15rem;
  font-size: 1.05rem;
}

.legal-panel p {
  margin: 0;
  color: var(--rendered-text);
}

.contact-shell {
  max-width: 42rem;
}

.contact-form textarea {
  min-height: 10rem;
}

.cookie-consent-banner {
  position: fixed;
  z-index: 40;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  padding: 0.75rem 0.85rem;
  display: grid;
  gap: 0.6rem;
  border-radius: 14px;
}

.cookie-consent-banner[hidden] {
  display: none;
}

.cookie-consent-copy {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
}

.cookie-consent-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.intro h1 {
  font-size: clamp(1.8rem, 3.8vw, 2.8rem);
  margin: 0;
  letter-spacing: -0.02em;
}

.intro p {
  margin-top: 0.7rem;
  color: var(--subtle);
}

.intro-compact h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.flash-stack {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.flash {
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  background: var(--flash-bg);
}

.flash-success {
  border-color: var(--flash-success-line);
  background: var(--flash-success-bg);
}

.flash-info {
  border-color: var(--flash-info-line);
  background: var(--flash-info-bg);
}

.flash-manage {
  display: grid;
  gap: 0.45rem;
}

.manage-link {
  display: block;
  padding: 0.5rem;
  background: var(--muted-surface);
  border-radius: 8px;
  overflow-wrap: anywhere;
}

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

.editor-grid {
  margin-top: 1.2rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 1fr);
  align-items: start;
}

.editor-side-stack {
  display: grid;
  gap: 1rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow), var(--surface-separation);
  padding: 1rem;
}

.panel-form {
  display: grid;
  gap: 0.65rem;
}

.markdown-toolbar {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem;
  border-radius: 12px;
  border: 1px dashed var(--draft-links-line);
  background: var(--draft-links-bg);
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.toolbar-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--subtle-button-bg);
  color: var(--subtle-button-text);
  padding: 0.34rem 0.56rem;
  font-size: 0.82rem;
  line-height: 1.2;
  font-weight: 650;
  cursor: pointer;
}

.toolbar-button:hover {
  background: var(--subtle-button-hover);
}

.toolbar-button:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px var(--focus-ring-strong);
}

.panel-preview {
  background: linear-gradient(180deg, var(--panel), var(--panel-muted));
}

label {
  font-weight: 650;
  font-size: 0.95rem;
}

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

input,
select,
textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0.68rem 0.72rem;
  background: var(--input-bg);
  color: var(--text);
  box-shadow: var(--input-shadow);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid transparent;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring-strong);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  border-radius: 10px;
  border: 1px solid var(--button-primary-border);
  background: var(--button-primary-bg);
  color: var(--button-text);
  font-weight: 650;
  text-decoration: none;
  padding: 0.62rem 1rem;
  cursor: pointer;
  box-shadow: var(--button-primary-shadow);
}

.button-compact {
  padding: 0.38rem 0.62rem;
  font-size: 0.84rem;
}

.button:hover {
  background: var(--button-primary-hover);
}

.button:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px var(--focus-ring-strong);
}

.button-subtle {
  background: var(--subtle-button-bg);
  color: var(--subtle-button-text);
  border-color: var(--line);
  box-shadow: none;
}

.button-subtle:hover {
  background: var(--subtle-button-hover);
}

.button-danger {
  background: var(--danger);
}

.button-danger:hover {
  background: var(--danger-strong);
}

.form-error {
  margin: 0;
  padding: 0.65rem 0.75rem;
  background: var(--error-bg);
  border: 1px solid var(--error-line);
  border-radius: 10px;
}

.anti-spam-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.status-row {
  margin-top: 0.1rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.save-status {
  margin: 0;
  color: var(--subtle);
  font-size: 0.92rem;
}

.save-status-error {
  color: var(--error-text);
}

.draft-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  background: var(--draft-badge-bg);
  color: var(--draft-badge-text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.draft-links {
  margin-top: 0.2rem;
  display: grid;
  gap: 0.45rem;
  border: 1px dashed var(--draft-links-line);
  border-radius: 12px;
  background: var(--draft-links-bg);
  padding: 0.75rem;
}

.publish-note {
  margin: 0;
  color: var(--subtle);
  font-size: 0.92rem;
}

.rendered-jot h1,
.rendered-jot h2,
.rendered-jot h3 {
  margin-top: 1.3em;
  line-height: 1.2;
}

.rendered-jot p,
.rendered-jot li {
  color: var(--rendered-text);
}

.rendered-jot pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.75rem;
  border-radius: 10px;
  overflow-x: auto;
}

.rendered-jot code {
  font-family: "IBM Plex Mono", "Consolas", monospace;
}

.empty-preview {
  color: var(--subtle);
}

.jot-header h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
}

.jot-description {
  margin-top: 0.5rem;
  color: var(--subtle);
}

.draft-view-note {
  margin-top: 0.55rem;
  margin-bottom: 0;
  color: var(--draft-note);
  font-weight: 550;
}

.meta {
  margin-top: 0.65rem;
  color: var(--subtle);
  font-size: 0.95rem;
}

.tag-list {
  margin: 0.9rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0;
  list-style: none;
}

.tag-list li {
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.87rem;
}

.share-row {
  margin: 1rem 0;
}

.share-controls {
  margin-top: 0.45rem;
  display: flex;
  gap: 0.55rem;
}

.share-controls input {
  flex: 1;
}

.share-controls textarea {
  flex: 1;
  min-height: 5.2rem;
}

.action-row {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.button-row {
  margin-top: 0.2rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.vote-controls {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.6rem;
}

.vote-button-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.vote-button-row form {
  margin: 0;
}

.vote-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--subtle-button-bg);
  color: var(--subtle-button-text);
  padding: 0.42rem 0.72rem;
  cursor: pointer;
  font-weight: 650;
}

.vote-button:hover {
  background: var(--subtle-button-hover);
}

.vote-button-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.vote-button-emoji {
  font-size: 1rem;
  line-height: 1;
}

.vote-button-label {
  font-size: 0.88rem;
}

.vote-button-count {
  min-width: 1.2rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.vote-score {
  margin: 0;
  color: var(--subtle);
  font-size: 0.9rem;
}

.comments-section {
  margin-top: 1rem;
  display: grid;
  gap: 0.9rem;
}

.comments-section h2 {
  margin: 0;
  font-size: 1.2rem;
}

.comments-form {
  display: grid;
  gap: 0.55rem;
}

.comments-form textarea {
  min-height: 6.5rem;
}

.comments-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.comments-list {
  display: grid;
  gap: 0.7rem;
}

.comment-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem;
  background: var(--panel-muted);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--subtle);
  font-size: 0.84rem;
  flex-wrap: wrap;
}

.comment-author {
  color: var(--text);
  font-weight: 700;
}

.comment-time {
  color: var(--subtle);
}

.comment-body p {
  margin: 0.45rem 0 0;
}

.comment-actions {
  margin-top: 0.55rem;
}

.comment-actions form {
  margin: 0;
}

.comment-item-deleted {
  opacity: 0.82;
}

.comment-deleted-label {
  margin: 0.45rem 0 0;
  color: var(--subtle);
  font-style: italic;
}

.owner-note {
  color: var(--subtle);
  margin: 0;
}

.settings-summary {
  margin-top: 1rem;
  display: grid;
  gap: 0.35rem;
}

.settings-summary p {
  margin: 0;
}

.settings-panel {
  margin-top: 1rem;
}

.settings-panel h2 {
  margin: 0;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

.toggle-row input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.embed-panel {
  margin-top: 1rem;
}

.embed-panel h2 {
  margin: 0;
}

.embed-token-list {
  display: grid;
  gap: 0.6rem;
}

.embed-token-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.75rem;
  background: var(--panel-muted);
}

.embed-token-item form {
  margin: 0;
}

.embed-token-main {
  min-width: 0;
}

.embed-token-actions {
  justify-self: end;
  align-self: start;
}

.embed-token-title {
  margin: 0;
  font-weight: 700;
}

.embed-token-links {
  margin-top: 0.55rem;
  display: grid;
  gap: 0.35rem;
}

.embed-token-links .share-controls {
  width: 100%;
}

.embed-token-links .share-controls input,
.embed-token-links .share-controls textarea {
  min-width: 0;
}

.embed-token-links .share-controls .button {
  flex: 0 0 auto;
}

.embed-body {
  min-height: 100vh;
  margin: 0;
  padding: 0.75rem;
}

.embed-shell {
  margin: 0;
}

.auth-shell {
  max-width: 30rem;
}

.auth-form {
  gap: 0.75rem;
}

.auth-note {
  margin: 0;
  color: var(--subtle);
  font-size: 0.92rem;
}

.auth-note a {
  color: var(--accent);
}

.jot-list {
  display: grid;
  gap: 0.75rem;
}

.jot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.jot-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.jot-row-main {
  min-width: 0;
}

.jot-row-title {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.jot-row-title:hover {
  text-decoration: underline;
}

.jot-row-meta {
  margin: 0.35rem 0 0;
  color: var(--subtle);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.jot-row-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.jot-row-actions form {
  margin: 0;
}

.status-pill {
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.status-public {
  background: #dff7ef;
  color: #135e4d;
}

.status-draft {
  background: var(--draft-badge-bg);
  color: var(--draft-badge-text);
}

.status-anonymous {
  background: #e7e8f9;
  color: #2a2f76;
}

.status-admin {
  background: #feecc8;
  color: #6a4510;
}

.status-banned {
  background: #fde0df;
  color: #7f2c29;
}

html[data-theme="dark"] .status-public {
  background: #1f4d43;
  color: #d6f5ed;
}

html[data-theme="dark"] .status-anonymous {
  background: #373c7f;
  color: #e6e8ff;
}

html[data-theme="dark"] .status-admin {
  background: #5d4316;
  color: #ffe5b9;
}

html[data-theme="dark"] .status-banned {
  background: #5a2a2b;
  color: #ffc8c6;
}

.admin-layout {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(13rem, 15rem) minmax(0, 1fr);
  align-items: start;
}

.admin-content {
  display: grid;
  gap: 1rem;
}

.admin-menu {
  display: grid;
  gap: 0.7rem;
}

.admin-menu h2 {
  margin: 0;
  font-size: 1.06rem;
}

.admin-nav {
  display: grid;
  gap: 0.35rem;
}

.admin-nav-link {
  display: block;
  padding: 0.42rem 0.56rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--subtle);
  background: var(--panel-muted);
  font-weight: 650;
}

.admin-nav-link:hover {
  color: var(--text);
  background: var(--card-hover-bg);
}

.admin-nav-link:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px var(--focus-ring-strong);
}

.admin-nav-link.is-active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--card-hover-bg);
}

.admin-stats {
  display: grid;
  gap: 0.75rem;
}

.admin-stats h2 {
  margin: 0;
}

.admin-stats-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-stat-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem;
  background: var(--panel-muted);
}

.admin-stat-label {
  margin: 0;
  color: var(--subtle);
  font-size: 0.84rem;
}

.admin-stat-value {
  margin: 0.18rem 0 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.admin-user-search {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.admin-user-list {
  display: grid;
  gap: 0.7rem;
}

.admin-message-filters {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.admin-message-filter {
  text-decoration: none;
  color: var(--subtle);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
  background: var(--panel-muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.admin-message-filter:hover {
  color: var(--text);
  background: var(--card-hover-bg);
}

.admin-message-filter:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px var(--focus-ring-strong);
}

.admin-message-filter.is-active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--card-hover-bg);
}

.admin-user-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-muted);
}

.admin-user-main {
  min-width: 0;
}

.admin-user-title {
  margin: 0;
  font-weight: 700;
}

.admin-user-meta {
  margin: 0.25rem 0 0;
  color: var(--subtle);
  font-size: 0.88rem;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-user-actions form {
  margin: 0;
}

.admin-message-list {
  display: grid;
  gap: 0.7rem;
}

.admin-message-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-muted);
}

.admin-message-main {
  min-width: 0;
}

.admin-message-meta {
  margin: 0.25rem 0 0;
  color: var(--subtle);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.admin-message-body {
  margin: 0.5rem 0 0;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-message-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.admin-message-actions form {
  margin: 0;
}

.admin-ban-form {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.admin-ban-form input[type="text"] {
  width: 14rem;
  min-width: 10rem;
}

.admin-ban-form-detail {
  width: 100%;
}

.admin-ban-form-detail input[type="text"] {
  width: min(100%, 24rem);
}

.admin-user-detail h2 {
  margin: 0;
}

.admin-linked-user {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.48rem;
  margin-right: 0.25rem;
  display: inline-block;
  background: var(--panel-muted);
}

.admin-linked-user:hover {
  text-decoration: underline;
}

.admin-linked-user:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px var(--focus-ring-strong);
}

.published-search {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
}

.published-search-form {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.published-search-field,
.published-sort-field {
  display: grid;
  gap: 0.4rem;
}

.published-sort-field select {
  min-width: 10rem;
}

.published-results {
  margin-top: 1rem;
}

.popular-tags-panel {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.7rem;
}

.popular-tags-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.popular-tags-head h2 {
  margin: 0;
  font-size: 1rem;
}

.popular-tags-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.62rem;
}

.popular-tag-link,
.popular-tags-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  color: var(--subtle);
  background: var(--panel-muted);
  font-size: 0.8rem;
  transition:
    color var(--theme-duration) var(--theme-ease),
    border-color var(--theme-duration) var(--theme-ease),
    background var(--theme-duration) var(--theme-ease),
    transform var(--theme-duration) var(--theme-ease);
}

.popular-tag-link:hover,
.popular-tags-list a:hover {
  color: var(--text);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.popular-tag-link:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px var(--focus-ring-strong);
}

.popular-tag-link.is-active {
  color: var(--text);
  border-color: color-mix(in oklab, var(--accent) 44%, var(--line));
  background: color-mix(in oklab, var(--accent-soft) 22%, var(--panel-muted));
}

.popular-tag-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: color-mix(in oklab, var(--text) 9%, transparent);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1.35;
}

.explore-active-tag {
  margin: 0.58rem 0 0;
}

.published-grid {
  display: grid;
  gap: 0.85rem;
}

.published-card {
  padding: 0;
  overflow: hidden;
  background: var(--panel);
  transition:
    background-color var(--theme-duration) var(--theme-ease),
    box-shadow var(--theme-duration) var(--theme-ease),
    transform var(--theme-duration) var(--theme-ease);
}

.published-card:hover,
.published-card:focus-within {
  background: var(--card-hover-bg);
  box-shadow: var(--shadow), var(--surface-separation), var(--card-hover-glow);
  transform: translateY(-1px);
}

.published-card-link {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  color: var(--text);
  text-decoration: none;
}

.published-card-link:hover {
  background: transparent;
}

.published-card-link:focus-visible {
  outline: 2px solid transparent;
  background: transparent;
  box-shadow: 0 0 0 4px var(--focus-ring-strong);
}

.published-admin-actions {
  border-top: 1px solid var(--line);
  padding: 0.7rem 1rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.published-admin-actions form {
  margin: 0;
}

.published-title {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.25;
}

.published-description {
  margin: 0;
  color: var(--subtle);
}

.published-tags {
  margin: 0.45rem 1.05rem 1rem;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.published-tags li {
  margin: 0;
}

.published-tag-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.56rem;
  color: var(--subtle);
  background: var(--panel-muted);
  font-size: 0.75rem;
  text-decoration: none;
  transition:
    color var(--theme-duration) var(--theme-ease),
    border-color var(--theme-duration) var(--theme-ease),
    background var(--theme-duration) var(--theme-ease);
}

.published-tag-link:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.published-tag-link:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px var(--focus-ring-strong);
}

.published-tag-link.is-active {
  color: var(--text);
  border-color: color-mix(in oklab, var(--accent) 44%, var(--line));
  background: color-mix(in oklab, var(--accent-soft) 22%, var(--panel-muted));
}

.published-tag-extra {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  color: var(--subtle);
  background: var(--panel-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.published-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem 1rem;
  flex-wrap: wrap;
}

.published-meta-group {
  margin: 0;
  color: var(--subtle);
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.published-meta-stats {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.published-meta-stats span {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.explore-load-more {
  margin-top: 0.9rem;
  display: flex;
  justify-content: center;
}

.explore-empty-state {
  display: grid;
  gap: 0.6rem;
}

.explore-empty-state h2 {
  margin: 0;
  font-size: 1.1rem;
}

.explore-empty-state p {
  margin: 0;
  color: var(--subtle);
}

.pager {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
}

.pager-state {
  color: var(--subtle);
  font-size: 0.88rem;
}

@media (max-width: 900px) {
  .editor-grid {
    grid-template-columns: 1fr;
  }

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

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-header {
    padding-top: 1.3rem;
  }

  .brand-wordmark {
    font-size: 2rem;
  }

  .brand-mark {
    width: 2.7rem;
    height: 2.7rem;
  }

  .header-actions {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .quick-nav {
    gap: 0.5rem;
  }

  .theme-toggle-label {
    display: none;
  }

  .theme-toggle-state {
    padding-left: 0.35rem;
    font-size: 0.76rem;
  }

  .page-shell {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .published-search-form {
    grid-template-columns: 1fr;
  }

  .published-sort-field select {
    width: 100%;
  }

  .published-meta-row {
    align-items: flex-start;
  }

  .admin-user-search {
    grid-template-columns: 1fr;
  }

  .admin-stats-grid {
    grid-template-columns: 1fr;
  }

  .admin-user-row {
    flex-direction: column;
  }

  .admin-user-actions {
    justify-content: flex-start;
  }

  .admin-message-row {
    flex-direction: column;
  }

  .admin-message-actions {
    justify-content: flex-start;
  }

  .admin-ban-form input[type="text"] {
    width: 100%;
    min-width: 0;
  }

  .site-footer {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .site-footer-inner {
    align-items: flex-start;
  }

  .share-controls {
    flex-direction: column;
  }

  .embed-token-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .embed-token-actions {
    justify-self: start;
  }

  .jot-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .panel,
  .flash,
  .manage-link,
  input,
  textarea,
  .button-subtle,
  .form-error,
  .draft-badge,
  .draft-links,
  .tag-list li,
  .rendered-jot pre,
  .theme-toggle,
  .theme-toggle-state,
  .auth-lightbox-panel,
  .auth-lightbox-backdrop,
  .bg-shape,
  .theme-transition-overlay {
    transition: none;
  }
}
