:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #fff;
  --ink: #1d211f;
  --muted: #626762;
  --line: #dedfda;
  --soft: #ecede9;
  --active: #dce7df;
  --green: #285641;
  --red: #b62640;
  --radius: 18px;
  font:
    16px/1.48 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
.button {
  cursor: pointer;
  touch-action: manipulation;
  text-decoration: none;
}
button {
  border: 0;
  background: transparent;
}
a {
  color: inherit;
  text-underline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #3777ac;
  outline-offset: 3px;
}
button:disabled,
.button[aria-disabled='true'] {
  opacity: 0.52;
  cursor: wait;
}
img {
  display: block;
  max-width: 100%;
}
h1,
h2,
h3,
p,
figure {
  margin: 0;
}
h1,
h2,
h3 {
  line-height: 1.13;
  text-wrap: pretty;
}
h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.06em;
}
h2 {
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}
h3 {
  font-size: 1.15rem;
  letter-spacing: -0.025em;
}
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  padding: 0.7rem 0.85rem;
}
textarea {
  resize: vertical;
  min-height: 6rem;
}
input::placeholder,
textarea::placeholder {
  color: #787d78;
}
.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke-width: 1.7;
}
.button,
.nav-item,
.icon-button,
.plain,
.chip,
.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}
.button {
  min-height: 43px;
  padding: 0.57rem 0.95rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  border-radius: 11px;
  border: 1px solid transparent;
  background: var(--soft);
}
.button:hover {
  background: #e2e4df;
}
.primary {
  background: var(--ink);
  color: white;
}
.primary:hover {
  background: #373d38;
}
.secondary {
  background: var(--surface);
  border-color: var(--line);
}
.secondary:hover {
  background: var(--bg);
}
.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--muted);
}
.icon-button:hover,
.plain:hover {
  color: var(--ink);
  background: var(--soft);
}
.plain {
  font-size: 0.92rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  min-height: 38px;
  font-weight: 550;
}
.small {
  font-size: 0.87rem;
}
.muted,
.subtitle {
  color: var(--muted);
}
.subtitle {
  max-width: 60ch;
}
.metadata {
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.4;
}
.row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.between {
  justify-content: space-between;
}
.vstack {
  display: grid;
  gap: 1rem;
}
.error {
  color: #9e1d35;
  white-space: pre-line;
}
.link {
  color: var(--green);
  font-weight: 550;
}
.icon-link {
  justify-content: flex-start;
}
.icon-link .icon {
  width: 16px;
  height: 16px;
}
.loading-screen,
.initial-error {
  max-width: 600px;
  margin: 20vh auto;
  padding: 2rem;
  color: var(--muted);
}
.initial-error .button {
  margin-top: 1rem;
}
.spinner {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: rotate 0.8s linear infinite;
  display: inline-block;
}
@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}
/* Private entrance */
.entrance {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: #fafaf8;
}
.entrance-header {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 5vw, 5.75rem);
  border-bottom: 1px solid var(--line);
}
.atlas-logo {
  width: 100px;
  height: auto;
}
.private-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  color: var(--muted);
}
.private-label .icon {
  width: 16px;
  height: 16px;
}
.entrance-grid {
  display: grid;
  grid-template-columns: minmax(270px, 0.82fr) minmax(350px, 1.18fr);
  gap: clamp(2.5rem, 7vw, 7.5rem);
  width: min(1200px, 100%);
  margin: auto;
  padding: clamp(2.5rem, 8vh, 6rem) clamp(1.5rem, 5vw, 4.5rem);
  align-items: center;
}
.entrance-copy {
  padding: 1.75rem 0;
}
.entrance-copy h1 {
  font-size: clamp(4.5rem, 8.5vw, 7.1rem);
  line-height: 0.98;
  font-weight: 660;
  letter-spacing: -0.09em;
  margin-bottom: 1.15rem;
}
.entrance-copy h1::after {
  content: '.';
  color: #ce304c;
}
.entrance-copy .subtitle {
  font-size: 1.15rem;
  max-width: 25ch;
  line-height: 1.45;
}
.entrance-copy .auth-action {
  margin-top: 1.9rem;
  min-height: 48px;
  padding: 0.75rem 1.15rem;
}
.auth-feedback {
  max-width: 35ch;
  margin-top: 0.7rem;
  font-size: 0.9rem;
}
.auth-art {
  min-width: 0;
}
.plate {
  overflow: hidden;
  padding: clamp(0.65rem, 1.7vw, 1.4rem);
  background: #e2e4dd;
  box-shadow: 0 12px 30px -20px #1116;
}
.plate img {
  width: 100%;
  aspect-ratio: 1.52;
  object-fit: cover;
  object-position: center;
  background: #c9c7bc;
}
.auth-art figcaption {
  padding: 1rem 0.1rem;
  display: grid;
  gap: 0.35rem;
}
.auth-art figcaption > a {
  display: inline;
  font-size: 1rem;
  font-weight: 550;
  line-height: 1.35;
  text-decoration: none;
}
.auth-art figcaption > a:hover {
  text-decoration: underline;
}
.auth-art .metadata {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.auth-art .metadata::before {
  content: '';
  width: 1.3rem;
  height: 1px;
  background: var(--muted);
}
/* Workspace */
.workspace {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100svh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  background: #eeefec;
  border-right: 1px solid #dfe1dc;
  display: flex;
  flex-direction: column;
  padding: 2.1rem 0.9rem 1.3rem;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  font-weight: 680;
  letter-spacing: -0.07em;
  font-size: 1.9rem;
  line-height: 1;
}
.wordmark img {
  width: 36px;
  height: 36px;
}
.sidebar .wordmark {
  margin: 0 0.7rem 2.7rem;
}
.nav-list {
  display: grid;
  gap: 0.34rem;
}
.nav-item {
  width: 100%;
  min-height: 44px;
  text-align: left;
  justify-content: flex-start;
  font-weight: 550;
  font-size: 0.97rem;
  border-radius: 11px;
  padding: 0.58rem 0.8rem;
  color: #535d54;
}
.nav-item:hover {
  background: #e5e8e2;
}
.nav-item.active {
  color: var(--green);
  background: var(--active);
}
.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 0.9rem 0 0;
}
.mobile-head,
.mobile-nav {
  display: none;
}
.pane {
  min-width: 0;
  max-width: 1170px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(2rem, 5.5vw, 5rem) clamp(1.5rem, 5vw, 4.7rem) 4rem;
}
.pane.editor-pane {
  max-width: 960px;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}
