/* The clerk portal (functions/src/sites/portal-views.ts). Bump ASSET_VERSION in render.ts after changes. */
:root {
  color-scheme: light;
  --bg: #f5f6f4;
  --fg: #1c2420;
  --muted: #59645e;
  --line: #d9ddd6;
  --card: #fff;
  --green: #1f4d3a;
  --green-2: #2c6a50;
  --link: #1d5c43;
  --ok-bg: #e3f1e8;
  --ok-fg: #1d5c35;
  --warn-bg: #fdf0d8;
  --warn-fg: #7a4b00;
  --danger: #a3261a;
  --gold: #c8962e;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); overflow-wrap: break-word; font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid #10151a; outline-offset: 2px; }
.ptop :focus-visible, .demo-bar :focus-visible { outline-color: #fff; }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 14px; }
h2 { font-size: 1.15rem; margin: 0 0 10px; }
.skip { position: absolute; left: -9999px; top: 0; background: #fff; padding: 10px 16px; z-index: 50; }
.skip:focus { left: 12px; top: 12px; }
.pwrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 14px; font-weight: 400; }
.crumb { font-size: 15px; color: var(--muted); margin: 0 0 6px; }

.demo-bar { background: #3b2a06; color: #fbe7bd; font-size: 15px; }
.demo-bar p { max-width: 920px; margin: 0 auto; padding: 8px 16px; }
.demo-bar strong { color: #ffd88a; }

.ptop { background: var(--green); color: #fff; }
.ptop > .pwrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 12px; padding-bottom: 12px; }
.pname { margin: 0; font-weight: 700; font-size: 1.1rem; }
.pname a { color: #fff; text-decoration: none; }
.pname span { font-weight: 400; color: #d6e6dc; font-size: 15px; margin-left: 6px; }
.pacts { display: flex; gap: 8px; align-items: center; }
.ptabs { background: var(--green-2); }
.ptabs .pwrap { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.ptabs a { flex: none; color: #fff; text-decoration: none; padding: 10px 12px; font-size: 15px; border-bottom: 3px solid transparent; white-space: nowrap; }
.ptabs a[aria-current="page"] { border-bottom-color: var(--gold); font-weight: 700; }
.ptabs a:hover { background: rgba(255, 255, 255, .1); }

main.pwrap { padding-top: 22px; padding-bottom: 40px; }
.pfoot { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }
.pfoot p { margin: 14px 0 28px; }

.pbtn { display: inline-block; font: inherit; font-weight: 600; font-size: 16px; line-height: 1.3; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--green); background: var(--green); color: #fff; cursor: pointer; text-decoration: none; }
.pbtn:hover { background: #163a2b; color: #fff; }
.pbtn.secondary { background: #fff; color: var(--green); }
.pbtn.secondary:hover { background: #eef4ef; color: var(--green); }
.pbtn.ghost { background: transparent; border-color: rgba(255, 255, 255, .5); color: #fff; padding: 6px 12px; font-size: 15px; }
.pbtn.small { padding: 5px 10px; font-size: 14px; }
.pbtn.danger { background: #fff; color: var(--danger); border-color: #e2b6b0; }
.pbtn.danger:hover { background: #fbeceb; }
.pbtn[disabled] { opacity: .5; cursor: wait; }
form.inline { display: inline; margin: 0; }

.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.head h1, .head h2 { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin: 0 0 18px; }
.box.tip { background: #fffaf0; border-color: #ecd9a8; }
.box.tip ol { margin: 6px 0 0; padding-left: 1.3em; }
.box > :first-child { margin-top: 0; }
.box p:last-child { margin-bottom: 0; }

ul.rows { list-style: none; margin: 0; padding: 0; }
ul.rows li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
ul.rows li:first-child { border-top: 0; padding-top: 0; }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tag { display: inline-block; font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eceeea; color: var(--muted); }
.tag.ok { background: var(--ok-bg); color: var(--ok-fg); }
.tag.warn { background: var(--warn-bg); color: var(--warn-fg); }
ul.log { margin: 0; padding-left: 1.1em; }
ul.log li { margin: 0 0 6px; }

.flash { background: var(--ok-bg); color: var(--ok-fg); border-radius: 8px; padding: 10px 14px; font-weight: 600; }
.flash.err { background: #fbeceb; color: var(--danger); }

.pform { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin: 0 0 18px; }
.pform label { display: block; font-weight: 600; margin: 0 0 14px; }
.pform input:not([type=checkbox]):not([type=file]), .pform textarea, .pform select { display: block; width: 100%; margin-top: 5px; font: inherit; font-weight: 400; padding: 9px 11px; border: 1px solid #b9c0b8; border-radius: 8px; background: #fff; color: var(--fg); }
.pform textarea { resize: vertical; }
.pform input[type=file] { display: block; margin-top: 6px; font: inherit; font-size: 15px; font-weight: 400; max-width: 100%; }
.pform label.check { display: flex; gap: 8px; align-items: baseline; font-weight: 400; }
.pform fieldset { border: 0; border-top: 1px solid var(--line); margin: 0 0 8px; padding: 14px 0 0; }
.pform fieldset:first-of-type { border-top: 0; padding-top: 0; }
.pform legend { font-weight: 700; font-size: 1.1rem; padding: 0; margin-bottom: 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.formacts { display: flex; align-items: center; gap: 16px; margin: 6px 0 0; }
.upload { border: 1px dashed #b9c0b8; border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; background: #fafbf9; }
.upload label { margin-bottom: 4px; }
.upload-status { margin: 6px 0 0; font-size: 15px; }
.upload-status.bad { color: var(--danger); font-weight: 600; }
form.danger { margin: 0 0 18px; }
form.danger p { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); font-size: 15px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: #eef2ee; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
td:first-child { white-space: nowrap; }

/* Sign-in and demo start */
body.plain { display: flex; justify-content: center; padding: 40px 16px; }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 26px 28px; max-width: 520px; width: 100%; }
.pcard .pname { color: var(--green); margin-bottom: 18px; }
.pcard .pname span { color: var(--muted); }
.pcard :focus-visible { outline-color: #10151a; }
.pcard label { display: block; font-weight: 600; }
.pcard input { display: block; width: 100%; margin-top: 5px; font: inherit; padding: 9px 11px; border: 1px solid #b9c0b8; border-radius: 8px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .two { grid-template-columns: 1fr; }
  .ptabs .pwrap { flex-wrap: wrap; overflow-x: visible; }
  .ptabs a { padding: 8px 10px; }
  td:first-child { white-space: normal; }
  .pcard { padding: 20px 18px; }
}
