:root {
  --bronze: #7415E8;
  --ink: #16151c;
  --muted: #7a7690;
  --cream: #faf8f5;
  --card: #ffffff;
  --border: #eceaf3;
  --header: #141210;
  --brand: #6b63d8;
  --brand-soft: #f3f0ff;
  --bg: #f4f6fb;
  --font-sans: "Manrope", system-ui, sans-serif;
  --font-serif: "Manrope", system-ui, sans-serif;
  --avent-1: #7415E8;
  --avent-2: #C026D3;
  --avent-3: #FF8500;
  --avent-ink: #421078;
  --avent-gradient: linear-gradient(100deg, var(--avent-1) 0%, var(--avent-2) 50%, var(--avent-3) 100%);
  --avent-shadow: 0 5px 20px rgba(164, 35, 210, 0.25);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  min-height: 100%;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--cream);
}
body.m-app {
  background: var(--bg);
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
  color: var(--ink);
}
html:has(body.m-inner),
body.m-inner {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
body.m-inner {
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}
body.mobile-login { background: var(--bg); padding-bottom: 0; }
[hidden] { display: none !important; }

.m-login {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 18px 40px;
  background: var(--bg);
}
.m-logo {
  height: 88px;
  width: 88px;
  object-fit: contain;
  border-radius: 22px;
  margin-bottom: 18px;
  box-shadow: 0 12px 28px rgba(20, 18, 16, .16);
}
.m-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px 22px 20px;
  box-shadow: 0 16px 40px rgba(36, 32, 56, .06);
}
.m-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.m-sub, .m-help, .m-empty, .m-role { color: var(--muted); font-size: 13.5px; }
.m-sub { margin: 4px 0 14px; }
.m-card label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.m-card input[type="email"],
.m-card input[type="password"],
.m-card input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  margin-bottom: 10px;
  background: #fff;
}
.otp-block[hidden] { display: none; }
.m-check { display: flex; gap: 8px; align-items: center; font-weight: 500; margin-bottom: 12px; }
.m-btn {
  width: 100%;
  border: 0;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
}
.m-err { color: #a33; font-size: 13px; margin-bottom: 10px; }

.m-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
body.m-inner .m-bar {
  position: sticky;
  flex: 0 0 auto;
}
.m-page {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.m-back-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  text-decoration: none;
}
.m-back-btn svg { width: 20px; height: 20px; }
.m-bar-copy { min-width: 0; }
.m-bar-copy h1 {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-bar-copy p { color: var(--muted); font-size: 12px; margin-top: 2px; }

.m-dash-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(16px + env(safe-area-inset-top)) 20px 0;
}
.m-brand-logo {
  height: 40px;
  width: 40px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}
.m-text-btn {
  background: var(--brand-soft);
  border: 0;
  color: var(--brand);
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 999px;
}
.m-hero {
  margin: 14px 16px 8px;
  padding: 22px 20px 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f0ff 100%);
  box-shadow: 0 10px 28px rgba(36, 32, 56, .05);
}
.m-hero-date {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand);
}
.m-greet { font-size: 15px; color: var(--muted); margin: 8px 0 2px; }
.m-hero h1 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin: 0 0 12px; }
.m-role-chip {
  display: inline-block;
  background: #fff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 999px;
}

.m-push-card {
  margin: 14px 16px 6px;
  background: #fff;
  border: 1px solid #ece8ff;
  border-radius: 20px;
  padding: 14px 14px 14px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px 12px;
  align-items: center;
  box-shadow: 0 10px 28px rgba(36, 32, 56, .05);
}
.m-push-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
}
.m-push-icon svg { width: 20px; height: 20px; display: block; }
.m-push-card .m-help { margin: 3px 0 0; }
.m-push-card .m-ios-tip { grid-column: 1 / -1; margin: 0; font-size: 12px; color: var(--muted); }
.m-btn-sm { width: auto; padding: 9px 14px; border-radius: 999px; font-size: 13px; }

