:root {
  --paper: #f6f2ea;
  --paper-deep: #eee8dc;
  --ink: #17342f;
  --ink-soft: #52635e;
  --line: #dcd5c8;
  --card: #fffdf8;
  --accent: #f16f52;
  --accent-dark: #dc5c40;
  --mint: #dce8df;
  --shadow: 0 24px 65px rgba(43, 55, 48, 0.09), 0 3px 10px rgba(43, 55, 48, 0.04);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 13% 27%, rgba(241, 111, 82, 0.05), transparent 24rem),
    linear-gradient(rgba(23, 52, 47, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 52, 47, 0.022) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 32px 32px, 32px 32px, auto;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

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

.site-header {
  width: min(1180px, calc(100% - 48px));
  height: 92px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(23, 52, 47, 0.13);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.23rem;
  font-weight: 760;
  letter-spacing: -0.035em;
}

.brand > span:last-child span { color: var(--accent); }

.brand-mark {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--paper);
  background: var(--ink);
  transform: rotate(-2deg);
}

.brand-mark svg { width: 22px; overflow: visible; }
.brand-mark path { fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }

.header-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 650;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.header-action:hover { color: var(--ink); background: rgba(255, 255, 255, 0.42); border-color: var(--line); }
.header-action svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.header-nav { display: flex; align-items: center; gap: 3px; }
.history-button { background: transparent; cursor: pointer; }
.history-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 20px;
  color: #fff;
  background: var(--accent);
  font-size: 0.61rem;
  font-weight: 800;
  line-height: 1;
}

main { width: 100%; flex: 1; }

.composer, .paste-view {
  width: min(900px, calc(100% - 48px));
  margin: 0 auto;
  padding: 75px 0 55px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.135em;
  text-transform: uppercase;
}

.eyebrow span { width: 28px; height: 1.5px; background: currentColor; }

h1 {
  margin: 17px 0 13px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 7.2vw, 5.3rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.057em;
}

h1 em { color: var(--accent); font-weight: 400; }
.intro { margin: 0; color: var(--ink-soft); font-size: 1rem; line-height: 1.65; }

