/* Luna Errands screen. Uses the app's colours, with the same values as fallbacks. */

.errand-overlay { position: fixed; inset: 0; z-index: 4000; display: flex; justify-content: center; align-items: stretch; background: rgba(2, 9, 22, 0.72); color: var(--text, #f6f8fc); }
.errand-sheet { display: flex; flex-direction: column; width: min(480px, 100%); height: 100%; background: var(--panel-strong, rgba(5, 18, 41, 0.97)); border-inline: 1px solid var(--border, rgba(255, 255, 255, 0.13)); }
.errand-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 10px 10px; border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.13)); }
.errand-title { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; text-align: center; }
.errand-title strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.errand-icon { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 20px; cursor: pointer; }
.errand-body { flex: 1; overflow-y: auto; padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 24px); display: flex; flex-direction: column; gap: 14px; }
.errand-body > * { flex-shrink: 0; }
.errand-body p { margin: 0; line-height: 1.5; }
.errand-lead, .errand-working { color: var(--muted, #aebbd0); }
.errand-input { box-sizing: border-box; width: 100%; padding: 12px; border: 1px solid var(--border, rgba(255, 255, 255, 0.13)); border-radius: 12px; background: rgba(255, 255, 255, 0.06); color: inherit; font: inherit; font-size: 16px; resize: vertical; }
.errand-primary, .errand-secondary { display: block; box-sizing: border-box; width: 100%; min-height: 46px; padding: 11px 16px; border-radius: 999px; font: inherit; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer; }
.errand-primary { border: 0; background: var(--accent, #bcecff); color: #06142c; }
/* A link styled as a button keeps its dark words: the site-wide link colour would otherwise paint light blue on the light-blue button. */
a.errand-primary, a.errand-primary:visited, a.errand-primary:hover { color: #06142c; }
.errand-secondary { border: 1px solid var(--border, rgba(255, 255, 255, 0.13)); background: transparent; color: inherit; }
.errand-primary:disabled, .errand-secondary:disabled { opacity: 0.55; cursor: default; }
.errand-link { align-self: center; border: 0; background: none; color: var(--muted, #aebbd0); font: inherit; text-decoration: underline; cursor: pointer; }
.errand-overlay button:focus-visible, .errand-overlay input:focus-visible, .errand-overlay textarea:focus-visible, .errand-overlay a:focus-visible { outline: 2px solid var(--accent, #bcecff); outline-offset: 2px; }
.errand-overlay [hidden] { display: none !important; }
.errand-list { display: flex; flex-direction: column; gap: 8px; }
.errand-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border, rgba(255, 255, 255, 0.13)); border-radius: 12px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.errand-pill { flex-shrink: 0; padding: 2px 10px; border-radius: 999px; background: rgba(188, 236, 255, 0.14); font-size: 12px; font-weight: 600; }
.errand-pill[data-status="needs_you"], .errand-pill[data-status="confirm"] { background: #ffd479; color: #2a1c00; }
.errand-pill[data-status="done"] { background: #9fe6b0; color: #06240f; }
.errand-pill[data-status="failed"] { background: var(--danger, #ff9d9d); color: #300606; }
.errand-ask { display: flex; flex-direction: column; gap: 10px; }
.errand-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--border, rgba(255, 255, 255, 0.13)); border-radius: 16px; background: rgba(255, 255, 255, 0.05); }
.errand-card h3 { margin: 0; font-size: 17px; }
.errand-confirm { border-color: #ffd479; }
.errand-card fieldset { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; }
.errand-card legend { margin-bottom: 8px; padding: 0; font-weight: 600; }
.errand-choice { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.errand-field { display: flex; flex-direction: column; gap: 6px; }
.errand-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.errand-card dt { color: var(--muted, #aebbd0); }
.errand-card dd { margin: 0; overflow-wrap: anywhere; }
.errand-email { white-space: pre-wrap; }
.errand-message { font-size: 16px; }
.errand-fine { color: var(--muted, #aebbd0); font-size: 13px; }
.errand-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.errand-problem { color: var(--danger, #ff9d9d); }
.errand-steps { margin: 0; padding: 0 0 0 18px; color: var(--muted, #aebbd0); font-size: 14px; }
.errand-steps li:last-child { color: var(--text, #f6f8fc); }
.errand-view-box { border: 1px solid var(--border, rgba(255, 255, 255, 0.13)); border-radius: 14px; overflow: hidden; background: #fff; }
.errand-view { display: block; width: 100%; height: auto; }

/* The errand card inside a chat answer. */
.errand-chat-card { display: flex; flex-direction: column; gap: 12px; max-width: 560px; margin: 12px 0; color: var(--text, #f6f8fc); }
.errand-chat-card p { margin: 0; line-height: 1.45; }
.errand-chat-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.errand-chat-links { display: flex; flex-direction: column; gap: 8px; }
.errand-chat-links:empty { display: none; }

/* While an errand is being worked on, its card is the progress checklist (the one Luna shows when comparing stores). */
.errand-chat-card.is-progress { padding: 0; border: 0; background: none; max-width: 560px; }
.errand-chat-card.is-progress .luna-assist-progress { margin: 0; }
.errand-chat-progress[hidden] { display: none; }
.errand-chat-card.is-progress .errand-chat-head { justify-content: flex-end; }

/* Talking to an errand that is under way. */
.errand-talk { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.errand-talk .errand-secondary { width: auto; padding-inline: 20px; }
.errand-reply { padding: 12px 14px; border: 1px solid var(--border, rgba(255, 255, 255, 0.13)); border-radius: 14px; background: rgba(188, 236, 255, 0.08); white-space: pre-wrap; }
.errand-reply[hidden] { display: none; }

/* The card is a column of boxes (checklist, what Luna asks, the result); each box carries its own frame. */
.errand-chat-card .errand-card { background: rgba(255, 255, 255, 0.05); }
.errand-chat-card .errand-view-box { border: 1px solid var(--border, rgba(255, 255, 255, 0.13)); border-radius: 14px; overflow: hidden; background: #fff; }
.errand-chat-card .errand-view { cursor: pointer; }
.errand-chat-card [hidden] { display: none !important; }

/* A sheet that asks for something private (a card, a password): says who is asking, and that it is not Luna. */
.errand-secure { border-color: rgba(141, 240, 180, 0.4); background: linear-gradient(160deg, rgba(40, 120, 90, 0.18), rgba(8, 24, 52, 0.4)); }
.errand-chat-card .errand-secure { background: linear-gradient(160deg, rgba(40, 120, 90, 0.18), rgba(8, 24, 52, 0.4)); }
.errand-secure-head { display: flex; align-items: center; gap: 12px; }
.errand-secure-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: rgba(141, 240, 180, 0.16); color: #8df0b4; }
.errand-secure-head strong { display: block; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: #8df0b4; }
.errand-secure-head small { display: block; color: var(--muted, #aebbd0); overflow-wrap: anywhere; }
.errand-secure h3 { font-size: 1.15rem; line-height: 1.3; }
.errand-amount { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.07); }
.errand-amount span { color: var(--muted, #aebbd0); }
.errand-amount strong { font-size: 1.3rem; }
.errand-callout { padding: 10px 14px; border-radius: 12px; background: rgba(255, 212, 121, 0.12); border: 1px solid rgba(255, 212, 121, 0.35); }
.errand-readlink { margin-left: 8px; font-weight: 600; color: var(--accent, #bcecff); text-decoration: underline; }

/* A booking that went through: the green card. */
.errand-booked { gap: 16px; padding: 18px; border: 1.5px solid #7ce698; border-radius: 22px; background: linear-gradient(180deg, rgba(124, 230, 152, 0.10), rgba(124, 230, 152, 0.03)); }
.errand-booked-head { display: flex; align-items: center; gap: 16px; }
.errand-booked-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.errand-booked-title p { margin: 0; color: var(--text, #f6f8fc); opacity: 0.88; }
.errand-eyebrow { color: #7ce698; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.errand-headline { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.errand-booked h3 { font-size: 21px; line-height: 1.2; text-wrap: balance; }
.errand-confirmed { flex-shrink: 0; padding: 3px 12px; border-radius: 999px; background: #8eeaa5; color: #06240f; font-size: 13px; font-weight: 700; }
.errand-facts { display: flex; flex-direction: column; border: 1px solid var(--border, rgba(255, 255, 255, 0.13)); border-radius: 16px; background: rgba(4, 16, 36, 0.55); }
.errand-fact { display: grid; grid-template-columns: 22px minmax(88px, 150px) 1fr; align-items: center; gap: 12px; padding: 11px 16px; }
.errand-fact + .errand-fact { border-top: 1px solid var(--border, rgba(255, 255, 255, 0.10)); }
.errand-fact-icon { display: grid; place-items: center; color: var(--muted, #aebbd0); }
.errand-fact-label { font-weight: 600; }
.errand-fact-value { display: flex; flex-direction: column; overflow-wrap: anywhere; }
.errand-fact-value small { color: var(--muted, #aebbd0); font-size: 13px; }
.errand-contact { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
.errand-contact-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.errand-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 18px; border-radius: 999px; background: var(--accent, #bcecff); color: #06142c; font-weight: 600; text-decoration: none; }
a.errand-chip, a.errand-chip:visited, a.errand-chip:hover { color: #06142c; }
.errand-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border, rgba(255, 255, 255, 0.10)); }
/* Short, even buttons: the words stay on one line and the row wraps as a whole instead. */
.errand-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 1 1 auto; width: auto; min-height: 42px; padding: 8px 16px; white-space: nowrap; }
.errand-draft { padding: 10px 14px; border: 1px solid var(--border, rgba(255, 255, 255, 0.13)); border-radius: 14px; }
.errand-draft summary { cursor: pointer; font-weight: 600; }
.errand-draft p { margin-top: 8px; }
@media (max-width: 560px) {
  .errand-booked-head { align-items: flex-start; }
  .errand-fact { grid-template-columns: 22px 1fr; row-gap: 2px; }
  .errand-fact-value { grid-column: 2; }
  .errand-action { flex-basis: 100%; }
}
.errand-fact.is-missed .errand-fact-icon, .errand-fact.is-missed .errand-fact-value { color: #ffd479; }
.errand-cart .errand-action { width: 100%; flex: none; }

.errand-cart .errand-price { display: block; margin-top: 2px; font-weight: 600; }
.errand-cart .errand-subtotal { margin: 10px 0 6px; }
.errand-cart .errand-check { display: block; margin-top: 2px; color: var(--errand-warn, #f5c451); }
.errand-cart .errand-check-note { margin: 8px 0 4px; }
