/* Boundary agent pages (/agent). Made for phones first; same type and colours as the console. */

@font-face { font-family: "Inter"; src: url("/fonts/Inter-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("/fonts/Outfit-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("/fonts/Outfit-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --mist: #f2f6f5; --surface: #fff; --line: #e1e8e7; --ink: #142120; --text-2: #55635f; --muted: #7d8a87;
  --teal: #0b9ca9; --primary: #0a7f87; --mint: #2faf91; --green: #80d959; --teal-50: #e6f5f4;
  --amber: #b86e0b; --amber-50: #fdf2df; --rose: #c43a51; --rose-50: #fbe9ec; --ok: #23703b; --ok-50: #e5f6ea;
  --brand: linear-gradient(100deg, var(--teal), var(--mint) 55%, var(--green));
  --r: 18px;
}
* { box-sizing: border-box; }
body.ag { margin: 0; font: 400 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--mist); -webkit-text-size-adjust: 100%; }
.sprite { display: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2 { font-family: "Outfit", "Inter", sans-serif; color: var(--ink); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; line-height: 1.2; }
h2 { font-size: 1.1rem; }
p { margin: 0; }
a { color: inherit; }

.ag-wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.ag-main { padding-top: 18px; padding-bottom: calc(40px + env(safe-area-inset-bottom)); display: grid; gap: 16px; }

/* Header and tabs */
.ag-top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.ag-top__in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.ag-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.ag-brand img { height: 24px; width: auto; }
.ag-chip { font: 600 0.74rem/1 "Inter", sans-serif; color: var(--primary); background: var(--teal-50); border-radius: 999px; padding: 5px 9px; }
.ag-signout { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 10px 4px 4px; color: var(--text-2); cursor: pointer; }
.ag-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--teal-50); color: var(--primary); display: grid; place-items: center; font: 600 0.78rem/1 "Inter", sans-serif; }
.ag-tabs { display: flex; gap: 4px; overflow-x: auto; }
.ag-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px 12px; text-decoration: none; color: var(--text-2); font-weight: 500; border-bottom: 2.5px solid transparent; white-space: nowrap; }
.ag-tabs a.is-on { color: var(--primary); border-bottom-color: var(--teal); }

