/*
 * What both sides of Camera lab share on top of their own stylesheet: the
 * public site loads lab.css and this; the admin loads app.css (from wrapdu)
 * and this. Here: pages with no header, the admin, the coffee button, the
 * shape slider and the Feedback sheet.
 * Base rules are the phone; min-width queries add the desktop.
 */

/* ---- the logo in the header, on both sides: the mark (app/views/mark.php),
   then the name set as one word, its last part in rust and a lighter
   weight, with the tagline under it. These rules win over the .brand in
   lab.css and app.css. */

.brand {
  display: flex; align-items: center; gap: 9px;
  line-height: 1; color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand:hover { color: var(--ink) }
.brand .mark { flex: none; width: 34px; height: auto }
.brand-text { display: flex; flex-direction: column; gap: 3px }
.brand b { font-size: 1.2rem; font-weight: 700; letter-spacing: -.015em }
.brand b em { font-style: normal; font-weight: 400; color: var(--rust) }
.brand-tag { font-size: .75rem; font-weight: 400; font-style: italic; letter-spacing: 0; color: var(--accent) }

@media (min-width: 768px) {
  .brand { gap: 11px }
  .brand .mark { width: 42px }
  .brand b { font-size: 1.4rem }
  .brand-tag { font-size: .78rem }
}

/* ---- pages with no header: setup, login */

.narrow {
  max-width: 440px; margin: 0 auto;
  padding: clamp(40px, 10vw, 90px) 16px 60px;
}
.narrow h1 { font-size: 1.7rem; margin-bottom: 14px }

/* ---- admin */

.admin-sims td:first-child { width: 72px }
.admin-sims .ord { width: 64px; padding: 4px 6px; font: inherit; text-align: right;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-sm) }
.admin-sims img { display: block; width: 56px; height: 35px; object-fit: cover; border-radius: 3px; background: #000 }
.admin-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px }
.admin-bar .sp { flex: 1 }
.admin-grid { display: grid; gap: 0 16px }
@media (min-width: 768px) {
  .admin-grid { grid-template-columns: 1fr 1fr }
}
.ta-r { text-align: right }
.inline-form { display: inline }

/* On a phone the admin sidebar is a scrolling row under the header, since
   app.css hides .side below 768px. */
@media (max-width: 767px) {
  .side--admin {
    display: flex; gap: 4px; overflow-x: auto;
    padding: 8px 12px; border-bottom: 1px solid var(--line);
  }
  .side--admin h2 { display: none }
  .side--admin a { white-space: nowrap }
}
.side-out { margin-top: 6px }
.side .badge-count { margin-left: auto }

/* ---- Buy me a coffee: a rust pill with the round portrait at its edge */

.coffee, .sitenav a.coffee {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 34px; padding: 3px 14px 3px 3px;
  font-size: .9rem; font-weight: 600; white-space: nowrap;
  color: #fff; background: var(--rust); text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 2px 8px -3px rgba(30, 27, 24, .45);
}
.coffee:hover, .sitenav a.coffee:hover { background: var(--rust-deep); color: #fff }
.coffee-face { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: block }
.coffee-cup { width: 18px; height: 18px; margin-left: 8px; filter: invert(1) }
/* the cup after the words, drawn in the pill's own text colour */
.coffee-mug { display: flex; margin-left: -2px }
.coffee-mug svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8 }
/* On a phone the header's pill is the portrait alone; its title still says what it is. */
@media (max-width: 767px) {
  .sitenav a.coffee--top { padding: 3px }
  .coffee--top .coffee-words, .coffee--top .coffee-mug { display: none }
  .coffee--top .coffee-cup { margin: 0 5px }
}

/* ---- the shape slider (app/views/captcha.php, assets/js/captcha.js) */

