/* Application shell and resident dashboard */
:root {
  color-scheme: light;
  --ink: #292635;
  --green: #6947d7;
  --deep: #43316e;
  --orange: #d07836;
  --cream: #f7f7fb;
  --paper: #fff;
  --muted: #777383;
  --line: #e7e5ed;
  --serif: "Inter", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --violet: #6947d7;
  --light-violet: #f0ecfc;
  --surface-shadow: 0 3px 12px rgb(47 36 83 / 3%);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  background: var(--cream);
  color: var(--ink);
}

body { background: var(--cream); }
#mode-tag { font-size: 11px; color: #60439e; background: #f1edfc; border-radius: 6px; padding: 5px 7px; white-space: nowrap; }
#mode-tag[hidden] { display: none; }
@media(max-width:830px){.mast-in:has(#mode-tag:not([hidden])) {gap:7px;}#mode-tag{font-size:10px;padding:4px;}}
::selection { background: #dfd6ff; color: #30205e; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #a18bea;
  outline-offset: 3px;
}
.container, .mast-in { width: min(calc(100% - 96px), 1240px); }
.mast { background: #fff; border-bottom: 1px solid var(--line); }
.mast-in { min-height: 76px; gap: 20px; }
.brand { gap: 10px; }
.brand-mark { width: 40px; height: 40px; color: var(--violet); }
.brand-name { font-size: 21px; color: #2f293e; font-weight: 800; letter-spacing: 1px; }
.brand-name small { font: 700 8px/1.6 "Inter", Arial, sans-serif; letter-spacing: 1.65px; color: #817b91; }
.mast nav { align-items: center; gap: 8px; }
.mast nav a {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  font-size: 14px;
  letter-spacing: 0;
  font-weight: 560;
  color: #666474;
  border-radius: 11px;
}
.mast nav a.active { color: #6243ca; background: #f1edfd; }
.mast nav a.active::after { display: none; }
.mast nav a:hover, .mast-account:hover, .bell-btn:hover { background: #f5f3fa; }
.mast-tools { gap: 13px; }
.mast-line { height: 24px; border-color: #e5e2ec; }
.bell-btn { display: grid; place-items: center; border-radius: 12px; color: #575164; }
.bell-btn i { background: #ef916b; top: 5px; right: 5px; }
.mast-account { display: flex; align-items: center; padding: 3px 5px; gap: 9px; border-radius: 22px; }
.mast-account .avatar { width: 33px; height: 33px; background: #ede6ff; color: #6642c9; font: 700 15px/1 var(--serif); border: 1px solid #e4dcfa; }
.mast-resident { color: #454050; font-weight: 650; font-size: 13px; }

.view-home { padding-bottom: 50px; }
.portal-intro { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 26px 0 21px; }
.portal-intro h1 { display: flex; align-items: center; gap: 10px; font-size: clamp(27px, 2.5vw, 37px); font-weight: 760; letter-spacing: -.9px; line-height: 1.32; color: #262333; }
.portal-intro p { color: #777381; font-size: 13px; margin-top: 5px; font-variant-numeric: tabular-nums; }
.hello-sun { display: inline-flex; color: #e9a145; }
.portal-location {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 13px;
  background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--surface-shadow);
  font-size: 13px; font-weight: 650; color: #514b61;
}
.portal-location svg:first-child { color: var(--violet); }
.portal-features { display: grid; grid-template-columns: minmax(0,2.45fr) minmax(260px,1fr); gap: 20px; }
.portal-hero, .resident-pass { min-height: 254px; border-radius: 21px; overflow: hidden; isolation: isolate; position: relative; }
.portal-hero {
  background: linear-gradient(110deg,#eee6fc 6%,#e6d8fb 55%,#c4a4ee);
  display: flex; align-items: center;
}
.portal-hero-art { position: absolute; inset: 0; z-index: -1; background: url("./assets/neighborhood.webp") right center / auto 100% no-repeat; mask-image: linear-gradient(90deg,transparent,black 48%); }
.portal-hero-copy { padding: 25px clamp(22px,2.7vw,40px); }
.promo-kicker {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 8px;
  background: #ffffffa8; color: #6641a9; font-size: 11px; line-height: 1.25; font-weight: 700; letter-spacing: .35px;
}
.portal-hero h2 { font-size: clamp(31px,3.1vw,46px); line-height: 1.19; letter-spacing: -1.4px; margin: 13px 0 8px; color: #32224b; font-weight: 800; }
.portal-hero-copy > p { font-size: 14px; line-height: 1.65; color: #675575; max-width: 300px; }
.promo-detail::before { content: "，"; }
.promo-actions { display: flex; align-items: center; gap: 15px; margin-top: 23px; }
.promo-actions a {
  display: inline-flex; align-items: center; gap: 13px; padding: 10px 15px;
  border-radius: 10px; background: #6a47d5; color: #fff; box-shadow: 0 3px 8px #5230a522;
  font-size: 13px; font-weight: 670; line-height: 1.4;
}
.promo-actions a:hover { background: #5936c0; }
.promo-actions span { display: inline-flex; gap: 5px; align-items: center; font-size: 11px; color: #6b5781; font-weight: 550; }
.resident-pass {
  background: linear-gradient(118deg,#443265 0%,#4f3b79 60%,#6c5398 120%);
  color: #fff; padding: 24px 25px; display: flex; flex-direction: column; justify-content: space-between;
}
.pass-lines { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.pass-lines::before, .pass-lines::after {
  content: ""; position: absolute; width: 130%; height: 130%; border-radius: 48%;
  border: 1px solid #cbbde122; transform: rotate(-33deg); right: -75%; top: -17%;
  background: repeating-radial-gradient(ellipse at center,transparent 0 16px,#e1d3ff29 16.5px 17px,transparent 17.5px 27px);
}
.pass-lines::after { right: -45%; top: 63%; transform: rotate(-26deg); }
.pass-top, .pass-top > span, .pass-title, .pass-details p, .pass-actions, .pass-open, .pass-visit, .pass-verified { display: flex; align-items: center; }
.pass-top { justify-content: space-between; color: #eadffb; }
.pass-top > span { gap: 9px; font-weight: 600; font-size: 13px; }
.pass-top > svg { color: #decef1; transform: rotate(1deg); }
.pass-details { padding: 16px 0; }
.pass-title { gap: 10px; flex-wrap: wrap; }
.pass-title h2 { font-size: clamp(23px,2.1vw,30px); letter-spacing: .3px; font-weight: 700; }
.pass-verified { gap: 3px; padding: 3px 6px; border-radius: 6px; background: #ffffff20; color: #f1e8fb; font-size: 10px; }
.pass-details p { gap: 5px; color: #d9cee7; margin-top: 8px; font-size: 12px; }
.pass-actions { justify-content: space-between; gap: 12px; padding-top: 15px; border-top: 1px solid #e7ddfa2f; }
.pass-open { gap: 8px; color: #49356e; background: #f5efff; font-weight: 700; font-size: 13px; padding: 9px 12px; border-radius: 9px; }
.pass-open:hover { background: white; }
.pass-visit { gap: 2px; color: #f2eafa; font-size: 12px; }
.portal-panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--surface-shadow); }
.portal-services { margin-top: 20px; padding: 20px 23px 18px; }
.portal-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.portal-heading h2 { font-weight: 740; font-size: 20px; letter-spacing: -.45px; line-height: 1.45; }
.portal-heading > a { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #716a80; min-height: 30px; }
.portal-heading > a:hover { color: var(--violet); }
.portal-grid { display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); gap: 4px; margin: 12px -4px 0; }
.portal-grid > a { display: flex; flex-direction: column; gap: 9px; align-items: center; justify-content: center; min-width: 0; padding: 7px 2px; border-radius: 12px; }
.portal-grid > a:hover { background: #f8f7fc; }
.portal-grid strong { font-size: 14px; font-weight: 600; color: #4b4559; }
.quick-symbol { width: 47px; height: 47px; display: grid; place-items: center; border-radius: 15px; transition: transform .16s; }
.portal-grid a:hover .quick-symbol { transform: translateY(-2px); }
.quick-symbol.iris { color: #7854d7; background: #eee8fc; }
.quick-symbol.sky { color: #5084d2; background: #e8f0ff; }
.quick-symbol.amber { color: #d58b40; background: #fbeedb; }
.quick-symbol.teal { color: #389b87; background: #e1f2ee; }
.quick-symbol.rose { color: #cc7390; background: #f9e9ee; }
.quick-symbol.grape { color: #8c69c9; background: #f0eafb; }
.quick-symbol.jade { color: #5f977e; background: #e6f1e7; }
.quick-symbol.blue { color: #5d85b6; background: #e8eff9; }
.portal-updates { display: grid; grid-template-columns: 1.17fr 1fr; gap: 20px; margin-top: 20px; }
.bulletin-panel, .portal-event-panel { padding: 19px 23px 15px; min-width: 0; }
.bulletins { margin-top: 7px; }
.bulletin-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.bulletin-row + .bulletin-row { border-top: 1px solid #efedf3; }
.bulletin-icon { flex-shrink: 0; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #7660aa; background: #f1ecfa; }
.bulletin-1 { color: #b47f53; background: #fcf0e5; }
.bulletin-2 { color: #538b81; background: #e8f3f1; }
.bulletin-content { display: grid; gap: 3px; min-width: 0; }
.bulletin-content strong { color: #3f394c; font-size: 14px; font-weight: 630; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulletin-content small { color: #80798b; font-size: 11px; }
.bulletin-row time { margin-left: auto; color: #847d90; font-size: 11px; font-variant-numeric: tabular-nums; }
.bulletin-row > svg { color: #a7a0b2; }
.portal-event { display: flex; align-items: stretch; min-height: 155px; gap: 20px; margin-top: 14px; }
.event-photo { width: 44%; border-radius: 12px; overflow: hidden; flex-shrink: 0; }
.event-photo img { width: 100%; height: 100%; max-height: 174px; object-fit: cover; }
.event-caption { display: flex; flex-direction: column; justify-content: center; align-items: start; }
.garden-tag, .event-caption p, .event-action { display: inline-flex; align-items: center; gap: 5px; }
.garden-tag { padding: 3px 7px; color: #3d816c; background: #e9f5ed; border-radius: 5px; font-size: 10px; }
.event-caption h3 { margin: 9px 0 7px; color: #352f40; font-size: clamp(16px,1.45vw,21px); line-height: 1.4; font-weight: 710; }
.event-caption p { font-size: 12px; line-height: 1.8; color: #777182; }
.event-action { font-size: 12px; margin-top: 10px; color: var(--violet); font-weight: 650; gap: 7px; }
.portal-merchants { margin-top: 25px; }
.merchant-teasers { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-top: 12px; }
.merchant-teasers a { display: flex; align-items: center; gap: 15px; border: 1px solid var(--line); border-radius: 15px; background: #fff; padding: 10px; box-shadow: var(--surface-shadow); }
.merchant-teasers img { width: 82px; height: 64px; object-fit: cover; border-radius: 9px; }
.merchant-teasers h3 { font-size: 15px; font-weight: 650; color: #383142; }
.merchant-teasers p { font-size: 12px; margin-top: 5px; color: var(--muted); }
.merchant-teasers a > svg { margin-left: auto; margin-right: 5px; color: #968ca7; }
.bulletin-row:hover strong, .portal-event:hover h3, .merchant-teasers a:hover h3 { color: var(--violet); }

@media (max-width:1050px) {
  .container, .mast-in { width: calc(100% - 56px); }
  .mast nav { gap: 3px; }
  .mast nav a { padding: 9px 10px; }
  .portal-features { grid-template-columns: minmax(0,2.15fr) minmax(240px,1fr); gap: 15px; }
  .portal-hero, .resident-pass { min-height: 228px; }
  .portal-hero-copy { padding: 22px; }
  .portal-hero-copy > p { max-width: 245px; font-size: 13px; }
  .resident-pass { padding: 20px; }
  .portal-updates { grid-template-columns: 1.12fr 1fr; gap: 15px; }
  .portal-event { gap: 13px; }
  .bulletin-panel, .portal-event-panel { padding-left: 17px; padding-right: 17px; }
  .event-photo { width: 36%; }
}
@media (min-width:701px) and (max-width:830px) {
  .container, .mast-in { width: calc(100% - 40px); }
  .mast nav a { font-size: 13px; gap: 5px; padding: 9px 7px; }
  .mast nav a svg { display: none; }
  .mast-tools { gap: 7px; }
  .portal-features { grid-template-columns: minmax(0,1.8fr) minmax(215px,1fr); }
  .portal-hero-art { mask-image: linear-gradient(90deg,transparent 15%,#0002 35%,black 72%); }
  .promo-actions { align-items: start; flex-direction: column; gap: 7px; margin-top: 13px; }
  .portal-updates { grid-template-columns: 1fr 1fr; }
  .portal-event { gap: 10px; }
  .event-caption p { font-size: 11px; }
}
@media (max-width:700px) {
  .container, .mast-in { width: calc(100% - 32px); }
  .mast-in { min-height: 59px; }
  .mast nav { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { font-size: 18px; letter-spacing: .65px; }
  .brand-name small { font-size: 6.9px; letter-spacing: 1.45px; }
  .brand { gap: 8px; }
  .mast-tools { gap: 9px; }
  .mast-account { padding: 2px; }
  .mast-account .avatar { width: 31px; height: 31px; font-size: 14px; }
  .mast-resident { display: none; }
  .view-home { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .portal-intro { align-items: center; padding: 20px 0 15px; gap: 7px; }
  .portal-intro h1 { font-size: 25px; gap: 5px; letter-spacing: -.6px; }
  .portal-intro p { font-size: 11px; margin-top: 4px; }
  .hello-sun svg { width: 21px; height: 21px; }
  .portal-location { padding: 9px 10px; font-size: 11px; gap: 5px; border-radius: 10px; }
  .portal-features { grid-template-columns: 1fr; gap: 10px; }
  .portal-hero, .resident-pass { border-radius: 16px; }
  .portal-hero { min-height: 178px; }
  .portal-hero-art { background-size: auto 100%; background-position: right -25px center; mask-image: linear-gradient(90deg,transparent 26%,#0001 41%,#0006 55%,#000 73%); }
  .portal-hero-copy { padding: 18px; width: 100%; }
  .promo-kicker { padding: 3px 6px; font-size: 9px; gap: 4px; border-radius: 5px; }
  .promo-kicker svg { width: 12px; height: 12px; }
  .portal-hero h2 { font-size: 30px; margin: 8px 0 5px; letter-spacing: -.95px; }
  .portal-hero-copy > p { font-size: 11px; max-width: 160px; line-height: 1.55; }
  .promo-detail { display: block; }
  .promo-detail::before { content: ""; }
  .promo-actions { margin-top: 12px; gap: 7px; align-items: start; flex-direction: column; }
  .promo-actions a { font-size: 12px; padding: 8px 12px; gap: 9px; border-radius: 8px; }
  .promo-actions a svg { width: 13px; height: 13px; }
  .promo-actions span { font-size: 9px; gap: 3px; }
  .promo-actions span svg { width: 11px; height: 11px; }
  .resident-pass { min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; padding: 12px 15px; column-gap: 8px; }
  .pass-top { grid-column: 1; }
  .pass-top > span { gap: 5px; font-size: 10px; color: #ddd0ec; }
  .pass-top > span svg { width: 13px; height: 13px; }
  .pass-top > svg, .pass-visit { display: none; }
  .pass-details { padding: 3px 0 0; }
  .pass-title { gap: 6px; }
  .pass-title h2 { font-size: 18px; }
  .pass-details p { font-size: 10px; margin-top: 2px; }
  .pass-details p svg { display: none; }
  .pass-verified { font-size: 9px; padding: 2px 5px; }
  .pass-verified svg { width: 10px; height: 10px; }
  .pass-actions { grid-column: 2; grid-row: 1/3; padding: 0; border: 0; }
  .pass-open { padding: 10px; min-height: 40px; gap: 5px; font-size: 12px; }
  .pass-open svg:last-child { display: none; }
  .portal-panel { border-radius: 15px; }
  .portal-services { padding: 12px 13px 10px; margin-top: 12px; }
  .portal-heading h2 { font-size: 18px; }
  .portal-heading > a { font-size: 10px; min-height: 27px; }
  .portal-heading > a svg { width: 12px; height: 12px; }
  .portal-grid { grid-template-columns: repeat(4,minmax(0,1fr)); row-gap: 5px; margin: 3px -4px 0; }
  .portal-grid > a { padding: 5px 1px; gap: 5px; }
  .quick-symbol { width: 37px; height: 37px; border-radius: 12px; }
  .quick-symbol svg { width: 22px; height: 22px; }
  .portal-grid strong { font-size: 12.5px; }
  .portal-updates { grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
  .bulletin-panel, .portal-event-panel { padding: 12px 14px; }
  .bulletins { margin-top: 4px; }
  .bulletin-row { gap: 9px; padding: 8px 0; }
  .bulletin-row:last-child { padding-bottom: 2px; }
  .bulletin-icon { width: 32px; height: 32px; border-radius: 9px; }
  .bulletin-content { gap: 1px; }
  .bulletin-content strong { font-size: 12px; }
  .bulletin-content small { font-size: 10px; }
  .bulletin-row time { font-size: 10px; }
  .portal-event { min-height: 125px; margin-top: 8px; gap: 15px; }
  .event-photo { width: 43%; }
  .event-photo img { max-height: 144px; }
  .event-caption h3 { font-size: 17px; }
  .event-caption p, .event-action { font-size: 11px; }
  .portal-merchants { margin-top: 16px; }
  .merchant-teasers { grid-template-columns: 1fr; gap: 8px; margin-top: 8px; }
  .merchant-teasers img { width: 69px; height: 50px; }
  #bottomnav { background: #ffffffed; border-color: #e8e5ee; box-shadow: 0 -4px 16px #30234806; }
  #bottomnav a { color: #746d82; font-size: 10px; gap: 3px; padding-top: 3px; }
  #bottomnav a.active { color: #6947d7; }
  #bottomnav a.active svg { stroke: #6947d7; fill: #e9e1fd; }
}
@media (max-width:350px) {
  .container, .mast-in { width: calc(100% - 22px); }
  .portal-intro h1 { font-size: 22px; }
  .hello-sun { display: none; }
  .portal-location { padding: 8px; }
  .portal-hero-art { background-position: right -45px center; }
  .portal-hero-copy { padding-left: 14px; }
}
