/* ==========================================================================
   Prefill Journal — dark pixel system
   Display: Alatsi, body: Instrument Sans, data: Spline Sans Mono
   Self-hosted OFL fonts. Zero radius. Notched corners. Hard offset shadows.
   Yellow accent.
   ========================================================================== */

@font-face {
  font-family: "Alatsi";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/alatsi-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Alatsi";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/alatsi-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/instrument-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Spline Sans Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/spline-sans-mono-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Spline Sans Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/spline-sans-mono-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --primary: #fae36a;
  --on-primary: #211b00;
  --primary-container: #383000;
  --on-primary-container: #fae36a;
  --secondary: #d3c790;
  --tertiary: #5cd8df;
  --success: #4ade80;
  --error: #f87171;
  --error-container: #7f1d1d;
  --on-error-container: #fecaca;
  --bg: #0e0e11;
  --surface: #131316;
  --surface-low: #1b1b1e;
  --surface-container: #1f1f22;
  --surface-high: #2a2a2d;
  --surface-highest: #353438;
  --on-surface: #e4e1e6;
  --on-surface-variant: #acaaae;
  --outline: #78767a;
  --outline-variant: #303033;
  --text-faint: #8f8d91;
  --font-display: "Alatsi", "Instrument Sans", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --rail-width: 256px;
  --page-max: 820px;
  --wide-max: 1080px;
  --pixel-shadow: #050506;
  --warning: #eab308;
  --state: 80ms linear;
}

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

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

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 22px;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--primary);
  color: var(--on-primary);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.2px;
}

p {
  margin: 0 0 1em;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--primary);
  text-decoration: none;
}

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

button,
input,
textarea,
select {
  font: inherit;
  border-radius: 0;
}

button {
  color: inherit;
}

form {
  margin: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--outline-variant);
}

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

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  display: inline-block;
  vertical-align: -3px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 16px;
  letter-spacing: 0.2px;
}

.muted {
  color: var(--on-surface-variant);
}

.small {
  font-size: 12px;
  line-height: 18px;
}

.mt-1 {
  margin-top: 8px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.1px;
  color: var(--text-faint);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  background: var(--primary);
  box-shadow: 3px 3px 0 var(--primary);
}

.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;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: -9999px;
  z-index: 200;
  padding: 8px 12px;
  background: var(--primary);
  color: var(--on-primary);
  border: 1px solid var(--primary);
  font-family: var(--font-mono);
  font-size: 11px;
}

.skip-link:focus {
  left: 8px;
}

