/* The portal look (ADR-0047): the door people sign in at, and the pages inside, for an
   application's own portal. A page takes it by using <ui:door> or <ui:portal>. It is laid on
   the control library and its tokens. Boxes have edges, not glows: nothing here casts a
   coloured shadow. */

/* Colour. The library gives one brand colour and its states; the portal adds a small palette, one
   colour to each place, so a page says where you are before you have read a word. Each tint is
   a strong colour for marks and a wash of it for what lies behind them. */
:root {
  --ui-hue-indigo: #3451B2; --ui-hue-blue: #1F6FE0; --ui-hue-green: #0F8F62; --ui-hue-teal: #0B8C9C;
  --ui-hue-purple: #7A45D1; --ui-hue-pink: #C93B86; --ui-hue-orange: #D9591C; --ui-hue-amber: #B57A00;
  --ui-hue-red: #CC3A32; --ui-wash: 13%;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ui-hue-indigo: #A9B8FF; --ui-hue-blue: #6FA8FF; --ui-hue-green: #4FD3A2; --ui-hue-teal: #4DD2E2;
    --ui-hue-purple: #BC9CFF; --ui-hue-pink: #FF8CC6; --ui-hue-orange: #FF9E66; --ui-hue-amber: #F5C451;
    --ui-hue-red: #FF8E86; --ui-wash: 20%;
  }
}
:root[data-theme="dark"] {
  --ui-hue-indigo: #A9B8FF; --ui-hue-blue: #6FA8FF; --ui-hue-green: #4FD3A2; --ui-hue-teal: #4DD2E2;
  --ui-hue-purple: #BC9CFF; --ui-hue-pink: #FF8CC6; --ui-hue-orange: #FF9E66; --ui-hue-amber: #F5C451;
  --ui-hue-red: #FF8E86; --ui-wash: 20%;
}
/* What an application makes its own. Each is a token: an application's stylesheet, which a page
   loads after this one, sets any of them, or any rule here, to look like itself; and a page may
   name a stylesheet of the application's to use instead of this one (ADR-0047). */
:root {
  --ui-brand-mark: linear-gradient(135deg, #1F6FE0, #7A45D1 60%, #C93B86);
  --ui-brand-mark-ink: #FFFFFF;
  --ui-brand-line: linear-gradient(90deg, var(--ui-hue-blue), var(--ui-hue-purple),
    var(--ui-hue-pink), var(--ui-hue-orange), var(--ui-hue-amber), var(--ui-hue-green));
  --ui-door-ground: radial-gradient(48% 42% at 12% 8%, color-mix(in srgb, var(--ui-hue-blue) 24%, transparent), transparent 72%),
    radial-gradient(42% 40% at 92% 12%, color-mix(in srgb, var(--ui-hue-purple) 24%, transparent), transparent 72%),
    radial-gradient(46% 44% at 86% 94%, color-mix(in srgb, var(--ui-hue-green) 20%, transparent), transparent 72%),
    radial-gradient(40% 38% at 8% 92%, color-mix(in srgb, var(--ui-hue-orange) 20%, transparent), transparent 72%),
    var(--ui-bg);
}
.ui-tint--indigo { --ui-tint: var(--ui-hue-indigo); } .ui-tint--blue { --ui-tint: var(--ui-hue-blue); }
.ui-tint--green { --ui-tint: var(--ui-hue-green); } .ui-tint--teal { --ui-tint: var(--ui-hue-teal); }
.ui-tint--purple { --ui-tint: var(--ui-hue-purple); } .ui-tint--pink { --ui-tint: var(--ui-hue-pink); }
.ui-tint--orange { --ui-tint: var(--ui-hue-orange); } .ui-tint--amber { --ui-tint: var(--ui-hue-amber); }
.ui-tint--red { --ui-tint: var(--ui-hue-red); }

/* A tile: an icon in its colour, on a wash of it. An emblem is a larger one. */
.ui-tile, .ui-emblem { display: inline-flex; flex: none; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--ui-tint, var(--ui-hue-blue)) var(--ui-wash), transparent);
  color: var(--ui-tint, var(--ui-hue-blue)); }
.ui-tile { width: 32px; height: 32px; border-radius: 10px; }
.ui-tile > .ui-icon { width: 18px; height: 18px; }
.ui-emblem { width: 52px; height: 52px; border-radius: 16px; }

/* The door: the pages before you are signed in. One card, in the middle, on a ground that
   carries the palette. */
.ui-door { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; min-height: 100vh; padding: 32px 16px;
  background: var(--ui-door-ground); }
.ui-door-card { position: relative; display: flex; flex-direction: column; gap: 20px;
  width: min(448px, 100%); padding: 40px 40px 36px; overflow: hidden;
  border: 1px solid var(--ui-hairline); border-radius: 28px; background: var(--ui-surface); }
.ui-door-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px;
  background: var(--ui-brand-line); }