.cap { border: 0; padding: 0; margin: 6px 0 0; min-width: 0; display: grid; gap: 8px }
.cap legend { font-weight: 600; font-size: .94rem; padding: 0; margin-bottom: 6px }
.cap-stage {
  position: relative; width: 100%; max-width: 320px; aspect-ratio: 2 / 1;
  background: var(--bg); overflow: hidden; user-select: none; touch-action: none;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px var(--line);
}
.cap-bg { display: block; width: 100%; height: 100% }
.cap-piece {
  position: absolute; left: 0; top: 0; width: 18.75%; height: auto; /* 60 / 320 */
  filter: drop-shadow(0 2px 3px rgba(30, 27, 24, .45)); pointer-events: none;
}
.cap-track {
  position: relative; width: 100%; max-width: 320px; height: 42px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 21px; overflow: hidden; user-select: none; touch-action: none;
}
.cap-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: color-mix(in srgb, var(--rust) 22%, transparent) }
.cap-hint {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: .86rem; color: var(--muted); pointer-events: none; transition: opacity .2s;
}
.cap-handle {
  position: absolute; left: 0; top: 0; width: 18.75%; min-width: 48px; height: 40px; border-radius: 20px;
  background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 20px;
  cursor: grab; box-shadow: 0 2px 6px rgba(30, 27, 24, .35);
}
.cap-handle:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px }
.cap.dragging .cap-handle, .cap.set .cap-handle { background: var(--rust); color: #fff; cursor: grabbing }
.cap-new {
  justify-self: start; padding: 0; font: inherit; font-size: .9rem;
  color: var(--accent); background: none; border: 0; cursor: pointer;
}
.cap-new:hover { text-decoration: underline }
.cap .flash { margin: 0; max-width: 320px }
.cap-need[hidden] { display: none }

/* ---- the Feedback sheet (assets/js/feedback.js), as in fennzo.
   The haze and the dashed frame are CSS only: the picture that is sent was
   drawn before the sheet went on, so none of this is in it. */

.fb {
  position: fixed; inset: 0; z-index: 1000; outline: none;
  background: rgba(239, 230, 212, .42);
  box-shadow: inset 0 0 0 3px rgba(224, 38, 28, .55), inset 0 0 60px rgba(224, 38, 28, .12);
}
.fb::after {
  content: ""; position: absolute; inset: 8px;
  border: 2px dashed rgba(224, 38, 28, .6); border-radius: 4px; pointer-events: none;
}
.fb-ink { position: absolute; inset: 0; display: block; cursor: crosshair; touch-action: none }
.fb.texting .fb-ink { cursor: text }
.fb-bar {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .45rem;
  max-width: calc(100vw - 24px); padding: .45rem .7rem;
  background: var(--surface); color: var(--ink);
  border-top: 3px solid #E0261C; border-radius: 3px;
  box-shadow: 0 2px 0 rgba(30, 27, 24, .15), 0 18px 36px -12px rgba(30, 27, 24, .6);
}
.fb-bar button {
  font: inherit; font-size: .88rem; font-weight: 600;
  border: 1.5px solid var(--ink); border-radius: 2px;
  background: transparent; color: var(--ink);
  padding: .25rem .7rem; cursor: pointer; white-space: nowrap;
}
.fb-bar button:hover { background: var(--surface-2) }
.fb-bar button:disabled { opacity: .4; cursor: default; background: transparent }
.fb-bar button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.fb-tool[aria-pressed="true"], .fb-tool[aria-pressed="true"]:hover { background: var(--ink); color: var(--bg) }
.fb-bar .fb-send { background: #E0261C; border-color: #E0261C; color: #fff; border-radius: 20px; margin-left: .3rem }
.fb-bar .fb-send:hover { background: #B81E16; border-color: #B81E16 }
.fb-bar .fb-send:disabled { background: #E0261C; border-color: #E0261C; opacity: .5 }
.fb-bar .fb-cancel { border-color: transparent }
.fb-hint { font-size: .85rem; font-style: italic; color: var(--muted); margin: 0 .35rem; white-space: nowrap }
.fb-status { font-size: .85rem; color: var(--muted); white-space: nowrap }
.fb-status:empty { display: none }
.fb-status.err { color: #B81E16; font-weight: 600 }
.fb-text {
  position: absolute; transform: translate(-4px, -2px); min-width: 10rem;
  padding: 2px 4px; border: 1px dashed #E0261C; border-radius: 2px;
  background: rgba(251, 246, 236, .85); color: #E0261C; outline: none;
}
.fb-text::placeholder { color: rgba(224, 38, 28, .5); font-weight: 400 }
.fb-done {
  position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 1000;
  min-width: 18rem; padding: 1.1rem 1.4rem 1.2rem;
  background: var(--surface); color: var(--ink);
  border-top: 3px solid #E0261C; border-radius: 3px;
  box-shadow: 0 2px 0 rgba(30, 27, 24, .15), 0 24px 48px -16px rgba(30, 27, 24, .65);
  text-align: center;
}
.fb-done h2 { margin: 0 0 .3rem; font-size: 1.15rem }
.fb-done p { margin: 0 0 .9rem; color: var(--muted) }
.fb-done-ok {
  font: inherit; font-size: .88rem; font-weight: 600; border: 0; border-radius: 20px;
  background: var(--ink); color: var(--bg); padding: .35rem 1.1rem; cursor: pointer;
}
.fb-done-ok:hover { background: var(--accent) }
@media (max-width: 767px) { .fb-hint { display: none } }

/* ---- admin: feedback pictures and the inbox */

.fb-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) }
.fb-card { margin: 0; padding: 0; overflow: hidden }
.fb-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: var(--line) }
.fb-card figcaption { display: grid; gap: 4px; padding: 10px 12px 12px; font-size: .88rem }
.fb-card.unread { border-color: var(--accent) }
.fb-new { color: var(--accent); font-weight: 650 }
.fb-full img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-sm) }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 16px }
.meta dt { color: var(--muted) }
.meta dd { margin: 0 }
.inbox { list-style: none; margin: 0; padding: 0 }
.inbox li { border-bottom: 1px solid var(--line) }
.inbox li:last-child { border-bottom: 0 }
.inbox a { display: grid; gap: 2px 14px; padding: 12px 16px; color: inherit; text-decoration: none }
.inbox a:hover { background: var(--surface-2) }
.inbox li.unread .who, .inbox li.unread strong { font-weight: 700 }
.inbox .what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
@media (min-width: 768px) { .inbox a { grid-template-columns: 180px 1fr auto } }
.msgbody { max-width: 70ch; margin: 0 0 18px; font-size: 1.04rem }
.seg { display: inline-flex; gap: 2px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 2px }
.seg a { padding: 5px 12px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; font-size: .9rem }
.seg a[aria-current="page"] { background: var(--surface); font-weight: 600 }
.badge-count {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font-size: .78rem; text-align: center;
}
