:root {
  --ink: #17231f;
  --ink-soft: #43524c;
  --ink-faint: #738079;
  --moss: #2e5749;
  --moss-deep: #16251f;
  --moss-mid: #203d33;
  --paper: #f2ede3;
  --paper-2: #faf7f0;
  --paper-3: #e9e3d7;
  --white: #fffdf8;
  --line: #ddd6c8;
  --line-strong: #c8bfad;
  --accent: #d96541;
  --accent-deep: #b84b2b;
  --accent-soft: #f1d3c5;
  --lime: #dbe7b8;
  --danger: #a53a2a;
  --danger-soft: #f6ded8;
  --success: #2f6b53;
  --shadow-sm: 0 1px 2px rgba(23, 35, 31, 0.05);
  --shadow-md: 0 16px 38px rgba(23, 35, 31, 0.1);
  --shadow-lg: 0 34px 80px rgba(15, 28, 23, 0.18);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 26px;
  --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", "Iowan Old Style", serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  color: var(--white);
  background: var(--moss);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* -------------------------------------------------------------------------- */
/* Shared pieces                                                              */
/* -------------------------------------------------------------------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
}

.brand--light {
  color: #f7f2e6;
}

.brand-mark {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  place-items: center;
  color: #f7f2e6;
  background: var(--moss-deep);
  border-radius: 11px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.brand--light .brand-mark {
  color: var(--moss-deep);
  background: var(--lime);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--accent-deep);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.17em;
  line-height: 1.3;
  text-transform: uppercase;
}

.eyebrow--light {
  color: var(--lime);
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.button svg {
  width: 18px;
  height: 18px;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.button--primary {
  color: #fffdf7;
  background: var(--moss-deep);
  border-color: var(--moss-deep);
  box-shadow: 0 8px 18px rgba(22, 37, 31, 0.18);
}

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

.button--quiet {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}

.button--quiet:hover {
  background: var(--white);
  border-color: var(--line-strong);
}

.button--small {
  min-height: 36px;
  padding: 8px 13px;
  font-size: 12.5px;
}

.button--wide {
  width: 100%;
  min-height: 50px;
  justify-content: space-between;
  padding: 12px 14px 12px 20px;
  border-radius: 14px;
  font-size: 14.5px;
}

.button--danger-quiet {
  color: var(--danger);
  background: transparent;
  border-color: transparent;
}

.button--danger-quiet:hover {
  background: var(--danger-soft);
  border-color: var(--danger-soft);
}

.button-arrow {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
}

.button-arrow svg {
  width: 18px;
  height: 18px;
  transition: transform 160ms ease;
}

.button--wide:hover .button-arrow svg {
  transform: translateX(2px);
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--white);
  border-color: var(--line);
}

.text-button {
  padding: 0;
  color: var(--accent-deep);
  background: none;
  border: 0;
  font-size: 12.5px;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 150ms ease;
}

.text-button:hover {
  text-decoration-color: currentColor;
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9cc78b;
  box-shadow: 0 0 0 3px rgba(156, 199, 139, 0.12);
}

/* -------------------------------------------------------------------------- */
/* Authentication                                                             */
/* -------------------------------------------------------------------------- */

.auth {
  display: grid;
  min-height: 100svh;
  grid-template-columns: minmax(0, 1.08fr) minmax(410px, 0.92fr);
}

.auth-story {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  gap: 44px;
  padding: clamp(30px, 4.5vw, 64px);
  color: #f4f0e6;
  background:
    radial-gradient(circle at 84% 8%, rgba(219, 231, 184, 0.13), transparent 30%),
    radial-gradient(circle at 5% 92%, rgba(217, 101, 65, 0.19), transparent 34%),
    linear-gradient(145deg, #1a2d26 0%, #14231e 55%, #101d18 100%);
}

.auth-story::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(244, 240, 230, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 240, 230, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 82%);
  pointer-events: none;
}

.auth-story::after {
  position: absolute;
  top: 16%;
  right: -235px;
  width: 560px;
  height: 560px;
  border: 1px solid rgba(219, 231, 184, 0.16);
  border-radius: 50%;
  box-shadow:
    0 0 0 38px rgba(219, 231, 184, 0.035),
    0 0 0 118px rgba(219, 231, 184, 0.025);
  content: "";
  pointer-events: none;
}

.auth-story > * {
  position: relative;
  z-index: 1;
}

.story-copy {
  max-width: 640px;
  margin: auto 0;
  padding: 3vh 0;
}

.story-copy h1 {
  max-width: 700px;
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 6.3vw, 6.6rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.91;
}

.story-copy h1 em {
  color: #e7a186;
  font-weight: 400;
}

.story-lede {
  max-width: 430px;
  margin-top: 28px;
  color: rgba(244, 240, 230, 0.68);
  font-size: 14.5px;
  line-height: 1.7;
}

.feature-list {
  display: grid;
  max-width: 560px;
  border-bottom: 1px solid rgba(244, 240, 230, 0.14);
}

.feature-list li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid rgba(244, 240, 230, 0.14);
  color: rgba(244, 240, 230, 0.78);
  font-size: 12.5px;
  letter-spacing: 0.01em;
}

