/* CLAUDE 10-05: the Presets page (presets.js): the two tabs, Clipping presets (cards and the builder with its live
   preview). Colours and sizes from DESIGN-SYSTEM.md. */
/* CLAUDE 10-18 (design polish B2): the two kinds are controls.css .m-seg (a quiet track and a thumb that slides to the
   open one; dashboard.js adds the class), so only the spacing is left here. CLAUDE 10-16 (owner, iPhone: the tab
   "smile") still holds: the thumb is a fill, never an underline drawn as an inset shadow */
.presets-tabs {
  margin: 4px 0 18px;
}
.presets-tabs.m-seg > [role='tab'] {
  min-width: 0;
  padding: 0 var(--s-4);
}

/* the list */
.pc-guest {
  display: grid;
  justify-items: start;
  gap: 14px;
  max-width: 60ch;
}
.pc-guest .hint {
  margin: 0;
  font-size: var(--t-body);
  line-height: 1.55;
}
.pc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.pc-head p {
  margin: 0;
  max-width: 60ch;
  color: var(--c-fg-2);
  font-size: var(--t-body);
}
.pc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.pc-empty {
  grid-column: 1 / -1;
}
.pc-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background: var(--c-surface);
}
.pc-thumb {
  position: relative;
  display: grid;
  place-items: center;
  height: 96px;
  border-radius: var(--r-sm);
  background: linear-gradient(160deg, var(--c-raised), var(--c-canvas));
  overflow: hidden;
}
.pc-thumb .sample {
  max-width: 90%;
  overflow: hidden;
  white-space: nowrap;
}
.pc-thumb .pc-hl {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--c-fg);
  font-size: var(--t-meta);
  font-weight: 700;
  letter-spacing: 1px;
}
.pc-thumb .pc-logo {
  position: absolute;
  top: 8px;
  right: 8px;
  max-width: 48px;
  max-height: 18px;
}
.pc-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--t-title);
}
.pc-default {
  padding: 1px 8px;
  border-radius: var(--r-pill);
  background: var(--c-overlay);
  color: var(--c-fg-2);
  font-size: var(--t-meta);
  font-weight: 700;
}
.pc-tags {
  flex: 1;
  margin: 0;
  color: var(--c-fg-3);
  font-size: var(--t-label);
  line-height: 1.4;
}
.pc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pc-actions button {
  min-height: 36px;
  padding: 0 12px;
  font-size: var(--t-body);
}
.pc-actions .danger {
  color: var(--c-danger);
}

/* the builder */
.pb-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.pb-name {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 320px;
  min-height: 40px;
  font-size: var(--t-title);
  font-weight: 600;
}
.pb-space {
  flex: 1;
}
.pb-undo,
.pb-redo {
  width: 40px;
  min-height: 40px;
  padding: 0;
  font-size: 18px;
}
.pb-bar .pb-def {
  gap: 8px;
}
.pb-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 24px;
  align-items: start;
}
.pb-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pb-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background: var(--c-surface);
}
.pb-section h3 {
  margin: 0;
  color: var(--c-fg-3);
  font-size: var(--t-meta);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.pb-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pb-group + .pb-group {
  padding-top: 12px;
  border-top: 1px solid var(--c-line);
}
.pb-group h4 {
  margin: 0;
  font-size: var(--t-title);
  font-weight: 650;
}
.pb-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--c-fg-2);
  font-size: var(--t-body);
}
.pb-field select {
  width: auto;
  min-width: 160px;
}
.pb-field input[type='range'] {
  width: 160px;
}
.pb-field input[type='color'] {
  width: 44px;
  height: 32px;
  padding: 2px;
}
.pb-switch b {
  font-weight: inherit;
}
.pb-upload button {
  min-height: 40px;
}
.pb-copy {
  display: flex;
  gap: 8px;
}
.pb-copy input {
  flex: 1;
  min-width: 0;
}
.pb-file {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pb-looks {
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}
.pb-preview {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.pb-phone {
  position: relative;
  width: 100%;
  max-width: 300px;
  max-height: 72vh;
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  background: #000;
  overflow: hidden;
}
.pb-phone canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.pb-netlabel {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: #000a;
  color: var(--c-fg);
  font-size: var(--t-meta);
  font-weight: 700;
}
.pb-preview .hint {
  margin: 0;
  max-width: 300px;
  text-align: center;
}

@media (max-width: 900px) {
  .pb-body {
    grid-template-columns: 1fr;
  }
  .pb-preview {
    position: static;
    order: -1;
  }
  .pb-phone {
    max-width: 220px;
  }
  .pc-head {
    flex-direction: column;
    align-items: stretch;
  }
}