/* --------------------------------------------------------------------------
   Buttons, tags and form controls
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface-container);
  color: var(--on-surface);
  border: 1px solid var(--outline-variant);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 18px;
  font-weight: 600;
  letter-spacing: 0.1px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--pixel-shadow);
  transition:
    background var(--state),
    border-color var(--state),
    color var(--state),
    transform var(--state),
    box-shadow var(--state);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--pixel-shadow);
}

.btn:hover {
  background: var(--surface-high);
  border-color: var(--outline);
  text-decoration: none;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.btn--primary:hover {
  background: var(--primary-container);
  border-color: var(--primary-container);
  color: var(--on-primary-container);
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--on-surface-variant);
  box-shadow: none;
}

.btn--ghost:active {
  transform: none;
  box-shadow: none;
}

.btn--ghost:hover {
  background: var(--surface-container);
  border-color: var(--outline-variant);
  color: var(--on-surface);
}

.btn--danger {
  background: transparent;
  border-color: var(--error);
  color: var(--error);
}

.btn--danger:hover {
  background: var(--error-container);
  border-color: var(--error);
  color: var(--on-error-container);
}

.btn--small {
  padding: 6px 10px;
  font-size: 12px;
  line-height: 16px;
}

.btn--block {
  width: 100%;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  background: var(--surface-container);
  color: var(--on-surface);
  border: 1px solid var(--outline-variant);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--pixel-shadow);
  transition:
    background var(--state),
    border-color var(--state),
    transform var(--state),
    box-shadow var(--state);
}

.icon-button:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--pixel-shadow);
}

.icon-button:hover {
  background: var(--surface-high);
  border-color: var(--outline);
}

.icon-button .icon {
  width: 16px;
  height: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  background: transparent;
  border: 0;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 18px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--on-surface-variant);
  white-space: nowrap;
}

.tag::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  background: currentColor;
  box-shadow: 3px 3px 0 currentColor;
}

.tag--primary {
  color: var(--primary);
}

.tag--outline {
  color: var(--on-surface-variant);
}

.tag--success {
  color: var(--success);
}

.tag--danger {
  color: var(--error);
}

.tag--warning {
  color: var(--warning);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: transparent;
  border: 0;
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--on-surface-variant);
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  flex: none;
  display: inline-block;
  background: transparent;
  background-image: conic-gradient(
    var(--success) 25%,
    transparent 0 50%,
    var(--success) 0 75%,
    transparent 0
  );
  background-size: 4px 4px;
}

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

.field__label {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--on-surface);
}

.field__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.field__link {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--primary);
  white-space: nowrap;
}

.field__hint {
  font-size: 12px;
  line-height: 18px;
  color: var(--on-surface-variant);
}

.input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  background: var(--bg);
  color: var(--on-surface);
  border: 1px solid var(--outline-variant);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 22px;
  transition: border-color var(--state);
}

.input::placeholder {
  color: var(--text-faint);
  opacity: 1;
}

.input:hover {
  border-color: var(--outline);
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.input--icon {
  padding-left: 38px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.input-wrap > .icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--on-surface-variant);
  pointer-events: none;
}

input[type="search"]::-webkit-search-cancel-button {
  filter: invert(0.65);
}

.input--title {
  padding: 2px 0 10px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--outline-variant);
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 36px;
  letter-spacing: -0.3px;
}

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

.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  padding: 10px 12px;
  background: var(--surface-low);
  border: 1px solid var(--outline-variant);
  color: var(--on-surface);
  font-size: 13px;
  line-height: 20px;
}

.flash::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  margin-top: 6px;
  background: var(--success);
  box-shadow: 4px 4px 0 var(--success);
}

.flash--error {
  background: var(--error-container);
  border-color: #9f2626;
  color: var(--on-error-container);
}

.flash--error::before {
  background: var(--error);
  box-shadow: 4px 4px 0 var(--error);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Brand and guest chrome
   -------------------------------------------------------------------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--on-surface);
  text-decoration: none;
  min-width: 0;
}

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

.brand__mark {
  display: block;
  flex: none;
  image-rendering: pixelated;
}

.brand__copy {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.brand__name {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
  letter-spacing: -0.1px;
  color: var(--on-surface);
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.2px;
  color: var(--on-surface-variant);
  white-space: nowrap;
}

.guest-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.guest-header {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--outline-variant);
}

.guest-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.guest-main {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.guest-footer {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 24px;
  border-top: 1px solid var(--outline-variant);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  flex-wrap: wrap;
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 16px;
  letter-spacing: 0;
  color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   Signed-in shell: rail + workspace
   -------------------------------------------------------------------------- */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.rail {
  width: var(--rail-width);
  flex: 0 0 var(--rail-width);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg);
  border-right: 1px solid var(--outline-variant);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.rail__brand {
  padding: 16px;
  border-bottom: 1px solid var(--outline-variant);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rail__brand .brand__name {
  font-size: 18px;
}

.rail__logout {
  display: flex;
  flex: none;
}

.rail__action {
  padding: 16px;
  border-bottom: 1px solid var(--outline-variant);
}

.rail__nav {
  padding: 12px 8px;
  border-bottom: 1px solid var(--outline-variant);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid transparent;
  color: var(--on-surface-variant);
  font-size: 14px;
  line-height: 22px;
  text-decoration: none;
  transition:
    background var(--state),
    border-color var(--state),
    color var(--state);
}

.rail-link:hover {
  background: var(--surface-low);
  color: var(--on-surface);
  text-decoration: none;
}

.rail-link--active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.rail-link--active:hover {
  background: var(--primary);
  color: var(--on-primary);
}

.rail-link__label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rail-link__label .icon {
  width: 16px;
  height: 16px;
}

.rail-link__count {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 14px;
  color: var(--on-surface-variant);
}

.rail-link--active .rail-link__count {
  color: var(--on-primary);
}

.rail-dot {
  width: 6px;
  height: 6px;
  flex: none;
  display: inline-block;
  background: var(--primary);
}

.rail-link--active .rail-dot {
  background: var(--on-primary);
}

.rail__months {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.rail__months-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-faint);
}

.rail__year {
  margin-top: 10px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 20px;
  letter-spacing: 0.4px;
  color: var(--on-surface);
}

.rail-month {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid transparent;
  color: var(--on-surface-variant);
  font-size: 13px;
  line-height: 20px;
  text-decoration: none;
  transition:
    background var(--state),
    color var(--state);
}

.rail-month:hover {
  background: var(--surface-low);
  color: var(--on-surface);
  text-decoration: none;
}

.rail-month--active {
  background: var(--surface-container);
  border-color: var(--primary);
  color: var(--on-surface);
}

.rail-month__count {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 14px;
  color: var(--on-surface-variant);
}

.rail-month--active .rail-month__count {
  color: var(--primary);
}

.rail-empty {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 18px;
  color: var(--on-surface-variant);
}

