/* Links list, "Create link" flow, step-by-step editor and account menu. Loaded after dash.css. */

/* ---- sidebar: create button & account menu --------------------------------- */
.create-link { margin: 2px 0 4px; }
.sidebar-foot { padding: 10px 0 0; }
.account { position: relative; }
.account summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; cursor: pointer; }
.account summary::-webkit-details-marker { display: none; }
.account summary:hover, .account[open] summary { background: var(--surface-2); }
.account-avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 800 15px/1 'Bricolage Grotesque', sans-serif; }
.account-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.account-who strong { font-size: 14.5px; }
.account-caret { color: var(--ink-2); font-size: 12px; transition: transform .15s; }
.account[open] .account-caret { transform: rotate(180deg); }
.account-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
}
.account-panel a, .account-panel button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  font: 600 14.5px/1.2 'Figtree', sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.account-panel a:hover, .account-panel form button:hover { background: var(--surface-2); }
.account-panel form { margin: 0; }
.account-email { margin: 2px 10px 6px; }
.dev-switch { margin: 0 0 6px; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line); }
.dev-title { margin: 0 0 8px; font-size: 12.5px; font-weight: 750; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.dev-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.dev-plans button { justify-content: center; padding: 7px 4px; font-size: 13px; border: 1.5px solid var(--line); background: var(--surface); }
.dev-plans button.is-active { border-color: var(--accent); color: var(--accent); }

/* ---- links list ------------------------------------------------------------- */
.link-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.link-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 14px 18px; }
.lr-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; overflow: hidden; font-size: 22px; background: var(--accent-soft); color: var(--accent); }
.lr-icon img { width: 100%; height: 100%; object-fit: cover; }
.lr-direct { background: var(--surface-2); color: var(--ink); }
.lr-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lr-name { font: 750 17px/1.2 'Bricolage Grotesque', sans-serif; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-name:hover { color: var(--accent); }
.lr-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lr-metric { white-space: nowrap; }
.type-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.type-landing { background: var(--accent-soft); color: var(--accent); }
.welcome h2 { margin-top: 0; }

/* ---- create link: step 1 ----------------------------------------------------- */
.wizard { max-width: 760px; }
.steps { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; counter-reset: step; }
.steps li { counter-increment: step; display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 13.5px; font-weight: 650; }
.steps li::before { content: counter(step); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); font-size: 12px; }
.steps li.is-current { background: var(--accent-soft); color: var(--accent); }
.steps li.is-current::before { background: var(--accent); color: var(--accent-ink); }
.steps li[hidden] { display: none; }
.type-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.type-pick legend { margin-bottom: 8px; }
.type-card { position: relative; }
.type-card input { position: absolute; opacity: 0; inset: 0; margin: 0; min-height: 0; cursor: pointer; }
.type-card > span { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; }
.type-card strong { font: 750 18px/1.2 'Bricolage Grotesque', sans-serif; }
.type-card input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.type-card input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.field-hint.is-ok { color: var(--ok); font-weight: 650; }
.field-hint.is-bad { color: var(--danger); font-weight: 650; }
.wizard-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 16px; margin-top: 4px; border-top: 1px solid var(--line); }

/* ---- page editor ----------------------------------------------------------- */
.editor-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.editor-head .back { color: var(--ink-2); text-decoration: none; font-weight: 650; }
.editor-head .back:hover { color: var(--ink); }
.editor-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.editor-title .share-url { font: 750 20px/1.2 'Bricolage Grotesque', sans-serif; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px; border-radius: 16px; background: var(--surface-2); align-self: stretch; }
.steps-tabs button { display: inline-flex; align-items: center; gap: 7px; flex: 1; justify-content: center; border: 0; background: none; padding: 9px 12px; border-radius: 11px; font: 650 14.5px/1 'Figtree', sans-serif; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.steps-tabs button[aria-selected='true'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.step-no { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); font-size: 11.5px; font-weight: 800; }
.steps-tabs button[aria-selected='true'] .step-no { background: var(--accent); color: var(--accent-ink); }
.panel h2 { margin: 0; }
.panel > .card > h2 { margin: 0 0 14px; }
.wizard-card { padding-top: 6px; padding-bottom: 18px; }
.wizard-card .wizard-nav { border-top: 0; margin: 0; }
.panel .sub, .card .sub { margin: 16px 0 8px; font: 650 14px/1.2 'Figtree', sans-serif; color: var(--ink-2); letter-spacing: 0; }
.dropzone { display: flex; align-items: center; gap: 16px; padding: 16px; border: 2px dashed var(--line); border-radius: 16px; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone > span:last-of-type { display: flex; flex-direction: column; gap: 2px; }
.avatar-edit { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.layout-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.layout-card { position: relative; }
.layout-card input { position: absolute; opacity: 0; inset: 0; margin: 0; min-height: 0; cursor: pointer; }
.layout-card > span { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; height: 100%; }
.layout-card input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.layout-card.is-locked > span { opacity: .55; cursor: not-allowed; }
.layout-card small { font-size: 12.5px; }
.color-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.color-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 14px; border: 1.5px solid var(--line); border-radius: 12px; font-weight: 600; font-size: 14px; }
.color-field input { width: 34px; height: 34px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.color-field input::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input::-webkit-color-swatch { border: 1px solid rgba(0, 0, 0, .15); border-radius: 50%; }
.color-field input::-moz-color-swatch { border: 1px solid rgba(0, 0, 0, .15); border-radius: 50%; }
.option-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 8px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 650 14px/1 'Figtree', sans-serif; cursor: pointer; }
.option-btn:hover { border-color: var(--accent); }
.setting-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; cursor: pointer; }
.setting + .setting { border-top: 1px solid var(--line); }
.setting > span:first-child { display: flex; flex-direction: column; gap: 3px; }
.setting .switch { flex: none; }
.socials-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.social-field { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.social-field .prefixed { width: 100%; }
.social-field .prefixed input { flex: 1; min-width: 0; }
.social-label { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14px; }
.social-label svg { width: 16px; height: 16px; fill: var(--ink); }
.social-field .prefixed > span { font-size: 14px; white-space: nowrap; }
.social-field .prefixed input { min-height: 42px; }
.link-list { margin-top: 0; }
.add-link { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; padding: 12px; border: 1.5px dashed var(--line); border-radius: 14px; }

@media (max-width: 760px) {
  .type-pick, .socials-grid { grid-template-columns: 1fr; }
  .color-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .link-row { grid-template-columns: 40px minmax(0, 1fr); }
  .link-row .lr-metric, .link-row .row-actions { grid-column: 2; }
  .steps-tabs button { flex: 0 0 auto; }
  .add-link { grid-template-columns: 1fr; }
}
.prefixed input:first-child { padding-left: 14px; }

/* ---- live ------------------------------------------------------------------ */
.live-dot { display: inline-block; width: 12px; height: 12px; margin-right: 10px; border-radius: 50%; background: #22c55e; vertical-align: middle; box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); animation: live-pulse 2s ease-out infinite; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.live-chart { height: 220px; }
.live-chart .bar.is-now { fill: #22c55e; }
.live-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.live-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 14.5px; }
.live-list progress { grid-column: 1 / -1; height: 6px; }
#live-target { width: auto; min-height: 38px; padding: 6px 12px; }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
