.tile {
  position: relative;
  display: block;
  box-sizing: border-box;
  padding: 20px;
  border: var(--tile-rim-border-width) solid transparent;
  border-radius: var(--radius-tile);
  background: var(--glass-tile);
  box-shadow: var(--shadow-tile);
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

@property --glint {
  syntax: '<number>';
  inherits: false;
  initial-value: 0;
}

a.tile {
  background:
    radial-gradient(320px circle at var(--glint-x, 50%) var(--glint-y, 0%), rgba(255, 255, 255, calc(0.52 * var(--glint))), rgba(255, 255, 255, 0) 72%),
    var(--glass-tile);
  transition: box-shadow 0.18s ease, --glint 0.35s ease, transform 0.16s var(--ease-quint);
}

@supports (transition-timing-function: linear(0, 1)) {
  a.tile { transition: box-shadow var(--motion-hover) ease, --glint 0.35s ease, transform var(--motion-release) var(--ease-spring); }
}

@property --rim-light {
  syntax: '<number>';
  inherits: false;
  initial-value: 0;
}

a.tile::before {
  background:
    radial-gradient(var(--rim-light-size) circle at var(--glint-x, 50%) var(--glint-y, 0%), rgb(255 255 255 / var(--rim-light)), rgb(var(--light-glass) / calc(0.95 * var(--rim-light))) 40%, rgb(var(--light-glass-edge) / calc(0.5 * var(--rim-light))) 64%, transparent 82%),
    var(--tile-rim-light);
  transition: --rim-light 0.35s ease;
}

@media (hover: hover) {
  a.tile:hover {
    --glint: 1;
    box-shadow: var(--shadow-lift);
  }
  a.tile:hover::before { --rim-light: 1; }
}

a.tile:focus-visible::before { --rim-light: 1; }

.tile[data-live="true"],
a.tile[data-live="true"]:hover {
  box-shadow: var(--shadow-glow);
  transition: box-shadow 0.8s ease, --glint 0.35s ease, transform 0.16s var(--ease-quint);
}

a.tile:active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.46));
  transform: scale(0.99);
  transition-duration: var(--motion-press);
  transition-timing-function: ease-out;
}

