/* A quiet motion layer for the app: smooth, liquid, never flashy. Nothing moves more than 2px, nothing flashes, colour fades in over about half a second,
   and everything stands still for people who ask their system for reduced motion. Loaded after ui.css. */
:root { --mo-ease: cubic-bezier(0.25, 0.8, 0.25, 1); --mo-soft: cubic-bezier(0.4, 0, 0.2, 1); --mo-fast: 220ms; --mo-base: 420ms; --mo-slow: 640ms;
  --mo-tint: linear-gradient(150deg, rgba(10, 191, 188, 0.10) 0%, rgba(80, 150, 230, 0.07) 100%); }
:root[data-theme="dark"] { --mo-tint: linear-gradient(150deg, rgba(10, 191, 188, 0.16) 0%, rgba(80, 150, 230, 0.10) 100%); }

@media (prefers-reduced-motion: no-preference) {
  /* the page arrives softly, once */
  .ui-main > * { animation: mo-arrive var(--mo-slow) var(--mo-ease) both; }
  @keyframes mo-arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

  /* things you can press: colour and shadow glide instead of snapping */
  .ui-btn, .ui-chip, .ui-tab, .ui-menu__item, .ui-input, .ui-select { transition: background-color var(--mo-fast) var(--mo-soft), border-color var(--mo-fast) var(--mo-soft), color var(--mo-fast) var(--mo-soft), box-shadow var(--mo-base) var(--mo-ease), transform var(--mo-fast) var(--mo-ease); }
  .ui-btn--primary { background-image: linear-gradient(120deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.16) 50%, rgba(255, 255, 255, 0) 100%); background-size: 220% 100%; background-position: 100% 0; transition: background-position var(--mo-slow) var(--mo-ease), background-color var(--mo-fast) var(--mo-soft), box-shadow var(--mo-base) var(--mo-ease), transform var(--mo-fast) var(--mo-ease); }
  .ui-btn--primary:hover { background-position: 0 0; }

  /* the sidebar: hover and selection glide */
  .ui-nav__item { transition: background-color var(--mo-base) var(--mo-ease), color var(--mo-base) var(--mo-soft), transform var(--mo-base) var(--mo-ease); }
  .ui-nav__item:hover { transform: translateX(2px); }

  /* tiles and cards you can open: a soft tint fades in behind the content and the edge warms, with a 1px lift */
  .ui-app, a.ui-link-card, .ui-launch__tile, .ui-todo__card, a.ui-stat, .ui-stat[href] { position: relative; isolation: isolate; transition: transform var(--mo-base) var(--mo-ease), box-shadow var(--mo-slow) var(--mo-ease), border-color var(--mo-base) var(--mo-soft); }
  .ui-app::after, a.ui-link-card::after, .ui-launch__tile::after, .ui-todo__card::after, a.ui-stat::after, .ui-stat[href]::after {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--mo-tint); opacity: 0; pointer-events: none; transition: opacity var(--mo-slow) var(--mo-ease); }
  .ui-app:hover, a.ui-link-card:hover, .ui-todo__card:hover, a.ui-stat:hover, .ui-stat[href]:hover { transform: translateY(-1px); border-color: rgba(10, 191, 188, 0.4); }
  .ui-launch__tile:hover { transform: translateY(-1px); }
  .ui-app:hover::after, a.ui-link-card:hover::after, .ui-launch__tile:hover::after, .ui-todo__card:hover::after, a.ui-stat:hover::after, .ui-stat[href]:hover::after, .ui-app:focus-within::after { opacity: 1; }

  /* tables: the row under the pointer glows quietly */
  .ui-table tbody tr { transition: background-color var(--mo-base) var(--mo-soft); }
  .ui-table tbody tr:hover { background-color: rgba(10, 191, 188, 0.06); }

  /* progress and rings fill smoothly */
  .ui-progress > *, .gd-bar i, .bh-spark rect { transition: width var(--mo-slow) var(--mo-ease), height var(--mo-slow) var(--mo-ease), y var(--mo-slow) var(--mo-ease), fill var(--mo-base) var(--mo-soft); }

  /* menus and dialogs open with a short, soft rise */
  .ui-modal__box { animation: mo-pop var(--mo-base) var(--mo-ease) both; }
  @keyframes mo-pop { from { opacity: 0; transform: translateY(4px) scale(0.985); } to { opacity: 1; transform: none; } }
}

