:root {
  --primary: #176B87;
  --primary-dark: #0F5068;
  --primary-50: #E7F1F5;
  --secondary: #42A5A0;
  --secondary-50: #E3F3F2;
  --surface: #E6F5F4;
  --bg: #F7FAFC;
  --health: #2E8B57;
  --health-50: #E2F2E9;
  --text: #243746;
  --muted: #64788A;
  --line: #DCE7EA;
  --card: #FFFFFF;
  --danger: #D14343;
  --danger-50: #FCEBEB;
  --warn: #B7791F;
  --warn-50: #FEF5E2;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(23, 55, 70, .06), 0 6px 18px rgba(23, 55, 70, .07);
  --shadow-lg: 0 10px 40px rgba(23, 55, 70, .18);
  --nav-h: 68px;
  --top-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: #E9F0F3;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
a { color: var(--primary); }

.ms {
  font-family: 'Material Symbols Rounded';
  font-weight: normal; font-style: normal;
  font-size: 22px; line-height: 1;
  letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap; direction: ltr;
  font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle; flex-shrink: 0;
}
.ms.fill { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
.ms.sm { font-size: 18px; }
.ms.lg { font-size: 28px; }
.ms.xl { font-size: 40px; }

.app {
  max-width: 480px; min-height: 100vh; margin: 0 auto;
  background: var(--bg); position: relative;
  box-shadow: 0 0 0 1px rgba(23,55,70,.04), 0 0 60px rgba(23,55,70,.08);
  overflow-x: hidden;
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  display: flex; align-items: center; gap: 6px;
  padding: 0 10px 0 12px;
  background: rgba(247, 250, 252, .88);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .title { flex: 1; min-width: 0; font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; background: none; border: 0; padding: 0; text-align: left; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.brand b { font-size: 17px; font-weight: 800; color: var(--primary); letter-spacing: -.2px; }
.brand small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: -2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: transparent; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, transform .1s;
}
.icon-btn:hover { background: var(--primary-50); }
.icon-btn:active { transform: scale(.92); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0;
}

.content { padding: 14px 16px calc(var(--nav-h) + var(--safe-b) + 28px); }
.content.no-nav { padding-bottom: 32px; }
.view-enter { animation: viewIn .32s cubic-bezier(.2,.8,.2,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.bottomnav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 40;
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 6px 6px calc(6px + var(--safe-b));
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.nav-item {
  border: 0; background: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 600; border-radius: 14px; position: relative;
  transition: color .2s;
}
.nav-item .pill {
  width: 52px; height: 30px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: background .25s, transform .2s;
}
.nav-item.active { color: var(--primary); }
.nav-item.active .pill { background: var(--surface); }
.nav-item.active .ms { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
.nav-item:active .pill { transform: scale(.9); }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.2px; }
.h-page { font-size: 22px; font-weight: 800; }
.h-sec { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin: 22px 2px 10px; }
.h-sec .ms { color: var(--primary); font-size: 20px; }
.h-sec .grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hidden { display: none !important; }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
  border: 1px solid rgba(220, 231, 234, .6);
}
.card + .card { margin-top: 12px; }
.card.flat { box-shadow: none; border-color: var(--line); }
.card.tint { background: var(--surface); border-color: transparent; box-shadow: none; }
.card-title { font-weight: 700; font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card-title .ms { color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 18px; border-radius: 14px;
  border: 1.5px solid transparent; font-weight: 700; font-size: 14.5px;
  transition: transform .1s, box-shadow .2s, background .2s, opacity .2s;
  white-space: nowrap; user-select: none; text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn-lg { height: 54px; font-size: 15.5px; border-radius: 16px; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 11px; gap: 6px; }
.btn-sm .ms { font-size: 18px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(23,107,135,.28); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: #fff; box-shadow: 0 6px 16px rgba(66,165,160,.28); }
.btn-health { background: var(--health); color: #fff; box-shadow: 0 6px 16px rgba(46,139,87,.28); }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-ghost { background: var(--primary-50); color: var(--primary); }
.btn-light { background: #fff; color: var(--text); border-color: var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: var(--danger-50); color: var(--danger); }
.btn .spin { width: 18px; height: 18px; border-width: 2.5px; border-color: rgba(255,255,255,.4); border-top-color: #fff; }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }
.link-btn { background: none; border: 0; color: var(--primary); font-weight: 700; padding: 4px; }

.field { margin-bottom: 14px; }
.field > label, .label {
  display: block; font-size: 13px; font-weight: 700; margin: 0 0 6px 2px; color: var(--text);
}
.field > label .req { color: var(--danger); }
.field .hint { font-size: 12px; color: var(--muted); margin: 5px 2px 0; }
.field .err { font-size: 12px; color: var(--danger); margin: 5px 2px 0; display: none; }
.field.invalid .err { display: block; }
.field.invalid .input, .field.invalid .picker-field { border-color: var(--danger); background: #FFF9F9; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 13px;
  background: #fff; font-size: 16px; outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
textarea.input { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
select.input {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http:%2F%2Fwww.w3.org%2F2000%2Fsvg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%2364788A' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
select.input:invalid { color: #93A3B1; }
select.input option { color: var(--text); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(23,107,135,.12); }
.input:disabled { background: #F1F5F7; color: var(--muted); }
.input-wrap .prefix, .input-wrap .suffix {
  position: absolute; color: var(--muted); font-weight: 600; font-size: 14px; pointer-events: none;
}
.input-wrap .prefix { left: 14px; }
.input-wrap .suffix { right: 14px; }
.input-wrap.has-prefix .input { padding-left: 44px; }
.input-wrap.has-suffix .input { padding-right: 48px; }
.input-wrap .in-btn { position: absolute; right: 4px; width: 40px; height: 40px; }
.input-wrap.has-btn .input { padding-right: 48px; }
input[type=date].input { min-height: 48px; }
input[type=date].input::-webkit-date-and-time-value { text-align: left; }

.switch-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 13px; background: var(--surface); margin-bottom: 14px;
}
.switch-row .grow b { display: block; font-size: 14px; }
.switch-row .grow span { font-size: 12px; color: var(--muted); }
.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span {
  position: absolute; inset: 0; background: #C6D3D9; border-radius: 28px; transition: background .2s;
}
.switch span::after {
  content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(20px); }

.picker-field {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 13px;
  background: #fff; display: flex; align-items: center; gap: 10px; text-align: left;
}
.picker-field .ph { color: #93A3B1; }
.picker-field .ms { color: var(--primary); }

.form-section {
  background: var(--card); border-radius: var(--radius); padding: 16px 16px 4px;
  box-shadow: var(--shadow); margin-bottom: 14px; border: 1px solid rgba(220,231,234,.6);
}
.form-section .sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.form-section .sec-head .num {
  width: 28px; height: 28px; border-radius: 9px; background: var(--surface); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
}
.form-section .sec-head b { font-size: 15px; }

.quick-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; height: 34px; padding: 0 14px; border-radius: 17px;
  border: 1.5px solid var(--line); background: #fff; color: var(--text);
  font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
  transition: all .15s;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip .count { font-size: 11px; background: rgba(0,0,0,.08); padding: 1px 7px; border-radius: 10px; }
.chip.active .count { background: rgba(255,255,255,.25); }
.chip.toggle.active { background: var(--surface); border-color: var(--secondary); color: var(--primary); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap;
  background: #EEF2F4; color: var(--muted);
}
.badge .ms { font-size: 14px; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--health-50); color: var(--health); }
.badge.info { background: var(--primary-50); color: var(--primary); }
.badge.teal { background: var(--secondary-50); color: #2C8681; }
.badge.warn { background: var(--warn-50); color: var(--warn); }
.badge.bad { background: var(--danger-50); color: var(--danger); }
.badge.grey { background: #EEF2F4; color: var(--muted); }

.seg {
  display: flex; background: #E8EFF2; border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 14px;
  position: relative;
}
.seg button {
  flex: 1; height: 38px; border: 0; background: transparent; border-radius: 11px;
  font-weight: 700; font-size: 13.5px; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .2s;
}
.seg button .ms { font-size: 19px; }
.seg button.active { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(23,55,70,.1); }

.landing { min-height: 100vh; display: flex; flex-direction: column; position: relative; overflow: hidden; background: var(--bg); }
.landing-bg {
  position: absolute; inset: 0 0 auto 0; height: 62%;
  background:
    radial-gradient(circle at 85% 10%, rgba(66,165,160,.55), transparent 45%),
    radial-gradient(circle at 10% 80%, rgba(46,139,87,.35), transparent 40%),
    linear-gradient(160deg, #176B87 0%, #1C7E8E 55%, #2E9A93 100%);
  border-radius: 0 0 44px 44px;
}
.landing-bg::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.12) 1.2px, transparent 1.2px);
  background-size: 18px 18px; border-radius: inherit;
  mask-image: linear-gradient(to bottom, #000 30%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent);
}
.landing-hero { position: relative; z-index: 1; padding: 64px 28px 24px; color: #fff; text-align: center; }
.logo-xl {
  width: 96px; height: 96px; margin: 0 auto 18px; border-radius: 28px; overflow: hidden;
  background: #fff; box-shadow: 0 16px 40px rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center;
  animation: floaty 5s ease-in-out infinite;
}
.logo-xl img, .logo-xl svg { width: 100%; height: 100%; object-fit: contain; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.landing-hero h1 { font-size: 34px; font-weight: 800; letter-spacing: -.6px; }
.landing-hero p { margin: 10px auto 0; max-width: 320px; opacity: .92; font-size: 15px; }
.hero-pills { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.hero-pills > span {
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22);
  padding: 6px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; backdrop-filter: blur(6px);
}
.hero-pills .ms { font-size: 17px; }
.landing-actions {
  position: relative; z-index: 1; margin: auto 20px 0; padding: 22px 20px;
  background: #fff; border-radius: 26px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 12px;
  animation: viewIn .5s .1s both cubic-bezier(.2,.8,.2,1);
}
.landing-foot { position: relative; text-align: center; color: var(--muted); font-size: 12px; padding: 18px 0 24px; }

.auth-wrap { padding: 8px 20px 40px; }
.auth-head { text-align: center; margin: 8px 0 22px; }
.auth-head .logo { width: 64px; height: 64px; border-radius: 20px; overflow: hidden; margin: 0 auto 12px; box-shadow: var(--shadow); }
.auth-head h2 { font-size: 24px; font-weight: 800; }
.auth-head p { color: var(--muted); margin: 6px 0 0; }
.auth-alt { text-align: center; margin-top: 18px; color: var(--muted); font-size: 14px; }
.steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.steps i { width: 26px; height: 5px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--primary); }

.hello {
  border-radius: 24px; padding: 18px 18px 20px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #176B87 0%, #2A8C95 60%, #42A5A0 100%);
  box-shadow: 0 12px 30px rgba(23,107,135,.3);
}
.hello::before, .hello::after {
  content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.1);
}
.hello::before { width: 180px; height: 180px; right: -50px; top: -70px; }
.hello::after { width: 110px; height: 110px; right: 40px; bottom: -60px; background: rgba(255,255,255,.07); }
.hello small { opacity: .85; font-weight: 500; }
.hello h2 { font-size: 21px; font-weight: 800; margin: 2px 0 2px; }
.hello .farm { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; opacity: .95; background: rgba(255,255,255,.15); padding: 5px 10px; border-radius: 20px; margin-top: 8px; }
.hello .farm .ms { font-size: 16px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.stat {
  background: #fff; border-radius: 18px; padding: 14px; box-shadow: var(--shadow);
  border: 1px solid rgba(220,231,234,.6); position: relative; overflow: hidden;
  animation: viewIn .4s both cubic-bezier(.2,.8,.2,1);
}
.stat:nth-child(2) { animation-delay: .05s; } .stat:nth-child(3) { animation-delay: .1s; } .stat:nth-child(4) { animation-delay: .15s; }
.stat .ic {
  width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.stat .ic.p { background: var(--primary-50); color: var(--primary); }
.stat .ic.s { background: var(--secondary-50); color: var(--secondary); }
.stat .ic.h { background: var(--health-50); color: var(--health); }
.stat .ic.w { background: var(--warn-50); color: var(--warn); }
.stat .ic.d { background: var(--danger-50); color: var(--danger); }
.stat .val { font-size: 24px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
.stat .val small { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.stat .lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }

.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.menu-tile {
  background: #fff; border: 1px solid rgba(220,231,234,.7); border-radius: 18px; padding: 14px 6px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700;
  box-shadow: var(--shadow); transition: transform .12s;
}
.menu-tile:active { transform: scale(.95); }
.menu-tile .ic { width: 46px; height: 46px; border-radius: 15px; display: flex; align-items: center; justify-content: center; color: #fff; }
.menu-tile .ic .ms { font-size: 25px; }

.agenda-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line);
  width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left;
}
.agenda-item:last-child { border-bottom: 0; }
.agenda-item .date {
  width: 46px; height: 50px; border-radius: 13px; background: var(--surface); color: var(--primary);
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0;
}
.agenda-item .date b { font-size: 17px; line-height: 1; }
.agenda-item .date span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; }
.agenda-item.late .date { background: var(--danger-50); color: var(--danger); }
.agenda-item .t b { display: block; font-size: 14px; }
.agenda-item .t span { font-size: 12.5px; color: var(--muted); }

.bars .bar-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.bars .bar-row .name { width: 120px; flex-shrink: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars .bar-row .track { flex: 1; height: 10px; background: #EDF3F5; border-radius: 6px; overflow: hidden; }
.bars .bar-row .fillbar { height: 100%; border-radius: 6px; transition: width .8s cubic-bezier(.2,.8,.2,1); width: 0; }
.bars .bar-row .n { width: 26px; text-align: right; font-weight: 700; }
.chart-box { position: relative; height: 210px; }

.search {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--line);
  border-radius: 14px; padding: 0 12px; height: 48px; margin-bottom: 12px;
}
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(23,107,135,.1); }
.search input { flex: 1; border: 0; outline: none; font-size: 16px; background: transparent; min-width: 0; }
.search .ms { color: var(--muted); }

.t-list { display: flex; flex-direction: column; gap: 10px; }
.t-card {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; text-align: left;
  background: #fff; border: 1px solid rgba(220,231,234,.7); border-radius: 18px; box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .2s;
  animation: viewIn .35s both cubic-bezier(.2,.8,.2,1);
}
.t-card:active { transform: scale(.985); }
.t-thumb {
  width: 60px; height: 60px; border-radius: 15px; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, var(--surface), #D3ECEA);
  display: flex; align-items: center; justify-content: center; color: var(--secondary);
}
.t-thumb img { width: 100%; height: 100%; object-fit: cover; }
.t-body { flex: 1; min-width: 0; }
.t-id { font-weight: 800; font-size: 15px; letter-spacing: .2px; }
.t-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 1px 0 6px; }
.t-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.t-right { text-align: right; flex-shrink: 0; }
.t-right .w { font-weight: 800; font-size: 15px; }
.t-right .w small { font-size: 11px; color: var(--muted); font-weight: 600; }
.t-right .g { font-size: 11.5px; font-weight: 700; margin-top: 2px; }
.g.up { color: var(--health); } .g.down { color: var(--danger); }

.list-meta { display: flex; justify-content: space-between; align-items: center; margin: 4px 2px 10px; font-size: 13px; color: var(--muted); }
.list-meta select { border: 0; background: transparent; font-weight: 700; color: var(--primary); font-size: 13px; outline: none; }

.hero-photo {
  position: relative; margin: -14px -16px 0; height: 270px; overflow: hidden;
  background: linear-gradient(135deg, #1B7290, #3FA29D);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; transition: opacity .4s, filter .4s; }
.hero-photo img.blur { filter: blur(8px); transform: scale(1.06); }
.hero-photo .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.55); }
.hero-photo .ph .ms { font-size: 84px; }
.hero-photo::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.05) 40%, rgba(10,35,45,.78));
}
.hero-info { position: absolute; left: 16px; right: 16px; bottom: 40px; z-index: 2; color: #fff; }
.hero-info .id { font-size: 26px; font-weight: 800; letter-spacing: .3px; }
.hero-info .sub { opacity: .92; font-size: 14px; margin-top: 2px; }
.hero-info .badges { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.hero-info .badge { background: rgba(255,255,255,.92); }

.actions-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: -26px 0 6px; position: relative; z-index: 3; }
.act {
  background: #fff; border: 0; border-radius: 16px; padding: 10px 2px 8px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--text);
}
.act .ms { color: var(--primary); font-size: 24px; }
.act:active { transform: scale(.94); }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.kv > div { padding: 11px 2px; border-bottom: 1px solid #EEF3F5; }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv .k { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 5px; }
.kv .k .ms { font-size: 15px; }
.kv .v { font-size: 14.5px; font-weight: 700; margin-top: 2px; word-break: break-word; }
.kv .full { grid-column: 1 / -1; }

.summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.summary-strip > div { background: var(--surface); border-radius: 14px; padding: 10px; text-align: center; }
.summary-strip b { display: block; font-size: 17px; font-weight: 800; color: var(--primary); }
.summary-strip span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.summary-strip .hl { background: var(--primary); }
.summary-strip .hl b, .summary-strip .hl span { color: #fff; }

.archived-banner {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px;
  background: var(--warn-50); color: #7A5310; margin-top: 12px;
}

.tpick {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-align: left;
  background: #fff; border: 1.5px solid var(--line); border-radius: 16px; margin-bottom: 14px;
  transition: border-color .15s;
}
.tpick:active { border-color: var(--primary); }
.tpick .t-thumb { width: 46px; height: 46px; border-radius: 12px; }
.tpick .lbl { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.tpick .nm { font-weight: 800; font-size: 15px; }
.tpick .sw { color: var(--primary); font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 2px; }

.mini-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mini {
  background: #fff; border-radius: 16px; padding: 12px 14px; border: 1px solid rgba(220,231,234,.7); box-shadow: var(--shadow);
}
.mini .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.mini .v { font-size: 19px; font-weight: 800; margin-top: 2px; letter-spacing: -.3px; }
.mini .v small { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.mini.hl { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; border: 0; }
.mini.hl .k, .mini.hl .v small { color: rgba(255,255,255,.85); }
.formula { font-size: 12px; color: var(--muted); background: var(--surface); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }

.rec {
  display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #EEF3F5; align-items: flex-start;
}
.rec:last-child { border-bottom: 0; }
.rec .ic { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rec .ic.b { background: var(--primary-50); color: var(--primary); }
.rec .ic.k { background: var(--health-50); color: var(--health); }
.rec .ic.v { background: var(--secondary-50); color: var(--secondary); }
.rec .body { flex: 1; min-width: 0; }
.rec .top { display: flex; align-items: baseline; gap: 8px; }
.rec .top b { font-size: 14.5px; }
.rec .top .date { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.rec .desc { font-size: 13px; color: var(--muted); margin-top: 3px; word-break: break-word; }
.rec .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.rec .more { margin: -6px -8px 0 0; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ill {
  width: 92px; height: 92px; border-radius: 30px; background: var(--surface); color: var(--secondary);
  margin: 0 auto 14px; display: flex; align-items: center; justify-content: center;
}
.empty .ill .ms { font-size: 46px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.skel {
  border-radius: 14px; background: linear-gradient(90deg, #EDF2F4 0%, #F7FAFB 50%, #EDF2F4 100%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite linear;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.backdrop {
  position: fixed; inset: 0; z-index: 90; background: rgba(15, 35, 45, .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .2s ease;
}
.backdrop.center { align-items: center; padding: 20px; }
.backdrop.closing { animation: fadeOut .2s ease forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
.sheet {
  width: 100%; max-width: 480px; max-height: 92vh; background: #fff;
  border-radius: 26px 26px 0 0; display: flex; flex-direction: column;
  animation: sheetUp .32s cubic-bezier(.2,.8,.2,1);
  padding-bottom: var(--safe-b);
}
.backdrop.closing .sheet { animation: sheetDown .22s ease forwards; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetDown { to { transform: translateY(100%); } }
.sheet .grab { width: 42px; height: 5px; border-radius: 3px; background: #D5DFE3; margin: 10px auto 2px; flex-shrink: 0; }
.sheet .sheet-head { display: flex; align-items: center; gap: 6px; padding: 6px 10px 10px 18px; flex-shrink: 0; }
.sheet .sheet-head h3 { flex: 1; font-size: 17px; font-weight: 800; }
.sheet .sheet-body { padding: 4px 18px 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet .sheet-foot { padding: 12px 18px 16px; border-top: 1px solid var(--line); flex-shrink: 0; }
.modal {
  width: 100%; max-width: 400px; background: #fff; border-radius: 24px; padding: 22px;
  animation: pop .28s cubic-bezier(.2,.9,.3,1.2); max-height: 90vh; overflow-y: auto;
}
.backdrop.closing .modal { animation: fadeOut .2s forwards; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.modal .m-icon { width: 60px; height: 60px; border-radius: 20px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; }
.modal .m-icon .ms { font-size: 32px; }
.modal h3 { text-align: center; font-size: 18px; font-weight: 800; }
.modal p { text-align: center; color: var(--muted); margin: 8px 0 18px; }

.opt-list { display: flex; flex-direction: column; }
.opt {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px; border: 0; background: none; text-align: left;
  border-bottom: 1px solid #EEF3F5; width: 100%; font-size: 14.5px;
}
.opt:last-child { border-bottom: 0; }
.opt .ms.go { margin-left: auto; color: #A8B6C0; }
.opt .grow small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.opt.danger { color: var(--danger); }
.opt:active { background: #F6FAFB; }
.opt mark { background: #FFF1B8; color: inherit; border-radius: 3px; padding: 0 1px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.crumbs button { border: 0; background: var(--surface); color: var(--primary); font-weight: 700; font-size: 12px; padding: 5px 10px; border-radius: 14px; }

.loader-ov {
  position: fixed; inset: 0; z-index: 120; background: rgba(247,250,252,.7);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; animation: fadeIn .15s;
}
.loader-box { background: #fff; border-radius: 20px; padding: 22px 26px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 170px; }
.loader-box span { font-weight: 600; font-size: 14px; color: var(--muted); }
.spin {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3.5px solid var(--surface); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast-root { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 150; width: calc(100% - 28px); max-width: 440px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px;
  background: #243746; color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600;
  animation: toastIn .3s cubic-bezier(.2,.9,.3,1.2); pointer-events: auto;
}
.toast.ok { background: var(--health); }
.toast.err { background: var(--danger); }
.toast.out { animation: toastOut .25s forwards; }
@keyframes toastIn { from { transform: translateY(-20px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-20px); opacity: 0; } }

.photo-box {
  border: 2px dashed #C7D8DE; border-radius: 18px; background: #FAFCFD; padding: 18px;
  text-align: center; margin-bottom: 14px;
}
.photo-box .ill { width: 58px; height: 58px; border-radius: 18px; background: var(--surface); color: var(--secondary); display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.photo-preview { position: relative; border-radius: 18px; overflow: hidden; margin-bottom: 14px; aspect-ratio: 4/3; background: #EEF3F5; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview .tools { position: absolute; right: 10px; top: 10px; display: flex; gap: 8px; }
.photo-preview .tools button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }

.qr-card { background: var(--surface); border-radius: 20px; padding: 14px; text-align: center; }
.qr-card img { margin: 0 auto; width: 100%; max-width: 260px; border-radius: 14px; box-shadow: var(--shadow); }
.success-ic { width: 66px; height: 66px; border-radius: 50%; background: var(--health-50); color: var(--health); display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; animation: pop .4s cubic-bezier(.2,.9,.3,1.4); }
.success-ic .ms { font-size: 38px; }

.scan-wrap { position: relative; border-radius: 24px; overflow: hidden; background: #0E2A35; aspect-ratio: 1/1; box-shadow: var(--shadow-lg); }
.scan-wrap #reader { width: 100%; height: 100%; }
.scan-wrap #reader video { object-fit: cover; width: 100% !important; height: 100% !important; }
.scan-wrap #reader img[alt="Info icon"], .scan-wrap #reader > div:not([id]) { display: none !important; }
.scan-frame { position: absolute; inset: 15%; pointer-events: none; z-index: 2; }
.scan-frame i { position: absolute; width: 34px; height: 34px; border: 4px solid #fff; border-radius: 4px; }
.scan-frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.scan-frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.scan-frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.scan-frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.scan-line { position: absolute; left: 8%; right: 8%; height: 3px; background: linear-gradient(90deg, transparent, #6FE3DA, transparent); box-shadow: 0 0 12px #6FE3DA; animation: scanline 2.2s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { top: 6%; } 50% { top: 92%; } }
.scan-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #D6EEF0; padding: 28px; gap: 10px; z-index: 1; }
.scan-msg .ms { font-size: 48px; opacity: .8; }

.pub-card { background: #fff; border-radius: 26px; overflow: hidden; box-shadow: var(--shadow-lg); }
.pub-card .photo { height: 240px; position: relative; background: linear-gradient(135deg, #1B7290, #3FA29D); }
.pub-card .photo img { width: 100%; height: 100%; object-fit: cover; }
.pub-card .photo .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.6); }
.pub-card .photo .ph .ms { font-size: 80px; }
.pub-card .verified { position: absolute; left: 14px; top: 14px; background: rgba(255,255,255,.94); color: var(--primary); padding: 6px 11px; border-radius: 20px; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.pub-card .inner { padding: 18px; }
.pub-card .id { font-size: 25px; font-weight: 800; }

.divider { height: 1px; background: var(--line); margin: 16px 0; }
.info-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--primary-50); color: var(--primary-dark); font-size: 13px; align-items: flex-start; }
.info-note .ms { font-size: 20px; }
.info-note.warn { background: var(--warn-50); color: #7A5310; }
.est-box { background: var(--surface); border-radius: 13px; padding: 10px 14px; font-size: 13px; margin: -4px 0 14px; display: flex; gap: 8px; align-items: center; }
.est-box .ms { color: var(--primary); font-size: 19px; }
.table-scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 700; padding: 8px 8px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 10px 8px; border-bottom: 1px solid #EEF3F5; vertical-align: top; }
table.tbl td.num, table.tbl th.num { text-align: right; white-space: nowrap; }
.kbd-gap { height: 8px; }

.acct { padding: 22px 20px 40px; text-align: center; }
.acct h2 { font-size: 22px; font-weight: 800; margin: 4px 0 8px; }
.acct > p { margin: 0 auto 18px; max-width: 380px; }
.acct .card, .acct form, .acct .info-note { text-align: left; }
.acct-ill { width: 96px; height: 96px; border-radius: 32px; margin: 8px auto 16px; display: flex; align-items: center; justify-content: center; background: var(--primary-50); color: var(--primary); animation: pop .4s cubic-bezier(.2,.9,.3,1.4); }
.acct-ill .ms { font-size: 50px; }
.acct-ill.warn { background: var(--warn-50); color: var(--warn); }
.acct-ill.bad { background: var(--danger-50); color: var(--danger); }
.acct-ill.ok { background: var(--health-50); color: var(--health); }
a.btn { text-decoration: none; }
span.brand { cursor: default; }
.admin-pending { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; position: relative; z-index: 1; }
.admin-pending b { font-size: 36px; font-weight: 800; line-height: 1; }
.admin-pending span { font-size: 13.5px; opacity: .92; }
.u-card .avatar { width: 48px; height: 48px; font-size: 16px; flex-shrink: 0; }
.u-card > .ms { color: #A8B6C0; }
.admin-actions { display: flex; flex-direction: column; gap: 10px; }
.modal .info-note { text-align: left; }

@media (min-width: 520px) {
  body { padding: 0; }
  .app { border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.scan-tools { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.landing-actions .link-btn { align-self: center; display: inline-flex; align-items: center; gap: 4px; }

.fab { position: fixed; z-index: 35; width: 58px; height: 58px; border-radius: 18px; border: 0; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(23,107,135,.35);
  right: max(16px, calc(50vw - 240px + 16px)); bottom: calc(var(--nav-h) + var(--safe-b) + 16px); transition: transform .12s; }
.fab .ms { font-size: 30px; }
.fab:active { transform: scale(.93); }
.seg.seg-sm { margin-bottom: 10px; }
.seg.seg-sm button { height: 34px; font-size: 12.5px; }
.seg.seg-sm button .ms { font-size: 17px; }
.price-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #EEF3F5; }
.price-row:last-child { border-bottom: 0; }
.price-row b { font-size: 14.5px; }
.price-row .w { font-weight: 800; font-size: 15px; white-space: nowrap; }
.price-row .w small { font-size: 11px; color: var(--muted); font-weight: 600; }
.delta { font-size: 11.5px; font-weight: 700; margin-top: 2px; white-space: nowrap; }
.delta.up { color: var(--health); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--muted); }
.pg-title { font-weight: 700; font-size: 13px; color: var(--primary); display: flex; gap: 6px; align-items: center; margin: 16px 0 8px; }
.pg-title .ms { font-size: 18px; }
.sup-card.tap { cursor: pointer; }
.sup-card.tap:active { transform: scale(.99); }
.sup-ic { width: 42px; height: 42px; border-radius: 13px; color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sup-name { font-size: 15px; display: block; }
.sup-meta { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--muted); margin-top: 8px; }
.sup-meta .ms { font-size: 16px; margin-top: 1px; }
.btn-wa { background: #25D366; color: #fff; }
.km-row { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid #EEF3F5; font-size: 14.5px; }
.loc-out { font-size: 12.5px; color: var(--health); margin-top: 6px; }
.loc-out a { font-weight: 700; }
.rec .ic.log-error { background: var(--danger-50); color: var(--danger); }
.rec .ic.log-warn { background: var(--warn-50); color: var(--warn); }
.grid2 > *, .grid3 > * { min-width: 0; }
input[type=date].input { min-width: 0; padding-right: 8px; }
