:root {
  color-scheme: dark;

  --bg: #07111f;
  --bg-deep: #050d18;
  --surface: #0c1725;
  --surface-raised: #101b2a;
  --surface-soft: #111f2d;
  --field: rgba(2, 9, 18, 0.8);

  --text: #e8f2fb;
  --text-soft: #c5d5e3;
  --muted: #91a5b8;
  --muted-dark: #60778a;

  --cyan: #78d9ef;
  --cyan-soft: #9cdef2;
  --coral: #f29272;
  --coral-soft: #ffb094;
  --violet: #9a8cff;
  --success: #72d8b0;
  --danger: #ff8290;

  --line: rgba(147, 190, 220, 0.22);
  --line-soft: rgba(147, 190, 220, 0.13);
  --line-strong: rgba(var(--accent-rgb), 0.42);
  --line-coral: rgba(var(--secondary-rgb), 0.42);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 30px;

  --shadow: 0 28px 80px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  --shadow-small: 0 10px 30px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.07);

  --font: Inter, "Segoe UI", Arial, sans-serif;
  --font-editorial: Georgia, "Times New Roman", serif;
  --mono: "Cascadia Code", "Fira Code", Consolas, monospace;
  --motion: 240ms cubic-bezier(0.22, 0.8, 0.22, 1);
  --bg-rgb: 7, 17, 31;
  --accent-rgb: 120, 217, 239;
  --secondary-rgb: 242, 146, 114;
}

[data-theme="titan"] {
  --bg: #16100c;
  --bg-deep: #0d0907;
  --surface: #211812;
  --surface-raised: #2a1e16;
  --surface-soft: #302219;
  --field: rgba(14, 8, 4, 0.82);
  --text: #fff1dc;
  --text-soft: #e9ceb2;
  --muted: #b79a7f;
  --muted-dark: #745f4e;
  --cyan: #f6b85f;
  --cyan-soft: #ffd18d;
  --coral: #e86f4e;
  --coral-soft: #ff9a75;
  --violet: #b38cff;
  --line: rgba(237, 181, 123, 0.24);
  --line-soft: rgba(237, 181, 123, 0.14);
  --line-strong: rgba(246, 184, 95, 0.46);
  --line-coral: rgba(232, 111, 78, 0.46);
  --bg-rgb: 22, 16, 12;
  --accent-rgb: 246, 184, 95;
  --secondary-rgb: 232, 111, 78;
}

[data-theme="europa"] {
  --bg: #07111f;
  --bg-deep: #050d18;
  --surface: #0c1725;
  --surface-raised: #101b2a;
  --surface-soft: #111f2d;
  --field: rgba(2, 9, 18, 0.8);
  --text: #e8f2fb;
  --text-soft: #c5d5e3;
  --muted: #91a5b8;
  --muted-dark: #60778a;
  --cyan: #78d9ef;
  --cyan-soft: #9cdef2;
  --coral: #f29272;
  --coral-soft: #ffb094;
  --violet: #9a8cff;
  --line: rgba(147, 190, 220, 0.22);
  --line-soft: rgba(147, 190, 220, 0.13);
  --line-strong: rgba(120, 217, 239, 0.42);
  --line-coral: rgba(242, 146, 114, 0.42);
  --bg-rgb: 7, 17, 31;
  --accent-rgb: 120, 217, 239;
  --secondary-rgb: 242, 146, 114;
}

[data-theme="triton"] {
  --bg: #1a101a;
  --bg-deep: #100810;
  --surface: #241524;
  --surface-raised: #2d1a2d;
  --surface-soft: #352035;
  --field: rgba(16, 7, 16, 0.82);
  --text: #fff0f7;
  --text-soft: #eccddd;
  --muted: #b994a8;
  --muted-dark: #795d6d;
  --cyan: #f5a8cf;
  --cyan-soft: #ffc5e2;
  --coral: #ff7e9f;
  --coral-soft: #ffadc1;
  --violet: #c69cff;
  --line: rgba(238, 166, 204, 0.24);
  --line-soft: rgba(238, 166, 204, 0.14);
  --line-strong: rgba(245, 168, 207, 0.48);
  --line-coral: rgba(255, 126, 159, 0.48);
  --bg-rgb: 26, 16, 26;
  --accent-rgb: 245, 168, 207;
  --secondary-rgb: 255, 126, 159;
}