.ui-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; }
.ui-brand-mark, .ui-app-mark { display: inline-flex; align-items: center; justify-content: center;
  background: var(--ui-brand-mark); color: var(--ui-brand-mark-ink); }
.ui-brand-mark { width: 36px; height: 36px; border-radius: 10px; font-size: 18px; font-weight: 700; }
.ui-door-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ui-door-head > .ui-emblem { margin-bottom: 6px; }
.ui-door-title { margin: 0; font-size: 28px; line-height: 36px; font-weight: 600;
  letter-spacing: -0.01em; overflow-wrap: anywhere; }
.ui-door-lead { margin: 0; color: var(--ui-ink-2); font-size: 15px; line-height: 22px; }
.ui-door-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 20px;
  color: var(--ui-ink-2); font-size: 13px; }
.ui-or { display: flex; align-items: center; gap: 12px; color: var(--ui-muted); font-size: 13px; }
.ui-or::before, .ui-or::after { content: ""; flex: 1; height: 1px; background: var(--ui-hairline); }
.ui-door .ui-button--outlined > .ui-icon { color: var(--ui-hue-amber); }
.ui-problem { margin: 0; color: var(--ui-bad); font-size: 13px; }
.ui-problem:empty { display: none; }
.ui-numbered { display: flex; gap: 14px; }
.ui-numbered-mark { display: inline-flex; flex: none; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ui-hue-teal), var(--ui-hue-blue)); color: var(--ui-surface);
  font-size: 14px; font-weight: 700; }
.ui-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0; padding: 0;
  list-style: none; }
.ui-codes > li { padding: 10px 12px; border-radius: 10px; text-align: center;
  background: color-mix(in srgb, var(--ui-hue-amber) var(--ui-wash), transparent); }
.ui-codes code { font: 600 15px/22px var(--ui-mono); letter-spacing: 0.04em; }
.ui-asks { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 16px;
  border-radius: 14px; list-style: none; font-size: 15px;
  background: color-mix(in srgb, var(--ui-hue-green) var(--ui-wash), transparent); }
.ui-asks > li { display: flex; align-items: flex-start; gap: 10px; }
.ui-asks .ui-icon { margin-top: 3px; color: var(--ui-hue-green); }

/* Inside. The bar carries the palette as a line; each place in the drawer has its colour; and
   the head of a page is washed in the colour of its place. */
.ui-app-bar { border-bottom: 3px solid transparent;
  background: linear-gradient(var(--ui-surface), var(--ui-surface)) padding-box,
    var(--ui-brand-line) border-box; }
.ui-app-mark { border-radius: 9px; }
.ui-who { color: var(--ui-ink-2); font-size: 14px; font-weight: 500; }
.ui-drawer .ui-nav-item { gap: 12px; padding-left: 8px; }
.ui-drawer .ui-nav-item[aria-current] > .ui-tile {
  background: var(--ui-tint); color: var(--ui-surface); }
.ui-main { display: flex; flex-direction: column; gap: 20px; }
.ui-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px;
  padding: 22px 24px; border: 1px solid color-mix(in srgb, var(--ui-tint) 28%, transparent);
  border-radius: 24px;
  background: linear-gradient(120deg,
    color-mix(in srgb, var(--ui-tint) 22%, var(--ui-surface)),
    color-mix(in srgb, var(--ui-tint) 7%, var(--ui-surface)) 55%, var(--ui-surface)); }
.ui-hero > .ui-emblem { background: var(--ui-tint); color: var(--ui-surface); }
.ui-hero-text { min-width: min(260px, 100%); }
.ui-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ui-hero-actions:empty { display: none; }
.ui-page-title { margin: 0; font-size: 28px; line-height: 36px; font-weight: 600;
  letter-spacing: -0.01em; overflow-wrap: anywhere; }
.ui-page-lead { max-width: 68ch; margin: 4px 0 0; color: var(--ui-ink-2); font-size: 15px;
  line-height: 22px; }
.ui-panel-head { display: flex; align-items: center; gap: 12px; }
.ui-panel-head > .ui-title { margin: 0; }
.ui-card--flush > .ui-row > .ui-tile { margin-right: -4px; }

/* Tables: each row leads with a mark, and the rows take the palette in turn, so a long list is
   not one grey column. */
.ui-lead { position: relative; justify-content: center; min-height: 38px; padding-left: 50px; }
.ui-lead::before, .ui-lead::after { content: ""; position: absolute; left: 0; top: 50%;
  width: 38px; height: 38px; margin-top: -19px; border-radius: 50%; }
.ui-lead::before { background: color-mix(in srgb, var(--ui-tint) var(--ui-wash), transparent); }
.ui-lead::after { background: var(--ui-tint);
  -webkit-mask: var(--ui-lead-icon) center / 18px no-repeat; mask: var(--ui-lead-icon) center / 18px no-repeat; }
