/* Girl Walk — onboarding layout dashboard
   Deliberately dependency-free: no build step, no CDN, so it keeps working
   years from now without a toolchain to resurrect. */

:root {
  --pink: #ff4d8d;
  --pink-soft: #fff5f8;
  --ink: #14121a;
  --ink-2: #4b4753;
  --ink-3: #8b8794;
  --line: #e7e4ec;
  --surface: #ffffff;
  --bg: #f7f6fa;
  --danger: #c8283c;
  --danger-soft: #fdecef;
  --warn: #8a5a00;
  --warn-soft: #fff6e0;
  --ok: #0a7a45;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(20, 18, 26, .06), 0 8px 24px rgba(20, 18, 26, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 17px; }
h2 { font-size: 14px; }
h3 { font-size: 16px; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ───────────── top bar ───────────── */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 20px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--pink); color: #fff;
  font-weight: 800; font-size: 13px; letter-spacing: -.02em;
}

.status { margin: 1px 0 0; font-size: 12px; color: var(--ink-3); }
.status.dirty { color: var(--warn); }
.status.error { color: var(--danger); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

button, .file-button {
  font: inherit; font-size: 13px; font-weight: 550;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  cursor: pointer; transition: background .12s, border-color .12s, transform .08s;
}
button:hover, .file-button:hover { background: #fbfafd; border-color: #d8d4e0; }
button:active { transform: scale(.98); }
button:disabled { opacity: .45; cursor: not-allowed; }

button.primary {
  background: var(--pink); border-color: var(--pink); color: #fff;
}
button.primary:hover { background: #f03c7f; border-color: #f03c7f; }
button.small { padding: 5px 10px; font-size: 12px; }
button.wide { width: 100%; margin-top: 14px; padding: 11px; }
.file-button { display: inline-block; }

/* ───────────── banner ───────────── */

.banner {
  margin: 12px 20px 0; padding: 10px 14px;
  border-radius: var(--radius); font-size: 13px;
  background: var(--danger-soft); color: var(--danger);
  border: 1px solid #f6ccd4;
}
.banner.ok { background: #eaf8f1; color: var(--ok); border-color: #c6e9d8; }
.banner ul { margin: 6px 0 0; padding-left: 18px; }
.banner code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

/* ───────────── layout ───────────── */

.layout {
  display: grid;
  grid-template-columns: 280px minmax(420px, 1fr) 360px;
  gap: 16px; padding: 16px 20px 40px;
  align-items: start;
}

@media (max-width: 1200px) {
  .layout { grid-template-columns: 260px 1fr; }
  .preview-panel { display: none; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
}

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  position: sticky; top: 74px;
}
.editor-panel { position: static; }

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
}

.pill {
  font-size: 11px; font-weight: 600; padding: 3px 8px;
  border-radius: 999px; background: var(--bg); color: var(--ink-3);
  border: 1px solid var(--line);
}

.hint { margin: 0 16px 12px; font-size: 12px; color: var(--ink-3); }
.warn {
  margin: 10px 0 0; padding: 9px 12px; font-size: 12px;
  background: var(--warn-soft); color: var(--warn);
  border: 1px solid #f0e0b8; border-radius: var(--radius);
}
.empty { padding: 40px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ───────────── screen list ───────────── */

.screens-panel { max-height: calc(100vh - 100px); display: flex; flex-direction: column; }

.screen-list {
  list-style: none; margin: 0; padding: 0 8px 8px;
  overflow-y: auto; flex: 1;
  counter-reset: screen;
}

.screen-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 4px;
  border-radius: var(--radius); cursor: grab;
  border: 1px solid transparent;
}
.screen-item:hover { background: var(--bg); }
.screen-item.selected { background: var(--pink-soft); border-color: #ffd0e0; }
.screen-item.dragging { opacity: .35; }
.screen-item.drop-target { border-top: 2px solid var(--pink); }
.screen-item.disabled .screen-name,
.screen-item.disabled .screen-type { opacity: .4; text-decoration: line-through; }

.screen-index {
  width: 20px; flex: none; text-align: right;
  font-size: 11px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.screen-body { min-width: 0; flex: 1; }
.screen-name {
  font-size: 13px; font-weight: 550;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.screen-type { font-size: 11px; color: var(--ink-3); }

.toggle {
  flex: none; width: 34px; height: 20px; border-radius: 999px;
  border: none; padding: 0; background: #d9d5e2; position: relative;
  cursor: pointer; transition: background .15s;
}
.toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  transition: transform .15s;
}
.toggle[aria-pressed="true"] { background: var(--pink); }
.toggle[aria-pressed="true"]::after { transform: translateX(14px); }
.toggle.risky[aria-pressed="false"] { background: var(--danger); }

.panel-foot { border-top: 1px solid var(--line); padding-top: 10px; }

/* ───────────── editor ───────────── */

.editor { padding: 0 16px 20px; }

.group {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 12px;
}
.group > h4 {
  margin: 0 0 10px; font-size: 12px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3);
}

.field { display: block; margin-bottom: 10px; }
.field > span {
  display: block; margin-bottom: 4px;
  font-size: 12px; font-weight: 550; color: var(--ink-2);
}
.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field input[type="search"],
.field textarea,
.field select {
  width: 100%; font: inherit; font-size: 13px;
  padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--surface); color: var(--ink);
}
.field textarea { resize: vertical; min-height: 62px; line-height: 1.45; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 77, 141, .12);
}

.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.row.tight { gap: 6px; }

input[type="search"] { width: 100%; font: inherit; font-size: 13px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 9px; margin-bottom: 12px; }

.swatch-row { display: flex; align-items: center; gap: 8px; }
input[type="color"] {
  width: 34px; height: 34px; padding: 0; border: 1px solid var(--line);
  border-radius: 9px; background: none; cursor: pointer; flex: none;
}

.run {
  border: 1px dashed var(--line); border-radius: 10px;
  padding: 10px; margin-bottom: 8px; background: #fcfcfe;
}
.run-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.run-label { font-size: 11px; color: var(--ink-3); font-weight: 600; }

.size-warn { color: var(--warn); font-size: 11px; margin-top: 4px; }

.thumb-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border: 1px solid var(--line); border-radius: 10px;
}
.thumb-preview img {
  width: 56px; height: 56px; object-fit: cover;
  border-radius: 8px; background: var(--bg); flex: none;
}
.thumb-preview .thumb-meta { min-width: 0; flex: 1; }
.thumb-preview .thumb-name {
  font-size: 12px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thumb-preview .thumb-kind { font-size: 11px; color: var(--ink-3); }

.list-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px; border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 6px;
}
.list-item > .list-body { flex: 1; min-width: 0; }
.readonly-note {
  font-size: 12px; color: var(--ink-3);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px;
}

/* ───────────── preview ───────────── */

.preview-panel { padding-bottom: 4px; }

.phone {
  width: 268px; height: 560px; margin: 4px auto 12px;
  border-radius: 40px; border: 9px solid #16141c;
  background: var(--pink-soft); position: relative;
  overflow: hidden; box-shadow: 0 10px 30px rgba(20, 18, 26, .18);
}
.phone-notch {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 78px; height: 20px; border-radius: 999px; background: #16141c; z-index: 2;
}
.phone-screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.pv-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 34px 12px 0; font-size: 10px; color: #8b8794; flex: none;
}
.pv-media { flex: none; overflow: hidden; background: #efecf4; }
.pv-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-media.empty-slot {
  display: grid; place-items: center; color: #b6b1c0; font-size: 10px;
}
.pv-spacer { flex: 1; }
.pv-text { padding: 0 14px; text-align: center; }
.pv-sub { padding: 6px 14px 0; text-align: center; }
.pv-options { padding: 0 12px; display: flex; flex-direction: column; gap: 5px; }
.pv-option {
  border: 1px solid #e7e4ec; border-radius: 12px;
  padding: 8px 10px; font-size: 10px; background: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pv-tags { padding: 0 12px; display: flex; flex-wrap: wrap; gap: 4px; }
.pv-tag { font-size: 9px; padding: 5px 8px; border-radius: 999px; }
.pv-button {
  margin: 10px 14px 18px; padding: 10px;
  border-radius: 999px; background: var(--pink); color: #fff;
  text-align: center; font-size: 11px; font-weight: 700; flex: none;
}
.pv-overflow {
  margin: 6px 12px; padding: 5px 8px; font-size: 9px;
  background: var(--warn-soft); color: var(--warn);
  border: 1px solid #f0e0b8; border-radius: 8px;
}
.pv-unsupported {
  margin: auto; padding: 20px; text-align: center;
  font-size: 11px; color: var(--ink-3);
}

/* ───────────── modals ───────────── */

.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 18, 26, .42);
  display: grid; place-items: center; padding: 20px;
}
/* `display: grid` above beats the `hidden` attribute's UA `display: none`,
   so modals need this or they are open on page load. */
