/* Paste-Post UI - light utility theme. Look: white header with ink wordmark,
   light search pill, light-blue icon chips, blue primary actions and teal
   success accents over a pale blue-gray page. Layout signatures (gray page
   over a white sheet, uppercase meta rows, toolbar strip, dashed line gutter)
   follow the classic paste-site shape; every rule, color and word is our own.
   No external assets, no frameworks. */

:root {
  --bg: #f2f5fa;            /* pale blue-gray page background */
  --panel: #ffffff;         /* white card / sheet */
  --border: #e2e7ef;        /* 1px borders */
  --border-strong: #c6cede; /* dashed gutter border */
  --text: #212326;          /* primary text */
  --muted: #5f6983;         /* secondary text */
  --ink: #050d33;           /* headings / wordmark */
  --accent: #196dff;        /* link blue family */
  --accent-dark: #2e4ce5;   /* link hover, chip text, active nav */
  --accent-solid: #1266f2;  /* solid blue fills under white text: #196dff is
                               4.49:1 with white (below the 4.5 guard), so the
                               fill is nudged just deep enough to clear it */
  --chip-blue: #e8f0fe;     /* light-blue chip background (HOW-TO, avatars,
                               public badge) */
  --green: #2dd4bf;         /* teal accent (success semantics, NOTE flash) */
  --green-dark: #0f9484;    /* teal icon / banner edge (>=3:1 on the tint) */
  --green-bg: #e6faf7;      /* NOTE flash background */
  /* central sheet: equal gray gutters left+right (see .wrap) */
  --sheet-max: min(1560px, calc(100% - 480px));
  --green-border: #b0ebdf;
  --green-text: #0f766e;
  --danger: #d92d20;        /* delete-only red */
  --danger-dark: #b42318;   /* red hover / red chip text */
  --strip: #f2f5fa;         /* toolbar / gutter strip */
  --radius: 12px;           /* panels; buttons/inputs use 8px */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.5 var(--sans);
  /* Sticky footer: the document is a full-viewport column, the main area
     flexes, so the footer always sits at the true bottom of the screen
     (short pages) or right after the content (long pages). */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* full-width page: no centered cap, generous side padding everywhere */
/* Central content container: header, main sheet and footer all share it, so
   the header aligns with the sheet edges like the original. Symmetric gray
   gutters (min 240px/side, capped sheet at 1560px) on both sides. */
.wrap { width: 100%; max-width: var(--sheet-max); margin: 0 auto; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

h1, h2 { margin: 0; font-weight: 600; color: var(--ink); }

/* --- white header (static, ~54px, one line) -------------------------- */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  height: 54px;
}
.site-header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 54px;
}
/* logo: own 4-color squares drawing + uppercase ink wordmark */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; flex: 0 0 auto; }
.brand-text {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
/* uppercase muted nav; active entry turns blue */
.main-nav { display: flex; gap: 16px; }
.main-nav a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  text-decoration: none;
}
.main-nav a:hover { color: var(--ink); text-decoration: none; }
.main-nav a.active { color: var(--accent-dark); border-bottom-color: var(--accent); }
/* blue "+ paste" button */
.nav-paste {
  background: var(--accent-solid);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
}
.nav-paste:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
/* header search: light-gray pill with magnifier submit */
.header-search {
  display: flex;
  align-items: center;
  margin-left: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.header-search input {
  border: none;
  background: transparent;
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
  width: 180px;
  color: var(--text);
}
.header-search input:focus { outline: none; box-shadow: none; }
.header-search input::placeholder { color: var(--muted); }
.search-btn {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  padding: 5px 8px;
  color: var(--muted);
  cursor: pointer;
}
.search-btn:hover { color: var(--accent-dark); }
/* right: light-blue chip buttons (real destinations only) */
.header-actions { display: flex; gap: 8px; }
.btn-outline-light {
  background: var(--chip-blue);
  border: 1px solid transparent;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 5px 10px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
}
.btn-outline-light:hover {
  background: #d9e6fd;
  border-color: transparent;
  color: var(--accent-dark);
  text-decoration: none;
}

/* --- main / footer ---------------------------------------------------- */
/* Flex column so the white sheet (.layout) stretches down to the footer on
   short pages - the original's content sheet runs the full viewport height. */
.site-main {
  padding: 20px 0 36px;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 14px 0;
  flex-shrink: 0;
}
.footer-inner { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 12px; }
.footer-links a:hover { color: var(--accent); }
.footer-note { margin: 0 0 0 auto; color: var(--muted); font-size: 12px; }

/* --- panels ------------------------------------------------------------ */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.panel-title { font-size: 16px; margin-bottom: 12px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.panel-head .panel-title { margin-bottom: 0; }
.list-hint { color: var(--muted); font-size: 12px; margin: 4px 0 10px; }
.hint { color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); font-style: italic; }

/* --- one white sheet: columns separated by 1px vertical dividers ------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  /* Stretch the sheet vertically inside the flexing .site-main. */
  flex: 1 0 auto;
}
.layout > * { padding: 16px 18px; min-width: 0; }
.form-panel { grid-column: 1; grid-row: 1; }
.sidebar-right { grid-column: 2; grid-row: 1; border-left: 1px solid var(--border); }