.rail__bottom {
  padding: 16px;
  border-top: 1px solid var(--outline-variant);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rail-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: var(--on-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
}

.rail-user__copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rail-user__name {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-user__email {
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 14px;
  color: var(--on-surface-variant);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail__license {
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 16px;
  letter-spacing: 0;
  color: var(--text-faint);
}

.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.workspace__main {
  flex: 1;
}

/* --------------------------------------------------------------------------
   Page bar and content
   -------------------------------------------------------------------------- */

.page-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--outline-variant);
  padding: 14px 24px;
}

.page-bar__inner {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.page-bar__inner--wide {
  max-width: var(--wide-max);
}

.page-bar__title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.page-bar h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 26px;
  font-weight: 400;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.page-bar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.content {
  padding: 32px 24px 64px;
}

.content__inner {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
}

.content__inner--wide {
  max-width: var(--wide-max);
}

.feed-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.feed-head h1 {
  margin: 6px 0 4px;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 36px;
  font-weight: 400;
  letter-spacing: -0.3px;
  overflow-wrap: anywhere;
}

.feed-head p {
  margin: 0;
  font-size: 13px;
  line-height: 20px;
}

/* --------------------------------------------------------------------------
   Search, month chips, entry feed
   -------------------------------------------------------------------------- */

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 280px;
  min-width: 0;
  max-width: 520px;
}

.search-field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}

.search-field > .icon {
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--on-surface-variant);
  pointer-events: none;
}

.search-field .input {
  padding-left: 36px;
  background: var(--surface-container);
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
  box-shadow: 2px 2px 0 var(--pixel-shadow);
  transition:
    background var(--state),
    border-color var(--state),
    color var(--state),
    transform var(--state),
    box-shadow var(--state);
}

.chip:hover {
  border-color: var(--outline);
  text-decoration: none;
}

.chip:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--pixel-shadow);
}

.chip--active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.entry-feed {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.entry-card {
  position: relative;
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  box-shadow: 4px 4px 0 var(--pixel-shadow);
}

.entry-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 12px;
  height: 12px;
  background: var(--bg);
  border-right: 1px solid var(--outline-variant);
  border-bottom: 1px solid var(--outline-variant);
  pointer-events: none;
}

.entry-card--today {
  border-color: var(--primary);
}

.entry-card--today::before {
  border-color: var(--primary);
}

.entry-card--today::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 56px;
  height: 8px;
  background-image: conic-gradient(
    var(--primary) 25%,
    transparent 0 50%,
    var(--primary) 0 75%,
    transparent 0
  );
  background-size: 8px 8px;
  pointer-events: none;
}

.entry-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--outline-variant);
  padding-bottom: 12px;
}

.entry-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.entry-card__date {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 26px;
  letter-spacing: 0;
  color: var(--on-surface);
}

.entry-card__stats {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 16px;
  letter-spacing: 0.2px;
  color: var(--on-surface-variant);
  white-space: nowrap;
}

.entry-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 30px;
  font-weight: 400;
  letter-spacing: -0.2px;
  overflow-wrap: anywhere;
}

.entry-card__title a {
  color: var(--on-surface);
}

.entry-card__title a:hover {
  color: var(--primary);
  text-decoration: none;
}

.entry-card__body {
  min-width: 0;
}

.entry-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--outline-variant);
  padding-top: 12px;
}

.entry-card__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Loading skeletons
   -------------------------------------------------------------------------- */

.skeleton-line,
.skeleton-text {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--surface-high);
  color: transparent;
  user-select: none;
}

.skeleton-line::after,
.skeleton-text::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 45%;
  background: var(--primary);
  opacity: 0.16;
  transform: translateX(-120%);
  animation: skeleton-scan 1.1s steps(10, end) infinite;
}

@keyframes skeleton-scan {
  from {
    transform: translateX(-120%);
  }

  to {
    transform: translateX(320%);
  }
}

.skeleton-line {
  height: 10px;
  width: 100%;
}

.skeleton-text {
  display: inline-block;
  width: 52%;
  height: 0.9em;
  min-height: 14px;
  vertical-align: middle;
}

.skeleton-text--wide {
  width: 72%;
}

.skeleton-text--short {
  width: 34%;
}

.skeleton-text--stat {
  width: 64px;
  height: 34px;
  min-height: 0;
  vertical-align: top;
}

.skeleton-text--inline {
  width: 48px;
  height: 10px;
  min-height: 0;
}

.skeleton-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-stack--editor {
  gap: 12px;
  padding: 2px 0;
}

.skeleton-line--title {
  height: 24px;
  width: 62%;
}

.skeleton-line--date {
  height: 16px;
  width: 124px;
}

.skeleton-line--meta {
  height: 10px;
  width: 82px;
}

.skeleton-line--short {
  width: 42%;
}

.skeleton-line--medium {
  width: 70%;
}

.skeleton-line--editor {
  height: 12px;
}

.skeleton-stack--editor .skeleton-line:nth-child(1) {
  width: 92%;
}

.skeleton-stack--editor .skeleton-line:nth-child(2) {
  width: 68%;
}

.skeleton-stack--editor .skeleton-line:nth-child(3) {
  width: 86%;
}

.skeleton-stack--editor .skeleton-line:nth-child(4) {
  width: 54%;
}

.skeleton-stack--editor .skeleton-line:nth-child(5) {
  width: 78%;
}

.skeleton-stack--editor .skeleton-line:nth-child(6) {
  width: 44%;
}

.skeleton-stack--editor .skeleton-line:nth-child(7) {
  width: 72%;
}

.skeleton-line--title-input {
  position: absolute;
  top: 8px;
  right: 32%;
  left: 0;
  width: auto;
  height: 30px;
}

