/* The editor's whole stylesheet. Deliberately small and dependency-free:
   no framework, no build step, no fonts fetched from anywhere. It has to keep
   working untouched for years, on Jody's laptop and on her phone. */

:root {
  --ink: #1C1C1A;
  --paper: #FFFFFF;
  --wash: #F4F1EC;
  --line: #E2DCD2;
  --soft: #5E5A52;
  --brand: #0080A3;   /* Choice teal — see the brand block below */
  --good: #2E6B46;
  --warn: #8A4B10;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--brand); }

/* ---------- top bar ---------- */

.bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--choice-teal);
  color: #fff;
  border-bottom: 3px solid var(--choice-orange);
}
.bar a { color: #fff; text-decoration: none; }
.bar a:hover { text-decoration: underline; }
.bar .brand { font-weight: 600; letter-spacing: .02em; }
.bar nav { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font-size: 14px; }
.bar .who { color: rgba(255,255,255,.72); }

/* ---------- page frame ---------- */

main {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}
main.narrow { max-width: 440px; padding-top: 64px; }

h1 { font-size: 28px; line-height: 1.2; margin: 0 0 6px; }
h2 { font-size: 19px; margin: 0 0 8px; }

.crumbs { margin: 0 0 18px; font-size: 14px; }
.muted { color: var(--soft); }
.tiny  { font-size: 13px; }
.help  { margin: 4px 0 10px; font-size: 13px; color: var(--soft); }
/* The same voice as .help, but numbered: a field whose instructions are a
   sequence rather than a sentence. */
.helpsteps { margin: 4px 0 12px; padding-left: 1.3em; font-size: 13px; color: var(--soft); }
.helpsteps li { margin: 0 0 .45em; line-height: 1.5; }

/* ---------- page tabs ---------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 24px;
  padding: 0;
  list-style: none;
}
.tabs a {
  display: block;
  padding: 7px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
}
.tabs a.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- the site cards on the dashboard ---------- */

.sites { display: grid; gap: 14px; padding: 0; margin: 22px 0 0; list-style: none; }
.sites li {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.sites h2 { margin: 0 0 4px; }

/* ---------- one editable field ---------- */

.field {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 0 0 16px;
}
.fieldhead {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
  margin-bottom: 2px;
}
.fieldhead label { font-weight: 600; }
.fieldhead .tiny { margin-left: auto; }

.req {
  font-weight: 400;
  font-size: 12px;
  color: var(--warn);
  text-transform: none;
}
.chip {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #FBEFD9;
  color: var(--warn);
}
.badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--wash);
  color: var(--soft);
}

input, textarea, select {
  width: 100%;
  font: inherit;
  color: inherit;
  padding: 9px 11px;
  background: #fff;
  border: 1px solid #C9C2B5;
  border-radius: 8px;
}
input:focus, textarea:focus, button:focus {
  outline: 3px solid #D8B5B2;
  outline-offset: 1px;
}
textarea { resize: vertical; min-height: 7em; font-size: 15px; }
input[type="file"] { padding: 7px; border-style: dashed; background: var(--wash); }

/* ---------- photo field ---------- */

.photo img {
  display: block;
  max-width: 320px;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-bottom: 10px;
}
.photo > label { display: block; margin: 14px 0 4px; font-weight: 600; font-size: 15px; }

/* ---------- items tables ---------- */