.ui-lead--person { --ui-lead-icon: var(--ui-i-person); } .ui-lead--key { --ui-lead-icon: var(--ui-i-key); }
.ui-lead--globe { --ui-lead-icon: var(--ui-i-globe); } .ui-lead--building { --ui-lead-icon: var(--ui-i-building); }
.ui-lead--upload { --ui-lead-icon: var(--ui-i-upload); } .ui-lead--window { --ui-lead-icon: var(--ui-i-window); }
.ui-table tbody tr { --ui-tint: var(--ui-hue-blue); }
.ui-table tbody tr:nth-child(6n+2) { --ui-tint: var(--ui-hue-purple); }
.ui-table tbody tr:nth-child(6n+3) { --ui-tint: var(--ui-hue-green); }
.ui-table tbody tr:nth-child(6n+4) { --ui-tint: var(--ui-hue-orange); }
.ui-table tbody tr:nth-child(6n+5) { --ui-tint: var(--ui-hue-teal); }
.ui-table tbody tr:nth-child(6n+6) { --ui-tint: var(--ui-hue-pink); }
.ui-table td > .ui-row > .ui-icon { color: var(--ui-tint); }
.ui-chips { gap: 6px; }
.ui-chips > .ui-chip { height: 28px; padding: 0 10px; border-color: transparent; font-size: 12px;
  font-weight: 600; background: color-mix(in srgb, var(--ui-hue-purple) var(--ui-wash), transparent);
  color: var(--ui-hue-purple); }
.ui-chips > .ui-chip:nth-child(2n) {
  background: color-mix(in srgb, var(--ui-hue-teal) var(--ui-wash), transparent); color: var(--ui-hue-teal); }
.ui-chips > .ui-chip:nth-child(3n) {
  background: color-mix(in srgb, var(--ui-hue-orange) var(--ui-wash), transparent);
  color: var(--ui-hue-orange); }
.ui-empty-mark { background: color-mix(in srgb, var(--ui-hue-amber) var(--ui-wash), transparent);
  color: var(--ui-hue-amber); }
.ui-table-search { margin: 0; width: min(360px, 100%); }
.ui-card--flush > .ui-row > .ui-table-search { margin-left: auto; }
.ui-menu-theme { display: flex; flex-direction: column; gap: 8px; padding: 10px 16px 12px;
  border-bottom: 1px solid var(--ui-hairline); }
.ui-door-theme:empty { display: none; }
.ui-qr { align-self: flex-start; border: 1px solid var(--ui-hairline); }
.ui-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; }
.ui-inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ui-compact { width: auto; height: 36px; padding: 0 32px 0 12px; font-size: 14px; }
.ui-nowrap { white-space: nowrap; }
.ui a.ui-row-link { display: block; color: inherit; text-decoration: none; }
.ui-row-link:hover .ui-list-title { color: var(--ui-primary); text-decoration: underline; }
.ui-confirm-form { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }

/* A narrow screen: the drawer lies along the top as a strip to sweep through, so the page is
   not pushed below a screenful of places to go. */
@media (max-width: 720px) {
  .ui-shell > .ui-drawer { flex-direction: row; gap: 6px; padding: 8px; overflow-x: auto;
    border-radius: 18px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .ui-shell > .ui-drawer::-webkit-scrollbar { display: none; }
  .ui-drawer .ui-nav-group { display: none; }
  .ui-drawer .ui-nav-item { flex: none; min-height: 44px; padding: 0 14px 0 6px;
    white-space: nowrap; scroll-snap-align: start; }
  .ui-drawer .ui-nav-item:not([aria-current]) { font-size: 0; gap: 0; padding: 0 6px; }
  .ui-drawer .ui-nav-item[aria-current] { order: -1; }
  .ui-hero-actions { width: 100%; }
}

@media (max-width: 520px) {
  .ui-door { justify-content: flex-start; padding: 16px 12px; }
  .ui-door-card { padding: 28px 20px; border-radius: 20px; }
  .ui-hero { padding: 18px 16px; border-radius: 18px; }
  .ui-who { display: none; }
}

/* Meters: what is used of what is allowed, each in the colour of its place. */
.ui-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.ui-meter { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.ui-meter > .ui-tile { background: var(--ui-tint); color: var(--ui-surface); }
.ui-meter .ui-progress { width: 100%; accent-color: var(--ui-tint); }
.ui-meter .ui-stat { padding: 0; border: 0; background: none; }

/* Things to do, in order, each with its number. */
.ui-todo { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; list-style: none; }
.ui-todo > .ui-numbered { align-items: flex-start; }

/* A notice across the top of a page that carries a small form, such as a way to leave. */
.ui-banner-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.ui-banner-row > form { margin: 0; }
.ui-panel > .ui-muted { margin: 0; }
.ui-break { overflow-wrap: anywhere; }
.ui-lead--mail { --ui-lead-icon: var(--ui-i-mail); }