.entry-card--skeleton {
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Prose (viewed entries and the Tiptap canvas)
   -------------------------------------------------------------------------- */

.prose {
  font-size: 16px;
  line-height: 26px;
  color: var(--on-surface);
  overflow-wrap: anywhere;
}

.prose > :first-child {
  margin-top: 0;
}

.prose > :last-child {
  margin-bottom: 0;
}

.prose p {
  margin: 0 0 14px;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  margin: 24px 0 10px;
  color: var(--on-surface);
  letter-spacing: -0.2px;
}

.prose h1 {
  font-size: 30px;
  line-height: 36px;
}

.prose h2 {
  font-size: 24px;
  line-height: 30px;
}

.prose h3 {
  font-size: 20px;
  line-height: 26px;
}

.prose h4,
.prose h5,
.prose h6 {
  font-size: 17px;
  line-height: 24px;
}

.prose ul,
.prose ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.prose ul {
  list-style: square;
}

.prose ol {
  list-style: decimal;
}

.prose li {
  margin: 4px 0;
}

.prose li::marker {
  color: var(--primary);
}

.prose blockquote {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px dashed var(--outline);
  background: var(--surface-low);
  color: var(--on-surface-variant);
}

.prose code {
  padding: 1px 5px;
  background: var(--surface-high);
  border: 1px solid var(--outline-variant);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
}

.prose pre {
  margin: 0 0 14px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--outline-variant);
  overflow-x: auto;
}

.prose pre code {
  padding: 0;
  background: transparent;
  border: 0;
}

.prose hr {
  margin: 22px 0;
}

.prose a {
  color: var(--primary);
  text-decoration: underline;
}

.prose strong {
  font-weight: 600;
}

.prose s {
  color: var(--on-surface-variant);
}

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

.editor-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.editor-card {
  position: relative;
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  box-shadow: 4px 4px 0 var(--pixel-shadow);
}

.editor-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 12px;
  height: 12px;
  background: var(--bg);
  border-right: 1px solid var(--outline-variant);
  border-bottom: 1px solid var(--outline-variant);
  pointer-events: none;
}

.editor-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--outline-variant);
  padding-bottom: 12px;
}

.editor-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--outline-variant);
  padding-top: 12px;
}

.field--title {
  position: relative;
  padding: 0;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  padding: 5px;
  background: var(--surface-low);
  border: 1px solid var(--outline-variant);
}

.tool {
  min-width: 30px;
  height: 28px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--on-surface-variant);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 16px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background var(--state),
    border-color var(--state),
    color var(--state);
}

.tool:hover {
  background: var(--surface-high);
  color: var(--on-surface);
}

.tool[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.toolbar-divider {
  width: 1px;
  align-self: stretch;
  margin: 2px 3px;
  background: var(--outline-variant);
}

.editor-content {
  position: relative;
  min-height: 300px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--outline-variant);
  transition: border-color var(--state);
}

.editor-content:focus-within {
  border-color: var(--primary);
}

.editor-content .ProseMirror {
  min-height: 266px;
  outline: none;
}

.editor-content.is-empty::before {
  content: attr(data-placeholder);
  position: absolute;
  top: 16px;
  left: 16px;
  color: var(--text-faint);
  font-size: 16px;
  line-height: 26px;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Encryption animation
   -------------------------------------------------------------------------- */

.encrypt-fx {
  position: absolute;
  inset: -1px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  overflow: hidden;
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
}

.encrypt-fx__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--outline-variant);
}

.encrypt-fx__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--primary);
}

.encrypt-fx__mark {
  width: 8px;
  height: 8px;
  flex: none;
  background: var(--primary);
  box-shadow: 4px 4px 0 var(--primary);
  animation: encrypt-pulse 0.52s steps(2, end) infinite;
}

@keyframes encrypt-pulse {
  50% {
    opacity: 0.25;
  }
}

.encrypt-fx__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 36px;
  font-weight: 400;
  letter-spacing: -0.3px;
  color: var(--primary);
  overflow-wrap: anywhere;
}

.encrypt-fx__body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  font-size: 16px;
  line-height: 26px;
  color: var(--on-surface);
}

.encrypt-fx__line {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.encrypt-fx__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--outline-variant);
}

.encrypt-fx__bar {
  height: 6px;
  background: var(--bg);
  border: 1px solid var(--outline-variant);
}

.encrypt-fx__bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--primary);
}

.encrypt-fx.is-complete .encrypt-fx__mark {
  animation: none;
  background: var(--success);
  box-shadow: 4px 4px 0 var(--success);
}

.encrypt-fx.is-complete .encrypt-fx__label,
.encrypt-fx.is-complete .encrypt-fx__title {
  color: var(--success);
}

/* --------------------------------------------------------------------------
   Full entry and delete confirmation
   -------------------------------------------------------------------------- */

.entry-full {
  position: relative;
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  box-shadow: 4px 4px 0 var(--pixel-shadow);
}

.entry-full::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 12px;
  height: 12px;
  background: var(--bg);
  border-right: 1px solid var(--outline-variant);
  border-bottom: 1px solid var(--outline-variant);
  pointer-events: none;
}

