/* Etsy Desk. A proof sheet: the listings' pictures carry the page; everything around them is ink on cool paper. */
:root {
  --paper: #eef1f5;
  --sheet: #ffffff;
  --ink: #17202b;
  --quiet: #566273;
  --line: #d3dae3;
  --action: #1c4ed0;
  --action-ink: #ffffff;
  --bad: #a3312a;
  --active: #177245;
  --draft: #8a5a00;
  --inactive: #566273;
  --sold_out: #a3312a;
  --expired: #6b4ea8;
  --radius: 6px;
  font-family: "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
h1, h2, h3, p, ol, ul { margin: 0; }
h1 { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; }
a { color: var(--action); }
.quiet { color: var(--quiet); }
.problem { color: var(--bad); }
.problem:empty { display: none; }

button, input, select { font: inherit; color: inherit; }
button {
  padding: 0.45rem 0.85rem; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--sheet); cursor: pointer; white-space: nowrap;
}
button:hover:not(:disabled) { background: #e6ebf2; }
button:disabled { opacity: 0.55; cursor: default; }
button.primary { background: var(--action); border-color: var(--action); color: var(--action-ink); font-weight: 600; }
button.primary:hover:not(:disabled) { background: #173fa9; }
button.plain { border-color: transparent; background: none; text-decoration: underline; padding-inline: 0.2rem; }
button.stop { border-color: var(--bad); color: var(--bad); }
input[type="text"], input[type="password"], input[type="search"], select {
  padding: 0.45rem 0.6rem; border: 1px solid #8e99a8; border-radius: var(--radius); background: var(--sheet); min-width: 0;
}
:focus-visible { outline: 3px solid #7aa2ff; outline-offset: 2px; }

/* the lock */
#gate { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.gate { width: min(22rem, 100%); display: grid; gap: 0.6rem; background: var(--sheet); border: 1px solid var(--line); border-radius: 10px; padding: 1.75rem; }
.gate label { font-weight: 600; margin-top: 0.6rem; }
.gate button { margin-top: 0.4rem; }

/* the panel */
#panel { max-width: 82rem; margin: 0 auto; padding: 1rem 1.25rem 4rem; }
.top { display: flex; align-items: baseline; gap: 1rem; padding: 0.5rem 0 1rem; border-bottom: 2px solid var(--ink); }
.top .shop { font-weight: 600; }
.top #lock { margin-left: auto; }

.links { display: grid; gap: 0.5rem; padding: 1rem 0; }
.link { display: flex; align-items: center; gap: 0.7rem; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.6rem 0.8rem; }
.link-text { flex: 1; min-width: 0; }
.link-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #9aa5b3; flex: none; }
.dot.good { background: var(--active); }
.dot.bad { background: var(--bad); }
.dot.busy { background: var(--action); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .dot.busy { animation: none; } }
.progress { padding: 0 0.2rem; }
.bar { height: 0.55rem; background: #dfe5ed; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--action); transition: width 0.4s ease; }
.progress p { margin-top: 0.3rem; font-variant-numeric: tabular-nums; }
.notes { padding: 0 0 0 1.4rem; color: var(--draft); }
#bridge-result { padding: 0 0.2rem; overflow-wrap: anywhere; }

/* connecting Etsy */
.setup { background: var(--sheet); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem 1.4rem; display: grid; gap: 0.8rem; max-width: 46rem; }
.steps { padding-left: 1.3rem; display: grid; gap: 1rem; }
.steps li::marker { font-weight: 700; }
.steps li > * + * { margin-top: 0.4rem; }
.steps li.done { color: var(--quiet); }
.copy-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
code { font-family: "Cascadia Mono", Consolas, "Courier New", monospace; font-size: 0.92rem; background: #e9edf3; padding: 0.3rem 0.5rem; border-radius: 4px; overflow-wrap: anywhere; }
#keys-form { display: grid; grid-template-columns: max-content minmax(0, 22rem); gap: 0.5rem 0.8rem; align-items: center; }
#keys-form button, #keys-form .problem { grid-column: 2; justify-self: start; }

/* the listings */
.tools { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; justify-content: space-between; padding-top: 0.5rem; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tabs button { border-color: var(--line); font-variant-numeric: tabular-nums; }
.tabs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.find { display: flex; gap: 0.6rem; align-items: center; flex: 1; justify-content: flex-end; min-width: min(100%, 20rem); }
.find input { flex: 1; max-width: 26rem; }
#found { padding: 0.8rem 0 0.5rem; font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: 0.9rem; }
.card { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer; white-space: normal; position: relative; }
.card:hover { border-color: var(--ink); background: var(--sheet); }
.card .shot { aspect-ratio: 4 / 3; background: #dfe5ed; display: grid; place-items: center; color: var(--quiet); font-size: 0.9rem; }
.card .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 0.55rem 0.7rem 0.7rem; display: grid; gap: 0.25rem; }
.card .title { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.card .facts { color: var(--quiet); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.card .price { color: var(--ink); font-weight: 650; }
.state { position: absolute; top: 0.5rem; left: 0.5rem; padding: 0.1rem 0.5rem; border-radius: 99px; font-size: 0.8rem; font-weight: 650; color: #fff; background: var(--inactive); }
.state.active { background: var(--active); }
.state.draft { background: var(--draft); }
.state.sold_out { background: var(--sold_out); }
.state.expired { background: var(--expired); }
.more { text-align: center; padding-top: 1.2rem; }
.empty { padding: 2rem 0; color: var(--quiet); }

/* one listing */
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 0; width: min(60rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); color: var(--ink); }
dialog::backdrop { background: rgba(23, 32, 43, 0.55); }
.detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.25rem; padding: 1.25rem; }
.detail .shots { display: grid; gap: 0.6rem; align-content: start; }
.detail .big { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #dfe5ed; border-radius: var(--radius); display: block; }
.thumbs { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.thumbs button { padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; width: 4rem; height: 3rem; background: #dfe5ed; }
.thumbs button[aria-pressed="true"] { border-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail .about { display: grid; gap: 0.7rem; align-content: start; min-width: 0; }
.detail .about h2 { overflow-wrap: anywhere; }
.detail .state { position: static; display: inline-block; }
.detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 0; font-variant-numeric: tabular-nums; }
.detail dt { color: var(--quiet); }
.detail dd { margin: 0; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.chips span { background: #e9edf3; border-radius: 99px; padding: 0.1rem 0.6rem; font-size: 0.9rem; }
.description { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 16rem; overflow: auto; border-top: 1px solid var(--line); padding-top: 0.7rem; }
.detail-actions { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }

.notice { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: var(--radius); max-width: calc(100vw - 2rem); z-index: 10; }

@media (max-width: 700px) {
  #panel { padding: 0.75rem 0.75rem 4rem; }
  .link { flex-wrap: wrap; }
  .link-actions { width: 100%; justify-content: flex-start; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .detail { grid-template-columns: 1fr; }
  #keys-form { grid-template-columns: 1fr; }
  #keys-form button, #keys-form .problem { grid-column: 1; }
  .find { justify-content: flex-start; flex-wrap: wrap; }
}
