/* Homes page: the resident's phone at work. */

/* ---------- Hero ---------- */

.res-hero .wrap {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2rem, 6vw, 6rem);
}
.res-hero h1 {
  max-width: 12ch;
}
.res-try {
  max-width: 30rem;
}
.res-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}
.res-stack {
  display: grid;
  justify-items: center;
  gap: 1rem;
}
.res-device {
  --d-w: 336px;
  aspect-ratio: 9 / 16.6;
}
.res-hero {
  padding-block: clamp(2.5rem, 5vw, 4rem);
}
.res-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}
@media (max-width: 900px) {
  .res-hero .wrap {
    grid-template-columns: 1fr;
  }
}

/* Switch: a real control, palette only. */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 38px;
  padding: 0.3rem 0.4rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.switch-track {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  position: relative;
  flex: none;
  transition: background-color 0.25s;
}
.switch-knob {
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: currentColor;
  transition: transform 0.3s var(--ease-out), background-color 0.25s;
}
.switch[aria-checked='true'] .switch-track {
  background: var(--gold);
  border-color: var(--gold);
}
.switch[aria-checked='true'] .switch-knob {
  transform: translateX(20px);
  background: var(--night);
}
[dir='rtl'] .switch[aria-checked='true'] .switch-knob {
  transform: translateX(-20px);
}
.switch-day[aria-checked='true'] .switch-knob {
  background: var(--ink);
}

/* ---------- Composer inside the device ---------- */

.cmp-signal {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.cmp-signal .ic {
  width: 14px;
  height: 14px;
}
.cmp-head {
  display: grid;
  gap: 0.05rem;
  font-size: 0.78rem;
}
.cmp-head b {
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--on-night);
  line-height: 1.2;
}
.cmp-q {
  font-size: 0.74rem;
  font-weight: 650;
  color: var(--on-night-soft);
  margin-block-start: 0.15rem;
}
.cats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.cat {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: 0.55rem 0.2rem 0.45rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  color: var(--on-night);
  background: var(--night-2);
  border: 1px solid var(--night-line);
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s var(--ease-out);
}
.cat .ic {
  width: 22px;
  height: 22px;
  color: var(--gold);
}
.cat:hover {
  transform: translateY(-1px);
  border-color: color-mix(in oklab, var(--gold) 60%, transparent);
}
.cat[aria-pressed='true'] {
  background: var(--gold);
  color: var(--night);
  border-color: var(--gold);
}
.cat[aria-pressed='true'] .ic {
  color: var(--night);
}
.pick {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.pill,
.opt {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--on-night);
  background: none;
  border: 1px solid var(--night-line);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}
.pill {
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
}
.opts {
  display: grid;
  gap: 5px;
}
.opt {
  padding: 0.42rem 0.65rem;
  border-radius: 10px;
  text-align: start;
}
.pill[aria-pressed='true'],
.opt[aria-pressed='true'] {
  border-color: var(--gold);
  background: var(--gold-soft);
  box-shadow: inset 0 0 0 1px var(--gold);
}
.cmp-media {
  display: flex;
  gap: 0.9rem;
  font-size: 0.72rem;
  color: var(--on-night-soft);
}
.cmp-media span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.cmp-media .ic {
  width: 15px;
  height: 15px;
}
.cmp-send {
  margin-block-start: auto;
  width: 100%;
  min-height: 44px;
  font-size: 0.9rem;
}
.cmp-send[disabled] {
  background: var(--night-3);
  border-color: var(--night-3);
  color: var(--on-night);
  opacity: 1;
}
.offline-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: start;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 1.5px dashed var(--gold);
  background: var(--gold-soft);
}
.offline-banner .ic {
  color: var(--gold);
  margin-block-start: 0.15rem;
}
.offline-banner b {
  display: block;
}
.offline-banner span {
  font-size: 0.78rem;
  color: var(--on-night-soft);
}
.cmp-sum {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.cmp-sum .ic {
  width: 26px;
  height: 26px;
  color: var(--gold);
}
.cmp-sum div {
  display: grid;
}
.cmp-sum span {
  font-size: 0.76rem;
}
.stage-now {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.74rem;
}
.prog {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
}
.prog span {
  height: 6px;
  border-radius: 3px;
  background: var(--night-3);
  transition: background-color 0.4s;
}
.prog span.on {
  background: var(--gold);
}
.tl {
  list-style: none;
  margin: 0.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-inline-start: 1px solid var(--night-line);
  margin-inline-start: 5px;
  overflow: hidden;
}
.tl li {
  position: relative;
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 0.4rem;
  padding: 0.38rem 0 0.38rem 0.9rem;
  font-size: 0.78rem;
  color: var(--on-night-soft);
  animation: tl-in 0.5s var(--ease-out);
}
[dir='rtl'] .tl li {
  padding: 0.38rem 0.9rem 0.38rem 0;
}
.tl li::before {
  content: '';
  position: absolute;
  inset-inline-start: -5px;
  inset-block-start: 0.68rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--night-3);
}
.tl li.now {
  color: var(--on-night);
  font-weight: 600;
}
.tl li.now::before {
  background: var(--gold);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--gold) 28%, transparent);
}
.tl time {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  text-align: start;
}
@keyframes tl-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}
.rated {
  display: grid;
  gap: 0.2rem;
  font-size: 0.78rem;
  animation: tl-in 0.5s var(--ease-out);
}
.stars {
  display: flex;
  gap: 2px;
  color: var(--gold);
}
.stars .ic {
  width: 20px;
  height: 20px;
  fill: var(--gold);
}