.entry-full__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--outline-variant);
  padding-bottom: 12px;
}

.entry-full__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 40px;
  font-weight: 400;
  letter-spacing: -0.4px;
  overflow-wrap: anywhere;
}

.entry-full__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--outline-variant);
  padding-top: 14px;
}

.danger-panel {
  border-color: var(--error-container);
}

.danger-panel .eyebrow {
  color: var(--error);
}

.danger-panel__title {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 34px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.danger-panel__preview {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0;
  padding: 10px 14px;
  border: 1px solid var(--error);
  background: var(--bg);
  color: var(--on-surface-variant);
  font-size: 13px;
  line-height: 20px;
}

.danger-panel__preview::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  margin-top: 6px;
  background: var(--error);
  box-shadow: 4px 4px 0 var(--error);
}

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */

.dash-head {
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.dash-head__title {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 42px;
  font-weight: 400;
  letter-spacing: -0.5px;
  overflow-wrap: anywhere;
}

.dash-head p {
  margin: 0;
  font-size: 13px;
  line-height: 20px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat {
  position: relative;
  padding: 18px;
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  box-shadow: 4px 4px 0 var(--pixel-shadow);
}

.stat::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 12px;
  height: 12px;
  background: var(--bg);
  border-right: 1px solid var(--outline-variant);
  border-bottom: 1px solid var(--outline-variant);
  pointer-events: none;
}

.stat--accent {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.stat--accent::before {
  border-color: var(--primary);
}

.stat--accent::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  background-image: conic-gradient(
    var(--on-primary) 25%,
    transparent 0 50%,
    var(--on-primary) 0 75%,
    transparent 0
  );
  background-size: 8px 8px;
  opacity: 0.35;
  pointer-events: none;
}

.stat__value {
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 40px;
  letter-spacing: -0.4px;
  overflow-wrap: anywhere;
}

.stat__label {
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--on-surface-variant);
}

.stat--accent .stat__label {
  color: #4a3f00;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.panel {
  position: relative;
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  padding: 22px;
  min-width: 0;
  box-shadow: 4px 4px 0 var(--pixel-shadow);
}

.panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 12px;
  height: 12px;
  background: var(--bg);
  border-right: 1px solid var(--outline-variant);
  border-bottom: 1px solid var(--outline-variant);
  pointer-events: none;
}

.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--outline-variant);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.panel__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 26px;
  font-weight: 400;
}

.panel__head a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.panel__head a .icon {
  width: 12px;
  height: 12px;
}

.panel__section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--outline-variant);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.panel__section h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 22px;
}

.panel__section p {
  margin: 0;
}

.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent-list li {
  border-bottom: 1px solid var(--outline-variant);
}

.recent-list li:last-child {
  border-bottom: 0;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  color: var(--on-surface);
  text-decoration: none;
}

.recent-item::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  background: var(--primary);
  box-shadow: 3px 3px 0 var(--primary);
}

.recent-item:hover {
  color: var(--primary);
  text-decoration: none;
}

.recent-item__title {
  flex: 1 1 auto;
  font-size: 14px;
  line-height: 22px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.recent-item time {
  white-space: nowrap;
}

.prompt-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.prompt-card::after {
  content: "";
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 96px;
  height: 96px;
  background-image: conic-gradient(
    var(--primary) 25%,
    transparent 0 50%,
    var(--primary) 0 75%,
    transparent 0
  );
  background-size: 16px 16px;
  opacity: 0.14;
  pointer-events: none;
}

.prompt-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 30px;
  font-weight: 400;
}

.prompt-card p {
  margin: 0 0 6px;
  color: var(--on-surface-variant);
  font-size: 14px;
  line-height: 22px;
}

/* --------------------------------------------------------------------------
   Empty and status states
   -------------------------------------------------------------------------- */

.empty-state {
  border: 1px dashed var(--outline);
  background: var(--surface);
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.empty-state--flush {
  border: 0;
  background: transparent;
  padding: 24px 0 8px;
}

.empty-state__mark {
  width: 40px;
  height: 40px;
  border: 1px solid var(--outline-variant);
  background-image: conic-gradient(
    var(--outline) 25%,
    transparent 0 50%,
    var(--outline) 0 75%,
    transparent 0
  );
  background-size: 10px 10px;
  opacity: 0.8;
}

.empty-state h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 30px;
  font-weight: 400;
}

.empty-state p {
  margin: 0;
  max-width: 46ch;
  color: var(--on-surface-variant);
}

.empty-state .btn {
  margin-top: 6px;
}

.status-card {
  position: relative;
  width: calc(100% - 48px);
  max-width: 520px;
  margin: 48px auto;
  padding: 32px 24px;
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  box-shadow: 4px 4px 0 var(--pixel-shadow);
}

.status-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 12px;
  height: 12px;
  background: var(--bg);
  border-right: 1px solid var(--outline-variant);
  border-bottom: 1px solid var(--outline-variant);
  pointer-events: none;
}

