:root {
  --ink: #0a0a0b;
  --paper: #f3efe7;
  --muted: #c2beb6;
  --line: #29292c;
  --acid: #d8ff3e;
  --orange: #ff5c35;
  --panel: #141416;
  --nav: 76px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "DM Sans", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
button,
input,
textarea {
  font: inherit;
}
button {
  border: 1px solid #4a4a50;
  border-radius: 8px;
  background: #252529;
  color: var(--paper);
  cursor: pointer;
}
button:hover:not(:disabled) {
  border-color: #777780;
  background: #303035;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid var(--acid);
  outline-offset: 3px;
}
button:disabled {
  cursor: wait;
  opacity: 0.7;
}
a {
  color: inherit;
  text-decoration: none;
}
.topbar {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto 0;
  height: var(--nav);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 11, 0.9);
  backdrop-filter: blur(18px);
  transition: transform 0.28s ease;
  will-change: transform;
}
.header-hidden .topbar {
  transform: translateY(-102%);
}
.brand {
  font:
    italic 2rem/1 "Instrument Serif",
    serif;
  letter-spacing: -0.03em;
  min-width: 150px;
}
.brand i {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--acid);
  border-radius: 50%;
  margin-left: 4px;
}
.search {
  height: 44px;
  max-width: 430px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid #333338;
  border-radius: 24px;
  background: #18181b;
  color: #d3d0c9;
}
.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--paper);
  font-size: 0.95rem;
}
.search input::placeholder {
  color: #b8b5af;
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.primary {
  border: 0;
  cursor: pointer;
  transition: 0.2s ease;
}
.post-action svg,
.nav-item svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.primary {
  height: 42px;
  padding: 0 18px;
  border-radius: 24px;
  background: var(--acid);
  color: #111;
  font-weight: 700;
}
.primary:hover {
  filter: brightness(0.9);
  transform: translateY(-1px);
}
.layout {
  max-width: 1440px;
  margin: 0 auto;
  padding-top: var(--nav);
  display: grid;
  grid-template-columns: 220px minmax(0, 680px) 300px;
  gap: 42px;
  align-items: start;
}
.left,
.right {
  position: sticky;
  top: calc(var(--nav) + 26px);
  height: calc(100vh - var(--nav) - 40px);
  padding-top: 14px;
}
.left {
  border-right: 1px solid var(--line);
}
.nav-list {
  display: grid;
  gap: 6px;
  padding-right: 24px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #d3d0c9;
  font-weight: 500;
}
.nav-item:hover,
.nav-item.active {
  background: #19191b;
  color: var(--paper);
}
.nav-item.active {
  box-shadow: inset 3px 0 var(--acid);
}
main {
  min-width: 0;
  padding: 22px 0 80px;
}
.feed-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 2px 0 18px;
}
.feed-title h1 {
  margin: 0;
  font:
    400 2.8rem/1 "Instrument Serif",
    serif;
  letter-spacing: -0.03em;
}
.feed-title p {
  margin: 0 0 4px;
  color: #b8b5af;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.composer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.avatar {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #28282c;
  color: #f5f0e7;
  font:
    400 1.25rem "Instrument Serif",
    serif;
}
.composer button {
  flex: 1;
  height: 44px;
  text-align: left;
  border: 1px solid #353539;
  border-radius: 24px;
  background: #1b1b1e;
  color: #c2beb6;
  padding: 0 18px;
  cursor: pointer;
}
.composer .upload {
  flex: 0 0 auto;
  width: 44px;
  padding: 0;
  text-align: center;
  color: var(--acid);
}
.post {
  overflow: hidden;
  margin-bottom: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.post-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}