/* ---------- Story: chat as each side sees it ---------- */

.res-story-copy {
  display: grid;
  gap: var(--space-3);
}
.viewer {
  display: grid;
  gap: 0.6rem;
  margin-block-start: 0.5rem;
}
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  justify-self: start;
}
.seg button {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  min-height: 42px;
  padding: 0.45rem 0.9rem;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.seg button + button {
  border-inline-start: 1px solid var(--ink);
}
.seg button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--plaster);
}
.seg-night {
  border-color: var(--night-line);
}
.seg-night button + button {
  border-color: var(--night-line);
}
.seg-night button[aria-pressed='true'] {
  background: var(--gold);
  color: var(--night);
}
.arch-frame {
  justify-self: center;
  padding: 2.5rem 2.25rem 0;
  border-radius: var(--arch);
  background: var(--pattern-bond), var(--brick);
  box-shadow: inset 0 0 0 1px var(--ink-hair);
}
.chat-device {
  --d-w: 320px;
  border-end-start-radius: 0;
  border-end-end-radius: 0;
  border-block-end: 0;
  aspect-ratio: 9 / 16;
}
.chat-head {
  display: grid;
  font-size: 0.74rem;
  padding-block-end: 0.5rem;
  border-block-end: 1px solid var(--night-line);
}
.chat-head b {
  font-family: var(--display);
  font-size: 1.1rem;
}
.chat {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  align-content: start;
}
.msg {
  max-width: 86%;
  padding: 0.45rem 0.65rem;
  border-radius: 14px;
  font-size: 0.8rem;
  line-height: 1.4;
  display: grid;
  gap: 0.15rem;
}
.msg .meta {
  font-size: 0.72rem;
  color: var(--on-night-soft);
}
.msg.me {
  justify-self: end;
  background: var(--gold);
  color: var(--night);
  border-end-end-radius: 4px;
}
.msg.me .meta {
  color: color-mix(in oklab, var(--night) 75%, var(--gold));
}
.msg.them {
  justify-self: start;
  background: var(--night-2);
  border: 1px solid var(--night-line);
  border-end-start-radius: 4px;
}
.msg.note {
  justify-self: stretch;
  max-width: none;
  border: 1.5px dashed var(--plaster);
  background: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in oklab, var(--plaster) 8%, transparent) 7px 9px);
}
.chat-device[data-viewer='resident'] .msg.note {
  display: none;
}
.sys {
  justify-self: center;
}
.sys .chip {
  font-size: 0.72rem;
}
.quick {
  display: flex;
  gap: 0.35rem;
  margin-block-start: auto;
}
.chat-device[data-viewer='resident'] .quick {
  display: none;
}

/* ---------- Announcements ---------- */