/* No blur on the top bar, menus or dialogs: a blurred ancestor becomes the reference frame for position: fixed descendants, and the menus are positioned in screen coordinates. */
@media (prefers-reduced-motion: reduce) { .ui-app::after, a.ui-link-card::after, .ui-launch__tile::after, .ui-todo__card::after { transition: none; } }

/* ---- Admin home: one calm list of what needs you, then the rest ---- */
.hm-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.hm-head h1 { margin: 0 0 2px; font-size: 1.55rem; letter-spacing: -0.02em; }
.hm-head p { margin: 0; }
.hm-posture { display: inline-flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 14px; border: 1px solid var(--ui-border); background: var(--ui-surface); color: var(--ui-text); text-decoration: none; }
.hm-posture .ui-ring { --ring: 54px; }
.hm-posture:hover { border-color: rgba(10, 191, 188, 0.4); }
.hm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hm-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--ui-border); border-left-width: 4px; background: var(--ui-surface); }
.hm-row[data-tone="danger"] { border-left-color: #dc2626; } .hm-row[data-tone="amber"] { border-left-color: #d97706; } .hm-row[data-tone="rose"] { border-left-color: #e11d48; }
.hm-row[data-tone="sky"] { border-left-color: #3b82f6; } .hm-row[data-tone="teal"], .hm-row[data-tone="brand"] { border-left-color: var(--ui-accent); }
.hm-row__t { display: grid; min-width: 0; } .hm-row__t b { font-weight: 590; } .hm-row__t small { color: var(--ui-text-2); overflow-wrap: anywhere; }
.hm-calm { display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--ui-surface-2); color: var(--ui-text-2); }
.hm-ai { display: flex; align-items: center; gap: 8px; margin: 10px 2px 0; color: var(--ui-text-2); font-size: 0.9rem; }
.hm-more { margin: 4px 0; } .hm-more > summary { cursor: pointer; padding: 8px 2px; color: var(--ui-text-2); font-weight: 590; list-style: none; }
.hm-more > summary::-webkit-details-marker { display: none; } .hm-more > summary::before { content: "+"; display: inline-block; width: 16px; color: var(--ui-accent-ink); }
.hm-more[open] > summary::before { content: "\2212"; }
.hm-done { display: flex; align-items: center; gap: 6px; margin: 4px 2px; }
@media (prefers-reduced-motion: no-preference) { .hm-row { transition: border-color var(--mo-base) var(--mo-soft), box-shadow var(--mo-slow) var(--mo-ease), transform var(--mo-base) var(--mo-ease); } .hm-row:hover { border-color: rgba(10, 191, 188, 0.4); box-shadow: 0 10px 24px -18px rgba(20, 90, 160, 0.5); transform: translateY(-1px); } }
.ui-split .ui-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ui-split .ui-quick a { padding: 8px 10px; font-size: 0.9rem; }
@media (max-width: 1180px) { .ui-split .ui-quick { grid-template-columns: 1fr; } }

/* Home: the AI card. A brand-tinted band so the assistant reads as part of the product, not a footnote. */
.hm-aicard { padding: 18px 20px; border-radius: 18px; border: 1px solid var(--ui-border); background: linear-gradient(120deg, rgba(10, 156, 153, 0.09), rgba(36, 87, 184, 0.09)), var(--ui-surface, #fff); }
.hm-aicard__top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hm-aicard__top > div { flex: 1 1 320px; min-width: 0; }
.hm-aicard h2 { margin: 0; font-size: 1.1rem; }
.hm-aicard p { margin: 2px 0 0; }
.hm-aicard__spark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #0A9C99, #2457B8); }
.hm-aicard__stats { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 14px 0 0; padding: 0; list-style: none; }
.hm-aicard__stats li { display: flex; align-items: baseline; gap: 8px; font-size: 0.92rem; }
.hm-aicard__stats b { font-size: 1.5rem; letter-spacing: -0.02em; }
.hm-aicard__stats span { color: var(--ui-text-2); }
.hm-aicard__asks form { margin: 0; }
.hm-aicard__asks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hm-aicard__brief { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.7); border: 1px solid var(--ui-border); }
.hm-aicard__brief p { margin: 6px 0 0; white-space: pre-line; }

/* Action centre (2.4.0): the next setup step stands out, the empty launch strip is one line, recent activity ends in one link */
.hm-row[data-next-step] { background: var(--ui-surface-2); }
.hm-row[data-next-step] .hm-row__t b { color: var(--ui-text); }
.hm-launch-empty { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--ui-surface-2); }
.hm-viewall { margin: 12px 0 0; text-align: right; font-weight: 590; }
@media (max-width: 560px) { .hm-row { grid-template-columns: auto 1fr; } .hm-row > .ui-btn { grid-column: 1 / -1; justify-self: stretch; text-align: center; } }

/* Stacked tables (ui.js labels the cells): on a phone each row is a card, the first cell is its title and any buttons come right under it */
.ui-disclose { margin: 12px 0; }
.ui-disclose > summary { cursor: pointer; font-weight: 590; padding: 8px 0; }
@media (max-width: 640px) {
  .ui-table--stack { display: block; width: 100% !important; table-layout: auto !important; }
  .ui-table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ui-table--stack tbody { display: block; }
  .ui-table--stack tr { display: flex; flex-direction: column; border: 1px solid var(--ui-border); border-radius: 14px; margin: 0 0 12px; padding: 10px 12px; background: var(--ui-surface); }
  .ui-table--stack td, .ui-table--stack th[scope="row"] { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 0; text-align: right; order: 2; min-width: 0; overflow-wrap: anywhere; width: auto !important; }
  .ui-table--stack td > span { min-width: 0; flex: 1 1 auto; }
  .ui-table--stack td::before { content: attr(data-label); color: var(--ui-text-2); font-size: 0.8rem; text-align: left; flex: 0 0 36%; }
  .ui-table--stack tr > :first-child { order: 0; display: block; text-align: left; font-weight: 590; font-size: 1rem; padding-bottom: 6px; }
  .ui-table--stack tr > :first-child::before { content: none; }
  .ui-table--stack td.stack-actions { order: 1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; padding: 4px 0 8px; }
  .ui-table--stack td.stack-actions::before { content: none; }
  .ui-table--stack td.stack-actions .ui-btn, .ui-table--stack td.stack-actions form { flex: 1 1 100%; }
  .ui-table--stack td.stack-actions .ui-btn { width: 100%; text-align: center; }
  .ui-table--stack caption { display: none; }
}

/* On a phone the summary tiles sit two to a row and stay short, so the decisions below them are on the first screen */
@media (max-width: 560px) {
  .ui-pam-hero, .ui-grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  .ui-pam-hero .ui-stat, .ui-grid-stats .ui-stat { padding: 10px 12px !important; min-height: 0 !important; }
  .ui-pam-hero .ui-stat__icon, .ui-grid-stats .ui-stat__icon { display: none; }
  .ui-pam-hero .ui-stat__value, .ui-grid-stats .ui-stat__value { font-size: 1.5rem !important; }
}

/* A dialog scrolls on its own: the page behind it stays put. */
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { overscroll-behavior: contain; }

/* The browser's own reveal / clear buttons would sit on top of ours. */
input::-ms-reveal, input::-ms-clear { display: none; }

/* Tab bars on phones: scroll sideways with a visible edge fade, snap to tabs, and never cut a label without showing there is more. */
@media (max-width: 640px) {
  .ui-tabs { -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent); padding-right: 28px; }
  .ui-tabs__list > * { scroll-snap-align: start; flex: 0 0 auto; }
  :root:not([data-theme="dark"]) .ui-tabs__list { display: flex; }
  input, select, textarea { font-size: 16px; } /* below 16px, iPhone zooms the page on focus */
}