.post-meta {
  min-width: 0;
}
.post-meta strong {
  display: block;
  font-size: 0.96rem;
}
.post-meta span {
  display: block;
  color: #b8b5af;
  font-size: 0.78rem;
}
.more {
  margin-left: auto;
  border: 0;
  background: none;
  color: #777;
  letter-spacing: 0.15em;
  cursor: pointer;
}
.artwork {
  position: relative;
  background: #202023;
}
.artwork img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 760px;
  object-fit: cover;
  cursor: zoom-in;
}
.artwork img:focus-visible {
  outline: 3px solid var(--acid);
  outline-offset: -3px;
}
.artwork.landscape img {
  aspect-ratio: 3/2;
}
.artwork.portrait img {
  aspect-ratio: 4/5;
}
.artwork .tag {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 20px;
  background: rgba(10, 10, 11, 0.58);
  backdrop-filter: blur(10px);
  font-size: 0.74rem;
  pointer-events: none;
}
.post-body {
  padding: 16px 18px 14px;
}
.post-copy {
  margin: 0 0 10px;
  color: #d3d0c9;
}
.post-copy strong {
  color: var(--paper);
}
.credit {
  display: block;
  margin: 0 0 14px;
  color: #b8b5af;
  font-size: 0.75rem;
}
.credit a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.credit a:hover {
  color: var(--paper);
}
.stats {
  display: flex;
  justify-content: space-between;
  color: #b8b5af;
  font-size: 0.8rem;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}
.actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-top: 9px;
}
.post-action {
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: #d3d0c9;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.86rem;
}
.post-action:hover {
  background: #202024;
  color: #fff;
}
.post-action.liked {
  color: var(--acid);
}
.post-action.liked svg {
  fill: currentColor;
}
.event {
  margin-top: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(140deg, #171719, #111112);
}
.eyebrow {
  color: var(--orange);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.event h3 {
  margin: 8px 0 12px;
  font:
    400 1.7rem/1.05 "Instrument Serif",
    serif;
}
.event p {
  margin: 0;
  color: #c2beb6;
  font-size: 0.8rem;
}
.event button {
  width: 100%;
  margin-top: 16px;
}
.fine {
  position: absolute;
  bottom: 0;
  color: #aaa7a1;
  font-size: 0.72rem;
  line-height: 1.7;
}
.toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 24px);
  padding: 11px 16px;
  border-radius: 24px;
  background: var(--paper);
  color: #111;
  font-size: 0.84rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.modal {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
}
.modal.open {
  display: grid;
}
.modal-card {
  width: min(520px, 100%);
  padding: 24px;
  border: 1px solid #39393d;
  border-radius: 22px;
  background: #151517;
}
.modal h2 {
  margin: 0 0 8px;
  font:
    400 2rem "Instrument Serif",
    serif;
}
.modal p {
  color: #c2beb6;
}
.modal textarea {
  width: 100%;
  height: 120px;
  resize: vertical;
  padding: 14px;
  border: 1px solid #38383c;
  border-radius: 14px;
  background: #0d0d0e;
  color: #fff;
  outline: 0;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.secondary {
  height: 42px;
  padding: 0 16px;
  border: 1px solid #39393d;
  border-radius: 22px;
  background: transparent;
  color: #aaa;
  cursor: pointer;
}
.saved-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 11px;
  background: #27272a;
  color: var(--acid);
  font-size: 0.72rem;
}
.empty {
  display: none;
  padding: 52px 24px;
  text-align: center;
  border: 1px dashed #333337;
  border-radius: 18px;
  color: #b8b5af;
}
.empty.show {
  display: block;
}
.empty h2 {
  margin: 0 0 6px;
  color: var(--paper);
  font:
    400 1.8rem "Instrument Serif",
    serif;
}
.sentinel {
  height: 44px;
  display: grid;
  place-items: center;
  color: #aaa7a1;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sentinel.loading::after {
  content: "Loading more art…";
}
.modal-card {
  max-height: calc(100vh - 36px);
  overflow: auto;
}
.field {
  display: grid;
  gap: 6px;
  margin: 13px 0;
  color: #d3d0c9;
  font-size: 0.8rem;
}
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #38383c;
  border-radius: 12px;
  background: #0d0d0e;
  color: #fff;
  outline: 0;
}
.field textarea {
  height: 90px;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  border-color: #666;
}
.file-drop {
  padding: 16px !important;
  border-style: dashed !important;
  color: #aaa;
}
.lightbox {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: none;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 28px;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(16px);
}
.lightbox.open {
  display: grid;
}
.lightbox-stage {
  min-height: 0;
  display: grid;
  place-items: center;
}
.lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 116px);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.lightbox-close {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(15, 15, 16, 0.72);
  color: #fff;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover,
.lightbox-close:focus-visible {
  border-color: var(--acid);
  color: var(--acid);
  outline: 0;
}
.lightbox-caption {
  padding-top: 16px;
  text-align: center;
}
.lightbox-caption strong {
  display: block;
  font:
    400 1.5rem "Instrument Serif",
    serif;
}
.lightbox-caption span {
  display: block;
  margin-top: 3px;
  color: #8e8b85;
  font-size: 0.82rem;
}
@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 82px minmax(0, 680px) 260px;
    gap: 28px;
  }
  .nav-item span {
    display: none;
  }
  .left {
    padding-right: 14px;
  }
  .nav-list {
    padding-right: 14px;
  }
  .nav-item {
    justify-content: center;
  }
  .brand {
    min-width: auto;
  }
  .search {
    max-width: 360px;
  }
}
@media (max-width: 900px) {
  .right {
    display: none;
  }
  .layout {
    grid-template-columns: 82px minmax(0, 680px);
    max-width: 810px;
  }
}
@media (max-width: 680px) {
  :root {
    --nav: 64px;
  }
  .topbar {
    padding: 0 15px;
    gap: 12px;
  }
  .brand {
    font-size: 1.65rem;
  }
  .search {
    display: none;
  }
  .primary {
    margin-left: auto;
    height: 38px;
    padding: 0 14px;
  }
  .layout {
    display: block;
  }
  .left {
    position: fixed;
    z-index: 25;
    inset: auto 0 0 0;
    height: 62px;
    border: 0;
    border-top: 1px solid var(--line);
    background: rgba(10, 10, 11, 0.96);
    padding: 6px 8px;
  }
  .nav-list {
    height: 100%;
    display: flex;
    justify-content: space-around;
    padding: 0;
  }
  .nav-item {
    padding: 10px 16px;
  }
  main {
    padding: 18px 12px 90px;
  }
  .feed-title h1 {
    font-size: 2.3rem;
  }
  .feed-title p {
    display: none;
  }
  .post {
    border-radius: 16px;
  }
  .artwork img {
    max-height: none;
  }
  .composer {
    padding: 12px;
  }
  .composer .avatar {
    display: none;
  }
  .fine {
    display: none;
  }
  .lightbox {
    padding: 16px;
  }
  .lightbox img {
    max-height: calc(100vh - 104px);
  }
  .lightbox-close {
    top: 10px;
    right: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

[hidden] {
  display: none !important;
}
.ops {
  max-width: 1100px;
  margin: 3rem auto;
  padding: 1.5rem;
  color: var(--paper);
}
.ops > section {
  margin: 2rem 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.ops h1,
.ops h2 {
  color: var(--paper);
}
.ops #status {
  min-height: 1.5rem;
  color: #d3d0c9;
}
.ops button {
  margin: 0.3rem 0;
  padding: 0.6rem 0.9rem;
  font-weight: 600;
}
.ops form {
  display: grid;
  gap: 0.75rem;
  max-width: 680px;
}
.ops label {
  display: grid;
  gap: 0.25rem;
  color: var(--paper);
  font-weight: 600;
}
.ops label span {
  color: #b8b5af;
  font-size: 0.85rem;
  font-weight: 400;
}
.ops textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  border: 1px solid #4a4a50;
  border-radius: 8px;
  background: #0d0d0e;
  color: var(--paper);
  resize: vertical;
}
.ops textarea::placeholder {
  color: #aaa7a1;
}
.ops pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #d3d0c9;
}
a.primary {
  color: inherit;
  text-decoration: none;
}