.ann {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.ann-device-col {
  display: grid;
  gap: 1rem;
  justify-items: center;
}
.ann-device {
  --d-w: 300px;
  transition: background-color 0.3s;
}
.ann-device[data-sev='emergency'] {
  background: var(--clay);
}
.ann-table tr.on th,
.ann-table tr.on td {
  color: var(--gold);
}
.ann-table tr.on th {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}
@media (max-width: 960px) {
  .ann {
    grid-template-columns: 1fr;
  }
}
.alarm {
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  gap: 0.75rem;
  height: 100%;
  color: var(--plaster);
  padding-block-end: 1.5rem;
}
.alarm > .ic {
  width: 56px;
  height: 56px;
  color: var(--plaster);
  animation: alarm 1.2s ease-in-out infinite;
}
@keyframes alarm {
  50% {
    transform: scale(1.12);
  }
}
.alarm-kind {
  font-family: var(--text);
  font-stretch: 75%;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.8rem;
}
:lang(ar) .alarm-kind {
  letter-spacing: 0;
  font-size: 1rem;
}
.alarm-title {
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1.25;
}
.alarm-sub {
  font-size: 0.74rem;
}
.alarm-ack {
  --b-bg: var(--plaster);
  --b-fg: var(--ink);
  width: 100%;
  margin-block-start: 0.5rem;
}
.feed {
  display: grid;
  gap: 0.55rem;
  align-content: start;
}
.feed .tile {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  font-size: 0.8rem;
}
.feed .tile > .ic {
  color: var(--gold);
  width: 20px;
  height: 20px;
}
.feed .tile-gold > .ic {
  color: var(--night);
}
.feed .tile div {
  display: grid;
  gap: 0.2rem;
  justify-items: start;
}
.feed .tile b {
  font-size: 0.86rem;
}
.feed .chip .ic {
  width: 12px;
  height: 12px;
}
.pinned {
  border-width: 2px;
}
.maint {
  border-style: dashed;
}

/* ---------- Community widgets ---------- */

.mini {
  background: var(--plaster);
  border: 1px solid var(--ink-hair);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  display: grid;
  gap: 0.6rem;
  box-shadow: 0 18px 30px -24px rgba(0, 0, 0, 0.80);
}
.mini .soft {
  color: color-mix(in oklab, var(--ink) 80%, var(--plaster));
}
.post-title {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.25;
}
.post-acts {
  display: flex;
  gap: 0.5rem;
}
.post-acts .ic {
  width: 14px;
  height: 14px;
}
.rsvp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
}
.stepper button {
  width: 38px;
  height: 38px;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  background: none;
  border: 0;
  color: var(--ink);
  cursor: pointer;
}
.stepper span {
  min-width: 5.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.92rem;
}
.meter {
  height: 8px;
  border-radius: 4px;
  background: color-mix(in oklab, var(--ink) 12%, var(--plaster));
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  background: var(--clay);
  transition: inline-size 0.5s var(--ease-out);
}
.poll {
  display: grid;
  gap: 0.4rem;
}
.poll-opt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.45rem 0.8rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  text-align: start;
  background: none;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  cursor: pointer;
  overflow: hidden;
}
.poll-opt:not([disabled]):hover {
  border-color: var(--ink);
}
.poll-opt[disabled] {
  cursor: default;
}
.poll-bar {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  background: color-mix(in oklab, var(--gold) 45%, var(--plaster));
  transition: inline-size 0.8s var(--ease-out);
}
.poll-opt[aria-pressed='true'] .poll-bar {
  background: var(--gold);
}
.poll-txt,
.poll-opt .num {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}
.dir-card {
  margin: 0;
  display: grid;
  gap: 0;
  border-block-start: 1px solid var(--ink-hair);
}
.dir-card div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.45rem;
  border-block-end: 1px solid var(--ink-hair);
}
.dir-card dt {
  font-weight: 600;
}
.dir-card dd {
  margin: 0;
  color: color-mix(in oklab, var(--ink) 75%, var(--plaster));
}
.dir-card.on dd {
  color: var(--ink);
}

/* ---------- More ---------- */

.res-more {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 4rem);
}
.plaster .walk-dot {
  background: var(--plaster);
}
@media (max-width: 960px) {
  .res-more {
    grid-template-columns: 1fr;
  }
}

/* The phone stands in a deep arch slot cut into the brick. */
.res-hero .res-stack {
  padding: clamp(2rem, 4vw, 3.25rem) clamp(1.5rem, 3vw, 2.5rem) 1.5rem;
  border-radius: var(--arch);
  background: linear-gradient(color-mix(in oklab, var(--ink) 88%, var(--clay)), color-mix(in oklab, var(--ink) 70%, var(--clay)));
  box-shadow: inset 0 18px 30px -12px rgba(0, 0, 0, 0.92), 0 1px 0 color-mix(in oklab, var(--plaster) 40%, transparent);
  color: var(--plaster);
}
/* Card meta sits under its title, never above it. */
.mini > p.label:first-child {
  order: 1;
}
.mini > :nth-child(2) {
  order: 0;
}
.mini > :nth-child(n + 3) {
  order: 2;
}

