/* WebcamClicks — Photo Border Maker */
.border-page {
  --pb-ink: #0f172a;
  --pb-muted: #5b6475;
  --pb-line: #e6e8ee;
  --pb-soft: #f6f7fb;
  --pb-accent: #c93a1d;
  --pb-accent-2: #8b5cf6;
  background: #fbfbfd;
}
.pb-wrap { max-width: 1180px; margin: 0 auto; padding: 28px 16px 80px; color: var(--pb-ink); }
.pb-crumbs { font-size: .85rem; color: var(--pb-muted); }
.pb-crumbs a { color: inherit; }

.pb-hero { text-align: center; max-width: 760px; margin: 18px auto 30px; }
.pb-kicker { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--pb-accent); background: #fff4f1; padding: 6px 14px; border-radius: 999px; }
.pb-hero h1 { font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.12; margin: 14px 0 12px; letter-spacing: -0.02em; }
.pb-hero p { font-size: 1.08rem; line-height: 1.65; color: var(--pb-muted); margin: 0; }

/* ---- app layout ---- */
.pb-app { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start; }
.pb-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; }
.pb-main { min-height: 420px; background: #fff; border: 1px solid var(--pb-line); border-radius: 20px; padding: 18px; }

.pb-drop {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 26px 18px; border: 2px dashed #d7dbe6; border-radius: 20px; background: #fff;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.pb-drop:hover, .pb-drop:focus-visible, .pb-drop.is-over { border-color: var(--pb-accent); background: #fff7fb; outline: none; }
.pb-drop-icon { width: 44px; height: 44px; color: var(--pb-accent); }
.pb-drop strong { font-size: 1.05rem; }
.pb-drop span { font-size: .85rem; color: var(--pb-muted); }
.pb-drop small { color: var(--pb-muted); font-size: .78rem; line-height: 1.4; }

.pb-controls { background: #fff; border: 1px solid var(--pb-line); border-radius: 20px; padding: 6px 18px 14px; }
.pb-controls fieldset { border: 0; padding: 12px 0 4px; margin: 0; border-bottom: 1px solid var(--pb-line); }
.pb-controls fieldset:last-child { border-bottom: 0; }
.pb-controls legend { display: flex; justify-content: space-between; width: 100%; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--pb-muted); padding: 0 0 8px; }
.pb-controls legend output { color: var(--pb-ink); font-weight: 700; }

.pb-seg { display: flex; gap: 4px; background: var(--pb-soft); padding: 4px; border-radius: 12px; }
.pb-seg-wrap { flex-wrap: wrap; }
.pb-seg button {
  flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 10px; border: 0; border-radius: 9px; background: transparent;
  font: inherit; font-size: .86rem; font-weight: 600; color: var(--pb-muted); cursor: pointer;
}
.pb-seg button[aria-pressed="true"] { background: #fff; color: var(--pb-ink); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.pb-ar { display: inline-block; height: 14px; width: calc(14px * var(--r, 1)); max-width: 26px; border: 1.8px solid currentColor; border-radius: 2px; }
.pb-ar-free { width: 16px; border-style: dashed; }

.pb-controls input[type="range"] { width: 100%; accent-color: var(--pb-accent); }

.pb-swatches { display: flex; gap: 10px; }
.pb-swatches button {
  width: 38px; height: 38px; border-radius: 50%; background: var(--c); cursor: pointer;
  border: 1px solid #d5d8e0; box-shadow: inset 0 0 0 3px #fff; transition: transform .12s;
}
.pb-swatches button[aria-pressed="true"] { outline: 2.5px solid var(--pb-accent); outline-offset: 2px; transform: scale(1.06); }

/* ---- buttons ---- */
.pb-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--pb-line); border-radius: 11px; background: #fff; color: var(--pb-ink);
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.pb-btn:hover { border-color: #cfd3dc; }
.pb-btn:disabled { opacity: .55; cursor: default; }
.pb-btn-primary { border: 0; color: #fff; background: linear-gradient(135deg, var(--pb-accent), var(--pb-accent-2)); box-shadow: 0 6px 16px rgba(201, 58, 29,.25); }
.pb-btn-sm { min-height: 32px; padding: 4px 12px; font-size: .82rem; }
.pb-icon-btn { width: 32px; height: 32px; border: 1px solid var(--pb-line); border-radius: 9px; background: #fff; color: var(--pb-muted); cursor: pointer; font-size: .8rem; }
.pb-icon-btn:hover { color: #b91c1c; border-color: #fecaca; }

/* ---- results ---- */
.pb-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--pb-line); margin-bottom: 16px; }
.pb-count { font-weight: 700; }
.pb-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

.pb-card { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--pb-line); border-radius: 16px; overflow: hidden; background: #fff; }
.pb-card-img {
  display: grid; place-items: center; aspect-ratio: 4 / 5; padding: 14px;
  background: linear-gradient(135deg, #eceef3, #f6f7fa);
}
.pb-preview { max-width: 100%; max-height: 100%; width: auto; height: auto; box-shadow: 0 8px 24px rgba(15,23,42,.18); border-radius: 2px; }
.pb-card figcaption { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 12px 12px; }
.pb-card-name { font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-card-status { grid-column: 1; font-size: .76rem; color: var(--pb-muted); }
.pb-card-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 6px; }
.pb-card.is-error .pb-card-status { color: #b91c1c; }
.pb-card.is-error .pb-dl { display: none; }
.pb-spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #d8dbe4; border-top-color: var(--pb-accent); animation: pb-spin .8s linear infinite; }
.pb-card.is-error .pb-spinner { display: none; }
@keyframes pb-spin { to { transform: rotate(360deg); } }

/* empty state mockup */
.pb-empty { display: grid; place-items: center; gap: 18px; min-height: 380px; text-align: center; color: var(--pb-muted); }
.pb-empty[hidden] { display: none; }
.pb-mock { position: relative; width: 250px; height: 260px; }
.pb-mock-card { position: absolute; left: 30px; top: 10px; width: 170px; padding: 12px 12px 0; background: #fff; box-shadow: 0 14px 34px rgba(15,23,42,.16); transform: rotate(-4deg); text-align: center; }
.pb-mock-2 { left: 70px; top: 30px; transform: rotate(5deg); }
.pb-mock-photo { aspect-ratio: 4 / 5; background: linear-gradient(160deg, #ffd9cf, #c4b5fd 55%, #93c5fd); }
.pb-mock-2 .pb-mock-photo { background: linear-gradient(160deg, #fde68a, #fca5a5 55%, #f0abfc); }
.pb-mock-card span { display: block; padding: 10px 0 12px; font-size: .58rem; letter-spacing: .16em; color: #8a8f99; }

/* ---- article ---- */
.pb-content { max-width: 800px; margin: 56px auto 0; line-height: 1.7; color: #334155; }
.pb-content h2 { font-size: 1.55rem; line-height: 1.3; color: var(--pb-ink); margin: 40px 0 12px; letter-spacing: -0.01em; }
.pb-content a { color: var(--pb-accent); }
.pb-steps li, .pb-content ul li { margin: 8px 0; }
.pb-table-wrap { overflow-x: auto; border: 1px solid var(--pb-line); border-radius: 14px; background: #fff; }
.pb-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.pb-table th, .pb-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--pb-line); white-space: nowrap; }
.pb-table th { background: var(--pb-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--pb-muted); }
.pb-table tr:last-child td { border-bottom: 0; }
.pb-faq details { border: 1px solid var(--pb-line); border-radius: 12px; padding: 12px 16px; margin: 10px 0; background: #fff; }
.pb-faq summary { font-weight: 700; color: var(--pb-ink); cursor: pointer; }
.pb-faq p { margin: 10px 0 0; }

@media (max-width: 900px) {
  .pb-app { grid-template-columns: 1fr; }
  .pb-side { position: static; }
  .pb-main { padding: 14px; }
  .pb-empty { min-height: 300px; }
}
@media (max-width: 480px) {
  .pb-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pb-card-img { padding: 8px; }
  .pb-card figcaption { grid-template-columns: 1fr; }
  .pb-card-actions { grid-column: 1; grid-row: auto; margin-top: 6px; }
  .pb-card-actions .pb-dl { flex: 1; }
  .pb-toolbar-actions { width: 100%; }
  .pb-toolbar-actions .pb-btn { flex: 1 1 auto; }
}