.page-head .subtitle {
  margin-top: 0.55rem;
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  justify-content: space-between;
  margin: 1.7rem 0 0.85rem;
}
.paper,
.record,
.empty,
.text-section {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
}
.record {
  padding: 1.35rem 1.5rem;
}
.record + .record {
  margin-top: 0.75rem;
}
.record-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
}
.record h2,
.record h3 {
  margin: 0.45rem 0 0.6rem;
}
.record .summary {
  line-height: 1.55;
  max-width: 73ch;
}
.record footer {
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.connections {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding-top: 0.45rem;
}
.connections summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  list-style: none;
  padding: 0.45rem 0;
  color: var(--green);
  font-weight: 600;
  font-size: 0.94rem;
  cursor: pointer;
}
.connections summary::-webkit-details-marker {
  display: none;
}
.connections summary .chevron {
  margin-left: auto;
  transition: transform 0.15s;
}
.connections[open] .chevron {
  transform: rotate(180deg);
}
.connection {
  padding: 0.75rem 0.1rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}
.connection p {
  margin: 0.25rem 0;
}
.connection .add {
  flex-shrink: 0;
}
.connection .icon-link {
  font-size: 0.83rem;
}
.connection-list {
  display: grid;
  gap: 0.5rem;
}
.connection-tag {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 9px;
}
.connection-tag p {
  font-size: 0.91rem;
  margin: 0.2rem 0;
}
.connection-tag .icon-button {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}
.empty {
  padding: clamp(1.6rem, 6vw, 4rem);
  text-align: center;
  display: grid;
  gap: 0.65rem;
  justify-items: center;
}
.empty > .icon {
  width: 30px;
  height: 30px;
  color: var(--green);
  margin-bottom: 0.2rem;
}
.empty p {
  color: var(--muted);
  max-width: 46ch;
}
.empty > .button {
  margin-top: 0.35rem;
}
.idea-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}
.idea-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  padding: 1.2rem 1.3rem;
  gap: 0.6rem;
  min-height: 150px;
  overflow-wrap: anywhere;
  transition: border-color 0.15s;
}
.idea-card:hover {
  border-color: #9ca99e;
}
.idea-card h2 {
  font-size: 1.22rem;
  line-height: 1.23;
}
.idea-card p {
  color: var(--muted);
  font-size: 0.94rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.idea-card .metadata {
  margin-top: auto;
}
.badge {
  width: fit-content;
  font-size: 0.77rem;
  line-height: 1.4;
  padding: 0.18rem 0.52rem;
  border-radius: 6px;
  color: #425945;
  background: #edf2eb;
  font-weight: 620;
}
.search-box {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  gap: 0.65rem;
  padding: 0 0.8rem;
}
.search-box input {
  border: 0;
  background: transparent;
  padding: 0.65rem 0;
}
.search-box input:focus-visible {
  outline: 0;
}
.search-box:focus-within {
  outline: 2px solid #3777ac;
}
.search-box > .icon {
  color: var(--muted);
}
.filter-bar {
  margin-bottom: 1.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.filter-bar .search-box {
  flex: 1;
  min-width: 160px;
}
.source-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.archive-list .record {
  position: relative;
}
.archive-list .record p {
  color: var(--muted);
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.editor-toolbar .plain {
  margin-left: -0.5rem;
}
.save-status {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: right;
}
.save-status[data-error] {
  color: #a52a3e;
}
.editor-head {
  margin-bottom: 1.4rem;
}
.editor-title {
  padding: 0.15rem 0.1rem;
  border: 1px solid transparent;
  border-radius: 5px;
  font-weight: 690;
  font-size: clamp(1.65rem, 3.8vw, 2.4rem);
  line-height: 1.2;
  letter-spacing: -0.045em;
  background: transparent;
}
.editor-title::placeholder {
  color: var(--ink);
}
.editor-title:hover {
  border-color: var(--line);
}
.editor-sections {
  display: grid;
  gap: 1rem;
}
.text-section {
  padding: clamp(1rem, 3vw, 1.65rem);
  display: grid;
  gap: 1rem;
  min-width: 0;
}
.text-section .label {
  font-size: 1.18rem;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.025em;
}
.text-section label {
  display: block;
}
.note-field,
.body-field {
  min-height: 140px;
  background: #fcfcfb;
  line-height: 1.6;
}
.body-field {
  min-height: 310px;
}
.art-variants {
  display: grid;
  gap: 1.15rem;
}
.art-variants figure {
  display: grid;
  gap: .4rem;
}
.art-image,
.atlas-preview-picture img {
  display: block;
  width: 100%;
  height: auto;
}
.art-image {
  border-radius: 9px;
}
.format-error:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
}
.atlas-preview-picture {
  display: block;
  margin-bottom: 1rem;
}
.modal-document.atlas-preview {
  white-space: normal;
}
.atlas-preview > p {
  white-space: pre-wrap;
}
.art-credit-list {
  display: grid;
  gap: 0.45rem;
  padding-left: 1.3rem;
  margin: 0.2rem 0;
}
.details-credits {
  font-size: 0.88rem;
  color: var(--muted);
}
.details-credits summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 550;
}
.activity {
  padding: 0.75rem 1rem;
  background: #eef2ed;
  color: var(--green);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.publish-box {
  border-color: #b9c9b9;
}
.actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.wide {
  width: 100%;
}
/* Dialogs & status */
#notice {
  position: fixed;
  z-index: 20;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 12px;
  padding: 0.7rem 1.1rem;
  background: #252924;
  color: white;
  font-size: 0.93rem;
  box-shadow: 0 8px 24px #0002;
  max-width: min(90vw, 540px);
  width: max-content;
  white-space: pre-line;
}
#notice:empty {
  display: none;
}
dialog {
  border: none;
  border-radius: 18px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  width: min(520px, calc(100% - 2rem));
  max-height: 84svh;
  box-shadow: 0 20px 70px #0003;
}
dialog::backdrop {
  background: #1b201d70;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.3rem 0.6rem;
}
.dialog-body {
  padding: 0.4rem 1.4rem 1.45rem;
  overflow-wrap: anywhere;
}
.dialog-body p + p {
  margin-top: 0.7rem;
}
.dialog-list {
  display: grid;
  margin: 0.9rem 0;
  gap: 0.35rem;
}
.dialog-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.6rem 0.8rem;
}
.dialog-option:hover {
  background: var(--bg);
}
.dialog-body .actions {
  margin-top: 1rem;
}
.modal-document {
  max-height: 54svh;
  overflow: auto;
  white-space: pre-wrap;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (min-width: 1500px) {
  .workspace {
    grid-template-columns: 245px minmax(0, 1fr);
  }
  .entrance-grid {
    max-width: 1350px;
  }
}
@media (max-width: 840px) {
  .workspace {
    grid-template-columns: 170px minmax(0, 1fr);
  }
  .sidebar {
    padding-inline: 0.6rem;
  }
  .sidebar .wordmark {
    margin-left: 0.5rem;
  }
  .pane {
    padding: 2.2rem 1.4rem 3rem;
  }
  .entrance-grid {
    gap: 2rem;
  }
  .idea-grid {
    gap: 0.65rem;
  }
  .idea-card {
    padding: 1rem;
  }
}
@media (max-width: 640px) {
  .entrance-header {
    height: 65px;
  }
  .atlas-logo {
    width: 81px;
  }
  .entrance-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem 1.2rem;
    width: min(470px, 100%);
    gap: 0.55rem;
    margin: auto;
  }
  .entrance-copy {
    padding: 1.1rem 0 0.9rem;
  }
  .entrance-copy h1 {
    font-size: 4.25rem;
    margin-bottom: 0.6rem;
  }
  .entrance-copy .auth-action {
    margin-top: 1.1rem;
  }
  .entrance-copy .subtitle {
    max-width: none;
    font-size: 1rem;
  }
  .plate {
    padding: 0.55rem;
  }
  .plate img {
    aspect-ratio: 2;
  }
  .auth-art figcaption {
    padding: 0.6rem 0;
    gap: 0.25rem;
  }
  .auth-art figcaption > a {
    font-size: 0.94rem;
  }
  .workspace {
    display: block;
  }
  .sidebar {
    display: none;
  }
  .mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }
  .mobile-head .wordmark {
    font-size: 1.45rem;
  }
  .mobile-head .wordmark img {
    width: 29px;
    height: 29px;
  }
  .mobile-head .button {
    min-height: 37px;
    padding: 0.42rem 0.65rem;
    font-size: 0.88rem;
  }
  .mobile-nav {
    display: flex;
    position: fixed;
    z-index: 7;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f8f9f8f2;
    backdrop-filter: blur(18px);
    border-top: 1px solid var(--line);
    padding: 0.24rem 0.4rem max(0.25rem, env(safe-area-inset-bottom));
  }
  .mobile-nav .nav-item {
    flex-direction: column;
    gap: 0.1rem;
    font-size: 0.75rem;
    min-height: 44px;
    padding: 0.3rem 0.4rem;
  }
  .mobile-nav .nav-item.active {
    background: transparent;
    color: var(--green);
    font-weight: 700;
  }
  .mobile-nav .nav-item.active .icon {
    stroke-width: 2.5;
  }
  .pane,
  .pane.editor-pane {
    padding: 1.5rem 1rem calc(5.5rem + env(safe-area-inset-bottom));
  }
  .page-head {
    margin-bottom: 1.2rem;
  }
  .page-head > .button.primary {
    display: none;
  }
  .page-head .subtitle {
    font-size: 0.95rem;
  }
  .page-head h1 {
    font-size: 2.3rem;
  }
  .record {
    padding: 1.05rem;
  }
  .idea-grid {
    grid-template-columns: 1fr;
  }
  .idea-card {
    min-height: 0;
  }
  .idea-card .metadata {
    margin-top: 0.15rem;
  }
  .filter-bar .button {
    font-size: 0.85rem;
  }
  .editor-toolbar {
    margin-bottom: 0.5rem;
  }
  .editor-sections {
    gap: 0.75rem;
  }
  .editor-head {
    margin-bottom: 0.85rem;
  }
  .text-section {
    border-radius: 14px;
  }
  .button,
  .plain {
    min-height: 44px;
  }
  .connection {
    gap: 0.25rem;
  }
  .connection .add {
    width: 40px;
    padding: 0.45rem;
  }
  .connection .add span {
    display: none;
  }
  #notice {
    bottom: calc(4.2rem + env(safe-area-inset-bottom));
  }
  .art-credit-list {
    font-size: 0.83rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.archive-kind {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0.53rem 1rem;
  background: var(--surface);
}
.arch-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.2rem;
}
.archive-thumb {
  width: 128px;
  height: 85px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.reader-image {
  width: 100%;
  max-height: 250px;
  object-fit: contain;
  margin: 0.35rem 0 1rem;
}
.modal-document > p {
  margin: 1rem 0;
}
.modal-document > figure {
  margin-top: 1rem;
}
@media (max-width: 640px) {
  .archive-kind {
    flex: 1;
    min-width: 120px;
  }
  .archive-thumb {
    width: 75px;
    height: 68px;
  }
  .arch-card-top {
    gap: 0.65rem;
  }
  .arch-card-top p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}
.plate img {
  height: auto;
}
.desktop-new {
  min-height: 36px;
  font-size: 0.88rem;
}
@media (max-width: 640px) {
  .desktop-new {
    display: none;
  }
}