.status-card__mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--primary-container);
  border: 1px solid var(--primary);
  color: var(--primary);
}

.status-card__mark .icon {
  width: 22px;
  height: 22px;
}

.status-card__mark--error {
  background: var(--error-container);
  border-color: var(--error);
  color: var(--on-error-container);
}

.status-card h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 34px;
  font-weight: 400;
}

.status-card p {
  margin: 0;
  max-width: 46ch;
  color: var(--on-surface-variant);
  font-size: 14px;
  line-height: 22px;
}

.status-card .form-actions {
  justify-content: center;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Auth card
   -------------------------------------------------------------------------- */

.auth-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px 0 24px;
}

.auth-stack {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.auth-card {
  position: relative;
  width: 100%;
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  box-shadow: 4px 4px 0 var(--pixel-shadow);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--surface-low);
  border-bottom: 1px solid var(--outline-variant);
}

.auth-tab {
  padding: 12px 6px;
  border-right: 1px solid var(--outline-variant);
  text-align: center;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--on-surface-variant);
  text-decoration: none;
  transition:
    background var(--state),
    color var(--state);
}

.auth-tab:last-child {
  border-right: 0;
}

.auth-tab:hover {
  background: var(--surface-container);
  color: var(--on-surface);
  text-decoration: none;
}

.auth-tab--active {
  background: var(--primary);
  border-right-color: var(--primary);
  color: var(--on-primary);
}

.auth-card__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-head h1 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 32px;
  font-weight: 400;
}

.auth-head p {
  margin: 0;
  color: var(--on-surface-variant);
  font-size: 13px;
  line-height: 20px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form .btn {
  margin-top: 4px;
}

.auth-alt {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--outline-variant);
  font-size: 12px;
  line-height: 18px;
  color: var(--on-surface-variant);
}

.auth-alt p {
  margin: 0;
}

.auth-foot {
  margin: 0;
  text-align: center;
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 16px;
  letter-spacing: 0;
  color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   Settings
   -------------------------------------------------------------------------- */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.account-list {
  margin: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px 18px;
  font-size: 14px;
  line-height: 22px;
}

.account-list dt {
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-faint);
}

.account-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Landing
   -------------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: center;
  padding: 16px 0 56px;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.hero__title {
  max-width: 12ch;
  margin: 14px 0 18px;
  font-family: var(--font-display);
  font-size: clamp(42px, 6.2vw, 68px);
  line-height: 1.03;
  letter-spacing: -1.5px;
  font-weight: 400;
}

.lede {
  max-width: 56ch;
  margin: 0;
  color: var(--on-surface-variant);
  font-size: 17px;
  line-height: 28px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 22px;
}

.hero__facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
}

.hero__facts li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--on-surface-variant);
}

.hero__facts li::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  background: var(--primary);
  box-shadow: 3px 3px 0 var(--primary);
}

.hero__art {
  position: relative;
  min-width: 0;
  padding: 24px;
  background: var(--surface-low);
  border: 1px solid var(--outline-variant);
}

.hero__checker {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 64px;
  height: 64px;
  opacity: 0.85;
}

.checker {
  background-image: conic-gradient(
    var(--primary) 25%,
    transparent 0 50%,
    var(--primary) 0 75%,
    transparent 0
  );
  background-size: 16px 16px;
}

.preview-card {
  position: relative;
  z-index: 1;
  background: var(--surface-container);
  border: 1px solid var(--primary);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 6px 6px 0 var(--pixel-shadow);
}

.preview-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--outline-variant);
  padding-bottom: 12px;
}

.preview-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 34px;
}

.preview-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-lines span {
  display: block;
  height: 8px;
  background: var(--surface-high);
}

.preview-lines span:nth-child(2) {
  width: 92%;
}

.preview-lines span:nth-child(3) {
  width: 78%;
}

.preview-lines .preview-lines__short {
  width: 48%;
}

.preview-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--outline-variant);
  padding-top: 12px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 24px;
}

.feature-card {
  position: relative;
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  box-shadow: 4px 4px 0 var(--pixel-shadow);
}

.feature-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 12px;
  height: 12px;
  background: var(--bg);
  border-right: 1px solid var(--outline-variant);
  border-bottom: 1px solid var(--outline-variant);
  pointer-events: none;
}

.feature-card h2 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 26px;
  font-weight: 400;
}

.feature-card p {
  margin: 0;
  color: var(--on-surface-variant);
  font-size: 13px;
  line-height: 21px;
}

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

@media (max-width: 1100px) {
  .hero {
    gap: 32px;
  }
}