/* 2-zone paste layout: same sheet minus the left about column */
.layout-paste { grid-template-columns: minmax(0, 1fr) 340px; }
.paste-main { grid-column: 1; grid-row: 1; }
.layout-paste .sidebar-right { grid-column: 2; grid-row: 1; }

.side-box { margin-bottom: 16px; }
.side-box:last-child { margin-bottom: 0; }
/* sidebar headers: bold dark sentence case, NOT uppercase */
.side-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.side-list { list-style: none; margin: 0; padding: 0; color: var(--text); }
.side-list li { padding: 4px 0; border-bottom: 1px solid var(--bg); font-size: 12px; }
.side-list li:last-child { border-bottom: none; }
.side-hint { color: var(--muted); font-size: 12px; margin: 0 0 10px; }
.btn-side { display: inline-block; }

/* --- forms -------------------------------------------------------------- */
label { display: block; font-weight: 600; font-size: 12px; margin: 10px 0 4px; }
input[type="text"], input[type="password"], select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: var(--text);
}
textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}
.paste-content { min-height: 420px; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.select-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}
.select-row label { margin-top: 0; }
.paste-settings-block {
  margin-top: 12px;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}
.paste-settings-block .settings-heading {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 12px 0 4px; }
.check input { width: auto; }

/* --- auto-title: dice button + suggestion hint --------------------------- */
.title-row { display: flex; align-items: center; gap: 8px; }
.title-row input { flex: 1 1 auto; }
.dice-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
}
.dice-btn:hover { border-color: var(--accent); color: var(--accent); }
/* CSS-only dice face (5 dots): no emoji, no external asset. */
.dice-icon {
  display: block;
  width: 14px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  position: relative;
}
.dice-icon::before {
  content: "";
  position: absolute;
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: currentColor;
  top: 2px;
  left: 2px;
  box-shadow:
    6.5px 0 0 currentColor,
    3.25px 3.25px 0 currentColor,
    0 6.5px 0 currentColor,
    6.5px 6.5px 0 currentColor;
}
.autotitle-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.autotitle-hint:hover { color: var(--accent); }

button, .primary {
  font: inherit;
  cursor: pointer;
  display: inline-block;
  border-radius: 8px;
  text-decoration: none;
}
.primary {
  background: var(--accent-solid);
  border: 1px solid var(--accent-solid);
  color: #fff;
  font-weight: 600;
  padding: 7px 14px;
  margin-top: 12px;
}
.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); text-decoration: none; }