[data-theme="amalthea"] {
  --bg: #180b09;
  --bg-deep: #0b0403;
  --surface: #25100d;
  --surface-raised: #301511;
  --surface-soft: #3a1b16;
  --field: rgba(16, 5, 4, 0.84);
  --text: #fff0e7;
  --text-soft: #e8c9ba;
  --muted: #b58c7d;
  --muted-dark: #76574e;
  --cyan: #e75f4b;
  --cyan-soft: #ff8a70;
  --coral: #b9322d;
  --coral-soft: #f17a65;
  --violet: #d07b68;
  --line: rgba(221, 112, 89, 0.25);
  --line-soft: rgba(221, 112, 89, 0.14);
  --line-strong: rgba(231, 95, 75, 0.5);
  --line-coral: rgba(185, 50, 45, 0.5);
  --bg-rgb: 24, 11, 9;
  --accent-rgb: 231, 95, 75;
  --secondary-rgb: 185, 50, 45;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(var(--secondary-rgb), 0.12), transparent 27rem),
    radial-gradient(circle at 89% 6%, rgba(var(--accent-rgb), 0.14), transparent 30rem),
    radial-gradient(circle at 55% 100%, rgba(77, 99, 211, 0.08), transparent 36rem),
    linear-gradient(145deg, var(--bg-deep) 0%, var(--bg) 50%, var(--bg-deep) 100%);
  font-family: var(--font);
  line-height: 1.55;
}

body::before {
  position: fixed;
  z-index: -2;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.48;
  background-image:
    linear-gradient(rgba(var(--accent-rgb), 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.032) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button {
  border: 0;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  color: var(--bg-deep);
  background: var(--coral);
}

[hidden] {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.1;
  transform: translateZ(0);
  will-change: transform, opacity;
}

.ambient-coral {
  top: 18vh;
  left: -18rem;
  background: var(--coral);
}

.ambient-coral-low {
  left: -13rem;
  bottom: -10rem;
  width: 24rem;
  height: 24rem;
  background: var(--coral);
  opacity: 0.07;
  animation: fog-coral-low 34s ease-in-out infinite alternate;
}

.ambient-cyan {
  right: -20rem;
  bottom: 5vh;
  background: var(--cyan);
}

.ambient-coral {
  animation: fog-coral 30s ease-in-out infinite alternate;
}

.ambient-cyan {
  animation: fog-cyan 36s ease-in-out infinite alternate;
}

.orbit-field {
  position: fixed;
  z-index: -1;
  inset: -20vh -15vw;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.18;
}

.orbit-field span {
  position: absolute;
  width: 76vw;
  height: 34vw;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 50%;
  transform: rotate(-18deg);
  animation: orbit-shift 28s linear infinite;
  will-change: transform;
}

.orbit-field span:nth-child(1) {
  top: 4%;
  right: -16%;
}

.orbit-field span:nth-child(2) {
  bottom: 8%;
  left: -18%;
  width: 64vw;
  animation-duration: 36s;
  animation-direction: reverse;
}

.orbit-field span:nth-child(3) {
  top: 38%;
  left: 20%;
  width: 44vw;
  height: 18vw;
  border-color: rgba(var(--secondary-rgb), 0.18);
  animation-duration: 22s;
}

.eyebrow {
  margin: 0;
  color: var(--cyan);
  font: 700 0.67rem/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.brand-link {
  text-decoration: none;
}

.brand-name,
.brand-subtitle {
  margin: 0;
}

.brand-name {
  color: var(--text);
  font-weight: 760;
  font-size: 0.94rem;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  color: var(--muted);
  font: 0.59rem/1.5 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-view {
  display: grid;
  min-height: 100vh;
  padding: 2rem;
  place-items: center;
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
  transition:
    opacity 320ms ease,
    transform 420ms cubic-bezier(0.22, 0.8, 0.22, 1),
    filter 320ms ease;
}

.login-transition .login-view {
  opacity: 0;
  transform: scale(0.985);
  filter: blur(9px);
}

.login-card {
  position: relative;
  width: min(100%, 46rem);
  overflow: hidden;
  padding: clamp(2rem, 6vw, 4.8rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 32%),
    rgba(var(--bg-rgb), 0.86);
  box-shadow: var(--shadow);
}

.login-card::after {
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--coral), var(--cyan), transparent);
  opacity: 0.72;
}

.login-card__signal {
  position: absolute;
  top: 1.6rem;
  right: 1.8rem;
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 1.4rem;
}

.login-card__signal span {
  width: 2px;
  border-radius: 2px;
  background: var(--cyan);
  opacity: 0.7;
}

.login-card__signal span:nth-child(1) { height: 30%; }
.login-card__signal span:nth-child(2) { height: 70%; }
.login-card__signal span:nth-child(3) { height: 100%; }
.login-card__signal span:nth-child(4) { height: 55%; }
.login-card__signal span:nth-child(5) { height: 82%; background: var(--coral); }

.login-overline {
  margin: 0;
  color: var(--muted);
  font: 0.68rem var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.moonlight-wordmark {
  max-width: none;
  margin: 4rem 0 1rem;
  font-family: var(--font-editorial);
  font-size: clamp(4.2rem, 13vw, 8.5rem);
  font-weight: 400;
  line-height: 0.82;
  letter-spacing: -0.075em;
}

.moonlight-wordmark span,
.site-wordmark span {
  color: transparent;
  -webkit-text-stroke: 1px var(--cyan);
}

.login-tagline {
  max-width: 28rem;
  margin: 1.5rem 0 0.7rem;
  color: var(--text);
  font-family: var(--font-editorial);
  font-size: clamp(1.2rem, 2.6vw, 1.55rem);
  line-height: 1.4;
}

.login-copy {
  max-width: 34rem;
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.login-form {
  margin-top: 2.5rem;
}

.identity-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0 0 1.2rem;
  padding: 0;
  border: 0;
}

.identity-choice legend {
  grid-column: 1 / -1;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font: 700 0.64rem var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.identity-choice label {
  margin: 0;
  cursor: pointer;
}

.identity-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.identity-choice span {
  display: grid;
  gap: 0.18rem;
  min-height: 4.25rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--field);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.identity-choice strong {
  color: var(--text);
  font-size: 0.9rem;
  text-transform: none;
}

.identity-choice small {
  color: var(--muted);
  font: 0.62rem var(--mono);
  letter-spacing: 0.04em;
  text-transform: none;
}

.identity-choice input:checked + span {
  border-color: var(--cyan);
  background: rgba(var(--accent-rgb), 0.11);
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.11);
  transform: translateY(-1px);
}

.login-form label,
.field label,
.field-label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font: 700 0.64rem var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
}

.remember-choice {
  display: flex !important;
  gap: 0.55rem;
  align-items: center;
  width: fit-content;
  margin-top: 0.8rem !important;
  color: var(--muted) !important;
  cursor: pointer;
  text-transform: none !important;
}

.remember-choice input {
  width: 1rem;
  min-height: 1rem;
  accent-color: var(--cyan);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(147, 190, 220, 0.26);
  border-radius: 9px;
  color: var(--text);
  background: var(--field);
}

input,
select {
  min-height: 2.8rem;
  padding: 0.7rem 0.85rem;
}

textarea {
  padding: 0.9rem;
  resize: vertical;
}

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

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.09);
}

