/* MENTit shared styles for app and public pages added after the canvas screens.
   Layout: sidebar + content on desktop; content + fixed bottom tab bar on phones. */
:root {
  color-scheme: light;
  --ink: #2D3964; --muted: #5B6275; --green: #385F0B; --green-dk: #1F3A0B; --lime: #6CBB23;
  --cream: #FDF3DC; --mint: #EAF3DE; --sage: #D6E7C3; --lav: #E8EAF2; --line: #E2E6DB; --line2: #EEF0E8;
  --bg: #F5F6F1; --on-bg: #EAF3DE; --danger: #B42318; --danger-bg: #FCE8E6; --warn: #6B4E00;
}
* { box-sizing: border-box }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Poppins', system-ui, sans-serif }
body.r-ym { --on-bg: #FDF3DC }
body.r-org { --bg: #F4F5F9; --line: #E1E4EE; --line2: #EEF0F5 }
a { color: var(--green) } a:hover { color: var(--green-dk) }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important } }

/* shell */
.shell { min-height: 100vh; display: flex }
.side { flex: none; width: 236px; background: #FFFFFF; border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 18px }
.side.dk { color: #FFFFFF; border-right: 0 }
.side.navy { background: #2D3964 } .side.forest { background: #1F3A0B }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; padding: 4px 8px; min-height: 44px }
.logo:hover { color: inherit }
.nav { display: flex; flex-direction: column; gap: 4px }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border-radius: 14px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14px }
.nav a:hover { background: #F2F4EC; color: var(--ink) }
.nav a.on { background: var(--on-bg); color: var(--green-dk); font-weight: 700 }
.side.dk .nav a { color: #E8EAF2 } .side.dk .nav a:hover { background: rgba(255,255,255,0.08); color: #FFFFFF }
.side.navy .nav a.on { background: #FFFFFF; color: #2D3964 } .side.forest .nav a.on { background: #FFFFFF; color: #1F3A0B }
.chip-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 4px; font-size: 13px; line-height: 1.3 }
.main { flex: 1; min-width: 0; padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 20px }
.mbar { display: none }
.mtab { display: none }

/* page header */
.ph { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px }
.ph > div:first-child { flex: 1 1 340px; min-width: 0 }
.ph h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.03em; text-wrap: balance }
.ph p { margin: 4px 0 0; font-size: 14px; color: var(--muted) }

/* building blocks */
.c { background: #FFFFFF; border: 1px solid var(--line); border-radius: 22px; padding: 20px; min-width: 0; display: flex; flex-direction: column; gap: 14px }
.row { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 14px }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 16px }
.st { background: #FFFFFF; border: 1px solid var(--line); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 4px }
.st b { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums }
.st span { font-size: 13px; color: var(--muted) }
.h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em }
.hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap }
.mut { color: var(--muted) }
.lab { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; line-height: 1.2; padding: 5px 10px; border-radius: 999px; white-space: nowrap }
.p-green { background: var(--mint); color: var(--green) } .p-cream { background: var(--cream); color: var(--warn) }
.p-lav { background: var(--lav); color: var(--ink) } .p-grey { background: #F2F4EC; color: var(--muted) }
.p-red { background: var(--danger-bg); color: var(--danger) } .p-yellow { background: #FBEFC4; color: var(--warn) }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; font: 600 14px 'Poppins', sans-serif; text-decoration: none; cursor: pointer; border: 0; white-space: nowrap }
.bp { background: var(--green); color: #FFFFFF } .bp:hover { background: #2C4B08; color: #FFFFFF }
.bs { background: #FFFFFF; color: var(--ink); border: 1.5px solid #CBD3C1 } .bs:hover { border-color: var(--green); color: var(--ink) }
.bd { background: #FFFFFF; color: var(--danger); border: 1.5px solid #F1C4BF }
.btn[disabled] { opacity: 0.5; cursor: not-allowed }
.ib { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #FFFFFF; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none }
.av { flex: none; border-radius: 50%; overflow: hidden; display: block }
.av img { width: 100%; height: 100%; display: block }
.chips { display: flex; flex-wrap: wrap; gap: 8px }
.chip { min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer; font: 600 13px 'Poppins', sans-serif; background: #FFFFFF; color: var(--ink); border: 1.5px solid #CBD3C1 }
.chip[aria-pressed="true"] { background: var(--green); color: #FFFFFF; border-color: var(--green) }
body.r-org .chip[aria-pressed="true"] { background: #2D3964; border-color: #2D3964 }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600 }
.fld input, .fld select, .fld textarea { min-height: 46px; border: 1.5px solid #CBD3C1; border-radius: 14px; padding: 0 14px; background: #FFFFFF; color: var(--ink); font: 500 14px 'Poppins', sans-serif; width: 100% }
.fld textarea { padding: 12px 14px; line-height: 1.5; resize: vertical; min-height: 96px }
.fld small { font-weight: 500; color: var(--muted); font-size: 12px }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px }
.tg { display: flex; align-items: center; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--line2); font-size: 14px }
.tg:last-child { border-bottom: 0 }
.tg > span { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35 }
.tg > span b { font-weight: 600 } .tg > span small { font-size: 12px; color: var(--muted) }
.sw { flex: none; position: relative; width: 48px; height: 28px; border-radius: 999px; border: 0; cursor: pointer; padding: 0; background: #CBD3C1; transition: background .2s }
.sw::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; transition: left .2s }
.sw[aria-checked="true"] { background: var(--green) } .sw[aria-checked="true"]::after { left: 24px }
.sw[disabled] { opacity: 0.6; cursor: not-allowed }
.tblw { overflow-x: auto; position: relative }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap }
.tbl td { padding: 12px 10px; border-bottom: 1px solid var(--line2); vertical-align: middle }
.who { display: flex; align-items: center; gap: 10px; line-height: 1.3 } .who small { display: block; font-size: 12px; color: var(--muted) }
.bar { height: 8px; border-radius: 999px; background: var(--line2); overflow: hidden; display: block }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--green) }
.note { background: var(--cream); border-radius: 16px; padding: 12px 14px; font-size: 13px; line-height: 1.5 }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 999px; padding: 5px; align-self: flex-start }
.tabs button { min-height: 42px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer; font: 600 14px 'Poppins', sans-serif; background: transparent; color: var(--ink) }
.tabs button[aria-selected="true"] { background: var(--green); color: #FFFFFF }
body.r-org .tabs button[aria-selected="true"] { background: #2D3964 }

/* public pages */
.pub-head { max-width: 1320px; margin: 0 auto; padding: 12px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px }
.pub-nav { display: flex; flex-wrap: wrap; gap: 0 22px; flex: 1 1 auto }
.pub-nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14px; padding: 12px 0 }
.pub-nav a:hover, .pub-nav a.on { color: var(--green) }
.pub-wrap { max-width: 1120px; margin: 0 auto; padding: 24px 24px 72px; display: flex; flex-direction: column; gap: 32px }
.prose { max-width: 720px; font-size: 16px; line-height: 1.7 }
.prose h2 { font-size: 22px; letter-spacing: -0.02em; margin: 28px 0 8px }
.prose p, .prose ul { margin: 0 0 12px }
.pub-foot { background: #242632; color: #C9CCD6 }
.pub-foot a { color: #C9CCD6; text-decoration: none; padding: 8px 0 }
.pub-foot a:hover { color: #FFFFFF }

/* toast */
.dc-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: #1F3A0B; color: #FFFFFF; padding: 12px 18px; border-radius: 14px; font: 500 14px 'Poppins', sans-serif; box-shadow: 0 14px 30px rgba(0,0,0,0.25); z-index: 100; max-width: min(92vw, 460px); text-align: center }

@media (max-width: 860px) { .pub-nav { display: none } }
@media (max-width: 720px) {
  .side { display: none }
  .main { padding: 12px 16px 104px }
  .mbar { display: flex; align-items: center; gap: 10px; min-height: 52px }
  .mtab { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; gap: 2px; background: #FFFFFF; border-top: 1px solid var(--line); padding: 8px 8px calc(12px + env(safe-area-inset-bottom, 0px)) }
  .mtab a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; text-decoration: none; font-size: 11px; font-weight: 600; color: var(--muted) }
  .mtab a.on { color: var(--green-dk) }
  .mtab .tbi { width: 52px; height: 30px; border-radius: 999px; display: flex; align-items: center; justify-content: center }
  .mtab a.on .tbi { background: var(--on-bg) }
  body.r-org .mtab a.on { color: #2D3964 } body.r-org .mtab a.on .tbi { background: #E8EAF2 }
  .ph h1 { font-size: 23px }
  .c { padding: 16px }
  .dc-toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)) }
}