/* small bordered utility button (toolbar Copy/raw/download, filters) */
.btn {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* --- NOTE flash: teal banner with check icon ------------------------------ */
.flash-note {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 16px;
  color: var(--text);
}
.flash-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--green-text);
  font-size: 13px;
}
.flash-icon { color: var(--green-dark); flex: 0 0 auto; }
.flash-sub { margin: 0 0 4px; font-size: 12px; color: var(--muted); }
.flash-secrets { margin: 4px 0 0 18px; padding: 0; font-size: 12px; }
.flash-secrets code { font-family: var(--mono); font-size: 12px; word-break: break-all; }

.banner {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 16px;
}
.banner ul { margin: 6px 0 0 18px; padding: 0; }
.banner code { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.banner.ok { border-color: var(--green-border); border-left-color: var(--green); background: var(--green-bg); }
.flash-inline { display: flex; align-items: center; gap: 8px; }
.banner.err { border-color: #fda29b; border-left-color: var(--danger); background: #fef3f2; }
.banner.err strong { color: var(--danger-dark); }

/* --- list rows: avatar + two lines (sidebar, archive, search) ------------ */
.item-list { list-style: none; margin: 0; padding: 0; }
.item-row { padding: 7px 0; border-bottom: 1px solid var(--border); }
.item-row:last-child { border-bottom: none; }
.pub-item { display: flex; align-items: flex-start; gap: 10px; }
.pub-avatar {
  flex: 0 0 auto;
  display: inline-flex;
  border-radius: 4px;
  overflow: hidden;
}
/* avatar placeholder tiles: light-blue chip + muted silhouette. The templates
   inline the SVGs with hard-coded fills; CSS fill rules override SVG
   presentation attributes, so the recolor stays inside style.css. */
.pub-avatar svg rect, .paste-avatar svg rect { fill: var(--chip-blue); }
.pub-avatar svg circle, .pub-avatar svg path,
.paste-avatar svg circle, .paste-avatar svg path { fill: var(--muted); }
.pub-body { flex: 1 1 auto; min-width: 0; }
.item-title {
  display: block;
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.item-time, .item-size, .item-views { white-space: nowrap; }
.item-syntax { text-transform: uppercase; letter-spacing: 0.2px; }

/* --- badges: 10px uppercase pills ---------------------------------------- */
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 1px 7px;
  line-height: 1.5;
  white-space: nowrap;
}
.badge-lang { color: var(--muted); background: var(--bg); }
.badge-public { color: var(--accent-dark); background: var(--chip-blue); border-color: #c9dbfd; }
.badge-unlisted { color: #8a5a00; background: #fff4d6; border-color: #e6d090; }
.badge-private { color: var(--danger-dark); background: #fee4e2; border-color: #fda29b; }
.badge-burn { color: var(--green-text); background: var(--green-bg); border-color: var(--green-border); }

/* --- paste view ------------------------------------------------------------ */
.paste-head { margin-bottom: 14px; }
.paste-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.paste-avatar { flex: 0 0 auto; display: inline-flex; border-radius: 5px; overflow: hidden; }
.paste-title { font-size: 24px; overflow-wrap: anywhere; min-width: 0; }
.untitled { color: var(--muted); font-style: italic; }
.paste-title-row .badge { margin-left: auto; }

/* icon + UPPERCASE meta row: A GUEST | NOV 29TH, 2026 | 1 | NEVER | DELETE */
.paste-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 10px 0 0;
}
.meta-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.meta-ic { color: var(--muted); flex: 0 0 auto; }
.meta-sep { color: var(--border-strong); }

/* red compact DELETE with the token-gated form as a small popover */
.delete-details { position: relative; display: inline-block; }
.delete-details summary { list-style: none; }
.delete-details summary::-webkit-details-marker { display: none; }
.delete-link {
  color: var(--danger);
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
}
.delete-link:hover { color: var(--danger-dark); text-decoration: underline; }
.delete-form {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(5, 13, 51, 0.14);
  min-width: 280px;
}
.delete-form input { width: 200px; }
.btn-danger {
  background: var(--danger);
  border: 1px solid var(--danger-dark);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.btn-danger:hover { background: var(--danger-dark); }

/* --- toolbar strip attached to the top of the content box ------------------ */
.paste-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--strip);
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  padding: 6px 10px;
  font-size: 11px;
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
}
.toolbar-syntax {
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.toolbar-info { white-space: nowrap; }
.toolbar-sep { color: var(--border-strong); }
.toolbar-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.code-box { background: #fff; }
.code-wrap-paste { border-top: none; border-radius: 0 0 8px 8px; }

.highlight { margin: 0; background: #fff; }
.highlight pre {
  margin: 0;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
}

/* line-number gutter (Pygments linenos="table"): light strip with a
   DASHED right border, numbers right-aligned and muted; excluded from text
   selection so copying the content stays clean */
.highlighttable {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}
.highlighttable td {
  padding: 0;
  border: none;
  vertical-align: top;
}
.highlighttable td.linenos {
  background: var(--strip);
  border-right: 1px dashed var(--border-strong);
  user-select: none;
  -webkit-user-select: none;
}
.linenodiv pre {
  padding: 12px 10px;
  text-align: right;
  color: var(--muted);
}
.highlighttable td.code pre { padding-left: 12px; }

/* --- archive / trending / languages ---------------------------------------- */
.archive-list .item-title { white-space: normal; overflow: visible; }
.filter-form { display: flex; align-items: center; gap: 8px; }
.filter-form label { margin: 0; }
.filter-form select { width: 200px; }
.filter-form input { width: 220px; }
.trending-list .item-views { font-weight: 600; color: var(--text); }

.lang-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 4;
  column-gap: 18px;
}
.lang-grid li { padding: 2px 0; font-family: var(--mono); font-size: 12px; break-inside: avoid; }
.lang-grid a { color: var(--accent); }
.lang-grid a:hover { text-decoration: underline; }

/* --- pagination --------------------------------------------------------------- */
.pagination { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pagination a, .pagination .current {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  text-decoration: none;
}
.pagination a:hover { border-color: var(--accent); text-decoration: none; }
.pagination .current { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; font-weight: 600; }

/* --- centered boxes (password, errors) ------------------------------------------- */
.center-wrap { max-width: 440px; margin: 48px auto 0; }
.auth-panel .panel-title { font-size: 14px; }
.auth-form input { margin-bottom: 4px; }
.auth-form .primary { margin-top: 10px; }
.error-panel { text-align: center; padding: 28px 16px; }
.error-code { font-size: 40px; color: var(--accent); margin-bottom: 6px; }
.error-message { color: var(--muted); margin: 0 0 16px; }

/* --- responsive: single breakpoint, sheet columns stack ---------------------- */
@media (max-width: 900px) {
  .wrap { padding: 0 16px; }
  .site-header { height: auto; }
  .site-header-inner { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; gap: 10px 16px; }
  .header-search { order: 4; width: 100%; margin-left: 0; }
  .header-search input { flex: 1 1 auto; width: auto; }
  .main-nav { order: 5; width: 100%; gap: 14px; }
  .header-actions { order: 3; }
  /* narrow screens: smaller gray gutters, stacked columns */
  :root { --sheet-max: calc(100% - 24px); }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .layout-paste { grid-template-columns: minmax(0, 1fr); }
  .form-panel, .sidebar-right, .paste-main, .layout-paste .sidebar-right {
    grid-column: 1;
    grid-row: auto;
  }
  .layout-paste .sidebar-right { border-left: none; border-top: 1px solid var(--border); }
  .select-row { grid-template-columns: 1fr; }
  .lang-grid { columns: 2; }
  .delete-form { position: static; min-width: 0; width: 100%; margin-top: 8px; }
  .delete-form input { flex: 1 1 auto; width: auto; }
  .footer-note { margin-left: 0; width: 100%; }
}