.button,
.icon-button,
.nav-action,
.tool-button,
.filter-chip {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0.62rem 0.9rem;
  border: 1px solid rgba(var(--accent-rgb), 0.38);
  border-radius: 9px;
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.08);
  font-size: 0.75rem;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.button:hover,
.icon-button:hover,
.nav-action:hover,
.tool-button:hover,
.filter-chip:hover {
  border-color: var(--cyan);
  background: rgba(var(--accent-rgb), 0.15);
  box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.1);
  transform: translateY(-1px);
}

.button-primary {
  border-color: rgba(var(--accent-rgb), 0.64);
  color: #06121d;
  background: linear-gradient(135deg, var(--cyan-soft), var(--cyan));
}

.button-primary:hover {
  color: #06121d;
  background: linear-gradient(135deg, var(--text), var(--cyan-soft));
}

.button-coral {
  border-color: rgba(var(--secondary-rgb), 0.55);
  color: #ffd8ca;
  background: rgba(var(--secondary-rgb), 0.09);
}

.button-coral:hover {
  border-color: var(--coral);
  background: rgba(var(--secondary-rgb), 0.16);
  box-shadow: 0 0 22px rgba(var(--secondary-rgb), 0.11);
}

.button-danger {
  border-color: rgba(255, 130, 144, 0.45);
  color: #ffd4d9;
  background: rgba(255, 130, 144, 0.08);
}

.form-message {
  min-height: 1.35rem;
  margin: 0.6rem 0 0;
  color: var(--danger);
  font-size: 0.78rem;
}

.login-card__footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font: 0.62rem var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.login-quote {
  display: grid;
  gap: 0.22rem;
  max-width: 23rem;
  text-align: right;
}

.login-quote small {
  color: var(--cyan);
  font: inherit;
}

.status-dot::before {
  display: inline-block;
  width: 0.43rem;
  height: 0.43rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px rgba(114, 216, 176, 0.45);
  content: "";
}

.app {
  width: min(100%, 96rem);
  margin: 0 auto;
  padding: 1rem clamp(1rem, 3vw, 3rem) 3rem;
}

.app-entering {
  animation: app-reveal 680ms cubic-bezier(0.22, 0.8, 0.22, 1) both;
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0.7rem;
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  padding: 0.72rem 0.85rem 0.72rem 1rem;
  border: 1px solid rgba(183, 218, 239, 0.19);
  border-radius: var(--radius-md);
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.075), transparent 42%),
    rgba(var(--bg-rgb), 0.72);
  box-shadow: var(--shadow-small);
  backdrop-filter: blur(20px) saturate(125%);
}

.site-wordmark {
  margin: 0;
  color: var(--text);
  font-family: var(--font-editorial);
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: -0.055em;
}

.site-wordmark-small {
  font-size: 1.05rem;
}

.site-nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.site-nav a,
.nav-action {
  min-height: auto;
  padding: 0.52rem 0.72rem;
  border-color: transparent;
  color: var(--muted);
  background: transparent;
  font-size: 0.7rem;
  font-weight: 720;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a.active,
.nav-action:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(var(--accent-rgb), 0.07);
  box-shadow: none;
}

.nav-action-settings {
  border-color: var(--line-soft);
}

.user-badge {
  margin: 0 0.25rem;
  color: var(--cyan);
  font: 0.61rem var(--mono);
  letter-spacing: 0.05em;
}