.rows { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
.rows th {
  text-align: left;
  font-size: 13px;
  color: var(--soft);
  font-weight: 600;
  padding: 0 6px 6px 0;
  white-space: nowrap;
}
.rows td { padding: 0 6px 6px 0; vertical-align: top; }
.rows td:last-child, .rows th:last-child { width: 1%; padding-right: 0; }
.rows input { padding: 7px 9px; }

/* ---------- a file to download ---------- */

.doc {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin: 6px 0 10px;
}
.doc-has { margin: 0 0 10px; }
.doc-has a { font-weight: 600; }
.doc-has .small { display: block; color: var(--soft); font-weight: 400; }
.doc .muted { margin: 0 0 10px; }

.docadd {
  display: inline-block;
  font-weight: 600;
  padding: 11px 20px;
  border: 1px solid #C9C2B5;
  border-radius: 8px;
  background: var(--paper);
  cursor: pointer;
}
.docadd input { display: none; }
/* An author display rule beats the browser's own [hidden] — the same trap the
   gallery's add button fell into. */
.docadd[hidden] { display: none; }

[data-doc-remove] { display: block; margin-top: 10px; }

/* ---------- galleries ---------- */

/* A list of photos the client can reorder. The number badge is drawn by the
   list rather than written into the markup, so the order shown is always the
   order that will be saved, however the rows were moved around. */

.gallist { list-style: none; counter-reset: gal; padding: 0; margin: 6px 0 10px; }

.galrow {
  counter-increment: gal;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}
.galrow > img {
  width: 92px;
  height: 92px;
  flex: none;
  object-fit: cover;          /* square thumbnails, whichever way the photo was shot */
  border-radius: 8px;
  background: var(--wash);
}
.galrow-main { flex: 1 1 auto; min-width: 0; }
.galrow-main label {
  display: block;
  font-size: 13px;
  color: var(--soft);
  font-weight: 600;
  margin-bottom: 4px;
}
.galrow-main label::before { content: counter(gal) ". "; color: var(--ink); }
.galrow-main input { width: 100%; padding: 7px 9px; }
.galrow-main .req { font-weight: 400; color: var(--warn); margin-left: 6px; }

.galrow-moves { flex: none; display: flex; flex-direction: column; gap: 6px; }
.galrow-moves button {
  background: var(--paper);
  color: var(--ink);
  border-color: #C9C2B5;
  padding: 6px 12px;
  font-weight: 400;
  font-size: 14px;
}
/* The first photo cannot move up and the last cannot move down. Disabled
   rather than hidden, so the buttons do not jump about as rows are moved. */
.galrow-moves button[disabled] { opacity: .35; cursor: default; }

.galadd {
  display: inline-block;
  font-weight: 600;
  padding: 11px 20px;
  border: 1px solid #C9C2B5;
  border-radius: 8px;
  background: var(--paper);
  cursor: pointer;
}
.galadd input { display: none; }
/* The script hides this with the hidden attribute once the gallery is full.
   An author display rule beats the browser's own [hidden], so say it here. */
.galadd[hidden] { display: none; }

@media (max-width: 640px) {
  .galrow { flex-wrap: wrap; }
  .galrow-moves { flex-direction: row; width: 100%; }
  .galrow-moves button { flex: 1; }
}

/* ---------- buttons ---------- */

button, .button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 11px 20px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { background: #333330; }
.button.secondary, button.secondary, .rows button {
  background: var(--paper);
  color: var(--ink);
  border-color: #C9C2B5;
}
.rows button { padding: 7px 12px; font-weight: 400; font-size: 14px; }
[data-add] { background: var(--paper); color: var(--ink); border-color: #C9C2B5; font-weight: 400; }

/* ---------- notices ---------- */

.ok, .warn, .pending {
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 0 0 18px;
  border: 1px solid;
}
.ok      { background: #ECF5EF; border-color: #BDDCC8; color: var(--good); }
.warn    { background: #FDECEA; border-color: #F0C4BE; color: #8E2B22; }
.pending { background: #FBF3E2; border-color: #EAD9B4; color: var(--warn); }
.ok p:last-child, .warn p:last-child, .warn ul:last-child, .pending p:last-child { margin-bottom: 0; }
.pending .button { margin: 6px 8px 0 0; }

/* ---------- history / activity lists ---------- */

.versions { padding: 0; margin: 0; list-style: none; }
.versions li {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
}

/* ---------- phone ---------- */

@media (max-width: 640px) {
  main { padding: 20px 14px 72px; }
  h1 { font-size: 24px; }
  .fieldhead .tiny { margin-left: 0; }
  .rows, .rows tbody, .rows tr, .rows td { display: block; width: 100%; }
  .rows thead { display: none; }
  .rows tr { border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 10px; }
  .rows td { padding: 0 0 6px; }
  .rows td::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    color: var(--soft);
    margin-bottom: 2px;
  }
}

/* What the unpublished changes are. A count you cannot check is not
   information, and Publish is the one thing here that cannot be undone. */
.changelist { margin: .6rem 0 .9rem; padding-left: 1.2rem; }
.changelist li { margin-bottom: .25rem; font-size: .95rem; }
.changelist a { font-weight: 600; }

/* "Throw these changes away" — present, but never competing with Publish. */
.linkish {
  background: none; border: 0; padding: 0; font: inherit; font-size: .9rem;
  color: var(--warn); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.linkish:hover { color: var(--ink); }
.confirm { background: #fff; border: 1px solid #EAD9B4; border-radius: 8px; padding: .8rem 1rem; }

/* ============================================================
   Choice Media
   Colours sampled from the logo itself rather than guessed:
   teal #00718F and orange #F26122. The teal carries the chrome;
   the orange is kept for the one accent, so it still means
   something when it appears.
   ============================================================ */
:root {
  /* The documented brand colours, from the vector pack's own README. */
  --choice-teal: #0080A3;
  --choice-orange: #F26122;
  --choice-ink: #122128;
}


.brand { display: inline-flex; align-items: baseline; gap: .55rem; text-decoration: none; }
.brand img { height: 30px; width: 30px; display: block; align-self: center; }
.brand span { font-size: .98rem; font-weight: 400; color: #FFFFFF; opacity: .88; }
.brand span b { font-weight: 700; }
.brand:hover span { opacity: 1; }

/* The sign-in page has no bar to carry the logo, and it is the first thing
   anybody sees — a client, on a link from an email. */
.signin { text-align: center; padding-top: clamp(28px, 6vw, 64px); }
.signin .mark { width: 210px; height: auto; margin: 0 auto 1.8rem; display: block; }
.signin h1 { margin-bottom: .4rem; }
.signin form { text-align: left; max-width: 360px; margin: 1.4rem auto 0; }

a { color: var(--choice-teal); }
.button { background: var(--choice-teal); border-color: var(--choice-teal); }
.button:hover { background: #005C74; border-color: #005C74; }

/* ---------- the client's mark on the websites list ---------- */
.sites li { display: flex; gap: clamp(14px, 2vw, 22px); align-items: center; }
.sitebody { min-width: 0; flex: 1; }

.sitemark {
  flex: none; width: 92px; height: 92px; border-radius: 12px;
  background: var(--wash); border: 1px solid var(--line);
  display: grid; place-items: center; padding: 10px; overflow: hidden;
}
.sitemark img { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; }

/* A client with no logo file gets their name set as type, not an invented mark. */
.sitemark.wordmark span {
  font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  text-align: center; line-height: 1.25; color: var(--choice-teal); word-break: break-word;
}

@media (max-width: 520px) {
  .sites li { gap: 14px; }
  .sitemark { width: 64px; height: 64px; border-radius: 10px; padding: 7px; }
  .sitemark.wordmark span { font-size: 10px; letter-spacing: .1em; }
}

/* ---------- people ----------
   Who can sign in, and to which websites. Choice staff only. The layout is
   one card per person rather than a table, because each row carries two small
   forms and a table of forms collapses on a phone. */

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 0 0 22px;
}
.panel h2 { margin: 0 0 12px; font-size: 1.05rem; }

.panel .field {
  border: 0;
  background: none;
  padding: 0;
  margin: 0 0 14px;
}
.panel .field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.panel .field small { display: block; margin-top: 4px; color: var(--soft); font-size: 13px; }

.panel input[type=email], .panel input[type=text], .panel select {
  width: 100%;
  max-width: 28rem;
  padding: 9px 10px;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid #C7C1B6;
  border-radius: 7px;
}
.panel input:focus, .panel select:focus, .person input:focus {
  outline: 2px solid var(--choice-teal);
  outline-offset: 1px;
  border-color: var(--choice-teal);
}

.panel fieldset, .person fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 14px 0 14px;
  padding: 12px 0 0;
}
.panel legend, .person legend {
  padding: 0 8px 0 0;
  font-weight: 600;
  font-size: 13px;
  color: var(--soft);
}

.tick {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 10px 8px 0;
  padding: 6px 12px 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
}
.tick input { accent-color: var(--choice-teal); margin: 0; }
.tick:has(input:checked) { border-color: var(--choice-teal); background: #EAF4F7; }
.tick:has(input:disabled) { opacity: .55; cursor: default; }

.people { list-style: none; margin: 0; padding: 0; }

.person {
  display: grid;
  gap: 4px 28px;
  grid-template-columns: 1fr;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 0 0 14px;
}
@media (min-width: 720px) {
  .person { grid-template-columns: minmax(12rem, 1fr) minmax(14rem, 1.3fr) auto; align-items: start; }
  .person fieldset { margin-top: 0; border-top: 0; padding-top: 0; }
}

.person--off { background: #FAF8F5; }
.person--off .person__name { text-decoration: line-through; }

.person__name { margin: 0; font-weight: 650; }
.person__email { margin: 2px 0 0; color: var(--soft); font-size: 14px; }
.person__meta { margin: 6px 0 0; color: var(--soft); font-size: 13px; }
.person__status { align-self: center; }

.flash {
  margin: 0 0 18px;
  padding: 11px 14px;
  background: #EAF4F7;
  border-left: 4px solid var(--choice-teal);
  border-radius: 6px;
}
.flash--bad { background: #FBECEA; border-left-color: #A8322D; }

.small { font-size: 13px; }

/* ---------- leftovers from the old palette ----------
   The brand block above only restyled .button, so a plain <button> — which is
   what the sign-in page uses — stayed the old near-black, and the focus ring
   stayed the dusty pink that went with the old red. Both are set here rather
   than edited in place above, so the original block stays readable as what
   the editor looked like before Choice's colours went on it. */

button, .button { background: var(--choice-teal); border-color: var(--choice-teal); }
button:hover, .button:hover { background: #005C74; border-color: #005C74; }
.button.secondary, button.secondary, .rows button {
  background: var(--paper);
  color: var(--ink);
  border-color: #C9C2B5;
}
.button.secondary:hover, button.secondary:hover, .rows button:hover {
  background: var(--wash);
  border-color: var(--choice-teal);
  color: var(--choice-teal);
}
[data-add] { background: var(--paper); color: var(--ink); border-color: #C9C2B5; }
[data-add]:hover { background: var(--wash); border-color: var(--choice-teal); color: var(--choice-teal); }

input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid #9FD2E0;
  outline-offset: 1px;
}

/* ---------- the sign-in form ----------
   The button sat flush under a full-width input and only as wide as its own
   text, which reads as a box that has gone wrong rather than a form. It is
   the first thing a client ever sees, so it is worth the twelve lines. */

.signin form { text-align: left; max-width: 22rem; margin: 1.6rem auto 0; }
.signin form label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
.signin form input { padding: 11px 12px; }
.signin form button { width: 100%; margin-top: 14px; padding: 12px 20px; }
.signin .ok { text-align: left; }

.askhuman { margin: 1.8rem 0 0; font-size: 14px; }
.askhuman a { color: var(--soft); text-decoration: underline; }
.askhuman a:hover { color: var(--choice-teal); }

/* ---------- ask for help ---------- */

.helpbody { text-align: left; max-width: 34rem; margin: 1.2rem auto 0; }
.helpbody > p { margin: 0 0 1rem; }
.helpbody .panel { margin-top: 1.2rem; }
.helpbody textarea { min-height: 8em; }
.helpbody .button { width: 100%; }

.panel textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  padding: 10px 11px;
  background: #fff;
  border: 1px solid #C7C1B6;
  border-radius: 7px;
}

/* The field bots fill in and people never see. Not display:none, which some
   bots check for; moved off the page instead, and taken out of the tab order
   and the accessibility tree at the markup. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- client notes ----------
   What the client said by clicking things on the review site. One card per
   note, grouped by what they clicked. The verdict is said in words as well as
   shown by the stripe, so the colour is never carrying the meaning alone. */

.views { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; margin: 0 0 18px; }
.view { padding: 8px 14px; color: var(--soft); text-decoration: none; font-size: 14px; }
.view + .view { border-left: 1px solid var(--line); }
.view--on { background: var(--choice-teal); color: #fff; font-weight: 600; }
.view--on .count { background: #fff; color: var(--choice-teal); }

.sitefilter { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; font-size: 14px; }
.sitefilter a {
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--soft); text-decoration: none;
}
.sitefilter a.on { border-color: var(--choice-teal); color: var(--choice-teal); font-weight: 600; }

.notes { list-style: none; margin: 0; padding: 0; }

.note {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid #C9C2B5;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 0 0 12px;
}
.note--done { background: #FAF8F5; border-left-color: var(--line); }
.note--done .note__text { color: var(--soft); }

.verdict--change { border-left-color: var(--choice-orange); }
.verdict--question { border-left-color: var(--choice-teal); }
.verdict--ok { border-left-color: #2E6B46; }

.note__where { margin: 0 0 6px; font-weight: 650; font-size: 15px; }
.note__text { margin: 0 0 8px; white-space: pre-wrap; }
.note__meta { margin: 0 0 6px; color: var(--soft); font-size: 13px; }
.note__meta .verdict { font-weight: 600; }
.verdict--change .note__meta .verdict { color: #B8470F; }
.verdict--question .note__meta .verdict { color: var(--choice-teal); }
.verdict--ok .note__meta .verdict { color: #2E6B46; }

/* ---------- finding your own website ----------
   Two ways to look at it, always on the editing screen: the preview, which
   shows unpublished changes, and the real website, which is what a customer
   sees. They used to appear only once something had been edited, so somebody
   who signed in to check something had no way to see their site at all. */

.look {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 20px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.look .muted { flex: 1 1 14rem; }

.siteactions { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 8px; }
.siteactions .button { font-size: 14px; padding: 8px 14px; }
.siteurl { margin: 0; color: var(--soft); font-size: 13px; word-break: break-all; }

@media (max-width: 520px) {
  .look .button, .siteactions .button { flex: 1 1 100%; text-align: center; }
}

/* A column the client never sees. The truck's web address is kept in the row
   so it survives a rename, and is not something to edit by hand. */
table.rows td.kept { display: none; }