body.lightbox-open,
body.modal-open {
  overflow: hidden;
}

/* Refined gallery and portal system */
:root {
  color-scheme: dark;
  --ink: #080b10;
  --paper: #f5f4ee;
  --muted: #a9b1bc;
  --line: #29333f;
  --acid: #cef36b;
  --orange: #ff856a;
  --panel: #10161e;
  --panel-raised: #151d27;
  --focus: #dcff82;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

html {
  scroll-padding-top: calc(var(--nav) + 24px);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(
      circle at 14% -8%,
      rgba(122, 154, 203, 0.13),
      transparent 34rem
    ),
    radial-gradient(
      circle at 92% 12%,
      rgba(206, 243, 107, 0.055),
      transparent 26rem
    ),
    var(--ink);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--acid);
  color: #0b0e12;
}

button,
input,
textarea,
select {
  min-height: 44px;
}

button {
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar,
.page-topbar {
  border-color: rgba(122, 137, 154, 0.3);
  background: rgba(8, 11, 16, 0.82);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(22px) saturate(140%);
}

.topbar {
  gap: clamp(16px, 2.4vw, 34px);
  padding-inline: clamp(18px, 3vw, 42px);
}

.brand {
  color: #fff;
  font-size: 2.08rem;
  font-style: normal;
  letter-spacing: -0.045em;
}

.brand i {
  width: 9px;
  height: 9px;
  margin-left: 5px;
  box-shadow: 0 0 18px rgba(206, 243, 107, 0.45);
}

.search {
  border-color: #303b48;
  background: rgba(18, 25, 34, 0.9);
  color: var(--muted);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.search:focus-within {
  border-color: #7f9552;
  background: #121a23;
  box-shadow: 0 0 0 4px rgba(206, 243, 107, 0.08);
}

.search input::placeholder {
  color: #8994a1;
}

.top-actions > a:not(.primary),
.top-actions > button:not(.primary),
.back-link {
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #c8ced6;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.top-actions > a:hover,
.top-actions > button:hover,
.back-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dcff82, #bfe657);
  box-shadow: 0 8px 24px rgba(168, 202, 71, 0.13);
  color: #10150a;
  white-space: nowrap;
}

.primary:hover:not(:disabled) {
  filter: none;
  background: linear-gradient(135deg, #e5ff9c, #cef36b);
  box-shadow: 0 10px 28px rgba(168, 202, 71, 0.2);
}

.layout {
  width: min(100% - 40px, 1480px);
  grid-template-columns: 210px minmax(0, 1000px);
  justify-content: center;
  gap: clamp(26px, 3vw, 50px);
}

.left,
.right {
  top: calc(var(--nav) + 24px);
}

.left {
  border-color: rgba(122, 137, 154, 0.22);
}

.nav-list {
  gap: 8px;
}

.nav-item {
  min-height: 48px;
  border: 1px solid transparent;
  color: #adb6c1;
}

.nav-item:hover {
  border-color: rgba(122, 137, 154, 0.18);
  background: rgba(255, 255, 255, 0.045);
}

.nav-item.active {
  border-color: rgba(206, 243, 107, 0.14);
  background: linear-gradient(
    90deg,
    rgba(206, 243, 107, 0.105),
    rgba(206, 243, 107, 0.025)
  );
  box-shadow: inset 3px 0 var(--acid);
  color: #fff;
}

main {
  padding-top: 30px;
}

.feed-title {
  gap: 20px;
  margin-bottom: 24px;
}

.feed-title h1 {
  margin-top: 5px;
  font-size: clamp(2.4rem, 5vw, 3.45rem);
  line-height: 0.98;
}

.feed-title p {
  max-width: 220px;
  color: #929da9;
  line-height: 1.55;
  text-align: right;
}

.eyebrow {
  color: var(--orange);
  letter-spacing: 0.16em;
}

.composer {
  padding: 14px;
  margin-bottom: 22px;
  border-color: #2c3744;
  background: linear-gradient(
    120deg,
    rgba(21, 29, 39, 0.96),
    rgba(15, 21, 29, 0.96)
  );
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
}

.composer button {
  border-color: #364351;
  background: #121922;
  color: #b9c2cc;
}

.composer button:hover:not(:disabled) {
  border-color: #536476;
  background: #17212c;
  color: #fff;
}

.composer .upload {
  color: var(--acid);
  font-size: 1.25rem;
}

.post {
  margin-bottom: 26px;
  border-color: #293541;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #121922, #0f151c);
  box-shadow: var(--shadow);
}

.post-head {
  padding: 17px 20px;
}

.avatar {
  border: 1px solid #394654;
  background: linear-gradient(145deg, #2c3947, #1a232e);
}

.post-meta span,
.credit,
.stats {
  color: #9ca6b1;
}

.artwork {
  background:
    linear-gradient(45deg, #161d25 25%, transparent 25%),
    linear-gradient(-45deg, #161d25 25%, transparent 25%), #11171e;
  background-size: 24px 24px;
}

.artwork img {
  object-fit: contain;
}

.artwork .tag {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(5, 8, 12, 0.72);
}

.post-body {
  padding: 18px 20px 16px;
}

.post-copy {
  color: #d5dae0;
  line-height: 1.6;
}

.actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  padding-top: 11px;
}

.post-action {
  min-width: 0;
  height: 42px;
  padding-inline: 8px;
  color: #b8c0ca;
}

.post-action:hover:not(:disabled) {
  background: #1b2530;
}

.event {
  padding: 22px;
  border-color: #30404d;
  border-radius: var(--radius-md);
  background:
    radial-gradient(
      circle at 100% 0,
      rgba(206, 243, 107, 0.1),
      transparent 14rem
    ),
    linear-gradient(145deg, #151e28, #10161d);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
}

.event h3 {
  font-size: 2rem;
}

.event p {
  color: #aeb8c3;
  line-height: 1.65;
}

.fine a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.toast {
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
}

.modal {
  background: rgba(2, 5, 9, 0.78);
}

.modal-card {
  padding: clamp(22px, 4vw, 30px);
  border-color: #344251;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #151e28, #0f151d);
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.55);
}

.modal p {
  color: #aeb7c2;
  line-height: 1.55;
}

.field input,
.field textarea,
.ops input,
.ops textarea,
.ops select {
  border: 1px solid #374554;
  border-radius: var(--radius-sm);
  background: #0b1118;
  color: var(--paper);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.field input:focus,
.field textarea:focus,
.ops input:focus,
.ops textarea:focus,
.ops select:focus {
  border-color: #819b4f;
  box-shadow: 0 0 0 4px rgba(206, 243, 107, 0.08);
}

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: flex-start;
  gap: 10px !important;
  color: #c5ccd4;
  font-weight: 500 !important;
  line-height: 1.45;
}

.check-row input {
  flex: 0 0 auto;
  width: 18px !important;
  min-height: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--acid);
}

.empty {
  padding: 64px 26px;
  border-color: #354252;
  background: rgba(16, 22, 30, 0.48);
}

.empty h2 {
  font-size: 2rem;
}

.sentinel.loading::after {
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.42;
  }
}

/* Account and administration portal */
.portal-page {
  padding-top: 72px;
}

.page-topbar {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: clamp(20px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
}

.page-shell.ops {
  width: min(100% - 36px, 1160px);
  max-width: none;
  margin: 0 auto;
  padding: clamp(38px, 6vw, 72px) 0 90px;
}

.page-heading {
  max-width: 740px;
  margin-bottom: 32px;
}

.page-heading h1 {
  margin: 7px 0 10px;
  font:
    400 clamp(3rem, 7vw, 5rem)/0.95 "Instrument Serif",
    serif;
  letter-spacing: -0.045em;
}

.page-heading p {
  max-width: 650px;
  margin: 0;
  color: #aeb7c2;
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.65;
}

.status-banner {
  min-height: 0 !important;
  margin: 0 0 20px;
  padding: 12px 15px;
  border: 1px solid #33404d;
  border-radius: var(--radius-sm);
  background: rgba(18, 25, 34, 0.72);
}

.status-banner:empty {
  display: none;
}

.status-banner[data-tone="success"] {
  border-color: rgba(151, 194, 81, 0.45);
  color: #dfff9b !important;
}

.status-banner[data-tone="error"] {
  border-color: rgba(255, 133, 106, 0.5);
  color: #ffb09f !important;
}

.ops > section,
.account-grid > section {
  margin: 0 0 22px;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid #2d3946;
  border-radius: var(--radius-md);
  background: linear-gradient(
    145deg,
    rgba(19, 27, 36, 0.94),
    rgba(14, 20, 27, 0.94)
  );
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.16);
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-heading h2,
.ops section > h2 {
  margin: 5px 0 0;
  font:
    400 1.9rem/1.1 "Instrument Serif",
    serif;
  letter-spacing: -0.02em;
}

.inline-form {
  display: grid !important;
  grid-template-columns: minmax(160px, 1fr) auto;
  align-items: end;
  max-width: 760px !important;
}

.inline-form label {
  grid-column: 1 / -1;
}

.item-list {
  display: grid;
  gap: 10px;
}

.list-card {
  overflow: hidden;
  border: 1px solid #303d4a;
  border-radius: var(--radius-sm);
  background: #0d141c;
}

.list-item {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid #303d4a;
  border-radius: var(--radius-sm);
  background: #0d141c;
  color: var(--paper);
  text-align: left;
}

.list-card > .list-item {
  border: 0;
  border-radius: 0;
}

button.list-item:hover:not(:disabled) {
  background: #17222d;
}

.list-item strong,
.list-item span {
  display: block;
}

.list-item > span,
.item-meta {
  color: #98a4b0;
  font-size: 0.82rem;
}

.list-item-row .secondary {
  flex: 0 0 auto;
}

.collection-items {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 4px 18px 16px 38px;
  color: #aeb7c2;
}

.list-empty {
  margin: 0;
  padding: 22px;
  border: 1px dashed #344250;
  border-radius: var(--radius-sm);
  color: #9ca7b2;
  line-height: 1.55;
}

.secondary.danger {
  color: #ffad9b;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 22px;
}

.toolbar #updated {
  margin: 0;
}

.ops form {
  max-width: 760px;
}

.ops select,
.ops input,
.ops textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
}

.ops textarea {
  min-height: 110px;
  resize: vertical;
}

.ops input::placeholder,
.ops textarea::placeholder {
  color: #818d99;
}

.ops button {
  min-height: 42px;
}

.ops pre {
  margin: 0;
  padding: 14px;
  border: 1px solid #2f3b48;
  border-radius: var(--radius-sm);
  background: #0b1118;
}

.analytics-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 20px 0;
  padding: 18px 20px;
  border: 1px solid #3c4956;
  border-radius: var(--radius-sm);
  background: #0d141c;
}

.analytics-total span {
  color: #aeb7c2;
}

.analytics-total strong {
  font:
    400 2.25rem/1 "Instrument Serif",
    serif;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.analytics-grid article {
  min-width: 0;
}

.analytics-grid h3 {
  margin: 0 0 10px;
}

.analytics-grid .table-scroll {
  max-height: 360px;
  overflow: auto;
}

.analytics-grid table {
  min-width: 0;
}

.run-card {
  width: 100%;
  display: block;
  margin: 10px 0;
  padding: 16px;
  border: 1px solid #34414e;
  border-radius: var(--radius-sm);
  background: #0e151d;
  color: var(--paper);
  text-align: left;
  white-space: pre-line;
}

.run-card:hover:not(:disabled) {
  border-color: #526272;
  background: #151f29;
}

.run-card[aria-pressed="true"] {
  border-color: #a7c556;
  box-shadow: 0 0 0 3px rgba(206, 243, 107, 0.08);
}

.table-scroll {
  border: 1px solid #303c49;
  border-radius: var(--radius-sm);
}

.ops table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ops th {
  color: #dce1e6;
  background: #151e27;
}

.ops td,
.ops th {
  padding: 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  border-bottom-color: #2c3743 !important;
}

#run-warning,
#action-status {
  white-space: pre-line;
}

#updated {
  color: #96a1ad;
  font-size: 0.85rem;
}