@media (max-width: 1024px) {
  .app-shell {
    display: block;
  }

  .rail {
    width: 100%;
    height: auto;
    position: static;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--outline-variant);
  }

  .rail__brand {
    padding: 14px 16px;
  }

  .rail__action {
    padding: 10px 16px;
  }

  .rail__nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 12px;
  }

  .rail-link {
    flex: 0 1 auto;
  }

  .rail__months,
  .rail__bottom {
    display: none;
  }

  .page-bar {
    padding: 12px 16px;
  }

  .content {
    padding: 28px 16px 56px;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__art {
    max-width: 520px;
  }

  .dash-grid,
  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 720px) {
  .guest-header {
    padding: 14px 16px;
    flex-wrap: wrap;
  }

  .guest-nav .status-pill--wide {
    display: none;
  }

  .guest-main {
    padding: 28px 16px 48px;
  }

  .guest-footer {
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
  }

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

  .hero__title {
    font-size: 42px;
  }

  .hero__art {
    max-width: none;
  }

  .auth-layout {
    padding-top: 0;
  }

  .page-bar__inner {
    align-items: flex-start;
  }

  .search-form {
    max-width: none;
  }
}

@media (max-width: 600px) {
  .content {
    padding: 20px 12px 40px;
  }

  .page-bar {
    padding: 10px 12px;
  }

  .page-bar h1 {
    font-size: 17px;
    line-height: 23px;
  }

  .page-bar__title {
    gap: 8px;
  }

  .entry-card,
  .entry-full,
  .editor-card,
  .panel {
    padding: 16px;
  }

  .entry-card__head {
    flex-direction: column;
    gap: 6px;
  }

  .entry-card__stats {
    white-space: normal;
  }

  .entry-full__title {
    font-size: 28px;
    line-height: 34px;
  }

  .auth-card__body {
    padding: 18px;
  }

  .auth-tabs {
    font-size: 9px;
  }

  .status-card {
    width: calc(100% - 24px);
    margin: 24px auto;
    padding: 24px 16px;
  }

  .hero {
    padding-top: 8px;
  }

  .hero__title {
    font-size: 36px;
    letter-spacing: -1px;
  }

  .lede {
    font-size: 15px;
    line-height: 25px;
  }

  .input--title {
    font-size: 24px;
    line-height: 30px;
  }

  .editor-card {
    padding: 14px;
  }

  .editor-content {
    padding: 12px;
  }

  .editor-content.is-empty::before {
    top: 12px;
    left: 12px;
  }

  .encrypt-fx {
    padding: 14px;
  }

  .encrypt-fx__title {
    font-size: 24px;
    line-height: 30px;
  }

  .encrypt-fx__body {
    font-size: 15px;
    line-height: 24px;
  }

  .skeleton-line--title-input {
    right: 20%;
    height: 26px;
  }

  .dash-head__title {
    font-size: 30px;
    line-height: 36px;
  }

  .feed-head h1 {
    font-size: 26px;
    line-height: 32px;
  }

  .status-card h1 {
    font-size: 24px;
    line-height: 30px;
  }

  .danger-panel__title {
    font-size: 24px;
    line-height: 30px;
  }
}

@media (max-width: 380px) {
  .brand__sub {
    display: none;
  }

  .guest-nav .btn {
    padding: 5px 8px;
    font-size: 11px;
  }

  .rail__nav {
    padding: 6px 8px;
  }

  .rail-link {
    padding: 7px 8px;
    font-size: 13px;
  }

  .auth-card__body {
    padding: 14px;
  }

  .auth-tabs .auth-tab {
    font-size: 10px;
  }

  .hero__title {
    font-size: 32px;
  }

  .page-bar__actions {
    width: 100%;
  }
}

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

  .skeleton-line::after,
  .skeleton-text::after {
    opacity: 0.06;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Themes / typography / density preferences
   -------------------------------------------------------------------------- */

:root {
  --body-size: 14px;
  --prose-size: 15px;
  --small-size: 13px;
  --lede-size: 17px;
}

html[data-theme="paper"] {
  color-scheme: light;
  --primary: #b79b00;
  --on-primary: #fffdf5;
  --primary-container: #eadf9f;
  --on-primary-container: #3d3400;
  --secondary: #6b6041;
  --tertiary: #0e6f73;
  --success: #157347;
  --error: #a42323;
  --error-container: #f6d4d4;
  --on-error-container: #5c0d0d;
  --bg: #f3efe4;
  --surface: #fffdf6;
  --surface-low: #f8f4e9;
  --surface-container: #efe8d8;
  --surface-high: #e5dcc8;
  --surface-highest: #d8cdb6;
  --on-surface: #1c1a15;
  --on-surface-variant: #5b5548;
  --outline: #8b8372;
  --outline-variant: #d6cdbb;
  --text-faint: #6b6456;
  --pixel-shadow: #b8ad97;
  --warning: #8a6d00;
}

html[data-theme="contrast"] {
  --bg: #000000;
  --surface: #050505;
  --surface-low: #0b0b0b;
  --surface-container: #111111;
  --surface-high: #1a1a1a;
  --surface-highest: #242424;
  --on-surface: #ffffff;
  --on-surface-variant: #dedede;
  --outline: #9b9b9b;
  --outline-variant: #3b3b3b;
  --text-faint: #c2c2c2;
  --primary: #ffe600;
  --primary-container: #4a4300;
  --pixel-shadow: #000000;
  --warning: #ffe600;
}

html[data-font="mono"] {
  --font-body: var(--font-mono);
  --font-display: var(--font-mono);
}

html[data-font="system"] {
  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: system-ui, -apple-system, "Segoe UI", sans-serif;
}

html[data-size="compact"] {
  --body-size: 13px;
  --prose-size: 14px;
  --small-size: 12px;
  --lede-size: 15px;
}

html[data-size="large"] {
  --body-size: 16px;
  --prose-size: 18px;
  --small-size: 14px;
  --lede-size: 19px;
}

body {
  font-size: var(--body-size);
}

.prose {
  font-size: var(--prose-size);
}

.small {
  font-size: var(--small-size);
}

.lede {
  font-size: var(--lede-size);
}

[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Dialogs / settings / encryption
   -------------------------------------------------------------------------- */

dialog.modal {
  width: min(680px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 40px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--outline-variant);
  border-radius: 0;
  background: var(--surface);
  color: var(--on-surface);
  box-shadow: 10px 10px 0 var(--pixel-shadow);
}

dialog.modal::backdrop {
  background: rgba(0, 0, 0, 0.76);
}

dialog.modal--settings {
  width: min(820px, calc(100vw - 32px));
}

.modal__panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  max-height: calc(100vh - 42px);
  overflow: auto;
}

.modal__panel--settings {
  padding: 0;
}

.modal__panel--settings > .modal__head {
  padding: 20px 22px 0;
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal__head h2 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 32px;
  font-weight: 400;
}

.modal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--outline-variant);
}

