/*
 * The one stylesheet for every Drop page (brief 063). Plain CSS, no framework,
 * nothing loaded from anywhere else: system fonts only.
 *
 * Utility first. On a phone, above the fold, there is the note, the photo
 * button and Send, and nothing else.
 *
 * The brand's colour arrives as two custom properties, --brand-color and
 * --brand-text, set by a small <style> block the Worker writes on signed-in
 * pages. Every use below carries a neutral fallback, so a brand with no
 * usable colour (and the plain pages, which never know the brand) look
 * finished, not broken.
 */

:root {
  --ink: #1f2933;
  --muted: #52606d;
  --line: #d9e2ec;
  --paper: #ffffff;
  --wash: #f5f7fa;
  --problem: #b42318;
  --good: #1b7f3b;
  --radius: 10px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--wash);
}

[hidden] {
  display: none !important;
}

/* ---------------------------------------------------------------------------
 * The header strip: the brand's name in its colour. No logo up here.
 * ------------------------------------------------------------------------ */

.strip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 16px;
  background: var(--brand-color, #1f2933);
  color: var(--brand-text, #ffffff);
}

.strip-name {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: inherit;
  text-decoration: none;
}

.strip-icon:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
 * The page body
 * ------------------------------------------------------------------------ */

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 22px;
  margin: 8px 0 16px;
}

h2 {
  font-size: 15px;
  margin: 0 0 6px;
  color: var(--muted);
  font-weight: 600;
}

.muted {
  color: var(--muted);
  margin: 4px 0 12px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.who {
  font-size: 19px;
  font-weight: 600;
  margin: 0;
}

.hidden-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
 * The composer
 * ------------------------------------------------------------------------ */

.note {
  display: block;
  width: 100%;
  min-height: 112px;
  padding: 12px;
  font: inherit;
  color: inherit;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  resize: vertical;
}

.note:read-only {
  background: var(--wash);
}

.note-count {
  margin: 4px 2px 0;
  font-size: 14px;
  color: var(--muted);
  text-align: right;
}

.for-line {
  margin: 12px 0 0;
  color: var(--muted);
}

.for-line select {
  font: inherit;
  color: var(--ink);
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  max-width: 100%;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.actions > * {
  flex: 1;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
}

.button:focus-visible {
  outline: 3px solid #7aa7ff;
  outline-offset: 2px;
}

.button-brand {
  background: var(--brand-color, #1f2933);
  color: var(--brand-text, #ffffff);
}

.button-secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}

.button:disabled,
.button[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
}

/* The real file picker, kept off screen; its label is the button people tap. */
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.file-input:focus-visible + .button,
.file-input:focus-visible ~ .button {
  outline: 3px solid #7aa7ff;
}

.problem {
  margin: 12px 0 0;
  color: var(--problem);
  font-weight: 500;
}

/* One row per photo: thumbnail, size and state, remove. */

.photo-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.photo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  margin-bottom: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.thumb {
  width: 56px;
  height: 56px;
  flex: none;
  object-fit: cover;
  border-radius: 6px;
  background: var(--wash);
}

.photo-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.photo-size {
  font-size: 15px;
}

.photo-state {
  font-size: 14px;
  color: var(--muted);
}

.photo-row[data-state="sent"] .photo-state {
  color: var(--good);
  font-weight: 600;
}

.photo-row[data-state="needs_attention"] .photo-state {
  color: var(--problem);
  font-weight: 600;
}

.photo-progress {
  width: 100%;
  height: 6px;
}

.remove {
  flex: none;
  width: 40px;
  height: 40px;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

/* While a send is under way, and once it is received. */

.status {
  margin-top: 16px;
}

.status-line {
  margin: 0;
  font-weight: 600;
}

.received {
  text-align: center;
  padding-top: 32px;
}

.received-title {
  font-size: 30px;
  color: var(--good);
  margin: 0 0 8px;
}

/* ---------------------------------------------------------------------------
 * The footer and the brand's optional logo
 * ------------------------------------------------------------------------ */

.footer {
  display: flex;
  justify-content: center;
  padding: 24px 16px 32px;
}

.logo {
  max-width: 120px;
  max-height: 48px;
}

/* ---------------------------------------------------------------------------
 * The plain pages: signed out, and a link that does not work
 * ------------------------------------------------------------------------ */

.plain-page {
  padding-top: 48px;
  text-align: center;
}
