/* hop. Tokens mirror the Paper file ("hop" page). */
:root {
  --paper: #ffffff;
  --ink: #0a0a0a;
  --graphite: #5c5c5c;
  --rule: #e7e7e4;
  --wash: #f6f6f4;
  --link: #0000ee;
  --alarm: #e0301e;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 8px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/22px var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
}
h1, h2, p { margin: 0; font: inherit; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }

.mono { font-family: var(--mono); }
.sans { font-family: var(--sans); }
.muted { color: var(--graphite); }
.ink { color: var(--ink); }
.small { font-size: 14px; }
.link { color: var(--link); text-decoration: none; }
.link:hover { text-decoration: underline 1px; text-underline-offset: 3px; }
.col { width: min(640px, 100% - 32px); margin-inline: auto; }
.title { font-weight: 500; font-size: 22px; line-height: 28px; letter-spacing: -0.02em; }

/* Text-styled controls ------------------------------------------------ */
.quiet, .action {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-size: 14px; line-height: 20px; color: var(--graphite); text-decoration: none;
}
.quiet:hover, .action:hover { color: var(--ink); }
.action-strong { color: var(--ink); font-weight: 500; }
.text-link { font-size: 14px; line-height: 20px; text-decoration: underline 1px; text-underline-offset: 3px; }
.text-link:hover { text-decoration-thickness: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 20px; width: 100%;
  background: var(--ink); color: var(--paper);
  border: 0; border-radius: var(--radius); cursor: pointer;
  font-weight: 500; font-size: 15px; line-height: 22px; text-decoration: none;
}
.btn:hover { background: #262626; }
.btn-sm { height: 32px; width: auto; padding: 0 14px; font-size: 14px; line-height: 20px; }
.btn-soft {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px;
  background: var(--wash); border: 0; border-radius: var(--radius); cursor: pointer;
  font-weight: 500; font-size: 14px; line-height: 20px; color: var(--ink); list-style: none;
}
.btn-soft:hover { background: #eeeeeb; }
.btn-soft::-webkit-details-marker { display: none; }

/* Header -------------------------------------------------------------- */
.header { display: flex; align-items: center; justify-content: space-between; padding: 36px 0 84px; }
.header-tight { padding-bottom: 52px; }
.header-public { padding-bottom: 36px; }
.wordmark {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font-weight: 500; font-size: 18px; line-height: 24px; letter-spacing: -0.02em; color: var(--ink);
}
.wordmark svg { color: var(--link); flex-shrink: 0; }
.header-right form { display: contents; }

/* Composer ------------------------------------------------------------ */
.composer {
  position: relative; display: flex; align-items: center; gap: 16px;
  height: 68px; padding: 0 22px;
  background: var(--wash); border-radius: var(--radius); overflow: hidden;
}
.composer input {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: none; background: none;
  font-size: 22px; line-height: 28px; letter-spacing: -0.01em; caret-color: var(--ink);
}
.composer input::placeholder { color: var(--graphite); opacity: 1; }
.composer-browse { flex-shrink: 0; }
.composer-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.composer-progress-fill { display: block; height: 100%; width: 0; background: var(--link); transition: width 0.2s ease; }
.composer.is-busy input { color: var(--graphite); }

.status { padding: 12px 22px 0; font-size: 14px; line-height: 20px; color: var(--graphite); }
.status:empty { display: none; }
.status.is-error { color: var(--alarm); }

.drop-overlay {
  position: fixed; inset: 0; z-index: 10; display: grid; place-items: center;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  pointer-events: none;
}
.drop-overlay::before {
  content: ""; position: absolute; inset: 16px;
  border: 2px dashed var(--link); border-radius: 16px;
}
.drop-overlay span { font-weight: 500; font-size: 40px; line-height: 48px; letter-spacing: -0.035em; color: var(--link); }
.drop-overlay[hidden] { display: none; }

/* Item list ----------------------------------------------------------- */
.list { display: flex; flex-direction: column; padding-top: 28px; margin-inline: -12px; }
.list-empty { padding: 12px; color: var(--graphite); }
.row {
  display: flex; align-items: center; gap: 16px;
  height: 46px; padding: 0 12px; border-radius: var(--radius);
}
.row:hover, .row:focus-within, .row.is-editing { background: var(--wash); }
.row-id {
  width: 120px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 15px; line-height: 22px; color: var(--link); text-decoration: none; text-underline-offset: 3px;
}
.row:hover .row-id, .row.is-new .row-id, .row-id:focus-visible { text-decoration: underline 1px; }
.row-dest { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-dest a { text-decoration: none; }
.row-dest a:hover { text-decoration: underline 1px; text-underline-offset: 3px; }
.row-meta { margin-left: 10px; font-size: 14px; color: var(--graphite); }
.row-end { flex-shrink: 0; display: flex; justify-content: flex-end; min-width: 56px; }
.row-hits { width: 56px; text-align: right; font-size: 14px; line-height: 20px; color: var(--graphite); }
.row-flag {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-weight: 500; font-size: 14px; line-height: 20px; color: var(--ink);
}
.row-actions { display: none; align-items: center; gap: 20px; }
.row-actions form { display: contents; }
.row:hover .row-actions, .row:focus-within .row-actions, .row.is-editing .row-actions { display: flex; }
.row:hover .row-hits, .row:hover .row-flag,
.row:focus-within .row-hits, .row:focus-within .row-flag,
.row.is-editing .row-hits, .row.is-editing .row-flag { display: none; }

.list-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0 80px; font-size: 14px; line-height: 20px; }

/* Inline edit form */
.edit {
  display: flex; flex-direction: column; gap: 12px;
  margin: 2px 0 10px; padding: 14px 12px 12px;
  border: 1px solid var(--rule); border-radius: var(--radius);
}
.edit-fields { display: flex; flex-wrap: wrap; gap: 12px; }
.edit-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.edit-id { flex: 1 1 200px; }
.edit-url { flex: 2 1 260px; }
.edit-expiry { flex: 0 0 auto; }
.edit input, .edit select, .input-sm {
  height: 36px; padding: 0 10px; min-width: 0;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; outline: none;
  font-size: 14px; line-height: 20px;
}
.edit input:focus, .edit select:focus, .input-sm:focus { border-color: var(--ink); }
.edit-prefixed {
  display: flex; align-items: center; height: 36px; padding-left: 10px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; font-size: 14px;
}
.edit-prefixed:focus-within { border-color: var(--ink); }
.edit-prefixed input { flex: 1; height: 34px; border: 0; padding-left: 0; }
.edit-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.edit-actions { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.edit-delete { order: -1; }
.edit-delete:hover { color: var(--alarm); }

/* Shared field styles */
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 14px; line-height: 20px; color: var(--graphite); }
.field-error { font-size: 14px; line-height: 20px; color: var(--alarm); }
.field-error:empty { display: none; }
.field-note { font-size: 14px; line-height: 20px; color: var(--graphite); }
.input {
  height: 48px; padding: 0 16px; width: 100%;
  background: var(--wash); border: 0; border-radius: var(--radius); outline: none;
  font-size: 15px; line-height: 22px;
}
.input:focus { box-shadow: inset 0 0 0 1px #cfcfca; }
.input-secret { font-size: 20px; letter-spacing: 0.08em; }

/* Settings ------------------------------------------------------------ */
.settings { display: flex; flex-direction: column; gap: 44px; padding-bottom: 96px; }
.settings > .field-error { margin-top: -28px; }
.section { display: flex; flex-direction: column; }
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 45px; padding-bottom: 12px; border-bottom: 1px solid var(--rule);
}
.section-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-weight: 500; font-size: 15px; line-height: 22px; }
.section-blurb { font-weight: 400; font-size: 14px; line-height: 20px; color: var(--graphite); }
.srow { display: flex; align-items: center; gap: 16px; min-height: 46px; }
.srow-empty { padding: 12px 0; font-size: 14px; color: var(--graphite); }
.s-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; line-height: 22px; }
.s-main .small { white-space: pre; }
.s-meta { width: 112px; flex-shrink: 0; font-size: 14px; line-height: 20px; color: var(--graphite); }
.s-acts { width: 112px; flex-shrink: 0; display: flex; justify-content: flex-end; gap: 20px; font-size: 14px; line-height: 20px; }
.s-acts form { display: contents; }
.snippet {
  margin: 10px 0 0; padding: 16px 20px; overflow-x: auto;
  background: var(--wash); border-radius: var(--radius);
  font-size: 14px; line-height: 22px;
}