.vault-loading {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0;
  color: var(--text-faint);
}

.encryption-setup {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--outline-variant);
  background: var(--surface-low);
}

.encryption-setup__copy {
  margin: 0;
  color: var(--on-surface-variant);
  font-size: 12px;
  line-height: 18px;
}

.encryption-setup__error {
  margin: 0;
  color: var(--error);
  font-size: 12px;
  line-height: 18px;
}

.settings {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 22px 24px;
}

.modal__panel--settings .settings {
  padding-top: 12px;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--outline-variant);
}

.settings-tab {
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--on-surface-variant);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
}

.settings-tab:hover {
  color: var(--on-surface);
}

.settings-tab--active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-panel .panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-panel .panel__head h2,
.settings-panel .panel__section h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 28px;
  font-weight: 400;
}

.settings-panel .panel__section h3 {
  font-size: 17px;
  line-height: 23px;
}

.settings-panel .panel__section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--outline-variant);
}

.settings-panel .panel__section p {
  margin: 0;
}

.pref-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pref-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pref-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--outline-variant);
  background: var(--surface-container);
  color: var(--on-surface);
  text-align: left;
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--pixel-shadow);
  transition:
    border-color var(--state),
    transform var(--state),
    box-shadow var(--state);
}

.pref-card:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--pixel-shadow);
}

.pref-card:hover,
.pref-card--active {
  border-color: var(--primary);
}

.pref-card--active {
  box-shadow: 3px 3px 0 var(--primary-container);
}

.pref-card--active::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  background: var(--primary);
}

.pref-card__hint {
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 15px;
  letter-spacing: 0;
  color: var(--text-faint);
}

.pref-swatch {
  width: 100%;
  height: 22px;
  border: 1px solid var(--outline);
  background: var(--bg);
  background-size: 8px 8px;
}

.pref-swatch--midnight {
  background-image: conic-gradient(
    #fae36a 25%,
    #0e0e11 0 50%,
    #fae36a 0 75%,
    #0e0e11 0
  );
}

.pref-swatch--paper {
  background-image: conic-gradient(
    #b79b00 25%,
    #f3efe4 0 50%,
    #b79b00 0 75%,
    #f3efe4 0
  );
}

.pref-swatch--contrast {
  background-image: conic-gradient(
    #ffe600 25%,
    #000 0 50%,
    #ffe600 0 75%,
    #000 0
  );
}

.pref-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

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

.export-card {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 2px;
  padding: 12px;
  border: 1px solid var(--outline-variant);
  background: var(--surface-container);
  color: var(--on-surface);
  text-align: left;
  font-family: var(--font-body);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--pixel-shadow);
  transition:
    border-color var(--state),
    transform var(--state),
    box-shadow var(--state);
}

.export-card:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--pixel-shadow);
}

.export-card:hover {
  border-color: var(--primary);
}

.export-card .icon {
  grid-row: 1 / span 2;
  width: 30px;
  height: 30px;
  padding: 6px;
  border: 1px solid var(--outline-variant);
  background: var(--surface-high);
  color: var(--primary);
}

.export-card__title {
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 20px;
}

.export-card__hint {
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 15px;
  letter-spacing: 0;
  color: var(--text-faint);
}

.danger-zone {
  border: 1px solid #9f2626;
  padding: 16px;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feed-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 26px 0 6px;
}

.entry-card--search .entry-card__body {
  padding: 8px 0 0;
}

@media (max-width: 720px) {
  .pref-grid,
  .pref-row,
  .export-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings,
  .modal__panel {
    padding: 16px;
  }

  .modal__panel--settings {
    padding: 0;
  }
}