.modal[hidden] { display: none; }
.tab-body[hidden] { display: none; }
.modal-card {
  background: var(--surface); border-radius: var(--radius-lg);
  width: min(760px, 100%); max-height: 86vh; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(20, 18, 26, .3);
}
.modal-card.narrow { width: min(420px, 100%); padding-bottom: 18px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--line);
}
.modal-card.narrow .modal-head { border-bottom: none; padding-bottom: 4px; }
.modal-card.narrow .field,
.modal-card.narrow .hint,
.modal-card.narrow .publish-summary,
.modal-card.narrow > button { margin-left: 18px; margin-right: 18px; }

.modal-tabs { display: flex; gap: 4px; padding: 10px 18px 0; }
.tab {
  border: none; background: none; padding: 6px 12px;
  border-radius: 999px; font-size: 13px; color: var(--ink-3);
}
.tab.active { background: var(--pink-soft); color: var(--pink); font-weight: 650; }
.tab-body { padding: 14px 18px 18px; overflow-y: auto; }

.picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}
.picker-cell {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; cursor: pointer; background: var(--surface); text-align: left;
}
.picker-cell:hover { border-color: var(--pink); }
.picker-cell img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 6px; background: var(--bg); display: block;
}
.picker-cell .no-thumb {
  width: 100%; aspect-ratio: 1; border-radius: 6px; background: var(--bg);
  display: grid; place-items: center; color: var(--ink-3); font-size: 9px;
}
.picker-cell .cell-name {
  margin-top: 5px; font-size: 10px; line-height: 1.3;
  word-break: break-word; color: var(--ink-2);
}

.upload-zone {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 28px; text-align: center; cursor: pointer;
}
.upload-zone:hover, .upload-zone.over { border-color: var(--pink); background: var(--pink-soft); }
.upload-zone p { margin: 0 0 4px; font-size: 13px; }

.publish-summary {
  font-size: 13px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; margin-bottom: 14px;
}
.publish-summary ul { margin: 6px 0 0; padding-left: 18px; }
.publish-summary .risky { color: var(--danger); font-weight: 600; }