.new-token { position: relative; }
.new-token-form {
  position: absolute; right: 0; top: 40px; z-index: 5;
  display: flex; gap: 8px; padding: 10px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.06);
}
.new-token-form .input-sm { width: 200px; }
.token-reveal { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.token-reveal-row { display: flex; align-items: center; gap: 20px; }
.token-reveal code { flex: 1; min-width: 0; font-size: 14px; line-height: 22px; overflow-wrap: anywhere; color: var(--link); }

/* Sign in / invite ---------------------------------------------------- */
body.auth { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px 96px; }
.auth-col { width: min(320px, 100%); }
.auth-form { display: flex; flex-direction: column; gap: 20px; }
.auth-head { display: flex; flex-direction: column; gap: 20px; padding-bottom: 16px; }
.auth-actions { padding-top: 4px; }

/* Public pages: preview + not found ----------------------------------- */
body.public { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.public-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding-bottom: 168px; }
.eyebrow { font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.eyebrow s { text-decoration-thickness: 1px; }
.headline { font-weight: 500; font-size: 40px; line-height: 48px; letter-spacing: -0.035em; overflow-wrap: anywhere; }
.headline-link { color: var(--link); text-decoration: underline 2px; text-underline-offset: 6px; }
.headline-link:hover { text-decoration-thickness: 3px; }
.public-meta { display: flex; flex-direction: column; gap: 28px; padding-top: 8px; }
.public-meta p { overflow-wrap: anywhere; }
.public-meta .small { line-height: 22px; }

/* Touch devices have no hover: always show row actions. */
@media (hover: none) {
  .row-actions { display: flex; }
  .row-hits { display: none; }
  .row-delete { display: none !important; } /* still available inside Edit */
}

@media (max-width: 640px) {
  .header { padding: 24px 0 40px; }
  .header-tight { padding-bottom: 32px; }
  .composer { height: 60px; padding: 0 18px; }
  .composer input { font-size: 18px; }
  .row { gap: 12px; }
  .row-id { width: 84px; }
  .row-meta { display: none; }
  .row-actions { gap: 14px; }
  .srow { flex-wrap: wrap; gap: 4px 16px; padding: 10px 0; }
  .s-main { flex-basis: 100%; }
  .s-meta { flex: 1; width: auto; }
  .s-acts { width: auto; }
  .headline { font-size: 32px; line-height: 40px; }
  .public-body { padding-bottom: 96px; }
}
