/* App Store Page Dashboard — light theme modeled on the App Store product
 * page + App Store Connect chrome. The store-page area is the mockup: Edit
 * renders the same layout with inline fields; Preview is the clean page. */
:root {
  --bg: #f5f5f7;          /* apple.com/App Store body */
  --page: #ffffff;
  --line: #d2d2d7;
  --hairline: rgba(0, 0, 0, .12);
  --text: #1d1d1f;
  --dim: #86868b;
  --blue: #0071e3;        /* ASC action blue */
  --applink: #007aff;     /* iOS link blue */
  --ok: #34c759; --warn: #ff9500; --err: #ff3b30;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 20px; background: rgba(255,255,255,.92); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline); flex-wrap: wrap;
}
.tb-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tb-title { font-weight: 700; font-size: 15px; letter-spacing: -.2px; }
.tb-sub { color: var(--dim); font-size: 12px; }
.tb-actions { display: flex; gap: 8px; align-items: center; position: relative; }

select {
  font: inherit; padding: 5px 26px 5px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
}
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 980px; padding: 6px 16px; font-weight: 500;
}
.btn:hover { background: #f7f7f9; }
.btn.primary {
  background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.06); background: var(--blue); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.danger { border-color: var(--err); color: var(--err); }
.btn.danger:hover { background: #fff1f0; }
.badge {
  font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 20px;
  background: #e8e8ed; color: var(--dim);
}
.badge.locked { background: #fff3e0; color: #b25000; }
.badge.live { background: #e2f7e8; color: #1d7a3a; }

/* overflow menu */
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 320px;
  background: #fff; border: 1px solid var(--hairline); border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0,0,0,.16); padding: 6px; z-index: 40;
}
.menu.hidden { display: none; }
.menu button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 9px 12px; border-radius: 9px;
}
.menu button:hover { background: #f2f2f7; }
.menu .m-label { font-weight: 600; }
.menu .m-note { color: var(--dim); font-size: 12px; margin-top: 1px; }
.menu hr { border: none; border-top: 1px solid var(--hairline); margin: 6px 4px; }

/* ------------------------------------------------------------------ tabs */
.tabsbar {
  max-width: 980px; margin: 18px auto 0; padding: 0 20px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.seg { display: inline-flex; background: #e8e8ed; border-radius: 10px; padding: 2px; }
.seg button {
  border: none; background: none; padding: 6px 22px; border-radius: 8px;
  font-weight: 600; color: var(--dim);
}
.seg button.active { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.seg.small button { padding: 4px 14px; font-weight: 500; font-size: 13px; }

/* ------------------------------------------------------------ store page */
.store {
  max-width: 980px; margin: 14px auto 60px; background: var(--page);
  border: 1px solid var(--hairline); border-radius: 18px; padding: 30px 34px 26px;
}
@media (max-width: 720px) { .store { border-radius: 0; padding: 22px 16px; } }

.app-header { display: flex; gap: 20px; align-items: flex-start; }
.app-icon {
  width: 118px; height: 118px; border-radius: 26px; flex: none;
  border: 1px solid var(--hairline); background: #eee; object-fit: cover;
}
.app-head-text { flex: 1; min-width: 0; padding-top: 4px; }
.app-name {
  font-size: 23px; font-weight: 700; letter-spacing: -.3px; line-height: 1.2;
  border: none; width: 100%; padding: 0; background: none; color: var(--text);
}
.app-subtitle {
  font-size: 15px; color: var(--dim); border: none; width: 100%;
  padding: 0; margin-top: 2px; background: none;
}
.get-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.get-pill {
  background: var(--applink); color: #fff; font-weight: 700; font-size: 15px;
  padding: 5px 22px; border-radius: 980px; border: none; letter-spacing: .2px;
}
.get-note { color: var(--dim); font-size: 11px; line-height: 1.3; }
.app-category { color: var(--dim); font-size: 12px; margin-top: 6px; }

.divider { border: none; border-top: 1px solid var(--hairline); margin: 24px 0 20px; }
.sec-h { font-size: 20px; font-weight: 700; letter-spacing: -.3px; margin: 0 0 12px; display: flex; align-items: baseline; gap: 10px; }
.sec-h .n { color: var(--dim); font-size: 12px; font-weight: 400; }

/* screenshots rail */
.shots-rail {
  display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 12px;
  scroll-snap-type: x mandatory;
}
.shots-rail::-webkit-scrollbar { height: 8px; }
.shots-rail::-webkit-scrollbar-thumb { background: #d6d6db; border-radius: 8px; }
.shot { flex: none; scroll-snap-align: start; position: relative; }
.shot img, .shot .ph {
  height: 380px; aspect-ratio: 1320 / 2868; display: block;
  border-radius: 16px; border: 1px solid var(--hairline); background: #f2f2f7;
  object-fit: cover;
}
.shots-rail.ipad .shot img, .shots-rail.ipad .shot .ph { aspect-ratio: 2064 / 2752; }
.shot .ph { display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: 12px; text-align: center; padding: 12px; }
/* app preview: same card as a screenshot, but a playable video */
.shot video {
  height: 380px; aspect-ratio: 886 / 1920; display: block;
  border-radius: 16px; border: 1px solid var(--hairline);
  background: #000; object-fit: cover;
}
.shots-rail.ipad .shot video { aspect-ratio: 1200 / 1600; }
.shot .play-tag {
  position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.6);
  color: #fff; font-size: 10px; font-weight: 600; letter-spacing: .3px;
  padding: 3px 8px; border-radius: 8px; pointer-events: none;
}
.shot .ref-tag {
  position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.92);
  border: 1px solid var(--hairline); color: #b25000; font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 8px;
}
.shot .ops { display: flex; gap: 4px; justify-content: center; margin-top: 8px; }
.shot .ops button {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 2px 9px; font-size: 12px;
}
.shot .ops button:hover { background: #f2f2f7; }
.shot .cap { color: var(--dim); font-size: 11px; text-align: center; margin-top: 5px; max-width: 176px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* drag-to-reorder */
.shot[draggable="true"] img { cursor: grab; }
.shot.dragging { opacity: .4; }
.shot.drop-before { box-shadow: -3px 0 0 var(--blue); }
.shot.drop-after { box-shadow: 3px 0 0 var(--blue); }

/* per-screenshot marketing goals (internal, never shipped) */
.shot .goals { margin-top: 6px; }
.shot .goals textarea {
  width: 100%; max-width: 176px; border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 7px; font: inherit; font-size: 11.5px; line-height: 1.35; color: var(--text);
  background: #fffdf5; resize: vertical; min-height: 46px;
}
.shot .goals textarea:focus { outline: none; border-color: var(--blue); background: #fff; }
.shot .goals label { display: block; font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }

/* description / whats-new text */
.copy-block { font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; }
.promo { font-size: 14.5px; line-height: 1.5; }
textarea.copy-block, textarea.promo, textarea.plain {
  width: 100%; border: 1px solid transparent; border-radius: 10px; padding: 8px 10px;
  margin: -8px -10px; background: none; color: var(--text); resize: vertical; font: inherit;
}
textarea.copy-block { font-size: 14.5px; line-height: 1.55; }
.editing textarea:hover, .editing input.app-name:hover, .editing input.app-subtitle:hover,
.editing input.plain:hover { background: #f5f9ff; }
.editing textarea:focus, .editing input:focus {
  outline: none; background: #f5f9ff; border-color: var(--blue);
}
.whats-version { display: flex; justify-content: space-between; color: var(--dim); font-size: 13px; margin-bottom: 8px; }

/* information table */
.info-table { font-size: 13.5px; }
.info-row {
  display: flex; justify-content: space-between; gap: 18px;
  padding: 11px 0; border-top: 1px solid var(--hairline);
}
.info-row:last-child { border-bottom: 1px solid var(--hairline); }
.info-row .k { color: var(--dim); flex: none; width: 130px; }
.info-row .v { text-align: right; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.info-row .v a { color: var(--applink); text-decoration: none; }
.info-row input.plain {
  width: 100%; text-align: right; border: 1px solid transparent; border-radius: 8px;
  padding: 2px 6px; margin: -2px -6px; background: none; color: var(--applink); font: inherit;
}

/* counters + edit-only chrome */
.count { color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.count.over { color: var(--err); font-weight: 700; }
.edit-only {}
body.previewing .edit-only { display: none !important; }

/* utility cards under the page (Edit tab) */
.util {
  max-width: 980px; margin: 0 auto 40px; padding: 0 20px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 860px) { .util { grid-template-columns: 1fr; } }
.card {
  background: #fff; border: 1px solid var(--hairline); border-radius: 14px; padding: 16px 18px;
}
.card h3 { margin: 0 0 10px; font-size: 14px; }
.card h3 .n { color: var(--dim); font-weight: 400; font-size: 12px; }
.card label { display: block; color: var(--dim); font-size: 12px; margin: 10px 0 4px; }
.card textarea, .card input[type="text"] {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px;
  font: inherit; background: #fff; color: var(--text);
}
.card textarea:focus, .card input:focus { outline: none; border-color: var(--blue); }
.card .mono { font: 12px/1.5 ui-monospace, "SF Mono", Menlo, monospace; }
.check { display: flex; align-items: center; gap: 7px; color: var(--dim); font-size: 13px; margin-top: 8px; }

.findings { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto; }
.findings li {
  padding: 6px 9px; margin-bottom: 5px; font-size: 13px;
  border-left: 3px solid var(--line); background: #f7f7f9; border-radius: 0 8px 8px 0;
}
.findings li.error { border-left-color: var(--err); }
.findings li.warn { border-left-color: var(--warn); }
.findings li.ok { border-left-color: var(--ok); color: var(--dim); }

.plan-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--hairline); font-size: 13px; }
.plan-row:first-of-type { border-top: none; }
.plan-row .meta { color: var(--dim); font-size: 12px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-row button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 3px 11px; font-size: 12px; }

.hint { color: var(--dim); font-size: 12px; }
.msg { color: var(--dim); font-size: 13px; }
.busy { opacity: .55; pointer-events: none; }
.hidden { display: none !important; }

/* ------------------------------------------------------- deploy modal */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .34); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-scrim.hidden { display: none; }
.modal {
  background: #fff; border-radius: 18px; width: min(560px, 100%);
  max-height: min(760px, 90vh); display: flex; flex-direction: column;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .3); animation: sheet-in .2s ease-out;
}
.modal header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 20px 22px 14px; border-bottom: 1px solid var(--hairline);
}
.modal-kicker { color: var(--dim); font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.modal h2 { margin: 2px 0 0; font-size: 19px; letter-spacing: -.3px; }
.modal-x { border: none; background: none; color: var(--dim); font-size: 15px; padding: 2px 6px; border-radius: 8px; }
.modal-x:hover { background: #f2f2f7; }
.modal-body { padding: 16px 22px; overflow: auto; flex: 1; }
.modal-foot {
  padding: 14px 22px 18px; border-top: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 10px;
}
.dp-note { color: var(--dim); font-size: 12px; line-height: 1.4; }
.dp-cta .btn { width: 100%; padding: 11px 16px; font-size: 15px; }

.dp-group { margin-bottom: 16px; }
.dp-group h4 {
  margin: 0 0 7px; font-size: 12px; color: var(--dim);
  text-transform: uppercase; letter-spacing: .5px; font-weight: 600;
}
.dp-item {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 6px 0; font-size: 13.5px; border-top: 1px solid var(--hairline);
}
.dp-group .dp-item:first-of-type { border-top: none; }
.dp-item .ic { flex: none; width: 16px; text-align: center; color: var(--blue); }
.dp-item.warn .ic { color: var(--warn); }
.dp-item.muted { color: var(--dim); }
.dp-item.muted .ic { color: var(--ok); }
.dp-empty { color: var(--dim); font-size: 13px; }

/* live progress state */
.dp-progress { display: flex; align-items: center; gap: 11px; justify-content: center; padding: 3px 0; }
.spinner {
  width: 17px; height: 17px; flex: none; border-radius: 50%;
  border: 2px solid #d7d7dd; border-top-color: var(--blue);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.dp-progress-text { font-size: 14px; font-weight: 500; }
.dp-bar { height: 4px; background: #e8e8ed; border-radius: 4px; overflow: hidden; margin-top: 10px; }
.dp-bar i { display: block; height: 100%; background: var(--blue); border-radius: 4px; transition: width .3s ease; }
.dp-log {
  margin-top: 12px; max-height: 190px; overflow: auto;
  font: 12px/1.6 ui-monospace, "SF Mono", Menlo, monospace; color: var(--dim);
}
.dp-log div { padding: 1px 0; }
.dp-log div.now { color: var(--text); font-weight: 600; }
.dp-result { text-align: center; padding: 6px 0 2px; }
.dp-result .big { font-size: 34px; line-height: 1; }
.dp-result h3 { margin: 10px 0 4px; font-size: 17px; }
.dp-result p { margin: 0; color: var(--dim); font-size: 13px; }
.dp-result a { color: var(--applink); }

/* toast/output sheet for deploy & diff results */
.sheet {
  position: fixed; right: 18px; bottom: 18px; width: min(430px, calc(100vw - 36px));
  background: #fff; border: 1px solid var(--hairline); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.22); padding: 14px 16px; z-index: 50;
  max-height: 60vh; overflow: auto;
}
.sheet h4 { margin: 0 0 8px; font-size: 13px; display: flex; justify-content: space-between; }
.sheet h4 button { border: none; background: none; color: var(--dim); font-size: 14px; }
/* the sheet is the deploy progress surface — make its arrival obvious */
.sheet:not(.hidden) { animation: sheet-in .22s ease-out; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.btn:disabled { position: relative; }