/* Cards and text */
.ag-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.ag-muted { color: var(--text-2); }
.ag-small { font-size: 0.85rem; }
.ag-center { text-align: center; }
.ag-strong { font-weight: 600; color: var(--ink); }
.ag-code { display: inline-block; font: 700 0.92rem/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: 0.08em; padding: 5px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.ag-link { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); font-weight: 600; text-decoration: none; cursor: pointer; }
.ag-link:disabled { color: var(--muted); cursor: default; }
.ag-note { background: var(--teal-50); color: var(--primary); border-radius: 12px; padding: 10px 12px; font-size: 0.9rem; }
.ag-alert { background: var(--rose-50); color: var(--rose); border-radius: 12px; padding: 10px 12px; font-size: 0.9rem; font-weight: 500; }
.ag-alert--info { background: var(--amber-50); color: #7a4a07; display: grid; gap: 4px; }
.ag-contact { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ag-toast { display: flex; align-items: center; gap: 8px; background: var(--ok-50); color: var(--ok); border: 1px solid #c6e8cf; border-radius: 12px; padding: 10px 12px; font-weight: 500; transition: opacity 0.4s ease; }
.ag-toast.is-gone { opacity: 0; }

/* Buttons */
.ag-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 999px; border: 1.5px solid transparent; font: 600 0.95rem/1 "Inter", sans-serif; text-decoration: none; cursor: pointer; color: var(--ink); background: var(--surface); white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.ag-btn:active { transform: scale(0.98); }
.ag-btn--primary { background: var(--brand); color: #082326; box-shadow: 0 10px 22px -14px rgba(11, 156, 169, 0.9); }
.ag-btn--ghost { border-color: var(--line); }
.ag-btn--wa { background: #25d366; color: #05361a; }
.ag-btn--small { min-height: 38px; padding: 0 14px; font-size: 0.86rem; }
.ag-btn--block { width: 100%; }

/* Forms */
.ag-form { display: grid; gap: 14px; }
.ag-field { display: grid; gap: 6px; font-size: 0.9rem; }
.ag-field > span:first-child { font-weight: 600; }
.ag-field input, .ag-prefix { font: 400 1rem "Inter", sans-serif; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; height: 50px; padding: 0 14px; width: 100%; outline: 0; }
.ag-field input:focus, .ag-prefix:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(11, 156, 169, 0.12); }
.ag-field input.is-bad { border-color: var(--rose); }
.ag-prefix { display: flex; align-items: center; gap: 10px; padding: 0 0 0 14px; }
.ag-prefix i { font-style: normal; font-weight: 600; color: var(--text-2); padding-right: 10px; border-right: 1px solid var(--line); }
.ag-prefix input { border: 0; height: 46px; padding: 0 12px 0 0; box-shadow: none !important; flex: 1; min-width: 0; font: inherit; outline: 0; background: transparent; }
.ag-otp { text-align: center; letter-spacing: 0.5em; font-size: 1.3rem !important; font-weight: 600 !important; }
.ag-err { color: var(--rose); font-weight: 500; }
.ag-file { display: flex; align-items: center; justify-content: center; min-height: 64px; border: 1.5px dashed #c9d6d3; border-radius: 14px; padding: 12px; text-align: center; color: var(--text-2); cursor: pointer; position: relative; }
.ag-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ag-file.has-file { border-color: var(--teal); color: var(--primary); font-weight: 600; }

/* Sign in */
.ag-login { display: grid; gap: 14px; padding-top: 4vh; }
.ag-login__card { display: grid; gap: 14px; padding: 22px; max-width: 440px; width: 100%; margin: 0 auto; }
.ag-login__more { display: flex; justify-content: space-between; gap: 12px; }

/* Dashboard */
.ag-head { display: flex; flex-wrap: nowrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ag-head .ag-muted { margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ag-nudge { display: flex; align-items: center; gap: 12px; text-decoration: none; border-color: #f3dcb3; background: var(--amber-50); color: #7a4a07; }
.ag-nudge svg { width: 22px; height: 22px; }
.ag-nudge span { display: grid; }
.ag-nudge small { color: #8d6020; }
.ag-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ag-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 2px; }
.ag-stat b { font: 700 1.5rem/1.1 "Outfit", sans-serif; }
.ag-stat span { color: var(--text-2); font-size: 0.85rem; }
.ag-stat--brand { grid-column: 1 / -1; background: #0c2a2e; border-color: #0c2a2e; color: #fff; }
.ag-stat--brand b { color: #9be37a; font-size: 1.8rem; }
.ag-stat--brand span { color: #b9d3cf; }
.ag-section { display: grid; gap: 10px; }
.ag-section h2 { display: flex; align-items: center; gap: 8px; }
.ag-section h2 svg { color: var(--primary); }
.ag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ag-item { display: grid; gap: 4px; }
.ag-item__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ag-item__top b { font-weight: 600; font-size: 1rem; }
.ag-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: var(--mist); border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.ag-pill--ok { background: var(--ok-50); color: var(--ok); border-color: #c6e8cf; }
.ag-pill--warn { background: var(--amber-50); color: var(--amber); border-color: #f3dcb3; }
.ag-pill--bad { background: var(--rose-50); color: var(--rose); border-color: #f2c7cf; }
.ag-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.ag-facts div { display: grid; gap: 2px; }
.ag-facts dt { font-size: 0.75rem; color: var(--muted); }
.ag-facts dd { margin: 0; font-size: 0.92rem; }
.ag-facts--list { grid-template-columns: 1fr; border-top: 0; padding-top: 0; }
.ag-facts--list div { grid-template-columns: 110px 1fr; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ag-empty { display: grid; gap: 12px; justify-items: start; color: var(--text-2); }
.ag-pane { display: grid; gap: 12px; }
.ag-qr { width: 200px; max-width: 70%; border-radius: 14px; border: 1px solid var(--line); justify-self: center; }

/* Share sheet: a bottom sheet on phones, a centred dialog on wider screens */
.ag-sheet { border: 0; padding: 0; width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; background: var(--surface); color: var(--ink); }
.ag-sheet::backdrop { background: rgba(12, 30, 34, 0.5); }
.ag-sheet__body { display: grid; gap: 14px; padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); }
.ag-sheet__head { display: flex; align-items: center; justify-content: space-between; }
.ag-x { border: 0; background: var(--mist); border-radius: 50%; width: 36px; height: 36px; display: grid; place-items: center; color: var(--text-2); cursor: pointer; }
.ag-linkbox { display: flex; gap: 8px; align-items: center; border: 1.5px solid var(--line); border-radius: 14px; padding: 6px 6px 6px 12px; }
.ag-linkbox input { border: 0; outline: 0; font: 500 0.88rem "Inter", sans-serif; color: var(--text-2); flex: 1; min-width: 0; background: transparent; }

@media (min-width: 640px) {
  h1 { font-size: 1.9rem; }
  .ag-main { padding-top: 26px; gap: 20px; }
  .ag-stats { grid-template-columns: 1fr 1fr 1.4fr; }
  .ag-stat--brand { grid-column: auto; }
  .ag-sheet { max-width: 460px; margin: auto; border-radius: 22px; }
}
@media (max-width: 380px) {
  .ag-facts { grid-template-columns: 1fr 1fr; }
  .ag-head .ag-btn { flex: none; min-height: 42px; padding: 0 14px; font-size: 14px; gap: 6px; }
  .ag-head .ag-btn svg { width: 16px; height: 16px; }
}
