/* Parent and teacher pages (/my). The Android app's own styles (colours, fonts and shapes are the same as the web
   admin's), scoped to .sg-portal, then laid out in the web admin's look: the dark sidebar, a pastel page header and
   white cards in a wide column. Generated base from the former web app's app.css; the admin-look rules are at the end. */
@font-face { font-family: "Material Symbols Rounded"; font-weight: 400; font-display: block; src: url("../fonts/material-symbols-rounded.woff2") format("woff2"); }

.sg-portal {--page: #F6F8FB; --surface: #FFFFFF; --surface-muted: #EEF3F9; --ink: #18202B; --ink2: #3A4452; --ink3: #56606E; --line: #D5DCE5; --navy900: #0F2236; --navy800: #14324F; --navy600: #1F4E79; --navy-on-dark: #C9D5E2; --saffron: #F2A900; --saffron-ink: #7A5300; --saffron-soft: #FFF1CC; --sky: #DCEAF7; --mint: #DDF3E6; --mint-ink: #155C36; --rose: #FBE3DD; --rose-ink: #9B2419; --lilac: #ECE5F8; --whatsapp: #25D366; --font-body: "Noto Sans", "Noto Sans Devanagari", system-ui, sans-serif; --font-heading: "Baloo 2", "Noto Sans Devanagari", system-ui, sans-serif; --shadow: 0 4px 14px rgba(20, 50, 79, 0.08); color-scheme: light; }
.sg-portal * {box-sizing: border-box; }
}
.sg-portal .sg-page {display: flex; flex-direction: column; flex: 1; padding-bottom: 24px; }
.sg-portal .sg-page--bar {padding-bottom: 104px; }
.sg-portal .sg-center {flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 32px 24px; text-align: center; }
.sg-portal .sg-start {background: var(--saffron-soft); min-height: 100vh; min-height: 100dvh; }
.sg-portal h1, .sg-portal h2, .sg-portal h3, .sg-portal p {margin: 0; }
.sg-portal .h1 {font-family: var(--font-heading); font-weight: 700; font-size: 28px; line-height: 1.2; color: var(--navy800); }
.sg-portal .h2 {font-family: var(--font-heading); font-weight: 600; font-size: 21px; line-height: 1.25; color: var(--navy800); }
.sg-portal .h2b {font-family: var(--font-heading); font-weight: 700; font-size: 22px; line-height: 1.2; color: var(--navy800); }
.sg-portal .muted {font-size: 15px; color: var(--ink3); line-height: 1.4; }
.sg-portal .small {font-size: 13px; color: var(--ink3); line-height: 1.4; }
.sg-portal .tiny {font-size: 12px; color: var(--ink3); line-height: 1.35; }
.sg-portal .semi {font-weight: 600; }
.sg-portal .error {font-weight: 600; font-size: 15px; color: var(--rose-ink); }
.sg-portal .center {text-align: center; }
.sg-portal .wrap {white-space: pre-wrap; word-break: break-word; }
.sg-portal .ellipsis {white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-portal .icon {font-family: "Material Symbols Rounded"; font-weight: normal; font-style: normal; font-size: 28px; line-height: 1; color: var(--navy800); display: inline-flex; align-items: center; justify-content: center; user-select: none; speak: never; }
.sg-portal .stack {display: flex; flex-direction: column; gap: 12px; }
.sg-portal .stack-4 {display: flex; flex-direction: column; gap: 4px; }
.sg-portal .stack-6 {display: flex; flex-direction: column; gap: 6px; }
.sg-portal .stack-8 {display: flex; flex-direction: column; gap: 8px; }
.sg-portal .stack-10 {display: flex; flex-direction: column; gap: 10px; }
.sg-portal .stack-14 {display: flex; flex-direction: column; gap: 14px; }
.sg-portal .stack-16 {display: flex; flex-direction: column; gap: 16px; }
.sg-portal .row {display: flex; align-items: center; gap: 10px; }
.sg-portal .row-top {display: flex; align-items: flex-start; gap: 10px; }
.sg-portal .grow {flex: 1; min-width: 0; }
.sg-portal .wrap-row {display: flex; flex-wrap: wrap; gap: 8px; }
.sg-portal .chips {display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.sg-portal .chips::-webkit-scrollbar {display: none; }
.sg-portal .m16 {margin-left: 16px; margin-right: 16px; }
.sg-portal .m20 {margin-left: 20px; margin-right: 20px; }
.sg-portal .pad20 {padding: 0 20px; }
.sg-portal .grid3 {display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sg-portal .grid2 {display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sg-portal .head {padding: 14px 16px 20px; border-radius: 0 0 28px 28px; background: var(--saffron-soft); }
.sg-portal .head--big {padding: 20px 24px 28px; border-radius: 0 0 32px 32px; }
.sg-portal .head--home {padding: 20px 20px 24px; border-radius: 0 0 32px 32px; }
.sg-portal .bg-saffron {background: var(--saffron-soft); }
.sg-portal .bg-mint {background: var(--mint); }
.sg-portal .bg-sky {background: var(--sky); }
.sg-portal .bg-lilac {background: var(--lilac); }
.sg-portal .bg-rose {background: var(--rose); }
.sg-portal .bg-white {background: #fff; }
.sg-portal .back {width: 44px; height: 44px; flex: none; border: 0; border-radius: 14px; background: rgba(255, 255, 255, 0.8); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.sg-portal .back .icon {font-size: 26px; }
.sg-portal .test-strip {background: var(--lilac); font-size: 13px; padding: 6px 16px; text-align: center; }
.sg-portal button {font-family: var(--font-body); }
.sg-portal .btn {font-family: var(--font-body); font-weight: 600; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; text-decoration: none; }
.sg-portal .btn:disabled {cursor: default; }
.sg-portal .btn-primary {width: 100%; min-height: 56px; border-radius: 16px; background: var(--navy800); color: #fff; font-size: 17px; padding: 8px 16px; }
.sg-portal .btn-primary:disabled {background: var(--line); color: var(--ink3); }
.sg-portal .btn-ghost {background: transparent; color: var(--navy600); min-height: 48px; font-size: 15px; padding: 6px 10px; border-radius: 12px; }
.sg-portal .btn-ghost:disabled {color: var(--ink3); opacity: 0.6; }
.sg-portal .btn-ghost.boxed {border: 1px solid var(--line); width: 100%; }
.sg-portal .btn-ghost.start {align-self: flex-start; padding-left: 0; }
.sg-portal .pill {background: #fff; color: var(--navy600); border: 1.5px solid var(--navy600); border-radius: 20px; min-height: 44px; padding: 0 16px; font-size: 14px; white-space: nowrap; flex: none; }
.sg-portal .pill:disabled {opacity: 0.55; }
.sg-portal .pill.on {background: var(--navy800); border-color: var(--navy800); color: #fff; }
.sg-portal .pill.soft {border-color: var(--line); color: var(--ink2); }
.sg-portal .pill.soft.on {background: var(--navy800); border-color: var(--navy800); color: #fff; }
.sg-portal .btn:focus-visible, .sg-portal .back:focus-visible, .sg-portal .tile:focus-visible, .sg-portal .tab:focus-visible, .sg-portal .tap:focus-visible {outline: 3px solid var(--saffron); outline-offset: 2px; }
.sg-portal .card {background: var(--surface); border-radius: 24px; padding: 20px; box-shadow: var(--shadow); }
.sg-portal .card-18 {border-radius: 18px; }
.sg-portal .card-14 {border-radius: 14px; }
.sg-portal .box {border-radius: 12px; padding: 10px 14px; }
.sg-portal .field {background: var(--surface-muted); border-radius: 14px; padding: 4px 14px; min-height: 58px; display: flex; align-items: center; gap: 12px; }
.sg-portal .field input, .sg-portal .field textarea, .sg-portal .field select {flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-family: var(--font-body); font-weight: 600; font-size: 20px; color: var(--ink); }
.sg-portal .field input::placeholder, .sg-portal .field textarea::placeholder {color: var(--ink3); font-weight: 400; }
.sg-portal .field.text input, .sg-portal .field.text textarea, .sg-portal .field.text select {font-size: 16px; font-weight: 400; }
.sg-portal .field textarea {resize: vertical; min-height: 96px; padding: 10px 0; line-height: 1.4; }
.sg-portal .field:focus-within {box-shadow: 0 0 0 2px var(--navy600); }
.sg-portal .label {font-weight: 600; font-size: 15px; }
.sg-portal .code-input {text-align: center; letter-spacing: 8px; }
.sg-portal .tap {cursor: pointer; }
.sg-portal .spinner {width: 32px; height: 32px; border-radius: 50%; border: 3px solid rgba(20, 50, 79, 0.15); border-top-color: var(--navy800); animation: sg-spin 0.9s linear infinite; align-self: center; }
.sg-portal .spinner.small {width: 22px; height: 22px; border-width: 3px; }
@keyframes sg-spin { to { transform: rotate(360deg); } }
.sg-portal .count {border-radius: 12px; padding: 6px 10px; }
.sg-portal .count b {display: block; font-family: var(--font-heading); font-weight: 700; font-size: 24px; line-height: 1.2; }
.sg-portal .count span {font-size: 12px; }
.sg-portal .count.present {background: #E6F4EC; color: var(--mint-ink); }
.sg-portal .count.absent {background: #FDE8E6; color: var(--rose-ink); }
.sg-portal .count.leave {background: #E8EFF7; color: var(--navy600); }
.sg-portal .hero {background: var(--navy800); border-radius: 24px; padding: 20px; margin: -12px 16px 0; box-shadow: var(--shadow); position: relative; }
.sg-portal .hero-title {font-family: var(--font-heading); font-weight: 700; font-size: 21px; color: #fff; line-height: 1.25; }
.sg-portal .hero-body {font-size: 15px; color: var(--navy-on-dark); margin-top: 6px; line-height: 1.4; }
.sg-portal .hero .pill {background: #fff; color: var(--navy800); margin-top: 12px; }
.sg-portal .tiles {display: grid; grid-template-columns: repeat(4, 1fr); margin: 20px 8px 0; }
.sg-portal .tile {background: none; border: 0; padding: 0 2px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; font-family: var(--font-body); }
.sg-portal .tile-icon {position: relative; width: 68px; height: 68px; border-radius: 20px; display: flex; align-items: center; justify-content: center; }
.sg-portal .tile-icon .icon {font-size: 30px; }
.sg-portal .tile-badge {position: absolute; top: -6px; right: -6px; background: #fff; border-radius: 8px; padding: 1px 5px; font-size: 10px; font-weight: 600; color: var(--saffron-ink); }
.sg-portal .tile-label {font-size: 13px; font-weight: 600; text-align: center; color: var(--ink); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sg-portal .bar {position: fixed; left: 50%; transform: translateX(-50%); bottom: 12px; width: calc(min(480px, 100vw) - 24px); background: var(--navy900); border-radius: 24px; padding: 10px 8px; display: flex; justify-content: space-around; align-items: center; min-height: 76px; z-index: 10; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.sg-portal .tab {background: none; border: 0; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; color: var(--navy-on-dark); padding: 0; }
.sg-portal .tab .icon {font-size: 24px; color: var(--navy-on-dark); }
.sg-portal .tab.on .icon {color: #fff; }
.sg-portal .tab span.t {font-size: 11px; color: var(--navy-on-dark); }
.sg-portal .tab .dot {width: 5px; height: 5px; border-radius: 50%; background: var(--saffron); }
.sg-portal .list-row {display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.sg-portal .list-row + .list-row {border-top: 1px solid #EEF1F5; }
.sg-portal .kv {display: grid; grid-template-columns: 100px 1fr; padding: 8px 0; gap: 8px; align-items: baseline; }
.sg-portal .kv .k {font-size: 14px; color: var(--ink3); }
.sg-portal .kv .v {font-size: 15px; font-weight: 600; }
.sg-portal .dot8 {width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.sg-portal .legend {display: flex; flex-wrap: wrap; gap: 14px; }
.sg-portal .legend > span {display: inline-flex; gap: 5px; align-items: center; font-size: 12px; color: var(--ink3); }
.sg-portal .avatar {width: 40px; height: 40px; border-radius: 20px; background: #E8EFF7; color: var(--navy600); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex: none; }
.sg-portal .badge {display: inline-block; border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.sg-portal .cal-week, .sg-portal .cal-days {display: grid; grid-template-columns: repeat(7, 1fr); }
.sg-portal .cal-week span {font-size: 12px; font-weight: 600; color: var(--ink3); text-align: center; }
.sg-portal .cal-cell {height: 44px; border-radius: 10px; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; padding: 0; font-family: var(--font-body); }
.sg-portal .cal-cell b {font-size: 14px; font-weight: 600; }
.sg-portal .cal-cell i {width: 6px; height: 6px; border-radius: 50%; display: block; }
.sg-portal .cal-cell.sel {background: var(--navy600); }
.sg-portal .cal-cell.sel b {color: #fff !important; }
.sg-portal .cal-cell.sel i {background: #fff !important; }
.sg-portal .cal-cell:disabled {cursor: default; }
.sg-portal .icon-btn {width: 44px; height: 44px; border: 0; background: transparent; border-radius: 12px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.sg-portal .icon-btn .icon {font-size: 24px; color: var(--navy600); }
.sg-portal .icon-btn:disabled .icon {color: var(--line); }
.sg-portal .mark-row {display: grid; grid-template-columns: 28px 40px 1fr auto; gap: 10px; align-items: center; border-radius: 18px; padding: 8px 10px; margin: 4px 0; box-shadow: var(--shadow); }
.sg-portal .mark-btn {width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: #5C6675; font-weight: 600; font-size: 16px; cursor: pointer; padding: 0; }
.sg-portal .mark-btn:disabled {cursor: default; }
.sg-portal .mark-btn.p.on {background: #1E8A4F; border-color: #1E8A4F; color: #fff; }
.sg-portal .mark-btn.a.on {background: #C0392B; border-color: #C0392B; color: #fff; }
.sg-portal .mark-btn.l.on {background: var(--navy600); border-color: var(--navy600); color: #fff; }
.sg-portal .sticky-foot {position: sticky; bottom: 0; background: #fff; padding: 12px 20px 18px; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 5; box-shadow: 0 -4px 14px rgba(20, 50, 79, 0.06); }
.sg-portal .done-mark {width: 88px; height: 88px; border-radius: 44px; background: #1E8A4F; display: flex; align-items: center; justify-content: center; align-self: center; }
.sg-portal .done-mark .icon {color: #fff; font-size: 48px; }
.sg-portal .chat {display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; overflow-y: auto; flex: 1; }
.sg-portal .bubble {max-width: 82%; border-radius: 18px; padding: 10px 14px; font-size: 15px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.sg-portal .bubble.me {align-self: flex-end; background: var(--navy800); color: #fff; border-bottom-right-radius: 6px; }
.sg-portal .bubble.them {align-self: flex-start; background: #fff; color: var(--ink); border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.sg-portal .bubble .when {display: block; font-size: 11px; margin-top: 4px; opacity: 0.75; }
.sg-portal .day-sep {align-self: center; font-size: 12px; color: var(--ink3); background: #EEF1F5; border-radius: 10px; padding: 2px 10px; }
.sg-portal .composer {display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; background: #fff; position: sticky; bottom: 0; box-shadow: 0 -4px 14px rgba(20, 50, 79, 0.06); padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.sg-portal .composer textarea {flex: 1; border: 0; background: var(--surface-muted); border-radius: 14px; padding: 12px 14px; font-family: var(--font-body); font-size: 16px; resize: none; min-height: 48px; max-height: 140px; outline: none; }
.sg-portal .send {width: 48px; height: 48px; border-radius: 16px; border: 0; background: var(--navy800); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.sg-portal .send .icon {color: #fff; font-size: 24px; }
.sg-portal .send:disabled {background: var(--line); }
.sg-portal .seg {display: flex; background: #fff; border-radius: 16px; padding: 4px; gap: 4px; box-shadow: var(--shadow); }
.sg-portal .seg button {flex: 1; border: 0; background: transparent; border-radius: 12px; min-height: 44px; font-weight: 600; font-size: 14px; color: var(--ink2); cursor: pointer; }
.sg-portal .seg button.on {background: var(--navy800); color: #fff; }
.sg-portal .period {display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 10px 0; }
.sg-portal .period + .period {border-top: 1px solid #EEF1F5; }
.sg-portal .camera {position: fixed; inset: 0; background: #000; z-index: 50; display: flex; flex-direction: column; }
.sg-portal .camera video {flex: 1; width: 100%; height: 100%; object-fit: cover; }
.sg-portal .camera .frame {position: absolute; top: 50%; left: 50%; width: 240px; height: 240px; transform: translate(-50%, -60%); border: 3px solid #fff; border-radius: 24px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35); pointer-events: none; }
.sg-portal .camera .cam-foot {position: absolute; left: 0; right: 0; bottom: 0; padding: 20px; display: flex; flex-direction: column; gap: 12px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)); padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
.sg-portal .camera .cam-foot p {color: #fff; text-align: center; font-weight: 600; }
.sg-portal .map {height: 220px; border-radius: 18px; background: #EEF1F5; overflow: hidden; }
.sg-portal .switch {position: relative; width: 52px; height: 32px; flex: none; }
.sg-portal .switch input {opacity: 0; width: 0; height: 0; position: absolute; }
.sg-portal .switch span {position: absolute; inset: 0; background: var(--line); border-radius: 16px; transition: background 0.15s; cursor: pointer; }
.sg-portal .switch span::after {content: ""; position: absolute; width: 26px; height: 26px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform 0.15s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.sg-portal .switch input:checked + span {background: #1E8A4F; }
.sg-portal .switch input:checked + span::after {transform: translateX(20px); }
.sg-portal .switch input:focus-visible + span {outline: 3px solid var(--saffron); outline-offset: 2px; }
.sg-portal .switch input:disabled + span {opacity: 0.6; cursor: default; }
.sg-portal .radio-row {display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.sg-portal .radio-row input {width: 22px; height: 22px; accent-color: var(--navy800); }
.sg-portal .check-row {display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.sg-portal .check-row input {width: 22px; height: 22px; accent-color: var(--navy800); flex: none; margin-top: 1px; }
.sg-portal .sg-error-ui {display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; background: #FDE8E6; color: var(--rose-ink); padding: 14px 20px; font-weight: 600; gap: 16px; align-items: center; justify-content: center; }
.sg-portal .sg-error-ui a {color: var(--navy600); }
@media (prefers-reduced-motion: reduce) {
  .sg-portal .spinner {animation-duration: 2.5s; }
}
.sg-portal .start {align-self: flex-start; }
.sg-portal .clamp2, .sg-portal .clamp3 {display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.sg-portal .clamp2 {-webkit-line-clamp: 2; }
.sg-portal .clamp3 {-webkit-line-clamp: 3; }
.sg-portal .opt {display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 14px; text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; font-size: 15px; color: var(--ink); }
.sg-portal .opt.on {border: 2px solid var(--navy600); }
.sg-portal .opt .dot {width: 20px; height: 20px; border-radius: 50%; border: 2px solid #A9B3C0; flex: none; }
.sg-portal .opt.on .dot {border: 6px solid var(--navy600); }
.sg-portal .opt span:last-child {padding: 12px 0; }
.sg-portal .opt:focus-visible {outline: 3px solid var(--saffron); outline-offset: 2px; }
.sg-portal .cal-fill {margin: 2px; height: 44px; border-radius: 10px; border: 0; padding: 0; font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.sg-portal .cal-fill.sel {box-shadow: inset 0 0 0 2.5px var(--navy600); }
.sg-portal .cal-fill:focus-visible {outline: 3px solid var(--saffron); outline-offset: 1px; }
.sg-portal .box10 {width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sg-portal .count-num {font-family: var(--font-heading); font-weight: 700; font-size: 24px; line-height: 1.2; }
.sg-portal .nav-row {display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 0; background: transparent; border: 0; text-align: left; cursor: pointer; font-family: var(--font-body); color: var(--ink); }
.sg-portal .nav-row + .nav-row {border-top: 1px solid var(--line); }
.sg-portal .nav-row .icon {font-size: 24px; color: var(--ink); }
.sg-portal .nav-row:focus-visible {outline: 3px solid var(--saffron); outline-offset: 2px; }
.sg-portal .notice {display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; padding: 14px; border-radius: 20px; width: 100%; text-align: left; cursor: pointer; border: 0; font-family: var(--font-body); color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.sg-portal .notice .ic {grid-row: span 2; width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; color: var(--navy800); }
.sg-portal .notice .body {grid-column: 2 / span 2; font-size: 14px; color: var(--ink2); }
.sg-portal .notice .file {grid-column: 2 / span 2; }
.sg-portal .notice:focus-visible {outline: 3px solid var(--saffron); outline-offset: 2px; }
.sg-portal .kv-row {display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 10px 0; }
.sg-portal .tog {width: 60px; height: 44px; border: 0; background: transparent; padding: 6px 4px; cursor: pointer; flex: none; }
.sg-portal .tog i {display: block; width: 52px; height: 32px; border-radius: 16px; background: #B8C0CB; padding: 3px; transition: background 0.15s; }
.sg-portal .tog i::after {content: ""; display: block; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.sg-portal .tog.on i {background: #1E8A4F; }
.sg-portal .tog.on i::after {transform: translateX(20px); }
.sg-portal .tog:focus-visible {outline: 3px solid var(--saffron); outline-offset: 0; border-radius: 12px; }
.sg-portal .tog:disabled {opacity: 0.6; cursor: default; }
.sg-portal .lang {display: flex; gap: 2px; background: var(--surface-muted); border-radius: 10px; padding: 3px; }
.sg-portal .lang button {min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink3); font-family: var(--font-body); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.sg-portal .lang button.on {background: #fff; color: var(--navy600); }
.sg-portal .btn-danger {background: var(--rose-ink); }
.sg-portal .avatar56 {width: 56px; height: 56px; border-radius: 50%; background: var(--navy800); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-weight: 700; font-size: 20px; flex: none; }
.sg-portal .line {height: 1px; background: var(--line); }
.sg-portal .map iframe {width: 100%; height: 100%; border: 0; display: block; }
.sg-portal .van-hero {border-radius: 18px; padding: 16px; background: #EEF1F5; }
.sg-portal .van-hero .k {font-size: 13px; font-weight: 600; color: var(--ink2); }
.sg-portal .van-hero .t {font-family: var(--font-heading); font-weight: 700; font-size: 22px; color: var(--ink); line-height: 1.25; }
.sg-portal .van-hero .s {font-size: 14px; color: var(--ink2); }
.sg-portal .van-hero.info {background: #1F4E79; }
.sg-portal .van-hero.good {background: #1E8A4F; }
.sg-portal .van-hero.done {background: #155C36; }
.sg-portal .van-hero.warn {background: #FFF4D6; }
.sg-portal .van-hero.dark .k {color: rgba(255, 255, 255, 0.85); }
.sg-portal .van-hero.dark .t {color: #fff; }
.sg-portal .van-hero.dark .s {color: rgba(255, 255, 255, 0.9); }
.sg-portal .step-dot {width: 14px; height: 14px; border-radius: 50%; border: 2px solid #C3CBD5; background: #fff; flex: none; }
.sg-portal .step-dot.done {background: #1E8A4F; border-color: #1E8A4F; }
.sg-portal .step-dot.next {border: 3px solid var(--saffron); }
.sg-portal .chat-page {height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--surface-muted); }
.sg-portal .chat-page .chat {min-height: 0; }
.sg-portal .chat-foot {background: var(--page); padding: 8px 16px 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; }
.sg-portal .chat-foot .row {align-items: flex-end; gap: 8px; }
.sg-portal .chat-foot textarea {flex: 1; border: 0; background: var(--surface-muted); border-radius: 14px; padding: 14px; font-family: var(--font-body); font-size: 16px; resize: none; min-height: 52px; max-height: 140px; outline: none; color: var(--ink); }
.sg-portal .chat-foot textarea:focus {box-shadow: 0 0 0 2px var(--navy600); }
.sg-portal .chat-foot .send {width: 52px; height: 52px; border-radius: 26px; }
.sg-portal .bubble.me {border-radius: 18px 18px 4px 18px; }
.sg-portal .bubble.them {border-radius: 18px 18px 18px 4px; }
.sg-portal .bubble .meta {display: block; font-size: 11px; margin-top: 4px; color: var(--ink3); }
.sg-portal .bubble.me .meta {color: var(--navy-on-dark, #BFD3E8); }
.sg-portal .day-label {align-self: center; font-size: 12px; color: var(--ink3); }
.sg-portal .thread {display: grid; grid-template-columns: auto 1fr auto; gap: 3px 12px; align-items: center; width: 100%; padding: 14px; border-radius: 20px; border: 0; background: var(--surface); box-shadow: var(--shadow); text-align: left; cursor: pointer; font-family: var(--font-body); color: var(--ink); }
.sg-portal .thread .av {grid-row: span 2; width: 42px; height: 42px; border-radius: 21px; background: var(--sky); color: var(--navy800); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.sg-portal .thread:focus-visible {outline: 3px solid var(--saffron); outline-offset: 2px; }
.sg-portal .unread-dot {width: 10px; height: 10px; border-radius: 50%; background: var(--saffron); justify-self: end; }
.sg-portal .daytabs {display: flex; gap: 2px; background: var(--surface-muted); border-radius: 12px; padding: 4px; }
.sg-portal .daytabs button {flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 4px; border: 0; border-radius: 9px; background: transparent; color: var(--ink2); font-family: var(--font-body); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.sg-portal .daytabs button.on {background: #fff; color: var(--navy800); }
.sg-portal .daytabs button:focus-visible {outline: 3px solid var(--saffron); outline-offset: 1px; }
.sg-portal .prow {display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 11px 14px; background: #fff; }
.sg-portal .prow.now {background: #FFF8E1; }
.sg-portal .ptag {border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 600; background: var(--surface-muted); color: var(--ink2); }
.sg-portal .prow.now .ptag {background: var(--navy900); color: #fff; }
.sg-portal .card-flat {background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.sg-portal .mrow {display: grid; grid-template-columns: 30px 1fr 64px 44px; gap: 10px; align-items: center; padding: 8px 14px; }
.sg-portal .mrow input {width: 100%; height: 42px; border: 1.5px solid var(--line); border-radius: 10px; text-align: center; font-family: var(--font-body); font-weight: 600; font-size: 16px; color: var(--ink); background: #fff; padding: 0 2px; }
.sg-portal .mrow input.bad {border-color: var(--rose-ink); }
.sg-portal .mrow input:disabled {background: var(--surface-muted); color: var(--ink3); }
.sg-portal .mrow input:focus {outline: 2px solid var(--navy600); outline-offset: 0; }
.sg-portal .ab-btn {width: 44px; min-height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; color: var(--ink2); font-family: var(--font-body); font-weight: 600; font-size: 12px; cursor: pointer; padding: 0; }
.sg-portal .ab-btn.on {background: #3A4452; border-color: #3A4452; color: #fff; }
.sg-portal .paper {display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 14px; border-radius: 18px; border: 0; background: var(--surface); box-shadow: var(--shadow); text-align: left; cursor: pointer; font-family: var(--font-body); color: var(--ink); }
.sg-portal .paper:focus-visible {outline: 3px solid var(--saffron); outline-offset: 2px; }
.sg-portal .field input[type=date] {width: 100%; padding: 0; font-size: 15px; }
.sg-portal .field:has(input[type=date]) {padding: 4px 10px; }

/* ---------- the web admin's look ---------- */
.sg-portal.sg-shell { background: var(--page); }
.sg-portal .sg-main { background: var(--page); }
.sg-portal .sg-page { max-width: 1000px; width: 100%; padding-bottom: 40px; }
.sg-portal .sg-page--bar { padding-bottom: 40px; }
.sg-portal .bar { display: none; }
.sg-portal .test-strip { border-radius: 0 0 14px 14px; padding: 6px 32px; text-align: left; }
.sg-portal .head, .sg-portal .head--big, .sg-portal .head--home { padding: 22px 32px 24px; border-radius: 0 0 28px 28px; }
.sg-portal .back { background: #fff; box-shadow: var(--shadow); }
.sg-portal .pt-head { display: flex; flex-direction: column; gap: 12px; }
.sg-portal .pt-head__row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sg-portal .pt-head__titles { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sg-portal .pt-head__titles h1 { font-family: var(--font-heading); font-size: 30px; font-weight: 700; line-height: 1.2; color: var(--navy800); }
.sg-portal .pt-head__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sg-portal .card { box-shadow: 0 4px 14px rgba(20, 50, 79, .07); }

/* Home: greeting header, the navy hero card, then the screens as tiles in a grid (like the dashboard's quick tiles). */
.sg-portal .hero { margin: -14px 32px 0; padding: 22px 24px; }
.sg-portal .pt-children { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 32px 0; }
.sg-portal .pt-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin: 22px 32px 0; }
.sg-portal .pt-tile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 76px; border: 0; border-radius: 20px; background: #fff; box-shadow: 0 4px 14px rgba(20, 50, 79, .07); font: inherit; text-align: left; cursor: pointer; color: var(--ink); text-decoration: none; }
.sg-portal .pt-tile:hover { box-shadow: 0 8px 22px rgba(20, 50, 79, .12); }
.sg-portal .pt-tile:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }
.sg-portal .pt-tile__icon { position: relative; width: 48px; height: 48px; border-radius: 14px; flex: none; display: flex; align-items: center; justify-content: center; }
.sg-portal .pt-tile__icon .icon { font-size: 26px; }
.sg-portal .pt-tile__label { font-weight: 700; font-size: 15px; line-height: 1.3; }
.sg-portal .pt-tile .tile-badge { top: -6px; right: -8px; box-shadow: var(--shadow); }
.sg-portal .pt-home-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 22px 32px 0; }

/* Buttons sit at their own width on a computer, as in the web admin. */
@media (min-width: 761px) {
  .sg-portal .m16, .sg-portal .m20 { margin-left: 32px; margin-right: 32px; }
  .sg-portal .pad20 { padding: 0 32px; }
  .sg-portal .btn-primary { min-height: 52px; border-radius: 14px; box-shadow: 0 6px 16px rgba(20, 50, 79, .25); }
  .sg-portal .btn-primary:disabled { box-shadow: none; }
  .sg-portal .sticky-foot { border-radius: 20px 20px 0 0; }
}

/* Sidebar links: the app's icons on the dark sidebar. */
.sg-portal .sg-nav__item .icon { font-size: 21px; color: inherit; width: 22px; }
.sg-portal .sg-nav__item { border: 0; background: transparent; font: inherit; font-size: 14.5px; width: 100%; text-align: left; cursor: pointer; }
.sg-portal .sg-who__badge { font-family: var(--font-body); }

/* Phones: the sidebar becomes a short top bar with the pages in one scrolling row. */
@media (max-width: 760px) {
  .sg-portal .sg-sidebar { gap: 12px; padding: 14px 12px 14px; }
  .sg-portal .sg-nav--portal { flex-direction: row; overflow-x: auto; gap: 6px; scrollbar-width: none; padding-bottom: 2px; }
  .sg-portal .sg-nav--portal::-webkit-scrollbar { display: none; }
  .sg-portal .sg-nav--portal .sg-nav__item { width: auto; flex: none; min-height: 40px; background: rgba(255,255,255,.06); border-radius: 999px; padding: 0 14px; white-space: nowrap; }
  .sg-portal .sg-nav--portal .sg-nav__item.active::after { display: none; }
  .sg-portal .sg-nav--portal .sg-nav__item.active { background: #fff; color: var(--navy800); }
  .sg-portal .sg-sidebar__foot { flex-direction: row; }
  .sg-portal .head, .sg-portal .head--big, .sg-portal .head--home { padding: 16px 16px 20px; }
  .sg-portal .pt-head__titles h1 { font-size: 24px; }
  .sg-portal .hero { margin: -12px 16px 0; }
  .sg-portal .pt-children, .sg-portal .pt-tiles, .sg-portal .pt-home-foot { margin-left: 16px; margin-right: 16px; }
  .sg-portal .pt-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sg-portal .pt-tile { flex-direction: column; align-items: flex-start; gap: 10px; min-height: 0; }
  .sg-portal .test-strip { padding: 6px 16px; }
}

/* Screen titles at the web admin's page-title size. */
.sg-portal .head h1.h2b, .sg-portal .head h1.h1 { font-size: 28px !important; }
@media (max-width: 760px) {
  .sg-portal .head h1.h2b, .sg-portal .head h1.h1 { font-size: 22px !important; }
}
.sg-portal .test-strip { max-width: 1000px; }
@media (min-width: 761px) {
  .sg-portal .btn-primary { width: auto; min-width: 260px; padding: 8px 32px; }
}
.sg-portal .chat-page { max-width: 1000px; height: calc(100vh - 32px); height: calc(100dvh - 32px); }
@media (max-width: 760px) {
  .sg-portal .chat-page { height: 80vh; height: 80dvh; }
}
.sg-portal .sg-who { min-width: 0; }