.feature-index {
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 10px;
}

.story-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(244, 240, 230, 0.45);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 22px;
  padding: 44px 36px;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(23, 35, 31, 0.09) 0.7px, transparent 0.7px);
  background-size: 20px 20px;
}

.auth-card {
  width: min(430px, 100%);
  padding: clamp(28px, 3.8vw, 40px);
  background: rgba(255, 253, 248, 0.93);
  border: 1px solid rgba(200, 191, 173, 0.7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: rise-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-heading {
  margin-bottom: 24px;
}

.auth-heading h2 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 3.5vw, 40px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1;
}

.auth-subtitle {
  margin-top: 12px;
  color: var(--ink-faint);
  font-size: 13.5px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-bottom: 24px;
  padding: 3px;
  background: var(--paper-3);
  border-radius: 11px;
}

.segmented-button {
  min-height: 37px;
  padding: 7px 10px;
  color: var(--ink-faint);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.segmented-button:hover {
  color: var(--ink);
}

.segmented-button.is-active {
  color: var(--ink);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: grid;
  gap: 17px;
}

.field-group {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field-group label {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.035em;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-group input,
.field-group textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--white);
  font-size: 14px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.field-group input {
  height: 46px;
  padding: 0 13px;
}

.field-group textarea {
  padding: 14px;
  line-height: 1.65;
  resize: vertical;
}

.field-group input::placeholder,
.field-group textarea::placeholder {
  color: #a39c8e;
}

.field-group input:hover,
.field-group textarea:hover {
  border-color: var(--line-strong);
}

.field-group input:focus,
.field-group textarea:focus {
  border-color: var(--moss);
  box-shadow: 0 0 0 3px rgba(46, 87, 73, 0.11);
  background: #fffefa;
}

.field-hint {
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.45;
}

.form-error {
  padding: 10px 12px;
  color: #8a2d1f;
  background: var(--danger-soft);
  border: 1px solid #eac1b7;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.5;
}

.auth-switch {
  margin-top: 22px;
  color: var(--ink-faint);
  font-size: 12px;
  text-align: center;
}

.auth-switch .text-button {
  margin-left: 3px;
}

.auth-legal {
  max-width: 360px;
  color: #8d877a;
  font-size: 10.5px;
  line-height: 1.55;
  text-align: center;
}

/* -------------------------------------------------------------------------- */
/* Application shell                                                          */
/* -------------------------------------------------------------------------- */

.app {
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  background: var(--paper-2);
}

.topbar {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(18px, 3vw, 34px);
  background: rgba(250, 247, 240, 0.94);
  border-bottom: 1px solid var(--line);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: inline-flex;
  max-width: 190px;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.user-chip > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--white);
  background: var(--moss);
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.workspace {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(292px, 346px) minmax(0, 1fr);
  height: calc(100svh - 73px);
}

/* -------------------------------------------------------------------------- */
/* Sidebar                                                                    */
/* -------------------------------------------------------------------------- */

.sidebar {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 28px 20px 16px;
  background: #f7f3ea;
  border-right: 1px solid var(--line);
}

.sidebar-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}

.sidebar-head .eyebrow {
  margin-bottom: 3px;
}

.sidebar-head h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.count-badge {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  margin-left: 4px;
  padding: 0 6px;
  place-items: center;
  color: var(--ink-soft);
  background: var(--paper-3);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  vertical-align: 3px;
}

.search {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 9px;
  margin: 24px 0 14px;
  padding: 0 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-faint);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.search:focus-within {
  border-color: var(--moss);
  box-shadow: 0 0 0 3px rgba(46, 87, 73, 0.1);
}

.search svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12.5px;
}

.search input::placeholder {
  color: #9d978a;
}

.search input::-webkit-search-cancel-button {
  opacity: 0.5;
}

.entry-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  padding: 2px 3px 14px;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.entry-item {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 12px 12px 11px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.entry-item:hover {
  background: rgba(255, 253, 248, 0.88);
  border-color: var(--line);
}

.entry-key {
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-time {
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.5;
  white-space: nowrap;
}

.entry-preview {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 11.5px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-item.is-active {
  color: #fbf7ed;
  background: var(--moss-deep);
  border-color: var(--moss-deep);
  box-shadow: 0 10px 20px rgba(22, 37, 31, 0.13);
}

.entry-item.is-active .entry-time,
.entry-item.is-active .entry-preview {
  color: rgba(251, 247, 237, 0.53);
}

.list-empty {
  padding: 18px 8px;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.list-empty p:first-child {
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-weight: 600;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 4px 2px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: 0.025em;
}

/* -------------------------------------------------------------------------- */
/* Editor                                                                     */
/* -------------------------------------------------------------------------- */

.editor-pane {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0, rgba(219, 231, 184, 0.16), transparent 30%),
    var(--paper-2);
}

.editor-empty {
  display: flex;
  width: min(540px, 100%);
  height: 100%;
  min-height: 480px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  margin: 0 auto;
  padding: 48px clamp(25px, 5vw, 56px);
  animation: rise-in 400ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.empty-illustration {
  width: 124px;
  margin-bottom: 30px;
  color: var(--moss);
  opacity: 0.9;
}

.empty-illustration svg {
  width: 100%;
  height: auto;
}

.editor-empty h2 {
  font-family: var(--font-serif);
  font-size: clamp(36px, 4vw, 48px);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 1.02;
}

.editor-empty h2 em {
  color: var(--accent-deep);
  font-weight: 400;
}

.editor-empty > p:not(.eyebrow) {
  max-width: 400px;
  margin: 17px 0 25px;
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.65;
}

.editor {
  display: flex;
  height: 100%;
  flex-direction: column;
  padding: 30px clamp(26px, 4.6vw, 62px) 18px;
  animation: fade-in 220ms ease both;
}

.editor-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.editor-meta .eyebrow {
  margin-bottom: 4px;
}

.editor-date {
  color: var(--ink-faint);
  font-size: 11px;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.entry-form {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  padding-top: 24px;
}

.entry-form .field-group input {
  height: 48px;
  background: rgba(255, 253, 248, 0.8);
  font-family: var(--font-mono);
  font-size: 13px;
}

.field-group--grow {
  min-height: 0;
  flex: 1;
  gap: 9px;
}

.field-group--grow textarea {
  min-height: 190px;
  flex: 1;
  background: rgba(255, 253, 248, 0.82);
  border-radius: 13px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  resize: none;
  tab-size: 2;
}

.field-group--grow textarea:focus {
  background: var(--white);
}

.char-count {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.char-count.is-near-limit {
  color: var(--accent-deep);
  font-weight: 700;
}

.editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 20px;
  color: var(--ink-faint);
  font-size: 10.5px;
}

.save-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.save-status.is-dirty {
  color: var(--accent-deep);
}

.save-status.is-saved {
  color: var(--success);
}

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

.shortcut {
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

kbd {
  display: inline-block;
  min-width: 18px;
  padding: 2px 5px;
  color: var(--ink-faint);
  background: var(--paper);
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  text-align: center;
}

/* -------------------------------------------------------------------------- */
/* API dialog                                                                 */
/* -------------------------------------------------------------------------- */

.api-dialog {
  width: min(580px, calc(100vw - 28px));
  max-height: calc(100svh - 32px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
}

.api-dialog::backdrop {
  background: rgba(13, 25, 20, 0.58);
  backdrop-filter: blur(3px);
}

.api-dialog[open] {
  animation: dialog-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 28px 0;
}

.dialog-head h2 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
}

.dialog-copy {
  padding: 15px 28px 0;
  color: var(--ink-faint);
  font-size: 12.5px;
  line-height: 1.65;
}

.dialog-copy code,
.dialog-note code {
  padding: 1px 5px;
  color: var(--moss);
  background: #eae7da;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.endpoint-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 19px 28px 0;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
}

.api-tabs {
  margin: 18px 28px 0;
  background: #e7e1d5;
}

.api-tabs .segmented-button {
  min-height: 34px;
}

.method-badge {
  padding: 3px 7px;
  color: var(--moss);
  background: #dfe9cb;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.code-block {
  margin: 10px 28px 0;
  padding: 16px;
  overflow-x: auto;
  color: #e8eadf;
  background: var(--moss-deep);
  border: 1px solid #263c33;
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  tab-size: 2;
  white-space: pre-wrap;
  word-break: break-word;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px 24px;
}

.dialog-note {
  color: var(--ink-faint);
  font-size: 10.5px;
  line-height: 1.5;
}

/* -------------------------------------------------------------------------- */
/* Toast                                                                      */
/* -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 100;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 18px;
  color: #f9f5ea;
  background: var(--moss-deep);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(15, 28, 23, 0.28);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast[data-kind="error"] {
  background: #762719;
  border-color: #8e3525;
}

/* -------------------------------------------------------------------------- */
/* Motion                                                                     */
/* -------------------------------------------------------------------------- */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                 */
/* -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .auth {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 0.9fr);
  }

  .story-copy h1 {
    font-size: clamp(3.3rem, 6.2vw, 5.3rem);
  }

  .story-lede {
    max-width: 370px;
  }
}

@media (max-width: 840px) {
  .auth {
    grid-template-columns: 1fr;
    min-height: 100svh;
  }

  .auth-story {
    gap: 20px;
    padding: 22px 24px 26px;
    border-radius: 0 0 28px 28px;
  }

  .auth-story::after {
    top: -170px;
    right: -250px;
    width: 460px;
    height: 460px;
  }

  .story-copy {
    margin: 5px 0 0;
    padding: 0;
  }

  .story-copy h1 {
    font-size: clamp(2.5rem, 9vw, 3.8rem);
    line-height: 0.94;
  }

  .story-copy .eyebrow,
  .story-lede,
  .feature-list,
  .story-foot {
    display: none;
  }

  .auth-panel {
    align-items: flex-start;
    padding: 26px 20px 38px;
    background-image: none;
  }

  .auth-card {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 22px;
  }

  .auth-legal {
    margin: 0 auto;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
  }

  .sidebar {
    max-height: none;
    padding: 22px 18px 15px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .entry-list {
    max-height: 244px;
    flex: 0 1 auto;
  }

  .sidebar-foot {
    display: none;
  }

  .editor-pane {
    min-height: 68svh;
  }

  .editor-empty {
    min-height: 58svh;
    padding: 48px 24px;
  }

  .editor {
    min-height: 68svh;
    padding: 24px 18px 16px;
  }

  .entry-form {
    min-height: 460px;
  }

  body {
    overflow-y: auto;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
  }
}

@media (max-width: 520px) {
  .auth-panel {
    padding: 20px 12px 32px;
  }

  .auth-card {
    padding: 25px 20px;
    border-radius: 20px;
  }

  .topbar {
    min-height: 64px;
    padding: 0 14px;
  }

  .topbar .brand-name {
    font-size: 18px;
  }

  .topbar .brand-mark {
    width: 33px;
    height: 33px;
  }

  .topbar-actions {
    gap: 4px;
  }

  .user-chip {
    max-width: 44px;
    padding: 3px;
    border-color: transparent;
    background: transparent;
  }

  .user-chip > span:last-child {
    display: none;
  }

  .topbar .button--quiet {
    padding: 8px 10px;
  }

  .sidebar-head h2 {
    font-size: 26px;
  }

  .editor-top {
    flex-direction: column;
    gap: 13px;
  }

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

  .editor-empty h2 {
    font-size: 36px;
  }

  .empty-illustration {
    width: 92px;
    margin-bottom: 22px;
  }

  .dialog-head {
    padding: 22px 20px 0;
  }

  .dialog-copy {
    padding: 13px 20px 0;
  }

  .endpoint-pill {
    margin: 16px 20px 0;
  }

  .api-tabs {
    margin: 16px 20px 0;
  }

  .code-block {
    margin: 9px 20px 0;
    padding: 13px;
    font-size: 10px;
  }

  .dialog-actions {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 20px 22px;
  }

  .dialog-actions .button {
    width: 100%;
  }

  .toast {
    bottom: 16px;
  }
}