.main-content {
  min-height: 70vh;
}

.archive-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(17rem, 0.8fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: end;
  padding: clamp(6rem, 14vw, 12rem) clamp(0rem, 3vw, 2rem) 5rem;
}

.archive-hero h1,
.reader-title {
  margin: 0;
  font-family: var(--font-editorial);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.062em;
}

.archive-hero h1 {
  max-width: 9em;
  margin-top: 1.2rem;
  font-size: clamp(4rem, 11vw, 9.5rem);
}

.archive-hero h1 span {
  display: block;
  margin-top: 0.08em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(var(--accent-rgb), 0.72);
}

.archive-intro {
  padding: 1.4rem 0 0 1.4rem;
  border-left: 1px solid var(--line-coral);
}

.archive-intro p {
  margin: 0;
  color: var(--text-soft);
  font-family: var(--font-editorial);
  font-size: clamp(1.15rem, 2.3vw, 1.55rem);
  line-height: 1.45;
}

.daily-quote {
  margin: 0;
}

.daily-quote cite {
  display: block;
  margin-top: 0.55rem;
  color: var(--cyan);
  font: 0.66rem var(--mono);
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive-intro .archive-stat {
  display: flex;
  gap: 1.2rem;
  margin-top: 1.4rem;
  color: var(--muted);
  font: 0.65rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive-controls {
  display: grid;
  grid-template-columns: minmax(15rem, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0 2rem;
  border-top: 1px solid var(--line);
}

.search-field {
  position: relative;
}

.search-field input {
  padding-left: 2.6rem;
}

.search-field::before {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 0.95rem;
  color: var(--cyan);
  content: "/";
  font: 700 0.9rem var(--mono);
  transform: translateY(-50%);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.filter-chip {
  min-height: 2.35rem;
  border-color: var(--line-soft);
  color: var(--muted);
  background: rgba(5, 15, 27, 0.45);
  font: 0.62rem var(--mono);
}

.filter-chip.active {
  border-color: var(--line-strong);
  color: var(--bg-deep);
  background: var(--cyan);
}

.archive-section {
  padding: 0 0 4rem;
}

.year-marker {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0 0;
  color: var(--muted);
  font: 0.64rem var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.year-marker::after {
  height: 1px;
  content: "";
  background: linear-gradient(90deg, var(--line), transparent);
}

.year-marker strong {
  color: var(--text);
  font-size: 0.82rem;
}

.post-list {
  display: grid;
}

.post-card {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) auto;
  gap: clamp(1rem, 4vw, 3.6rem);
  align-items: start;
  padding: clamp(2rem, 4vw, 3.2rem) 0;
  border-bottom: 1px solid var(--line-soft);
}

.post-card:hover .post-card__title {
  color: var(--cyan-soft);
}

.post-card__date {
  color: var(--muted);
  font: 0.66rem/1.55 var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.post-card__date strong {
  display: block;
  color: var(--text);
  font-family: var(--font);
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: -0.06em;
}

.post-card__category,
.category-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 1.7rem;
  padding: 0.25rem 0.48rem;
  border: 1px solid var(--line-coral);
  border-radius: 6px;
  color: var(--coral-soft);
  background: rgba(var(--secondary-rgb), 0.07);
  font: 0.58rem var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.draft-tag {
  border-color: rgba(154, 140, 255, 0.42);
  color: #c7bfff;
  background: rgba(154, 140, 255, 0.09);
}

.post-card__title {
  max-width: 21em;
  margin: 0.8rem 0 0.55rem;
  font-family: var(--font-editorial);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.04em;
  transition: color 160ms ease;
}

.post-card__title a {
  text-decoration: none;
}

.post-card__dek {
  max-width: 54rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.post-card__meta {
  display: grid;
  gap: 0.6rem;
  justify-items: end;
  color: var(--muted);
  font: 0.61rem var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-card__arrow {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  color: var(--cyan);
  font-size: 0.65rem;
  text-decoration: none;
  text-transform: uppercase;
}

.empty-state {
  margin: 2rem 0 5rem;
  padding: 3rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  text-align: center;
}

.reader {
  width: min(100%, 74rem);
  margin: 0 auto;
  padding: clamp(5rem, 12vw, 10rem) 0 5rem;
}

.reader-header {
  max-width: 67rem;
  margin-bottom: 4rem;
}

.reader-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font: 0.64rem var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.reader-title {
  font-size: clamp(3.6rem, 9vw, 8rem);
}

.reader-dek {
  max-width: 46rem;
  margin: 2rem 0 0;
  color: var(--text-soft);
  font-family: var(--font-editorial);
  font-size: clamp(1.2rem, 2.4vw, 1.65rem);
  line-height: 1.45;
}

.reader-rule {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  margin: 3rem 0;
  color: var(--muted);
  font: 0.62rem var(--mono);
  text-transform: uppercase;
}

.reader-rule::before {
  width: 3.2rem;
  height: 1px;
  content: "";
  background: var(--coral);
}

.reader-rule::after {
  height: 1px;
  content: "";
  background: var(--line-soft);
}

.article-body,
.editor-preview {
  color: var(--text-soft);
  font-family: var(--font-editorial);
  font-size: 1.08rem;
  line-height: 1.78;
}

.article-body {
  width: min(100%, 47rem);
  margin: 0 auto;
}

.article-body > :first-child,
.editor-preview > :first-child {
  margin-top: 0;
}

.article-body h1,
.article-body h2,
.article-body h3,
.editor-preview h1,
.editor-preview h2,
.editor-preview h3 {
  color: var(--text);
  font-family: var(--font);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.article-body h1,
.editor-preview h1 {
  margin: 3.5rem 0 1rem;
  font-size: 2.6rem;
}

.article-body h2,
.editor-preview h2 {
  margin: 3.5rem 0 1rem;
  font-size: 2rem;
}

.article-body h3,
.editor-preview h3 {
  margin: 2.6rem 0 0.8rem;
  font-size: 1.45rem;
}

.article-body p,
.editor-preview p {
  margin: 1.15rem 0;
}

.article-body a,
.editor-preview a {
  color: var(--cyan-soft);
  text-decoration-color: rgba(var(--accent-rgb), 0.42);
  text-underline-offset: 0.18em;
}

.article-body blockquote,
.editor-preview blockquote {
  margin: 2.5rem 0;
  padding: 0.4rem 0 0.4rem 1.4rem;
  border-left: 3px solid var(--coral);
  color: #ffe2d8;
  font-size: 1.35rem;
  line-height: 1.55;
}

.article-body code,
.editor-preview code {
  padding: 0.16rem 0.32rem;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  color: var(--cyan-soft);
  background: rgba(2, 9, 18, 0.58);
  font: 0.82em var(--mono);
}

.article-body pre,
.editor-preview pre {
  overflow: auto;
  margin: 1.8rem 0;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text-soft);
  background: rgba(3, 11, 21, 0.74);
  font: 0.78rem/1.65 var(--mono);
  white-space: pre-wrap;
}

.article-body pre code,
.editor-preview pre code {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
}

.article-image-frame {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 2.2rem auto;
  padding: 0.38rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(var(--bg-rgb), 0.72);
  box-shadow: var(--shadow-small);
}

.article-image-frame::before,
.article-image-frame::after {
  position: absolute;
  width: 1.35rem;
  height: 1.35rem;
  content: "";
  pointer-events: none;
}

.article-image-frame::before {
  top: -0.32rem;
  left: -0.32rem;
  border-top: 2px solid var(--cyan);
  border-left: 2px solid var(--cyan);
}

.article-image-frame::after {
  right: -0.32rem;
  bottom: -0.32rem;
  border-right: 2px solid var(--coral);
  border-bottom: 2px solid var(--coral);
}

.article-image-frame img {
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius-md) - 4px);
}

.article-body hr,
.editor-preview hr {
  width: 5rem;
  height: 1px;
  margin: 3rem auto;
  border: 0;
  background: var(--coral);
}

.footnote-ref {
  margin-left: 0.1rem;
  color: var(--coral);
  font: 700 0.72em var(--mono);
  text-decoration: none;
}

.footnotes {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.82rem;
}

.footnotes ol {
  padding-left: 1.3rem;
}

.chart-card {
  width: min(100vw - 2rem, 58rem);
  margin: 2.6rem 50%;
  padding: clamp(1rem, 3vw, 1.7rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 34%),
    rgba(6, 17, 30, 0.8);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.chart-card__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.chart-card__title {
  margin: 0;
  color: var(--text);
  font: 760 0.88rem var(--font);
}

.chart-card__type {
  color: var(--muted);
  font: 0.56rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chart-card canvas {
  display: block;
  width: 100%;
  height: 21rem;
}

.comments-section {
  width: min(100%, 47rem);
  margin: 5rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.comments-heading {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
}

.comments-heading h2 {
  margin: 0.5rem 0 0;
  font-family: var(--font-editorial);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 400;
  line-height: 1;
}

.comments-heading > span {
  color: var(--muted);
  font: 0.62rem var(--mono);
  text-transform: uppercase;
}

.comment-form {
  display: grid;
  gap: 0.7rem;
  margin: 1.5rem 0 2rem;
  padding: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: rgba(var(--bg-rgb), 0.52);
}

.comment-form .button {
  justify-self: end;
}

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

.comment-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.comment-card-mahnoor {
  border-color: var(--line-coral);
}

.comment-avatar {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--bg-deep);
  background: var(--cyan);
  font: 800 0.78rem var(--mono);
  place-items: center;
}

.comment-card-mahnoor .comment-avatar {
  border-color: var(--line-coral);
  background: var(--coral);
}

.comment-meta {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  color: var(--muted);
  font: 0.61rem var(--mono);
  text-transform: uppercase;
}

.comment-meta strong {
  color: var(--text);
}

.comment-card p {
  margin: 0.4rem 0 0;
  color: var(--text-soft);
  font-family: var(--font-editorial);
}

.comments-empty {
  margin: 0;
  padding: 1.5rem;
  border: 1px dashed var(--line-soft);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
}

.reader-actions {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 4rem;
}

.studio {
  padding: 5.5rem 0 4rem;
}

.studio-header {
  display: flex;
  gap: 2rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1.6rem;
}

.studio-header h1 {
  margin: 0.7rem 0 0;
  font-family: var(--font-editorial);
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.studio-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.editor-shell {
  display: grid;
  grid-template-columns: 3.15rem minmax(0, 1fr) minmax(0, 1fr);
  min-height: 45rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(5, 15, 27, 0.58);
  box-shadow: var(--shadow);
  transition: grid-template-columns var(--motion);
}

.editor-shell.writing-rail-open {
  grid-template-columns: 18rem minmax(0, 1fr) minmax(0, 1fr);
}

.editor-pane {
  min-width: 0;
}

.editor-writing-pane {
  border-right: 1px solid var(--line);
}

.writing-rail {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid var(--line-soft);
  background:
    linear-gradient(180deg, rgba(var(--secondary-rgb), 0.055), transparent 28%),
    var(--surface);
}

.writing-rail__toggle {
  position: absolute;
  z-index: 2;
  inset: 0 auto 0 0;
  display: flex;
  width: 3.15rem;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line-soft);
  color: var(--muted);
  background: rgba(var(--bg-rgb), 0.48);
  cursor: pointer;
}

.writing-rail__toggle span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font: 0.62rem var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.writing-rail__toggle strong {
  position: absolute;
  top: 0.8rem;
  display: grid;
  width: 1.4rem;
  height: 1.4rem;
  place-items: center;
  border: 1px solid var(--line-coral);
  border-radius: 50%;
  color: var(--coral-soft);
  font: 0.55rem var(--mono);
}

.writing-rail__toggle:hover,
.writing-rail__toggle:focus-visible {
  color: var(--cyan-soft);
  background: rgba(var(--accent-rgb), 0.08);
}

.writing-rail__panel {
  width: calc(100% - 3.15rem);
  height: 100%;
  margin-left: 3.15rem;
  overflow: auto;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-0.6rem);
  transition: opacity var(--motion), transform var(--motion);
}

.writing-rail-open .writing-rail__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.writing-rail__heading {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.7rem;
}

.writing-rail__heading h2 {
  margin: 0.2rem 0 0;
  font-family: var(--font-editorial);
  font-size: 1.45rem;
  font-weight: 400;
}

.editor-pane__header {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  min-height: 3.6rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}

.editor-pane__header h2 {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.editor-status {
  color: var(--muted);
  font: 0.59rem var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.editor-metrics {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.editor-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tool-button {
  min-height: 2rem;
  padding: 0.38rem 0.55rem;
  border-color: var(--line-soft);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(2, 9, 18, 0.32);
  font: 0.62rem var(--mono);
}

.editor-tools .tool-button:nth-child(odd):hover {
  border-color: var(--cyan);
  color: var(--cyan-soft);
  background: rgba(var(--accent-rgb), 0.14);
}

.editor-tools .tool-button:nth-child(even):hover {
  border-color: var(--coral);
  color: var(--coral-soft);
  background: rgba(var(--secondary-rgb), 0.14);
  box-shadow: 0 0 22px rgba(var(--secondary-rgb), 0.1);
}

.editor-tools .tool-button.active,
.editor-tools .tool-button[aria-pressed="true"] {
  border-color: var(--cyan);
  color: var(--bg-deep);
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.18);
}

.editor-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line-soft);
}

.field-wide {
  grid-column: 1 / -1;
}

.title-input {
  min-height: 3.5rem;
  padding: 0.4rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-family: var(--font-editorial);
  font-size: 2.1rem;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.title-input:focus {
  border-color: var(--cyan);
  box-shadow: none;
}

.visual-editor {
  min-height: 36rem;
  padding: clamp(1.5rem, 4vw, 3.2rem);
  color: var(--text-soft);
  background:
    linear-gradient(rgba(var(--accent-rgb), 0.025) 1px, transparent 1px),
    rgba(var(--bg-rgb), 0.24);
  background-size: 100% 2rem;
  font-family: var(--font-editorial);
  font-size: 1.05rem;
  line-height: 1.78;
  outline: none;
}

.visual-editor:empty::before {
  color: var(--muted-dark);
  content: attr(data-placeholder);
  pointer-events: none;
}

.visual-editor:focus {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.visual-editor.image-drag-active {
  background:
    linear-gradient(rgba(var(--accent-rgb), 0.07) 1px, transparent 1px),
    rgba(var(--accent-rgb), 0.08);
  background-size: 100% 2rem;
  box-shadow: inset 0 0 0 2px var(--cyan);
}

.visual-editor .article-image-frame {
  margin: 2rem auto;
}

.editor-drop-hint {
  margin: 0;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  background: var(--surface);
  font: 0.58rem var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.visual-editor h1,
.visual-editor h2,
.visual-editor h3 {
  color: var(--text);
  font-family: var(--font-editorial);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.visual-editor h1 {
  margin: 0 0 1rem;
  font-size: 2.35rem;
}

.visual-editor h2 {
  margin: 2.5rem 0 0.8rem;
  font-size: 1.75rem;
}

.visual-editor h3 {
  margin: 2rem 0 0.7rem;
  font-size: 1.3rem;
}

.visual-editor p {
  margin: 1rem 0;
}

.visual-editor blockquote {
  margin: 1.8rem 0;
  padding: 0.35rem 0 0.35rem 1.15rem;
  border-left: 3px solid var(--coral);
  color: var(--coral-soft);
  font-size: 1.18rem;
}

.visual-editor a {
  color: var(--cyan-soft);
}

.visual-editor .chart-card {
  width: 100%;
  margin: 2rem 0;
  transform: none;
  cursor: default;
}

.chart-editor-placeholder {
  display: grid;
  min-height: 10rem;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.05), transparent),
    var(--field);
  font: 0.68rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.editor-chart-block {
  position: relative;
}

.chart-editor-controls {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.chart-delete-button:hover {
  border-color: var(--danger);
  color: #ffd4d9;
  background: rgba(255, 130, 144, 0.1);
}

.chart-live-section {
  margin-top: 0.8rem;
}

.chart-live-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.chart-live-heading span {
  color: var(--muted-dark);
  font: 0.55rem var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chart-live-preview .chart-card {
  width: 100%;
  margin: 1rem 0 0;
  transform: none;
}

.preview-scroll {
  height: 100%;
  max-height: 56rem;
  overflow: auto;
  padding: clamp(1.5rem, 4vw, 3.5rem);
}

.editor-preview {
  max-width: 44rem;
  margin: 0 auto;
  font-size: 1rem;
}

.editor-preview .chart-card {
  width: 100%;
  margin-inline: 0;
  transform: none;
}

.studio-library {
  margin-top: 2.5rem;
}

.studio-library h2 {
  margin: 0 0 1rem;
  font-family: var(--font-editorial);
  font-size: 2rem;
  font-weight: 400;
}

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

.draft-card {
  padding: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: rgba(5, 15, 27, 0.56);
}

.draft-card h3 {
  margin: 0.65rem 0 0.45rem;
  font-size: 1rem;
}

.draft-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.draft-card__actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 1rem;
}

.tool-drawer {
  position: fixed;
  z-index: 80;
  inset: 0 0 0 auto;
  width: min(38rem, calc(100vw - 1rem));
  overflow: auto;
  padding: 0 1.1rem 2rem;
  border-left: 1px solid var(--line-coral);
  background: var(--surface-raised);
  box-shadow: -24px 0 65px rgba(0, 0, 0, 0.42), inset 1px 0 0 rgba(255, 255, 255, 0.035);
  transform: translateX(103%);
  transition: transform var(--motion);
}

.theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1rem;
}

.theme-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.7rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--field);
  text-align: left;
  cursor: pointer;
}

.theme-card:hover,
.theme-card.active {
  border-color: var(--line-strong);
  background: rgba(var(--accent-rgb), 0.08);
}

.theme-card strong {
  font-size: 0.8rem;
}

.theme-card small {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.66rem;
}

.theme-card em {
  grid-column: 2;
  justify-self: end;
  color: var(--muted-dark);
  font: 0.54rem var(--mono);
  text-transform: uppercase;
}

.theme-orb {
  grid-row: 1 / span 3;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  box-shadow: inset -0.35rem -0.25rem 0 rgba(0, 0, 0, 0.22), 0 0 18px currentColor;
}

.theme-orb-titan { color: #f6b85f; background: #d78942; }
.theme-orb-europa { color: #78d9ef; background: #78d9ef; }
.theme-orb-triton { color: #f5a8cf; background: #f5a8cf; }
.theme-orb-amalthea { color: #e75f4b; background: #b9322d; }

.settings-actions {
  display: grid;
  gap: 0.65rem;
}

.settings-actions h3,
.settings-actions .help-text {
  grid-column: 1 / -1;
}

.notes-heading {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.notes-heading h3 {
  margin-bottom: 0.25rem;
}

.note-form {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}

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

.note-card {
  padding: 1rem 1.05rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, rgba(var(--accent-rgb), 0.045), transparent 42%),
    var(--surface);
}

.note-card-mahnoor {
  border-color: var(--line-coral);
  background:
    linear-gradient(145deg, rgba(var(--secondary-rgb), 0.065), transparent 42%),
    var(--surface);
}

.note-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font: 0.61rem var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.note-card__meta strong {
  color: var(--cyan-soft);
}

.note-card__controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.note-delete {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.note-delete:hover,
.note-delete:focus-visible {
  color: var(--coral-soft);
}

.note-card-mahnoor .note-card__meta strong {
  color: var(--coral-soft);
}

.note-card p {
  margin: 0.8rem 0 0;
  color: var(--text-soft);
  font-family: var(--font-editorial);
  font-size: 1rem;
}

.notes-empty {
  margin: 0;
}

.drawer-loading {
  min-height: 20rem;
}

.tool-drawer.open {
  transform: translateX(0);
}

.drawer-scrim {
  position: fixed;
  z-index: 70;
  inset: 0;
  background: rgba(2, 7, 13, 0.58);
  backdrop-filter: blur(3px);
}

.drawer-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin: 0 -1.1rem 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line-soft);
  background:
    linear-gradient(105deg, rgba(var(--secondary-rgb), 0.09), transparent 54%),
    var(--surface-raised);
}

.drawer-header h2 {
  margin: 0.2rem 0 0;
  font-size: 1.1rem;
}

.drawer-content {
  display: grid;
  gap: 0.85rem;
}

.drawer-section {
  padding: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.drawer-section h3 {
  margin: 0 0 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(var(--secondary-rgb), 0.22);
  font-size: 0.85rem;
}

.drawer-form {
  display: grid;
  gap: 0.75rem;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.help-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.issue-list {
  display: grid;
  gap: 0.55rem;
}

.issue {
  padding: 0.75rem;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--coral);
  border-radius: 8px;
  background: rgba(5, 15, 27, 0.5);
}

.issue p {
  margin: 0;
  font-size: 0.76rem;
}

.issue-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.rewrite-result {
  min-height: 9rem;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  gap: 0.5rem;
  width: min(23rem, calc(100vw - 2rem));
}

.toast {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text-soft);
  background: rgba(9, 23, 38, 0.94);
  box-shadow: var(--shadow-small);
  font-size: 0.78rem;
  animation: toast-in 180ms ease both;
}

.toast.error {
  border-color: rgba(255, 130, 144, 0.48);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: center;
  margin-top: 2rem;
  padding: 2rem 0 0;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font: 0.64rem var(--mono);
  text-transform: uppercase;
}

.loading {
  display: grid;
  min-height: 60vh;
  place-items: center;
  color: var(--muted);
  font: 0.72rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
}

@keyframes orbit-shift {
  from {
    transform: rotate(-18deg) translateX(-2%) rotate(0deg);
  }
  to {
    transform: rotate(-18deg) translateX(2%) rotate(360deg);
  }
}

@keyframes fog-coral {
  from {
    opacity: 0.08;
    transform: translate3d(-2rem, 1rem, 0) scale(0.92);
  }
  to {
    opacity: 0.17;
    transform: translate3d(9rem, -5rem, 0) scale(1.16);
  }
}

@keyframes fog-cyan {
  from {
    opacity: 0.08;
    transform: translate3d(2rem, 2rem, 0) scale(1);
  }
  to {
    opacity: 0.16;
    transform: translate3d(-10rem, -7rem, 0) scale(1.18);
  }
}

@keyframes fog-coral-low {
  from {
    opacity: 0.055;
    transform: translate3d(-3rem, 2rem, 0) scale(0.9);
  }
  to {
    opacity: 0.13;
    transform: translate3d(12rem, -9rem, 0) scale(1.22);
  }
}

@keyframes app-reveal {
  from {
    opacity: 0;
    transform: translateY(1.2rem);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@media (max-width: 900px) {
  .archive-hero {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .archive-intro {
    max-width: 34rem;
  }

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

  .filter-row {
    justify-content: flex-start;
  }

  .post-card {
    grid-template-columns: 5rem 1fr;
  }

  .post-card__meta {
    display: none;
  }

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

  .editor-shell.writing-rail-open {
    grid-template-columns: 1fr;
  }

  .writing-rail {
    min-height: 3.15rem;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .writing-rail__toggle {
    inset: 0;
    width: 100%;
    height: 3.15rem;
    border-right: 0;
  }

  .writing-rail__toggle span {
    writing-mode: initial;
    transform: none;
  }

  .writing-rail__toggle strong {
    position: static;
    margin-left: 0.55rem;
  }

  .writing-rail__panel {
    display: none;
    width: 100%;
    margin: 3.15rem 0 0;
  }

  .writing-rail-open .writing-rail__panel {
    display: block;
  }

  .editor-writing-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

@media (max-width: 640px) {
  .login-view {
    padding: 0.6rem;
  }

  .login-card {
    padding: 1.6rem;
    border-radius: var(--radius-lg);
  }

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

  .login-card__footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    position: relative;
    top: 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header .brand-subtitle {
    display: none;
  }

  .site-nav {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .site-nav a,
  .nav-action {
    padding: 0.42rem 0.5rem;
    font-size: 0.64rem;
  }

  .archive-hero {
    padding-top: 5rem;
  }

  .archive-hero h1 {
    font-size: clamp(4rem, 21vw, 7rem);
  }

  .post-card {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .post-card__date strong {
    display: inline;
    margin-right: 0.4rem;
    font-size: 1rem;
  }

  .reader-title {
    font-size: clamp(3rem, 17vw, 5rem);
  }

  .studio-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .studio-header__actions {
    justify-content: flex-start;
  }

  .editor-meta,
  .two-column {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

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

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

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