a.tile:active .tile-panel { background: #EFEEF4; }

a.tile:focus-visible {
  outline: 2px solid var(--tint);
  outline-offset: 3px;
}

.tile-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.tile-title {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.tile-danger .tile-title { color: var(--bad); }

.tile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tile-tags:empty { min-height: 28px; }

.tile-panel {
  margin: 16px -13px -13px;
  padding: 16px;
  border: 1px solid var(--glass-rim);
  border-radius: var(--radius-panel);
  background: var(--glass-panel);
  box-shadow: 0 0 0 0.5px var(--glass-hair);
}

.tile-text {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.tile-panel > .tile-text + .facts,
.tile-panel > .facts + .tile-text {
  margin-top: 12px;
}

.tile-note {
  margin: 8px 0 0;
  color: var(--bad);
  font-size: 13px;
}

.tile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.tile-status {
  color: var(--good);
  font-size: 13px;
  font-weight: 500;
}

.tile-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.tiles {
  display: grid;
  gap: var(--thread);
}

.tiles > * + *,
.tiles:not(:empty) + .tiles-tail { position: relative; }

.tiles:not(:empty) + .tiles-tail { margin-top: var(--thread); }

.tiles > * + *::after,
.tiles:not(:empty) + .tiles-tail::after {
  content: '';
  position: absolute;
  left: calc(50% - 3px);
  top: calc(-1 * var(--thread) - 1px);
  width: 7px;
  height: var(--thread);
  pointer-events: none;
  background:
    radial-gradient(circle, var(--thread-dot) 2px, var(--ink-line) 2.5px, var(--ink-line) 3px, transparent 3.5px) center / 7px 7px no-repeat,
    linear-gradient(var(--ink-line), var(--ink-line)) center / 1px 100% no-repeat;
}

.tiles[data-live="true"] > * + *::after {
  background:
    radial-gradient(circle, #FFFFFF 2px, rgba(242, 92, 168, 0.35) 2.5px, transparent 3.5px) center / 7px 7px no-repeat,
    linear-gradient(180deg, rgba(242, 92, 168, 0), rgba(242, 92, 168, 0.9) 45%, rgba(13, 173, 194, 0.9) 70%, rgba(13, 173, 194, 0)) center -18px / 1px 18px no-repeat,
    linear-gradient(var(--ink-line), var(--ink-line)) center / 1px 100% no-repeat;
  animation: tiles-flow 1.8s var(--ease-swap) infinite;
}

@keyframes tiles-flow {
  to { background-position: center, center calc(var(--thread) + 18px), center; }
}

@media (prefers-reduced-motion: reduce) {
  a.tile { transition: box-shadow 0.18s ease; }
  a.tile::before { transition: none; }
  a.tile:active { transform: none; }
  .tiles[data-live="true"] > * + *::after { animation: none; }
}

.section-heading.section-heading {
  display: flex;
  align-items: center;
  gap: var(--section-heading-gap);
  color: var(--section-heading-ink);
  font-size: var(--section-heading-size);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.01em;
  text-transform: none;
}

.section-heading-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--section-heading-mark-size);
  height: var(--section-heading-mark-size);
  border-radius: 50%;
  color: var(--section-heading-ink);
  background: var(--section-heading-surface);
  box-shadow: var(--section-heading-shadow);
}

.section-heading-mark > svg,
.section-heading-mark > .icon {
  width: var(--section-heading-icon-size);
  height: var(--section-heading-icon-size);
  fill: currentColor;
}

.tile-danger .section-heading,
.tile-danger .section-heading-mark { color: var(--bad); }

.content-reveal-preview { position: relative; }
.content-reveal[data-overflow="true"][data-expanded="false"] .content-reveal-preview {
  max-height: var(--content-preview-height);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - var(--content-preview-fade)), rgba(0,0,0,.88) calc(100% - var(--content-preview-fade) * .65), rgba(0,0,0,.30) calc(100% - var(--content-preview-fade) * .25), transparent 100%);
  mask-image: linear-gradient(180deg, #000 calc(100% - var(--content-preview-fade)), rgba(0,0,0,.88) calc(100% - var(--content-preview-fade) * .65), rgba(0,0,0,.30) calc(100% - var(--content-preview-fade) * .25), transparent 100%);
}
.content-reveal[data-overflow="true"][data-expanded="false"] .content-reveal-preview::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: var(--content-preview-fade);
  pointer-events: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  -webkit-mask-image: linear-gradient(180deg, transparent, rgba(0,0,0,.4) 45%, #000 100%);
  mask-image: linear-gradient(180deg, transparent, rgba(0,0,0,.4) 45%, #000 100%);
}
.content-reveal-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  margin: 10px 0 -6px -6px;
  padding: 6px;
  border: 0;
  border-radius: 22px;
  color: var(--section-heading-ink);
  background: transparent;
  font: 600 12px/1.5 var(--font-body);
  cursor: pointer;
}
.content-reveal-toggle[hidden] { display: none; }
.content-reveal-toggle::before {
  content: "";
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23344761' d='M6.1 8.1a1.3 1.3 0 0 0-1.8 1.8l6.8 6.8a1.3 1.3 0 0 0 1.8 0l6.8-6.8a1.3 1.3 0 0 0-1.8-1.8L12 14Z'/%3E%3C/svg%3E") center / 12px no-repeat, var(--section-heading-surface);
  box-shadow: var(--section-heading-shadow);
}
.content-reveal-toggle[aria-expanded="true"]::before { transform: rotate(180deg); }
.content-reveal-toggle:focus-visible { outline: 2px solid var(--tint); outline-offset: 3px; }
@media (hover: hover) {
  .content-reveal-toggle:hover { color: var(--ink); }
  .content-reveal-toggle:hover::before { box-shadow: var(--section-heading-shadow), 0 3px 8px rgba(31, 48, 72, 0.12); }
}

.tile,
.memory-message-reader,
.memory-message-access,
.memory-from-detail,
.memory-detail-people .memory-chip { position: relative; }

.tile::before,
.memory-message-reader::before,
.memory-message-access::before,
.memory-from-detail::before,
.memory-detail-people .memory-chip::before {
  content: "";
  position: absolute;
  inset: var(--tile-rim-inset, calc(-1 * var(--tile-rim-border-width)));
  box-sizing: border-box;
  z-index: 1;
  padding: var(--tile-rim-width);
  border-radius: inherit;
  background: var(--tile-rim-light);
  opacity: var(--tile-rim-opacity, 1);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