@media (max-width: 1100px) {
  .layout {
    width: min(100% - 28px, 1030px);
    grid-template-columns: 78px minmax(0, 900px);
    gap: 26px;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 78px minmax(0, 700px);
  }

  .top-actions > a:not(.primary),
  .top-actions > button:not(.primary) {
    display: none;
  }
}

@media (max-width: 680px) {
  .topbar {
    padding-inline: 14px;
  }

  .top-actions {
    gap: 7px;
  }

  .top-actions .primary {
    padding-inline: 13px;
  }

  .layout {
    width: 100%;
  }

  .left {
    background: rgba(8, 11, 16, 0.92);
    backdrop-filter: blur(20px);
  }

  .nav-item {
    min-width: 52px;
    padding-inline: 14px;
  }

  main {
    padding-inline: 14px;
  }

  .feed-title {
    align-items: flex-start;
  }

  .composer .avatar {
    display: grid;
  }

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

  .post-action {
    justify-content: flex-start;
    padding-inline: 14px;
  }

  .page-topbar {
    padding-inline: 18px;
  }

  .page-shell.ops {
    width: min(100% - 24px, 1160px);
    padding-top: 34px;
  }

  .account-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

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

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

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

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

@media (max-width: 420px) {
  .topbar .brand {
    font-size: 1.5rem;
  }

  .topbar .brand i {
    width: 7px;
    height: 7px;
  }

  .top-actions .primary {
    font-size: 0.82rem;
  }

  .composer {
    gap: 8px;
  }

  .composer button:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sentinel.loading::after {
    animation: none;
  }
}

/* Feed preferences */
#feed-preferences {
  margin: 0 0 24px;
  padding: 18px;
  border: 1px solid #343439;
  border-radius: 16px;
  background: #141416;
}
#feed-preferences summary {
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
}
#feed-preferences summary span {
  display: block;
  margin-top: 6px;
  color: #aaaab2;
  font-size: 12px;
  font-weight: 400;
}
#feed-preferences p {
  color: #b4b4bd;
  font-size: 13px;
  line-height: 1.6;
  margin: 14px 0;
}
#feed-preferences fieldset {
  border: 0;
  padding: 0;
  margin: 20px 0;
  min-width: 0;
}
#feed-preferences legend {
  font-size: 13px;
  font-weight: 600;
}
#feed-preferences .filter-help {
  font-size: 12px;
}
.filter-options,
.preference-actions,
#filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.filter-choice {
  cursor: pointer;
  position: relative;
}
.filter-choice input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.filter-choice span,
#filter-chips button,
.preference-actions button {
  display: block;
  border: 1px solid #44444d;
  border-radius: 20px;
  padding: 10px 13px;
  font-size: 12px;
  background: #202024;
  color: #dddde3;
}
.filter-choice input:checked + span {
  border-color: #bba6eb;
  background: #423253;
  color: #fff;
}
.filter-choice input:focus-visible + span,
.era-stop:has(input:focus-visible) {
  outline: 2px solid #cbb2ff;
  outline-offset: 3px;
}
.era-timeline {
  display: flex;
  overflow-x: auto;
  padding: 16px 4px 12px;
}
.era-stop {
  flex: 1 0 72px;
  position: relative;
  cursor: pointer;
  text-align: center;
  font-size: 11px;
  padding-top: 4px;
}
.era-stop::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 0;
  width: 100%;
  height: 2px;
  background: #50505a;
}
.era-stop input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.era-dot {
  display: block;
  position: relative;
  pointer-events: none;
  width: 20px;
  height: 20px;
  border: 2px solid #686873;
  background: #202024;
  border-radius: 50%;
  margin: 0 auto 12px;
}
.era-stop input:checked ~ .era-dot {
  background: #c6a5f0;
  border-color: #e7d8fa;
}
.era-stop input:checked ~ span {
  color: #e7d8fa;
  font-weight: 600;
}
.era-stop small {
  display: block;
  color: #aaaab2;
  margin-top: 4px;
  font-size: 10px;
}
#preferences-status:empty,
#filter-chips:empty,
.art-tags:empty {
  display: none;
}
.art-tags {
  font-size: 12px;
  color: #bba6d3;
  margin: 10px 0;
}
@media (max-width: 600px) {
  .era-timeline {
    flex-direction: column;
    overflow: visible;
  }
  .era-stop {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    text-align: left;
    padding: 10px 0;
    gap: 14px;
    min-height: 52px;
  }
  .era-stop::before {
    top: 0;
    left: 9px;
    width: 2px;
    height: 100%;
  }
  .era-dot {
    margin: 0;
    flex-shrink: 0;
  }
  .era-stop small {
    display: inline;
    margin-left: 8px;
  }
  .preference-actions button {
    min-height: 44px;
  }
}