/* ======================================================================
   Second option: dark glass, vivid signals, the app's own look in the phone.
   ====================================================================== */

/* Hero portal: the phone floats in a glowing glass niche instead of a brick slot. */
.res-hero .res-stack {
  position: relative;
  padding: clamp(2rem, 4vw, 3rem) clamp(1.4rem, 3vw, 2.4rem) 1.5rem;
  border-radius: 200px 200px 28px 28px;
  background:
    radial-gradient(70% 45% at 50% 0%, rgba(139, 92, 255, 0.35), transparent 70%),
    radial-gradient(60% 40% at 50% 100%, rgba(34, 230, 255, 0.18), transparent 70%),
    linear-gradient(180deg, rgba(20, 25, 50, 0.9), rgba(8, 10, 22, 0.92));
  border: 1px solid rgba(160, 175, 255, 0.18);
  box-shadow: 0 0 0 1px rgba(139, 92, 255, 0.25), 0 40px 90px -40px rgba(0, 0, 0, 0.95), 0 0 90px -30px rgba(139, 92, 255, 0.7);
  color: var(--ink);
}
.res-hero .res-stack::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--spin, 0deg), transparent 0 60%, var(--cyan), var(--violet), var(--magenta), transparent 85%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spin-border 7s linear infinite;
  pointer-events: none;
}
@property --spin {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes spin-border {
  to {
    --spin: 360deg;
  }
}
.res-device {
  background: radial-gradient(120% 60% at 50% 0%, #17203d, #0a0f1f 60%);
}
.res-device .device-body {
  gap: 0.55rem;
}

/* Composer: navy tiles, orange choice, like the product's request form. */
.cmp-head b {
  font-family: 'Readex Pro', sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}
.cat {
  background: #131b33;
  border-color: rgba(255, 255, 255, 0.07);
  border-radius: 14px;
}
.cat .ic {
  color: #6ea8ff;
}
.cat:hover {
  border-color: rgba(255, 106, 26, 0.6);
}
.cat[aria-pressed='true'] {
  background: rgba(255, 106, 26, 0.16);
  color: var(--ink);
  border-color: #ff6a1a;
  box-shadow: 0 0 18px -6px #ff6a1a;
}
.cat[aria-pressed='true'] .ic {
  color: #ff8a3d;
}
.pill,
.opt {
  background: #131b33;
  border-color: rgba(255, 255, 255, 0.09);
}
.pill[aria-pressed='true'],
.opt[aria-pressed='true'] {
  border-color: #ff6a1a;
  background: rgba(255, 106, 26, 0.12);
  box-shadow: none;
  color: #ffd9c2;
}
.res-device .cmp-send {
  background: linear-gradient(180deg, #ff7a2e, #e2520c);
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 10px 26px -10px #ff6a1a;
}
.res-device .cmp-send[disabled] {
  background: #1d2544;
  color: #9aa3cc;
  box-shadow: none;
}
.offline-banner {
  border-color: var(--amber);
  background: rgba(255, 162, 31, 0.1);
}
.offline-banner .ic {
  color: var(--amber);
}

/* The case screen: a notification, the five-stage bar and what is happening now. */
.app-push {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border-radius: 16px;
  background: rgba(30, 38, 72, 0.95);
  border: 1px solid color-mix(in oklab, var(--c) 55%, transparent);
  box-shadow: 0 12px 26px -12px rgba(0, 0, 0, 0.8), 0 0 22px -10px var(--c);
  font-size: 0.74rem;
  animation: push-in 0.55s var(--ease-out);
}
.app-push b {
  display: block;
  font-size: 0.78rem;
}
.app-push span {
  color: #b9c2e8;
}
.app-push time {
  color: #9aa3cc;
  font-variant-numeric: tabular-nums;
  align-self: start;
}
.push-logo {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #04050a;
  background: var(--grad);
}
@keyframes push-in {
  from {
    opacity: 0;
    transform: translateY(-18px) scale(0.96);
  }
}
.case-id {
  color: #6ea8ff;
  font-weight: 600;
  font-size: 0.74rem;
  margin-block-start: 0.2rem;
}
.tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.tag {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  border: 1px solid currentColor;
}
.t-cyan {
  color: #6ee7ff;
  background: rgba(34, 230, 255, 0.1);
}
.t-amber {
  color: #ffc46b;
  background: rgba(255, 162, 31, 0.12);
}
.t-lime {
  color: #d4ff8a;
  background: rgba(182, 255, 59, 0.12);
}
.sb5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-block-start: 0.2rem;
}
.sb5 i {
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  transition: background-color 0.4s;
}
.sb5 i.on {
  background: linear-gradient(90deg, #ffb066, #ff6a1a);
}
.sb5 i.now {
  background: linear-gradient(90deg, #ff6a1a 0 50%, rgba(255, 255, 255, 0.1) 50%);
  background-size: 200% 100%;
  animation: sb-now 1.6s ease-in-out infinite alternate;
}
@keyframes sb-now {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}
.sb5-lab {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  font-size: 0.58rem;
  color: #9aa3cc;
  text-align: center;
}
.sb5-lab .on {
  color: #ffd2b8;
  font-weight: 600;
}
.now-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: center;
  padding: 0.75rem;
  border-radius: 16px;
  background: color-mix(in oklab, var(--c) 10%, #121a31);
  border: 1px solid color-mix(in oklab, var(--c) 50%, transparent);
  box-shadow: 0 0 26px -12px var(--c);
  animation: push-in 0.5s var(--ease-out) 0.08s both;
}
.now-card > .ic {
  width: 26px;
  height: 26px;
  color: var(--c);
}
.now-k {
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--c);
  letter-spacing: 0.04em;
}
.now-card b {
  font-size: 0.86rem;
  line-height: 1.35;
}
.rated {
  background: rgba(182, 255, 59, 0.08);
  border-color: rgba(182, 255, 59, 0.4);
}
.stars,
.stars .ic {
  color: #fbbf24;
  fill: #fbbf24;
}

/* Chat: the same glass portal; internal notes are violet (office and system). */
.arch-frame {
  padding: 2.4rem 2.1rem 0;
  border-radius: 200px 200px 0 0;
  background:
    radial-gradient(70% 45% at 50% 0%, rgba(34, 230, 255, 0.25), transparent 70%),
    linear-gradient(180deg, rgba(20, 25, 50, 0.85), rgba(8, 10, 22, 0.6));
  box-shadow: inset 0 0 0 1px rgba(160, 175, 255, 0.16), 0 0 80px -30px rgba(34, 230, 255, 0.6);
}
.msg.me .meta {
  color: rgba(4, 5, 10, 0.72);
}
.msg.note {
  border: 1.5px dashed var(--violet);
  background: repeating-linear-gradient(135deg, rgba(139, 92, 255, 0.06) 0 7px, rgba(139, 92, 255, 0.14) 7px 9px);
}
.msg.note b {
  color: #c9b8ff;
}
.sys .chip {
  border-color: rgba(160, 175, 255, 0.35);
  color: var(--ink-soft);
}
.sys .chip-solid {
  background: var(--lime);
  border-color: var(--lime);
  color: #04050a;
}
.seg {
  border: 1px solid var(--ink-line);
  border-radius: 999px;
  background: rgba(13, 16, 32, 0.6);
}
.seg button + button {
  border-color: var(--ink-line);
}
.seg button[aria-pressed='true'],
.seg-night button[aria-pressed='true'] {
  background: var(--cyan);
  color: #04050a;
  border-radius: 999px;
}

/* Announcements: the emergency is a full-screen pulse with acknowledgements counting up. */
.ann-device {
  position: relative;
  overflow: hidden;
}
.ann-device[data-sev='emergency'] {
  background: #14040d;
  border-color: #3a0c22;
  box-shadow: 0 0 0 1px rgba(255, 61, 154, 0.5), 0 40px 90px -30px rgba(0, 0, 0, 0.9), 0 0 120px -10px rgba(255, 61, 154, 0.8);
  animation: alarm-glow 1.6s ease-in-out infinite;
}
.ann-device[data-sev='emergency']::before,
.ann-device[data-sev='emergency']::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.ann-device[data-sev='emergency']::before {
  background: radial-gradient(70% 50% at 50% 38%, rgba(255, 61, 154, 0.55), rgba(255, 61, 154, 0.08) 60%, transparent 80%);
  animation: alarm-flood 1.6s ease-in-out infinite;
}
.ann-device[data-sev='emergency']::after {
  inset: 22% 18% auto;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(255, 140, 190, 0.7);
  animation: alarm-ring 1.6s ease-out infinite;
}
@keyframes alarm-glow {
  50% {
    box-shadow: 0 0 0 1px rgba(255, 61, 154, 0.9), 0 40px 90px -30px rgba(0, 0, 0, 0.9), 0 0 160px 0 rgba(255, 61, 154, 0.9);
  }
}
@keyframes alarm-flood {
  50% {
    opacity: 0.45;
  }
}
@keyframes alarm-ring {
  from {
    transform: scale(0.35);
    opacity: 1;
  }
  to {
    transform: scale(1.6);
    opacity: 0;
  }
}
.ann-device .device-bar,
.ann-device .device-body {
  position: relative;
  z-index: 1;
}
.alarm,
.alarm > .ic {
  color: #fff;
}
.alarm > .ic {
  filter: drop-shadow(0 0 14px rgba(255, 61, 154, 0.9));
}
.alarm-kind {
  color: #ff9ccb;
  font-stretch: 100%;
}
.alarm-title {
  font-family: 'Readex Pro', sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}
.alarm-sub {
  color: #ffc6df;
}
.ack {
  width: 100%;
  display: grid;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #ffd9ea;
}
.ack-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.ack-bar span {
  display: block;
  height: 100%;
  inline-size: 0;
  background: linear-gradient(90deg, var(--magenta), #ffd0e6);
  box-shadow: 0 0 12px var(--magenta);
}
.ack b {
  font-family: var(--display);
  font-size: 1.15rem;
  color: #fff;
}
.ann-device .alarm-ack {
  --b-bg: #fff;
  --b-fg: #3a0620;
  background: #fff;
  color: #3a0620;
  box-shadow: 0 0 30px -6px rgba(255, 61, 154, 0.9);
}
.ann-device .tile-gold {
  background: var(--amber);
  border-color: var(--amber);
  color: #1a0f00;
  box-shadow: 0 0 26px -8px var(--amber);
}
.ann-device .feed .tile-gold > .ic {
  color: #1a0f00;
}
.ann-device .maint {
  border-color: rgba(255, 162, 31, 0.6);
}
.ann-device .maint > .ic {
  color: var(--amber);
}
.ann-device .feed .tile:not(.tile-gold):not(.maint) > .ic {
  color: var(--cyan);
}
.ann-table tr[data-row='emergency'].on th,
.ann-table tr[data-row='emergency'].on td {
  color: #ff8fc4;
}
.ann-table tr[data-row='urgent'].on th,
.ann-table tr[data-row='urgent'].on td {
  color: var(--amber);
}
.ann-table tr.on th {
  text-decoration-color: currentColor;
}

/* Community widgets: glowing glass. */
.mini {
  background: linear-gradient(160deg, rgba(22, 27, 54, 0.88), rgba(10, 12, 24, 0.88));
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 30px 60px -36px rgba(0, 0, 0, 0.9);
}
.mini .soft {
  color: var(--ink-soft);
}
.post-title {
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.15rem;
}
:lang(ar) .post-title {
  font-family: 'Readex Pro', sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}
.stepper {
  border-radius: 999px;
}
.meter {
  background: rgba(255, 255, 255, 0.08);
}
.meter span {
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  box-shadow: 0 0 12px rgba(34, 230, 255, 0.6);
}
.poll-opt {
  border-radius: 14px;
}
.poll-opt:not([disabled]):hover {
  border-color: var(--cyan);
}
.poll-bar {
  background: rgba(139, 92, 255, 0.28);
}
.poll-opt[aria-pressed='true'] .poll-bar {
  background: linear-gradient(90deg, rgba(34, 230, 255, 0.45), rgba(139, 92, 255, 0.35));
}
.poll-opt[aria-pressed='true'] .poll-txt .ic {
  color: var(--lime);
}
.dir-card dd {
  color: var(--ink-soft);
}
.dir-card.on dd {
  color: var(--lime);
}
.row h3 .ic {
  color: var(--cyan);
}

/* The rest of the home: a glowing rail instead of an ink line. */
.res-more::before {
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--magenta));
  box-shadow: 0 0 14px rgba(139, 92, 255, 0.6);
  height: 2px;
}
.res-more .walk-dot,
.plaster .res-more .walk-dot {
  background: var(--brick);
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(34, 230, 255, 0.6);
}
.res-more a:hover .walk-dot {
  background: var(--cyan);
}
.res-more p {
  color: var(--ink-soft);
}
@media (max-width: 960px) {
  .res-more::before {
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, var(--cyan), var(--violet), var(--magenta));
  }
}
@media (prefers-reduced-motion: reduce) {
  .res-hero .res-stack::after,
  .ann-device[data-sev='emergency'],
  .ann-device[data-sev='emergency']::before,
  .ann-device[data-sev='emergency']::after,
  .sb5 i.now {
    animation: none;
  }
}
