/* M&M outside-user portal - the platform portal look (portal_theme.py), same sizes: full-width navy bar with a 64px logo,
   navy hero with a 46px serif title, cyan accents, white cards on #eef2f5, 48px page edges (16px on phones). */
:root {
  --navy: #0b1320; --navy-2: #111c2e; --cyan: #39c5f3; --cyan-hover: #6ad6f7; --page: #eef2f5;
  --border: #e1e7ec; --ink: #0b1420; --muted: #4c5a6b; --soft: #a6adb9; --white: #fff; --edge: 48px;
  --err-bg: #fdecec; --err: #9b1c1c; --info-bg: #e8f6fd; --info: #0b4a66; --warn-bg: #fff6e0; --warn: #6b4a00;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.5 "Helvetica Neue", Arial, sans-serif; }
a { color: #0a6f96; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: 34px; } h2 { font-size: 28px; }
code { font-family: "IBM Plex Mono", Consolas, monospace; font-size: 14px; word-break: break-all; }

/* ---- full-width dark bar (portal_theme .st-key-pt_header) ---- */
.bar { background: var(--navy); border-bottom: 1px solid #1d2838; color: var(--white); }
.bar-in { padding: 18px var(--edge); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.bar-in .brand { grid-column: 1; justify-self: start; }
.bar-in .env { grid-column: 2; justify-self: center; }
.bar-in .who { grid-column: 3; justify-self: end; }
.brand { display: flex; align-items: center; gap: 16px; color: var(--white); text-decoration: none; font-weight: 700; font-size: 26px; line-height: 1.1; }
.brand img { height: 64px; width: auto; display: block; }
.env { background: rgba(57,197,243,0.10); color: var(--cyan); border: 1px solid rgba(57,197,243,0.55); border-radius: 999px; padding: 3px 12px;
  font-family: "IBM Plex Mono", Consolas, monospace; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.who { display: flex; align-items: center; gap: 20px; }
.who-name { text-align: right; font-size: 16px; font-weight: 600; line-height: 1.25; }
.who-name small { display: block; color: var(--soft); font-size: 13px; font-weight: 400; margin-top: 3px; }
.who form { margin: 0; }
.link-btn { background: transparent; border: 1px solid #5b6b82; color: var(--white); border-radius: 8px; min-height: 56px; padding: 12px 26px; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.link-btn:hover { background: rgba(255,255,255,0.08); }

/* ---- navy hero (portal_theme .st-key-pt_hero) ---- */
.hero { background: var(--navy) radial-gradient(circle at 88% 0%, rgba(57,197,243,0.13), transparent 46%); color: var(--white); }
.hero-in { padding: 46px var(--edge) 50px; display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.hero h1 { color: var(--white); font-size: 46px; line-height: 1.1; margin: 0; }
.eyebrow { margin: 0 0 10px; font-family: "IBM Plex Mono", Consolas, monospace; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); }
.sub { margin: 12px 0 0; color: var(--soft); font-size: 17px; }
.picker { min-width: 320px; }
.picker label { margin: 0; font-family: "IBM Plex Mono", Consolas, monospace; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); }
.picker select { display: block; width: 100%; margin-top: 8px; background: var(--navy-2); color: var(--white); border: 1px solid #3a4558; border-radius: 8px; min-height: 46px; padding: 0 12px; font: 16px "Helvetica Neue", Arial, sans-serif; }

/* ---- page ---- */
.wrap { padding: 28px var(--edge) 56px; }
.card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 3px rgba(11,20,32,0.05); padding: 28px 32px; margin: 0 0 18px; }
.muted { color: var(--muted); }
.small { font-size: 14px; color: var(--muted); }
label { display: block; font-size: 14px; color: var(--muted); margin: 0 0 16px; }
input[type=email], input[type=password], input[type=text], input:not([type]), select { display: block; width: 100%; margin-top: 6px; min-height: 46px; padding: 8px 12px; font: inherit; color: var(--ink); background: #f6f8fa; border: 1px solid #cfd8e1; border-radius: 8px; }
input:focus, select:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }
.btn { display: inline-block; min-height: 46px; padding: 11px 22px; border-radius: 6px; border: 1px solid #c9d2dc; background: var(--white); color: #1b2a3d; font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--cyan); border-color: var(--cyan); color: var(--navy); font-weight: 600; }
.btn.primary:hover { background: var(--cyan-hover); border-color: var(--cyan-hover); }
form .btn.primary { width: 100%; text-align: center; }
.msg { border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; }
.msg.err { background: var(--err-bg); color: var(--err); }
.msg.info { background: var(--info-bg); color: var(--info); }
.msg.warn { background: var(--warn-bg); color: var(--warn); }
.key { font-family: "IBM Plex Mono", Consolas, monospace; font-size: 18px; letter-spacing: 0.06em; background: #f6f8fa; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 6px 0; word-break: break-all; }
.codes { font-family: "IBM Plex Mono", Consolas, monospace; font-size: 17px; background: #f6f8fa; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.steps { padding-left: 20px; } .steps li { margin: 0 0 10px; }
details { margin: 14px 0; } summary { cursor: pointer; color: #0a6f96; }
.qr { display: block; margin: 10px auto; max-width: 100%; height: auto; }

/* ---- sign-in screens: navy page, the full M&M logo large on a white card ---- */
body.auth { background: var(--navy) radial-gradient(circle at 85% 0%, rgba(57,197,243,0.16), transparent 50%); min-height: 100vh; }
body.auth .bar { display: none; }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 16px; }
/* No box: the form sits straight on the navy page, under the portal's own logo mark + name (owner 2026-11-21). */
.auth-card { width: 100%; max-width: 440px; padding: 0; color: var(--white); }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 0 0 34px; text-align: center; }
.auth-brand img { height: 120px; width: auto; display: block; }
.auth-brand span { color: var(--white); font-weight: 700; font-size: 28px; line-height: 1.15; }
.auth-card h1 { text-align: center; color: var(--white); font-size: 34px; margin-bottom: 26px; }
.auth-card .muted { text-align: center; color: var(--soft); }
.auth-card label { color: var(--soft); font-family: "IBM Plex Mono", Consolas, monospace; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.auth-card input[type=email], .auth-card input[type=password], .auth-card input[type=text], .auth-card input:not([type]) {
  background: var(--navy-2); color: var(--white); border: 1px solid #3a4558; font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; letter-spacing: normal; text-transform: none; margin-top: 8px; }
.auth-card input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--navy-2) inset; -webkit-text-fill-color: var(--white); }
.auth-card .btn.primary { margin-top: 6px; }
.auth-card .btn:not(.primary) { background: transparent; border-color: #5b6b82; color: var(--white); }
.auth-card a { color: var(--cyan); }
.auth-card b, .auth-card code { color: var(--white); }
.auth-card .steps { color: var(--soft); }
.auth-card .key, .auth-card .codes { background: var(--navy-2); border-color: #3a4558; color: var(--white); }
.auth-card summary { color: var(--cyan); }
.auth-card .qr { background: var(--white); padding: 10px; border-radius: 8px; }
.auth-links { text-align: center; margin: 22px 0 0; font-size: 14px; color: var(--soft); }
.auth-env { margin-top: 28px; }

/* ---- owner portal pieces (portal_theme: pills, metric tiles, cards, captions) ---- */
.pickers { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.pickers form { margin: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; padding: 22px var(--edge) 0; }
.pill { display: inline-block; border-radius: 999px; border: 1px solid #d5dde6; background: var(--white); color: #1b2a3d; min-height: 40px;
  padding: 9px 16px; font-size: 13px; font-weight: 500; text-decoration: none; line-height: 1.6; }
.pill:hover { border-color: var(--cyan); }
.pill.on { background: var(--cyan); border-color: var(--cyan); color: var(--navy); }
.wrap h2 { margin-top: 4px; }
h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 22px; margin: 22px 0 10px; }
.tiles { display: grid; gap: 16px; margin: 0 0 16px; }
.tiles.three { grid-template-columns: repeat(3, 1fr); } .tiles.two { grid-template-columns: repeat(2, 1fr); }
.tile { background: var(--white); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 3px rgba(11,20,32,0.05); padding: 16px 20px; }
.tile-label { display: block; font-family: "IBM Plex Mono", Consolas, monospace; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.tile-value { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 30px; color: var(--ink); margin-top: 6px; }
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--border); border-radius: 12px; margin: 0 0 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 600; color: var(--muted); background: #f6f8fa; border-bottom: 1px solid var(--border); padding: 10px 14px; white-space: nowrap; }
table.data td { border-bottom: 1px solid #eef2f5; padding: 10px 14px; vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; white-space: nowrap; }
table.data tr.sel td { background: #e8f6fd; }
table.data .acts { white-space: nowrap; text-align: right; }
table.data .acts a { margin-left: 12px; font-weight: 500; }
.caption { color: var(--muted); font-size: 14px; margin: 6px 0 14px; }
.msg.ok { background: #e7f6ec; color: #145c2c; }
.facts p { margin: 0 0 10px; } .facts p:last-child { margin: 0; }
details.expander { background: var(--white); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 3px rgba(11,20,32,0.05); margin: 16px 0; }
details.expander > summary { padding: 14px 20px; font-weight: 600; color: var(--ink); }
.expander-body { padding: 0 20px 18px; }
textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; color: var(--ink); background: #f6f8fa; border: 1px solid #cfd8e1; border-radius: 8px; resize: vertical; }

.card-title { margin: 0 0 4px; font-size: 17px; }
.body-text { margin: 8px 0 4px; } .body-text p { margin: 0 0 10px; }
.files-line { color: var(--muted); font-size: 14px; margin: 12px 0 6px; }
ul.files { list-style: none; padding: 0; margin: 0; }
ul.files li { display: flex; gap: 14px; align-items: baseline; padding: 6px 0; border-top: 1px solid #eef2f5; font-size: 14px; }
ul.files li span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
ul.files li a { font-weight: 500; }

details.inner { margin: 6px 0 0; border-top: 1px solid #eef2f5; padding-top: 6px; }
details.inner > summary { padding: 6px 0; font-weight: 500; }
.tl-line { margin: 10px 0 2px; } .tl-line p, .tl-note p { margin: 0; }
.tl-note { margin: 2px 0 4px 14px; padding-left: 10px; border-left: 2px solid #d5dde6; color: var(--ink); }
.note-form { margin-top: 16px; padding-top: 12px; border-top: 1px solid #eef2f5; }
.note-form textarea { margin: 0 0 10px; }
input[type=file] { display: block; margin-top: 6px; font: inherit; font-size: 14px; color: var(--muted); }
select[required]:invalid { color: var(--muted); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
label.check { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); font-size: 14px; }
label.check input { margin-top: 3px; flex: none; width: 18px; height: 18px; }
input[type=date] { display: block; width: 100%; margin-top: 6px; min-height: 46px; padding: 8px 12px; font: inherit; color: var(--ink); background: #f6f8fa; border: 1px solid #cfd8e1; border-radius: 8px; }
.msg p { margin: 0; }

fieldset.radios { border: 0; padding: 0; margin: 0 0 12px; }
fieldset.radios legend { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
fieldset.radios label.check { margin: 0 0 6px; }
#card-note p { display: inline; margin: 0; }

.sub-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 10px 0; background: #fbfcfd; }
.inline-confirm { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 12px 0 0; }
.inline-confirm label.check { margin: 0; }

.btn.view-switch { background: transparent; color: var(--white); border-color: #5b6b82; align-self: flex-end; min-height: 46px; }
.btn.view-switch:hover { border-color: var(--cyan); }

.approval-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.approval-line { font-weight: 600; }
.decide textarea { margin: 10px 0; }
.decide-buttons { display: flex; gap: 10px; }
.decide-buttons .btn { min-width: 140px; }
ul.review { margin: 4px 0 8px; padding-left: 20px; font-size: 14px; } ul.review p { margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: flex-end; margin: 0 0 6px; }
.filters fieldset.radios { margin: 0; }
fieldset.radios.inline { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* screens drawn from today's own functions (portal/st_render.py) */
.pill-group { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .75; align-self: center; margin-right: 6px; }
.drawn h2 { margin-top: 22px; }
.st-row { display: grid; gap: 14px; margin: 8px 0 12px; align-items: start; }
.st-col { min-width: 0; }
.metric { background: var(--card, #fff); border: 1px solid rgba(30, 58, 138, .15); border-radius: 10px; padding: 10px 12px; cursor: default; }
.metric[title] { cursor: help; }
.metric-label { font-size: 13px; opacity: .8; }
.metric-value { font-size: 22px; font-weight: 700; margin: 2px 0; overflow-wrap: anywhere; }
.metric-delta { font-size: 13px; opacity: .85; }
.st-widget { display: inline-block; margin: 0 18px 10px 0; vertical-align: top; min-width: 220px; max-width: 100%; }
.st-widget .st-label { display: block; font-size: 14px; margin-bottom: 4px; }
.st-widget select, .st-widget input[type=text], .st-widget input[type=number], .st-widget input[type=date],
.st-widget input[type=password], .st-widget textarea { width: 100%; }
label.check.st-widget { display: block; min-width: 0; }
.radios { display: flex; flex-direction: column; gap: 4px; } .radios.inline { flex-direction: row; flex-wrap: wrap; gap: 6px 18px; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
.table-tools { margin: 4px 0 12px; font-size: 13px; }
.file-actions { display: flex; gap: 10px; margin: 6px 0; flex-wrap: wrap; }
form.drawn.busy { opacity: .6; pointer-events: none; cursor: progress; }
form.drawn .btn { margin: 4px 8px 8px 0; }
.st-img { max-width: 100%; border-radius: 8px; }
.drawn .caption p, .drawn .msg p { margin: 0 0 4px; }
pre.st-text { white-space: pre-wrap; }

@media (max-width: 700px) {
  .st-row { grid-template-columns: 1fr !important; }
  :root { --edge: 16px; }
  .bar-in { padding: 12px var(--edge); gap: 10px; grid-template-columns: auto 1fr auto; }
  .bar-in .env { justify-self: start; }
  .brand { font-size: 18px; gap: 10px; } .brand img { height: 40px; }
  .who-name { display: none; }
  .link-btn { min-height: 44px; padding: 8px 16px; }
  .hero-in { padding: 28px var(--edge) 30px; }
  .hero h1 { font-size: 34px; }
  .picker { min-width: 0; width: 100%; }
  .pickers { width: 100%; }
  .pills { padding: 16px var(--edge) 0; }
  .tiles.three, .tiles.two, .two-col { grid-template-columns: 1fr; }
  .tile-value { font-size: 26px; }
  .card { padding: 20px; }
  .auth-brand img { height: 88px; } .auth-brand span { font-size: 22px; }
  .auth-card h1 { font-size: 28px; }
}