@media (max-width: 680px) {
  :root {
    --nav: 120px;
  }
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 50px 44px;
    gap: 8px;
    padding: 8px 14px;
  }
  .topbar .brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  .topbar .top-actions {
    grid-column: 2;
    grid-row: 1;
  }
  .topbar .search {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: none;
  }
  .left {
    top: auto;
    bottom: 0;
  }
}


/* Operations portal workspace */
.operations-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.operations-nav button { background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 999px; padding: 8px 13px; }
.operations-nav button[aria-selected="true"] { background: var(--panel); color: var(--text); border-color: var(--line); }
.operations-nav button span { display: inline-block; margin-left: 4px; color: var(--accent); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.operations-panel-is-hidden { display: none !important; }
.operations-overview { display: grid; gap: 18px; }
.operations-health { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.operations-health article, .operations-next { border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 16px; }
.operations-health span, .operations-health small { display: block; color: var(--muted); font-size: 12px; }
.operations-health strong { display: block; margin: 5px 0 2px; font-size: 25px; line-height: 1.1; }
.operations-next { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.operations-next h2 { margin: 0; font-size: 18px; }
.operations-next p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.operations-next-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.operations-scope { display: block; margin-bottom: 7px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.operations-empty { max-width: 680px; }
.operations-empty a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) { .operations-health { grid-template-columns: repeat(2, minmax(0, 1fr)); } .operations-next { align-items: flex-start; flex-direction: column; } }
@media (max-width: 440px) { .operations-health { grid-template-columns: 1fr; } }
