:root {
  color-scheme: light;
  --paper: #e3cf9d;
  --paper-light: #f0dfb4;
  --paper-deep: #c6a867;
  --paper-shadow: #8b6b38;
  --ink: #1d1b16;
  --ink-soft: #514837;
  --ink-faint: #786b53;
  --red: #8c2e23;
  --red-dark: #5f1b16;
  --green: #3d5a3d;
  --line: rgba(48, 37, 22, 0.25);
  --serif: Georgia, "Times New Roman", "Noto Serif", serif;
  --script: "Apple Chancery", "Segoe Script", "URW Chancery L", cursive;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow: 0 18px 55px rgba(52, 36, 12, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% -15%, #f6e9c6 0%, transparent 52%),
    linear-gradient(103deg, rgba(89, 56, 14, 0.055), transparent 22%, rgba(255,255,255,0.12) 56%, transparent 78%),
    var(--paper);
  font-family: var(--serif);
  line-height: 1.5;
  overflow-x: hidden;
}

body::after {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  box-shadow: inset 0 0 150px rgba(75, 47, 10, 0.28), inset 0 0 28px rgba(69, 44, 10, 0.2);
}

button,
input {
  font: inherit;
}

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

button {
  color: inherit;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

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

.loading-view {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}

.ink-loader {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(29, 27, 22, 0.16);
  border-top-color: var(--ink);
  border-radius: 53% 47% 50% 46%;
  animation: ink-spin 0.9s linear infinite;
}

@keyframes ink-spin {
  to { transform: rotate(360deg); }
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 28px;
  padding: 62px 22px 40px;
}

.login-scroll {
  position: relative;
  width: min(470px, calc(100vw - 36px));
  filter: drop-shadow(0 28px 25px rgba(64, 43, 12, 0.22));
}

.login-content {
  position: relative;
  padding: 66px 62px 59px;
  background:
    linear-gradient(91deg, rgba(92, 60, 20, 0.09), transparent 9%, transparent 91%, rgba(92, 60, 20, 0.08)),
    radial-gradient(ellipse at 51% 6%, rgba(255,255,255,0.34), transparent 42%),
    #ead8a8;
  clip-path: polygon(1.2% 0.8%, 99.2% 0, 98.7% 99%, 1.7% 98.5%, 0.4% 76%, 1% 51%, 0 25%);
  border: 1px solid rgba(80, 54, 20, 0.18);
}

.login-content::before {
  position: absolute;
  inset: 18px;
  content: "";
  border: 1px solid rgba(61, 45, 25, 0.18);
  border-radius: 48% 2% 45% 1% / 1% 42% 2% 47%;
  pointer-events: none;
}

.scroll-rod {
  position: absolute;
  z-index: 2;
  right: -22px;
  left: -22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(#392b1b, #8a6439 18%, #3b2b19 53%, #17140f 72%, #7a5630);
  box-shadow: 0 8px 12px rgba(44, 28, 7, 0.32);
}

.scroll-rod::before,
.scroll-rod::after {
  position: absolute;
  top: 5px;
  width: 35px;
  height: 12px;
  content: "";
  border-radius: 50%;
  background: #2b2116;
}

.scroll-rod::before { left: -24px; }
.scroll-rod::after { right: -24px; }
.scroll-rod-top { top: -9px; }
.scroll-rod-bottom { bottom: -3px; }

.brand-mark {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  flex: 0 0 auto;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-mark-large {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 7px;
  color: var(--red-dark);
  font-family: var(--sans);
  font-size: 0.69rem;
  font-weight: 750;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.login-content h1 {
  margin: 0;
  font-family: var(--script);
  font-size: clamp(3rem, 12vw, 4.3rem);
  font-weight: 500;
  line-height: 0.95;
  text-align: center;
  letter-spacing: -0.05em;
  transform: rotate(-1deg);
}

.ink-form,
.link-form {
  display: grid;
}

.field-label {
  margin: 0 0 4px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field-label:not(:first-child) {
  margin-top: 22px;
}

.field-label span {
  color: var(--ink-faint);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.ink-input-wrap {
  position: relative;
}

.ink-input-wrap input,
.slug-composer input,
.search-box input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  outline: none;
  border: 0;
  background: transparent;
}

.ink-input-wrap input {
  height: 43px;
  padding: 4px 56px 7px 2px;
  font-family: var(--serif);
  font-size: 1.04rem;
}

.ink-input-wrap input::placeholder,
.slug-composer input::placeholder,
.search-box input::placeholder {
  color: rgba(62, 51, 35, 0.48);
}

.input-stroke {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ink) 2%, var(--ink) 89%, transparent);
  opacity: 0.55;
  transform: rotate(-0.2deg);
}

.input-stroke::after {
  position: absolute;
  right: 4%;
  bottom: -2px;
  left: 23%;
  height: 1px;
  content: "";
  background: var(--ink);
  opacity: 0.38;
  transform: rotate(0.5deg);
}

.ink-input-wrap:focus-within .input-stroke {
  height: 3px;
  opacity: 0.9;
}

.reveal-button {
  position: absolute;
  z-index: 2;
  top: 7px;
  right: 0;
  padding: 6px 4px;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.brush-button,
.ghost-button,
.text-button,
.icon-button {
  cursor: pointer;
}

.brush-button {
  position: relative;
  min-height: 46px;
  padding: 11px 21px;
  overflow: hidden;
  color: #f7edcf;
  border: 0;
  border-radius: 45% 4% 41% 5% / 12% 48% 15% 43%;
  background:
    linear-gradient(91deg, rgba(255,255,255,0.08), transparent 23%, rgba(0,0,0,0.13)),
    var(--ink);
  box-shadow: 3px 4px 0 rgba(103, 55, 26, 0.28);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.brush-button::before {
  position: absolute;
  inset: 2px -4px;
  content: "";
  border-top: 1px solid rgba(255,255,255,0.16);
  border-bottom: 1px solid rgba(0,0,0,0.18);
  transform: rotate(-0.8deg);
}

.brush-button:hover:not(:disabled) {
  transform: translateY(-2px) rotate(-0.3deg);
  box-shadow: 4px 7px 0 rgba(103, 55, 26, 0.22);
}

.brush-button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 1px 2px 0 rgba(103, 55, 26, 0.28);
}

.brush-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.brush-button-wide {
  width: 100%;
  margin-top: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.button-arrow {
  font-size: 1.15rem;
  line-height: 1;
}

.form-error {
  margin: 14px 0 0;
  padding-left: 12px;
  color: var(--red-dark);
  border-left: 2px solid var(--red);
  font-size: 0.86rem;
  font-style: italic;
}

.login-footnote {
  margin: 0;
  color: rgba(37, 31, 22, 0.62);
  font-size: 0.78rem;
  font-style: italic;
  text-align: center;
}

.login-copyright {
  margin-top: -16px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  padding: 14px max(24px, calc((100vw - 1280px) / 2));
  border-bottom: 1px solid rgba(60, 44, 23, 0.2);
  background: rgba(226, 205, 155, 0.87);
  box-shadow: 0 6px 28px rgba(69, 46, 15, 0.08);
  backdrop-filter: blur(13px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-copy {
  display: grid;
  line-height: 1.12;
}

.brand-copy strong {
  font-family: var(--script);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.73rem;
  font-weight: 650;
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(61, 90, 61, 0.13);
}

.text-button {
  padding: 7px 1px;
  color: var(--red-dark);
  border: 0;
  border-bottom: 1px solid rgba(95, 27, 22, 0.35);
  background: transparent;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
}

.text-button:hover { border-bottom-color: var(--red-dark); }

.dashboard-shell {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 78px 0 90px;
}

.stats-strip {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1.2fr;
  align-items: center;
  gap: 26px;
  margin: 0 0 38px;
  padding: 22px 34px;
  border-top: 1px solid rgba(47, 35, 20, 0.3);
  border-bottom: 1px solid rgba(47, 35, 20, 0.25);
  background: rgba(238, 220, 177, 0.35);
}

.stats-strip::before,
.stats-strip::after {
  position: absolute;
  right: 3%;
  left: 4%;
  height: 1px;
  content: "";
  background: rgba(42, 34, 22, 0.16);
  transform: rotate(-0.12deg);
}

.stats-strip::before { top: 2px; }
.stats-strip::after { bottom: 2px; }

.stats-strip article {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.stat-number {
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1;
}

.stat-label {
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 0.67rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ink-divider {
  width: 3px;
  height: 34px;
  border-radius: 80%;
  background: var(--ink);
  opacity: 0.18;
  transform: rotate(3deg);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(310px, 0.72fr) minmax(500px, 1.28fr);
  align-items: start;
  gap: 35px;
}

.editor-card,
.collection-panel {
  position: relative;
  border: 1px solid rgba(61, 46, 25, 0.22);
  background:
    radial-gradient(circle at 83% 11%, rgba(113, 72, 24, 0.07) 0 2px, transparent 3px),
    linear-gradient(96deg, rgba(111, 75, 31, 0.07), transparent 14%, transparent 86%, rgba(111, 75, 31, 0.06)),
    rgba(238, 219, 175, 0.76);
  box-shadow: var(--shadow);
}

.editor-card {
  position: sticky;
  top: 111px;
  padding: 36px 35px 39px;
  clip-path: polygon(0.7% 0.5%, 99% 0, 99.5% 99%, 1% 99.4%, 0 68%);
}

.editor-card::before,
.collection-panel::before {
  position: absolute;
  inset: 7px;
  content: "";
  border: 1px solid rgba(57, 43, 25, 0.12);
  pointer-events: none;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 31px;
}

.section-heading h2,
.collection-header h2,
.confirm-dialog h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.seal {
  display: grid;
  width: 47px;
  height: 47px;
  place-items: center;
  flex: 0 0 auto;
  color: #e9cfa3;
  border: 2px solid rgba(101, 26, 20, 0.75);
  background: var(--red);
  box-shadow: inset 0 0 0 3px rgba(232, 202, 154, 0.22);
  font-size: 1.35rem;
  transform: rotate(-3deg);
}

.slug-composer {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 1px;
  padding: 9px 12px;
  border: 1px solid rgba(45, 35, 23, 0.3);
  background: rgba(255, 245, 214, 0.22);
  box-shadow: inset 0 1px 7px rgba(84, 57, 20, 0.06);
}

.slug-composer:focus-within {
  border-color: rgba(29, 27, 22, 0.7);
  box-shadow: inset 0 1px 7px rgba(84, 57, 20, 0.06), 0 0 0 2px rgba(29, 27, 22, 0.08);
}

.origin-prefix {
  max-width: 54%;
  overflow: hidden;
  flex: 0 1 auto;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slug-composer input {
  flex: 1 1 110px;
  padding: 0;
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 700;
}

.field-hint {
  margin: 7px 0 2px;
  color: var(--ink-faint);
  font-size: 0.72rem;
  font-style: italic;
}

.link-form .ink-input-wrap input {
  padding-right: 2px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
}

.ghost-button {
  padding: 9px 4px;
  color: var(--ink-soft);
  border: 0;
  border-bottom: 1px solid rgba(58, 46, 30, 0.32);
  background: transparent;
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 700;
}

.ghost-button:hover { color: var(--ink); border-bottom-color: var(--ink); }

.brush-corner {
  position: absolute;
  right: 18px;
  bottom: 15px;
  width: 53px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.09;
  transform: rotate(-13deg);
}

.collection-panel {
  min-height: 510px;
  padding: 35px;
  clip-path: polygon(0.5% 0, 99.3% 0.5%, 100% 73%, 99.1% 99.5%, 0 99%, 0.7% 31%);
}

.collection-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 27px;
  padding-bottom: 19px;
  border-bottom: 1px solid rgba(54, 42, 26, 0.23);
}

.search-box {
  display: flex;
  width: min(230px, 43%);
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  color: var(--ink-soft);
  border-bottom: 1px solid rgba(48, 38, 25, 0.38);
}

.search-box > span:first-child {
  font-size: 1.2rem;
  line-height: 1;
}

.search-box input {
  padding: 0;
  font-family: var(--sans);
  font-size: 0.76rem;
}

.links-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
}

.link-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 20px 18px 18px 21px;
  border-left: 3px solid transparent;
  border-bottom: 1px solid rgba(54, 42, 26, 0.15);
  background: rgba(255, 245, 216, 0.2);
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.link-card::after {
  position: absolute;
  right: 2%;
  bottom: -2px;
  left: 26%;
  height: 1px;
  content: "";
  background: rgba(51, 39, 24, 0.12);
  transform: rotate(0.2deg);
}

.link-card:hover {
  border-left-color: var(--red);
  background: rgba(255, 247, 222, 0.42);
  transform: translateX(2px);
}

.link-main {
  min-width: 0;
}

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

.link-title {
  overflow: hidden;
  margin: 0;
  font-size: 1.03rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.click-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: var(--ink-faint);
  border: 1px solid rgba(58, 45, 27, 0.15);
  border-radius: 40% 48% 43% 45%;
  font-family: var(--sans);
  font-size: 0.6rem;
}

.short-url {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  color: var(--red-dark);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
}

.short-url-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.short-url:hover .short-url-text {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.target-url {
  overflow: hidden;
  margin: 7px 0 8px;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 13px;
  color: rgba(62, 50, 32, 0.55);
  font-size: 0.68rem;
  font-style: italic;
}

.link-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  opacity: 0.55;
  transition: opacity 150ms ease;
}

.link-card:hover .link-actions,
.link-card:focus-within .link-actions { opacity: 1; }

.icon-button {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  padding: 0;
  color: var(--ink-soft);
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  font-family: var(--sans);
  font-size: 1rem;
}

.icon-button:hover {
  border-color: rgba(49, 38, 24, 0.25);
  background: rgba(252, 240, 208, 0.5);
}

.icon-button.danger:hover {
  color: var(--red-dark);
  border-color: rgba(140, 46, 35, 0.3);
}

.links-loading,
.empty-state {
  position: relative;
  z-index: 1;
  min-height: 290px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--ink-faint);
  text-align: center;
}

.links-loading {
  flex-direction: row;
  gap: 6px;
}

.links-loading span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-soft);
  animation: dot-pulse 1.2s infinite ease-in-out;
}

.links-loading span:nth-child(2) { animation-delay: 0.12s; }
.links-loading span:nth-child(3) { animation-delay: 0.24s; }
.links-loading p { margin-left: 7px; font-size: 0.8rem; font-style: italic; }

@keyframes dot-pulse {
  0%, 70%, 100% { opacity: 0.25; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-4px); }
}

.empty-state h3 {
  margin: 16px 0 5px;
  color: var(--ink-soft);
  font-size: 1.12rem;
  font-weight: 500;
}

.empty-state p {
  max-width: 280px;
  margin: 0;
  font-size: 0.8rem;
  font-style: italic;
}

.empty-state.compact { min-height: 220px; }
.empty-state.compact h3 { margin-top: 0; }

.empty-enso {
  width: 72px;
  height: 69px;
  border: 5px solid rgba(29, 27, 22, 0.55);
  border-right-color: transparent;
  border-radius: 48% 53% 46% 55%;
  transform: rotate(-18deg);
  mask-image: linear-gradient(118deg, #000 0 79%, transparent 94%);
}

.site-footer {
  display: flex;
  width: min(1280px, calc(100% - 48px));
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 0 auto;
  padding: 23px 0 38px;
  color: rgba(49, 39, 25, 0.58);
  border-top: 1px solid rgba(55, 42, 23, 0.18);
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.copyright-link {
  color: inherit;
  text-decoration: none;
  transition: color 160ms ease;
}

.copyright-link:hover,
.copyright-link:focus-visible {
  color: var(--red-dark);
}

.footer-brush {
  width: 35px;
  height: 2px;
  background: var(--ink);
  opacity: 0.34;
  transform: rotate(-2deg);
}

.confirm-dialog {
  width: min(430px, calc(100% - 34px));
  padding: 0;
  color: var(--ink);
  border: 1px solid rgba(54, 38, 19, 0.35);
  background: #ead7a5;
  box-shadow: 0 32px 100px rgba(23, 17, 8, 0.5);
  clip-path: polygon(1% 0, 99% 1%, 100% 98%, 0 100%);
}

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

.confirm-dialog form {
  padding: 40px;
  text-align: center;
}

.confirm-dialog .seal { margin: 0 auto 18px; }
.confirm-dialog p:not(.section-kicker) { color: var(--ink-soft); font-size: 0.9rem; }

.seal-danger { background: var(--red-dark); }

.dialog-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 27px;
}

.danger-button { background-color: var(--red-dark); }

.toast-region {
  position: fixed;
  z-index: 1000;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast {
  max-width: min(360px, calc(100vw - 48px));
  padding: 13px 17px;
  color: #f3e6c4;
  border-left: 3px solid #c6a867;
  background: rgba(29, 27, 22, 0.95);
  box-shadow: 0 13px 30px rgba(34, 23, 8, 0.28);
  font-family: var(--sans);
  font-size: 0.78rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast-error { border-left-color: #c55749; }

.clipboard-fallback {
  position: fixed;
  top: -9999px;
  left: -9999px;
}

.error-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.error-scroll {
  width: min(520px, 100%);
  padding: 70px 34px;
  border: 1px solid rgba(55, 40, 20, 0.23);
  background: rgba(239, 220, 175, 0.75);
  box-shadow: var(--shadow);
  text-align: center;
  clip-path: polygon(1% 0, 99% 1%, 100% 98%, 0 100%);
}

.error-scroll h1 {
  margin: 0;
  font-family: var(--script);
  font-size: clamp(5rem, 20vw, 9rem);
  font-weight: 400;
  line-height: 0.9;
}

.error-scroll p { margin: 18px 0 30px; color: var(--ink-soft); font-style: italic; }
.error-scroll .brush-button { display: inline-flex; align-items: center; text-decoration: none; }

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

@media (max-width: 930px) {
  .dashboard-shell { width: min(760px, calc(100% - 34px)); padding-top: 56px; }
  .workspace-grid { grid-template-columns: 1fr; }
  .editor-card { position: relative; top: auto; }
  .collection-panel { min-height: 430px; }
}

@media (max-width: 650px) {
  .topbar { min-height: 72px; padding: 11px 17px; }
  .brand-mark { width: 43px; height: 43px; }
  .brand-copy strong { font-size: 1.3rem; }
  .user-actions { gap: 11px; }
  .user-chip { max-width: 108px; }
  #current-user { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dashboard-shell { width: calc(100% - 24px); padding-top: 42px; }
  .stats-strip { grid-template-columns: 1fr 1fr; gap: 19px; padding: 20px; }
  .stats-strip article { display: grid; gap: 5px; }
  .stats-strip article:last-child { grid-column: 1 / -1; }
  .stats-strip .ink-divider { display: none; }
  .stat-number { font-size: 1.65rem; }
  .editor-card, .collection-panel { padding: 28px 22px 31px; }
  .collection-header { align-items: stretch; flex-direction: column; gap: 16px; }
  .search-box { width: 100%; }
  .link-card { grid-template-columns: 1fr; padding: 18px 13px 15px 16px; }
  .link-actions { justify-content: flex-end; opacity: 0.75; }
  .login-content { padding: 59px 35px 52px; }
  .scroll-rod { right: -9px; left: -9px; }
  .scroll-rod::before, .scroll-rod::after { display: none; }
  .site-footer { width: calc(100% - 30px); flex-wrap: wrap; }
}

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