.m-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px 16px 8px;
}
.m-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 154px;
  background: var(--tile, #fff);
  border-radius: 22px;
  padding: 16px 15px 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 10px 28px rgba(36, 32, 56, .05);
}
.m-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 18px;
}
.m-tile-icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #fff;
  color: var(--ink, var(--brand));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(36, 32, 56, .08);
}
.m-tile-icon svg { width: 26px; height: 26px; display: block; }
.m-tile-go {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink, var(--brand));
  display: flex;
  align-items: center;
  justify-content: center;
}
.m-tile-go svg { width: 14px; height: 14px; display: block; }
.m-tile strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
}
.m-tile-hint { color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: 4px; }
.m-tile-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  font-style: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.m-list, .m-facts { padding: 14px 16px 8px; display: grid; gap: 10px; }
.m-item, .m-fact, .m-empty-card, .m-panel {
  background: #fff;
  border-radius: 18px;
  padding: 15px 16px;
  box-shadow: 0 8px 24px rgba(36, 32, 56, .05);
  color: inherit;
  text-decoration: none;
}
.m-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.m-item strong, .m-fact dd { font-size: 15px; font-weight: 800; }
.m-item span, .m-note button span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin-top: 4px;
}
.m-pill {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  font-style: normal;
  padding: 4px 8px;
  border-radius: 999px;
}
.m-pill.is-on { background: #e8f6ee; color: #1f7a46; }
.m-pill.is-off { background: #ffe8e8; color: #c24141; }
.m-empty-card { color: var(--muted); text-align: center; padding: 28px 16px; }
.m-note { padding: 0; }
.m-note button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 15px 16px;
}
.m-note.is-unread { box-shadow: 0 8px 24px rgba(107, 99, 216, .12); }

.m-fact dt { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.m-fact dd a { color: var(--brand); font-weight: 800; text-decoration: none; }

.m-panel { margin: 14px 16px; }
.m-panel h2 { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.m-form label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin: 10px 0 6px; }
.m-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
  background: #f8f7fc;
}
.m-form .m-btn { margin-top: 14px; }
.m-flash {
  margin: 12px 16px 0;
  background: #e7f6ed;
  color: #1f7a46;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}
.m-month-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.m-month-row select {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  font: inherit;
  background: #f8f7fc;
}
.m-cal-legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.m-cal-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  margin-right: 4px;
}
.m-cal-legend .is-work, .m-cal-day.is-work { background: #d9f3e3; }
.m-cal-legend .is-half, .m-cal-day.is-half { background: #ffe7c2; }
.m-cal-legend .is-off, .m-cal-day.is-off { background: #ffd4d4; }
.m-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.m-cal-dow { text-align: center; font-size: 11px; color: var(--muted); font-weight: 700; }
.m-cal-day {
  min-height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
}
.m-cal-day.is-future { color: #c5c5c5; }
.m-cal-day.is-today { outline: 2px solid var(--brand); }
.m-day-view { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.m-day-view strong { display: block; margin-bottom: 8px; }
.m-day-view p { margin: 0 0 8px; font-size: 13px; }
.m-day-view span { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.m-panel .m-row { padding: 12px 0; border-top: 1px solid var(--border); }
.m-panel .m-row:first-of-type { border-top: 0; padding-top: 0; }
.m-panel .m-row strong { display: block; font-size: 14px; }
.m-panel .m-row span, .m-panel .m-row em { display: block; color: var(--muted); font-size: 13px; font-style: normal; margin-top: 3px; }
.m-confirm {
  position: fixed;
  inset: 0;
  background: rgba(22, 21, 28, .35);
  display: grid;
  place-items: end center;
  padding: 16px;
  z-index: 40;
}
.m-confirm-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 22px;
  padding: 20px 18px 16px;
  box-shadow: 0 16px 40px rgba(36, 32, 56, .16);
}
.m-confirm-card h2 { font-size: 20px; font-weight: 800; }
.m-confirm-card p { color: var(--muted); font-size: 14px; margin: 6px 0 16px; }
.m-confirm-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }

/* ========== Avent gradient buttons (mobile) ========== */
.avent-wrapper {
  position: relative;
  display: inline-flex;
  padding: 1.5px;
  border-radius: 999px;
  isolation: isolate;
  overflow: hidden;
  vertical-align: middle;
  max-width: 100%;
}
.avent-wrapper--block {
  display: flex;
  width: 100%;
}
.avent-wrapper:has([hidden]),
.avent-wrapper:has([aria-hidden="true"]),
.avent-wrapper:has([style*="display: none"]),
.avent-wrapper:has([style*="display:none"]) {
  display: none !important;
}
.avent-wrapper::before {
  content: "";
  position: absolute;
  inset: -150%;
  background: conic-gradient(
    from 0deg,
    #ffffff 0deg,
    #FF8500 10deg,
    #C026D3 24deg,
    #7415E8 40deg,
    transparent 64deg,
    transparent 360deg
  );
  opacity: 0;
  z-index: -1;
  pointer-events: none;
  transform: rotate(0deg);
  transform-origin: center center;
  will-change: transform;
}
.avent-wrapper.active::before,
.avent-wrapper:has(:active)::before {
  opacity: 1;
  animation: aventRotate 1.2s linear infinite;
  animation-direction: normal;
}
@keyframes aventRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.m-btn,
.avent-btn {
  position: relative;
  z-index: 1;
  border: none !important;
  border-radius: 999px !important;
  background: var(--avent-gradient) !important;
  color: #ffffff !important;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: var(--avent-shadow);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.m-btn:hover,
.avent-btn:hover {
  transform: none;
  box-shadow: var(--avent-shadow);
}
.m-btn:active,
.avent-btn:active {
  transform: scale(0.97);
}
.m-btn:focus-visible,
.avent-btn:focus-visible {
  outline: 3px solid var(--avent-2);
  outline-offset: 6px;
}
.avent-wrapper > .m-btn,
.avent-wrapper > .avent-btn {
  width: 100%;
  flex: 1 1 auto;
}
@media (prefers-reduced-motion: reduce) {
  .avent-wrapper.active::before { animation: none; }
  .m-btn, .avent-btn { transition: none; }
}
