:root { --ink: #14171A; --paper: #F6F3EE; --accent: #4f46e5; }
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--ink); color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.wrap { max-width: 420px; width: 100%; padding: 32px 24px; }
h1 { font-size: 22px; margin: 0 0 20px; }
form { display: flex; flex-direction: column; gap: 6px; }
label { font-size: 13px; color: #C7C1B4; margin-top: 12px; }
input {
  background: #1D2126; border: 1px solid rgba(255,255,255,0.15); border-radius: 6px;
  color: #fff; font: inherit; font-size: 15px; padding: 10px 12px;
}
button {
  margin-top: 20px; background: var(--accent); color: #fff; border: none;
  border-radius: 6px; padding: 12px; font: inherit; font-weight: 600; cursor: pointer;
}
.error { background: rgba(232,67,42,0.15); border: 1px solid rgba(232,67,42,0.4); border-radius: 6px; padding: 10px 14px; font-size: 14px; }
body:has(.dashboard) { align-items: flex-start; }
.dashboard.wrap { max-width: 520px; padding-top: 56px; padding-bottom: 56px; }
.dashboard.wrap.links-grid-3 { max-width: 900px; }
.dashboard h1 { margin-bottom: 4px; }
.dashboard .sub { color: #8A8375; font-size: 14px; margin: 0 0 18px; }
.dashboard .pitch {
  font-size: 14px; line-height: 1.6; color: #C7C1B4;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 14px 16px; margin: 0 0 24px;
}
.dashboard .pitch strong { color: #fff; }
.dashboard .intro {
  font-size: 14px; line-height: 1.6; color: #C7C1B4;
  margin: 0 0 16px; max-width: 820px;
}
.dashboard .links { display: flex; flex-direction: column; gap: 12px; }
.dashboard .links a {
  display: flex; flex-direction: column; gap: 6px;
  background: #1D2126; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
  padding: 16px 18px; color: #fff; text-decoration: none; font-weight: 500;
}
.dashboard .links a:hover { border-color: var(--accent); }
.dashboard .links .link-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dashboard .links .link-price {
  flex-shrink: 0; font-size: 13px; font-weight: 600; color: #C7C1B4;
  background: rgba(255,255,255,0.08); border-radius: 5px; padding: 4px 10px;
}
.dashboard .links .link-note { font-size: 12.5px; font-weight: 400; color: #8A8375; }
.dashboard .preview-section { margin-bottom: 28px; }
.dashboard .preview-section:last-child { margin-bottom: 0; }
.dashboard .section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: #8A8375; margin: 0 0 10px;
}
.dashboard .section-empty {
  font-size: 13.5px; color: #8A8375;
  background: rgba(255,255,255,0.03); border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 8px; padding: 12px 14px; margin: 0;
}
.dashboard .logout { margin-top: 32px; }
.dashboard .logout a { color: #8A8375; font-size: 13px; }

.dashboard.links-grid-3 .section-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: start; }
.dashboard.links-grid-3 .section-columns .preview-section { margin-bottom: 0; }
@media (max-width: 760px) { .dashboard.links-grid-3 .section-columns { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .dashboard.links-grid-3 .section-columns { grid-template-columns: 1fr; } }

.dashboard.wrap.links-cols-2 { max-width: 640px; }
.dashboard.links-cols-2 .section-title { text-align: center; }
.dashboard.links-cols-2 .links {
  display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: row; gap: 12px;
}
.dashboard.links-cols-2 .links a { height: 100%; }
@media (max-width: 640px) {
  .dashboard.links-cols-2 .links { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none; }
}

/* Approve-for-Client-Staging flow (cgiweb account only) */
.dashboard .link-row { display: flex; flex-direction: column; }
.dashboard .approve-form {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 8px; padding: 10px 12px;
  background: rgba(255,255,255,0.03); border: 1px dashed rgba(255,255,255,0.15); border-radius: 8px;
}
.dashboard .approve-form select,
.dashboard .approve-form input[type="text"] {
  background: #1D2126; border: 1px solid rgba(255,255,255,0.15); border-radius: 6px;
  color: #fff; font-size: 13px; padding: 6px 8px;
}
.dashboard .approve-form input[type="text"] { flex: 1; min-width: 140px; }
.dashboard .approve-form button {
  background: var(--accent); border: none; border-radius: 6px;
  color: #14181d; font-size: 13px; font-weight: 700; padding: 7px 12px; cursor: pointer;
}
.dashboard .approve-form button:hover { filter: brightness(1.08); }
.dashboard .approve-success {
  background: rgba(80,200,120,0.12); border: 1px solid rgba(80,200,120,0.35); color: #9EE6B4;
  border-radius: 8px; padding: 10px 14px; font-size: 13.5px; margin: 0 0 16px;
}


/* cgiweb approve form: keep the select inside the phone viewport (pre-existing overflow, fixed 2026-09-04) */
.dashboard .approve-form select, .dashboard .approve-form input[type=text] { max-width: 100%; width: 100%; }

/* Image tiles: every preview link carries a screenshot of the page (thumbs/ via wip-thumbs.mjs). */
.dashboard .links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dashboard .links .link-row { min-width: 0; }
.dashboard .links a.tile { padding: 0; overflow: hidden; height: 100%; }
.dashboard .links a.tile .tile-img { display: block; aspect-ratio: 8 / 5; overflow: hidden; background: #0f1215; border-bottom: 1px solid rgba(255,255,255,0.08); }
.dashboard .links a.tile .tile-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transition: transform 300ms cubic-bezier(.2,.8,.2,1); }
.dashboard .links a.tile:hover .tile-img img, .dashboard .links a.tile:focus-visible .tile-img img { transform: scale(1.04); }
.dashboard .links a.tile .link-top, .dashboard .links a.tile .link-note { padding: 0 14px; }
.dashboard .links a.tile .link-top { padding-top: 12px; }
.dashboard .links a.tile .link-note { padding-bottom: 12px; }
.dashboard .links a.tile .link-top:last-child { padding-bottom: 12px; }
.dashboard .links a.tile--text { padding: 16px 18px; }
.dashboard .links a.tile--text .link-top, .dashboard .links a.tile--text .link-note { padding: 0; }
.dashboard .links .link-label { font-size: 14px; line-height: 1.35; }
.dashboard.wrap { max-width: 640px; }
.dashboard.links-grid-3 .section-columns .links { grid-template-columns: 1fr; }
@media (max-width: 480px) { .dashboard .links { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .dashboard .links a.tile .tile-img img { transition: none; } }

/* Text-only tiles (no thumbnail yet) sit at their natural height instead of stretching to the row */
.dashboard .links a.tile--text { height: auto; }
.dashboard .links .link-row:has(a.tile--text) { align-self: start; }

/* Sections flagged "flow": "row" in accounts.json read left-to-right, top-to-bottom, even on cols-2 accounts */
.dashboard.links-cols-2 .links.links--rows { grid-auto-flow: row; grid-template-rows: none; }

/* Desktop: use the width. 4 tiles across from 1100px, 3 from 800px; phones keep 1 column, tablets 2. */
@media (min-width: 481px) { .dashboard .links .link-row { order: var(--o, 0); } }
@media (min-width: 800px) {
  .dashboard.wrap, .dashboard.wrap.links-cols-2 { max-width: 980px; }
  .dashboard .links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard.links-cols-2 .links { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard .pitch { max-width: 820px; }
  .dashboard.links-cols-2 .section-title { text-align: left; }
}
@media (min-width: 1100px) {
  .dashboard.wrap, .dashboard.wrap.links-cols-2 { max-width: 1240px; }
  .dashboard .links { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard.links-grid-3 .section-columns .links { grid-template-columns: 1fr; }
}

/* Client "Not needed" control on each preview, and the collapsed list of what they hid */
.dashboard .links .link-row { position: relative; }
.dashboard .links button.dismiss {
  margin: 8px 0 0; padding: 6px 10px; font-size: 12px; font-weight: 600; border-radius: 5px; cursor: pointer;
  background: transparent; color: #8A8375; border: 1px solid rgba(255,255,255,0.14);
}
.dashboard .links button.dismiss:hover { color: #fff; border-color: #fff; }
.dashboard .links button.dismiss.restore { color: #C7C1B4; }
.dashboard .hidden-links { margin: 14px 0 0; }
.dashboard .hidden-links summary { cursor: pointer; font-size: 13px; color: #8A8375; padding: 6px 0; }
.dashboard .hidden-links summary:hover { color: #fff; }
.dashboard .hidden-links .links { margin-top: 10px; opacity: 0.75; }
.dashboard .hidden-links .links a.tile .tile-img img { filter: grayscale(0.6); }

/* A preview that has gone live: green badge, links straight to the live site, no "Not needed" */
.dashboard .links .link-live { flex-shrink: 0; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #0f5132; background: #d1f0dc; border-radius: 5px; padding: 4px 10px; }