.paste-card {
  position: relative;
  margin-top: 39px;
  padding: 23px 25px 20px;
  border: 1px solid rgba(23, 52, 47, 0.15);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.paste-card::before {
  content: "";
  position: absolute;
  width: 34px;
  height: 3px;
  top: -2px;
  left: 30px;
  border-radius: 3px;
  background: var(--accent);
}

.editor-topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.editor-topline label { font-size: 0.78rem; font-weight: 760; letter-spacing: 0.02em; }
.editor-topline span { color: #82908b; font-size: 0.72rem; font-variant-numeric: tabular-nums; }

.textarea-wrap { position: relative; }

textarea {
  display: block;
  width: 100%;
  min-height: 284px;
  padding: 20px 22px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  color: #243b37;
  background:
    linear-gradient(rgba(23, 52, 47, 0.025) 1px, transparent 1px),
    #fbfaf6;
  background-size: 100% 28px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.91rem;
  line-height: 1.72;
  caret-color: var(--accent);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea::placeholder { color: #9aa19c; }
textarea:focus { border-color: #8ca49d; box-shadow: 0 0 0 3px rgba(23, 52, 47, 0.07); }

.corner-lines { position: absolute; right: 8px; bottom: 8px; width: 17px; height: 17px; pointer-events: none; }
.corner-lines i { position: absolute; right: 0; bottom: 0; width: 1px; height: 8px; background: #b0b8b3; transform-origin: bottom; transform: rotate(45deg); }
.corner-lines i:nth-child(2) { right: 4px; height: 6px; }
.corner-lines i:nth-child(3) { right: 8px; height: 4px; }

.form-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
}

.expiration-field { display: flex; align-items: center; gap: 10px; }
.expiration-field > label { color: var(--ink-soft); font-size: 0.78rem; font-weight: 650; }
.select-wrap { position: relative; }

select {
  appearance: none;
  min-width: 122px;
  padding: 9px 32px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: #fbfaf6;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}

select:focus-visible { box-shadow: 0 0 0 3px rgba(23, 52, 47, 0.09); }
.select-wrap svg { position: absolute; top: 50%; right: 10px; width: 14px; transform: translateY(-50%); fill: none; stroke: var(--ink-soft); stroke-width: 1.8; pointer-events: none; }

.primary-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 45px;
  padding: 0 19px;
  border: 0;
  border-radius: 9px;
  color: #fffaf4;
  background: var(--ink);
  font-size: 0.82rem;
  font-weight: 740;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 7px 16px rgba(23, 52, 47, 0.16);
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.primary-button:hover, .secondary-button:hover { transform: translateY(-1px); background: #214941; box-shadow: 0 9px 20px rgba(23, 52, 47, 0.2); }
.primary-button:active, .secondary-button:active { transform: translateY(0); }
.primary-button:disabled { cursor: wait; opacity: 0.68; transform: none; }
.primary-button svg, .secondary-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.primary-button.loading svg { animation: nudge 850ms ease-in-out infinite; }

@keyframes nudge { 50% { transform: translateX(3px); } }

.form-error { margin: 14px 0 0; color: #b33d30; font-size: 0.78rem; font-weight: 620; }

.share-result {
  margin-top: 22px;
  padding: 26px;
  display: flex;
  gap: 19px;
  border: 1px solid #cbd9ce;
  border-radius: 14px;
  background: #e7efe8;
  box-shadow: 0 18px 45px rgba(43, 55, 48, 0.06);
  animation: reveal 360ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes reveal { from { opacity: 0; transform: translateY(10px); } }

.success-icon { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--ink); }
.success-icon svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.result-copy { min-width: 0; flex: 1; }
.result-kicker { margin: 0 0 3px; color: #62756e; font-size: 0.67rem; font-weight: 780; letter-spacing: 0.11em; text-transform: uppercase; }
.result-copy h2 { margin: 0 0 14px; font-family: Georgia, "Times New Roman", serif; font-size: 1.42rem; font-weight: 500; letter-spacing: -0.025em; }
.link-field { display: flex; overflow: hidden; border: 1px solid #bdcbc0; border-radius: 9px; background: #fbfdf9; }
.link-field input { min-width: 0; flex: 1; padding: 11px 13px; border: 0; outline: 0; color: #3e514b; background: transparent; font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.77rem; }
.copy-link-button { display: inline-flex; align-items: center; gap: 7px; padding: 0 15px; border: 0; border-left: 1px solid #bdcbc0; color: var(--ink); background: #f2f6f1; font-size: 0.74rem; font-weight: 750; cursor: pointer; }
.copy-link-button:hover { background: #e8f0e8; }
.copy-link-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.result-actions { display: flex; gap: 16px; margin-top: 13px; }
.result-actions a, .result-actions button { border: 0; padding: 0; color: #526a62; background: none; font-size: 0.73rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 34px;
  margin-top: 30px;
  padding: 0 12px;
}

.trust-row > div { display: flex; align-items: center; gap: 11px; min-width: 0; }
.trust-row svg { flex: 0 0 auto; width: 24px; height: 24px; fill: none; stroke: #789087; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.trust-row span { color: #82908b; font-size: 0.66rem; line-height: 1.45; }
.trust-row strong { display: block; color: var(--ink-soft); font-size: 0.7rem; font-weight: 760; }

.paste-view { padding-top: 68px; }
.paste-view h1 { font-size: clamp(2.7rem, 6vw, 4.45rem); }
.view-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; }
.view-heading > div:first-child { min-width: 0; }
.view-heading p { margin: 0; color: #778680; font-size: 0.78rem; }
.view-actions { display: flex; align-items: center; gap: 9px; padding-bottom: 3px; }
.secondary-button { min-height: 41px; padding: 0 15px; box-shadow: none; }
.icon-button { width: 41px; height: 41px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.4); }
.icon-button:hover { background: var(--card); }
.icon-button svg { width: 18px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.paste-output-wrap {
  position: relative;
  min-height: 360px;
  margin-top: 34px;
  overflow: hidden;
  border: 1px solid rgba(23, 52, 47, 0.15);
  border-radius: 15px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.paste-output-wrap::before { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--accent) 0 17%, var(--ink) 17% 100%); }

pre {
  margin: 0;
  padding: 28px 31px 35px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #2a3e39;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  line-height: 1.75;
  tab-size: 2;
}

.loading-state { position: absolute; inset: 4px 0 0; padding: 31px; background: var(--card); }
.loading-state i { display: block; height: 12px; margin-bottom: 16px; border-radius: 5px; background: linear-gradient(90deg, #ece8df 20%, #f6f3ed 45%, #ece8df 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
.loading-state i:nth-child(1) { width: 84%; }
.loading-state i:nth-child(2) { width: 93%; }
.loading-state i:nth-child(3) { width: 68%; }
.loading-state i:nth-child(4) { width: 78%; }
.loading-state i:nth-child(5) { width: 46%; }
@keyframes shimmer { to { background-position: -150% 0; } }

.paste-not-found { padding: 70px 25px; text-align: center; }
.empty-mark { width: 50px; height: 50px; margin: 0 auto 18px; display: grid; place-items: center; border: 1px solid #c9d2cb; border-radius: 50%; color: var(--accent); background: #edf2ed; font-family: Georgia, serif; font-size: 1.5rem; }
.paste-not-found h2 { margin: 0 0 8px; font-family: Georgia, serif; font-size: 1.8rem; font-weight: 500; }
.paste-not-found p { margin: 0 auto 23px; color: var(--ink-soft); font-size: 0.84rem; }

footer {
  width: min(1180px, calc(100% - 48px));
  min-height: 82px;
  margin: auto auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid rgba(23, 52, 47, 0.12);
  color: #82908b;
  font-size: 0.69rem;
}

footer p { margin: 0; }
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); }

body.history-open { overflow: hidden; }

.history-layer { position: fixed; z-index: 20; inset: 0; display: flex; justify-content: flex-end; }
.history-backdrop { position: absolute; inset: 0; border: 0; background: rgba(18, 34, 30, 0.34); backdrop-filter: blur(3px); cursor: default; animation: fade-in 180ms ease both; }
.history-panel {
  position: relative;
  width: min(430px, calc(100% - 32px));
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(23, 52, 47, 0.14);
  background: var(--card);
  box-shadow: -25px 0 70px rgba(23, 52, 47, 0.16);
  animation: slide-in 260ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(100%); } }

.history-panel-header { padding: 30px 28px 23px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.history-panel-header p { margin: 0 0 5px; color: var(--accent-dark); font-size: 0.65rem; font-weight: 790; letter-spacing: 0.1em; text-transform: uppercase; }
.history-panel-header h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 2rem; font-weight: 500; letter-spacing: -0.04em; }
.history-close { width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-soft); background: transparent; cursor: pointer; }
.history-close:hover { color: var(--ink); background: var(--paper); }
.history-close svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.history-content { min-height: 0; flex: 1; overflow-y: auto; }
.history-list { margin: 0; padding: 11px 16px 20px; list-style: none; }
.history-item { position: relative; display: flex; align-items: center; gap: 5px; border-bottom: 1px solid #e8e2d8; }
.history-item-link { min-width: 0; flex: 1; padding: 14px 8px; display: flex; align-items: center; gap: 12px; border-radius: 9px; text-decoration: none; }
.history-item-link:hover { background: var(--paper); }
.history-item-icon { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; color: #6d827a; background: #e6eee7; }
.history-item-icon svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.history-item-copy { min-width: 0; flex: 1; }
.history-item-title { display: block; overflow: hidden; color: var(--ink); font-size: 0.79rem; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.history-item-meta { display: block; margin-top: 4px; overflow: hidden; color: #82908b; font-size: 0.66rem; text-overflow: ellipsis; white-space: nowrap; }
.history-remove { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; color: #9aa39f; background: transparent; cursor: pointer; }
.history-remove:hover { color: #b44b3b; background: #faece7; }
.history-remove svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

.history-empty { padding: 76px 35px; text-align: center; }
.history-empty > span { width: 52px; height: 52px; margin: 0 auto 17px; display: grid; place-items: center; border-radius: 50%; color: #789087; background: var(--mint); }
.history-empty svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.history-empty h3 { margin: 0 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; font-weight: 500; }
.history-empty p { max-width: 230px; margin: 0 auto; color: #82908b; font-size: 0.75rem; line-height: 1.55; }

.history-panel-footer { min-height: 68px; padding: 16px 27px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); background: #faf7f1; }
.history-panel-footer p { margin: 0; display: flex; align-items: center; gap: 7px; color: #82908b; font-size: 0.66rem; }
.history-panel-footer p svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.history-panel-footer button { padding: 5px 0; border: 0; color: var(--accent-dark); background: transparent; font-size: 0.68rem; font-weight: 720; cursor: pointer; }
.history-panel-footer button:hover { text-decoration: underline; text-underline-offset: 3px; }

.toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border-radius: 9px;
  color: #fff;
  background: var(--ink);
  font-size: 0.77rem;
  font-weight: 670;
  box-shadow: 0 10px 30px rgba(23, 52, 47, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 17px; fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

[hidden] { display: none !important; }

:focus-visible { outline: 3px solid rgba(241, 111, 82, 0.42); outline-offset: 3px; }

@media (max-width: 700px) {
  .site-header, footer, .composer, .paste-view { width: min(100% - 28px, 900px); }
  .site-header { height: 76px; }
  .composer, .paste-view { padding-top: 53px; }
  h1 { font-size: clamp(3rem, 14.8vw, 4.4rem); }
  .intro { max-width: 34rem; font-size: 0.94rem; }
  .paste-card { margin-top: 30px; padding: 20px 16px 17px; }
  textarea { min-height: 250px; padding: 17px; }
  .form-footer { align-items: stretch; flex-direction: column; gap: 16px; }
  .expiration-field { justify-content: space-between; }
  .primary-button { width: 100%; }
  .share-result { padding: 20px 16px; }
  .trust-row { grid-template-columns: 1fr; gap: 14px; padding: 0 8px; }
  .view-heading { align-items: flex-start; flex-direction: column; gap: 23px; }
  .view-actions { width: 100%; }
  .secondary-button { flex: 1; }
  .paste-output-wrap { margin-top: 24px; }
  pre { padding: 23px 20px 29px; font-size: 0.81rem; }
}

@media (max-width: 430px) {
  .header-action { padding: 8px 5px; }
  .header-action svg { display: none; }
  .share-result { align-items: flex-start; gap: 12px; }
  .success-icon { width: 32px; height: 32px; }
  .link-field { flex-direction: column; }
  .link-field input { width: 100%; }
  .copy-link-button { min-height: 40px; justify-content: center; border-left: 0; border-top: 1px solid #bdcbc0; }
  footer { min-height: 76px; }
  .history-panel { width: 100%; height: min(78vh, 650px); margin-top: auto; border: 0; border-radius: 18px 18px 0 0; animation-name: sheet-in; }
  .history-panel-header { padding: 22px 20px 18px; }
  .history-panel-footer { padding: 14px 20px; }
}

@keyframes sheet-in { from { transform: translateY(100%); } }

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