/* The clickable customer app inside the landing page phones. Everything is sized in em, and
   1em = 10 logical pixels of a 390px wide phone, so the demo scales with the phone. Colours and
   type follow the real app (lib/ui/widgets/ih), not the marketing page. */
.demo {
  --d-ink: #15171C;
  --d-ink-2: #55565A;
  --d-grey: #6C6C68;
  --d-line: #E5E3DC;
  --d-bg: #F5F4F0;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--d-bg);
  color: var(--d-ink);
  font-family: 'Commissioner', 'Sofia Sans', Arial, sans-serif;
  font-size: calc(100cqw / 39);
  font-weight: 400;
  line-height: 1.3;
  text-align: left;
  letter-spacing: 0;
}
.demo * { box-sizing: border-box; }
.demo p { margin: 0; }
.demo button, .demo input, .demo select, .demo textarea { font: inherit; color: inherit; letter-spacing: 0; }
.demo button { cursor: pointer; }
.demo :focus-visible { outline: .2em solid #1D3FA8; outline-offset: -.2em; }
.d-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* A page scroll that passes over the phone is not captured: see the note in phone-demo.js. */
.d-view { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; scrollbar-width: none; }
.d-view::-webkit-scrollbar { display: none; }
.is-engaged .d-view { overflow-y: auto; overscroll-behavior: contain; }
.d-screen { flex: 1 0 auto; display: flex; flex-direction: column; min-height: 100%; }
.d-screen--forward { animation: dIn .32s cubic-bezier(.22, .8, .2, 1); }
.d-screen--back { animation: dBack .32s cubic-bezier(.22, .8, .2, 1); }
@keyframes dIn { from { opacity: 0; transform: translateX(2.6em); } to { opacity: 1; transform: none; } }
@keyframes dBack { from { opacity: 0; transform: translateX(-2.6em); } to { opacity: 1; transform: none; } }

.d-ico { flex: none; width: 2.2em; height: 2.2em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Bars */
.d-homehead, .d-pagehead { background: #fff; padding: 4.4em 1.6em 1.5em; border-bottom: 1px solid #E7E5DF; }
.d-pagehead { padding-bottom: 1.3em; }
.d-homehead__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1em; }
.d-office { font-size: 1.1em; font-weight: 500; letter-spacing: .09em; color: #6F6F6B; min-height: 1.3em; overflow-wrap: anywhere; }
.d-hello { font-size: 2.6em; font-weight: 500; margin-top: .1em !important; }
.d-title { font-size: 2.6em; font-weight: 500; }
.d-sub { font-size: 1.38em; color: var(--d-ink-2); margin-top: .25em !important; }
.d-sub--form { margin: 0 0 1em !important; }
.d-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: .6em; padding: 4em 1em 1em; background: #fff; border-bottom: 1px solid #E7E5DF; }
.d-bar__t { font-size: 1.7em; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-iconbtn { display: grid; place-items: center; width: 3.8em; height: 3.8em; flex: none; padding: 0; background: none; border: 0; border-radius: .7em; }
.d-iconbtn:hover { background: var(--d-bg); }

/* Buttons */
.d-btn { display: flex; align-items: center; justify-content: center; gap: .55em; width: 100%; min-height: 3.45em; margin-top: 1em; padding: .7em 1em; background: var(--d-ink); color: #fff !important; border: 1px solid var(--d-ink); border-radius: .57em; font-size: 1.4em !important; font-weight: 600; transition: background-color .2s; }
.d-btn:hover { background: #33363E; }
.d-btn .d-ico { width: 1.5em; height: 1.5em; }
.d-btn--line { background: #fff; color: var(--d-ink) !important; border-color: #C8C5BC; }
.d-btn--line:hover { background: var(--d-bg); }

/* Content */
.d-body { flex: 1 0 auto; padding: .5em 1.6em 2em; }
.d-body--foot { padding-bottom: 1.4em; }
.d-label { display: flex; align-items: center; gap: 1em; margin: 1.5em 0 .75em; font-size: 1.05em; font-weight: 600; letter-spacing: .09em; color: #777771; }
.d-label span { text-transform: uppercase; }
.d-label::after { content: ""; order: 1; flex: 1; height: 1px; background: #E0DED7; }
.d-all { order: 2; display: inline-flex; align-items: center; gap: .3em; padding: .2em 0; background: none; border: 0; color: var(--d-ink); font-size: 1.15em !important; font-weight: 600; letter-spacing: 0; }
.d-all .d-ico { width: 1.25em; height: 1.25em; }
.d-card { background: #fff; border: 1px solid var(--d-line); border-radius: .9em; overflow: hidden; }
.d-card--pad { padding: 1.3em 1.5em; margin-top: 1em; }
.d-card--gap { margin-top: 1.5em; }
.d-card + .d-card { margin-top: 1em; }
.d-row { display: flex; align-items: center; gap: 1em; width: 100%; padding: 1.1em 1.5em; background: none; border: 0; border-top: 1px solid #EAE8E2; text-align: left; transition: background-color .2s; }
.d-card > .d-row:first-child, .d-card > p + .d-row { border-top: 0; }
.d-row:hover { background: #FAF9F6; }
.d-row > .d-ico { color: #55565A; }
.d-row__b { flex: 1; min-width: 0; }
.d-row b { display: block; font-size: 1.4em; font-weight: 400; overflow-wrap: anywhere; }
.d-row b.d-strong { font-weight: 600; }
.d-row small { display: block; font-size: 1.22em; color: var(--d-grey); margin-top: .15em; overflow-wrap: anywhere; }
.d-row strong { font-size: 1.55em; font-weight: 600; }
.d-count { font-style: normal; background: #FBE6DC; color: #B4471C; font-size: 1.2em; font-weight: 700; padding: .15em .6em; border-radius: .3em; }
.d-officecard { padding: 1.1em 1.1em 1em; font-size: 1.5em; font-weight: 600; border-bottom: 1px solid #EAE8E2; overflow-wrap: anywhere; }
.d-heading { font-size: 1.7em; font-weight: 600; }
.d-small { font-size: 1.25em; color: var(--d-grey); margin-top: .15em !important; }
.d-center { text-align: center; margin-top: 1em !important; }
.d-kv { display: flex; justify-content: space-between; gap: 1em; padding: 1em 1.4em; border-top: 1px solid #EAE8E2; font-size: 1.4em; }
.d-kv:first-child { border-top: 0; }
.d-kv span { color: var(--d-grey); flex: none; }
.d-kv b { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.d-cov { padding: 1.1em 1.5em; border-top: 1px solid #EAE8E2; }
.d-cov:first-child { border-top: 0; }
.d-cov b { display: block; font-size: 1.4em; font-weight: 500; }
.d-cov small { display: block; font-size: 1.25em; color: var(--d-ink-2); margin-top: .15em; }
.d-none { padding: 1.1em; font-size: 1.3em; color: var(--d-grey); }
.d-foot { position: sticky; bottom: 0; display: flex; gap: .7em; margin-top: auto; padding: .4em 1.6em 1em; background: #fff; border-top: 1px solid #E7E5DF; }
.d-foot .d-btn { margin-top: .4em; }

/* List cards */
.d-policy { display: block; width: 100%; margin-top: 1em; padding: 1.2em 1.4em; background: #fff; border: 1px solid var(--d-line); border-radius: .9em; text-align: left; transition: border-color .2s; }
.d-policy:hover { border-color: #B9B6AC; }
.d-policy__top { display: flex; justify-content: space-between; align-items: flex-start; gap: .7em; margin-bottom: .3em; }
.d-policy b { font-size: 1.5em; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.d-policy small { display: block; font-size: 1.25em; color: var(--d-grey); margin-top: .12em; }
.d-clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-tag { flex: none; font-style: normal; font-size: 1.1em; font-weight: 600; padding: .2em .55em; border-radius: .35em; white-space: nowrap; }
.d-tag--ok { background: #E3F2E7; color: #1E6B3C; }
.d-tag--warn { background: #FBE6DC; color: #B4471C; }
.d-tag--grey { background: #ECEAE4; color: #55565A; }
.d-search { display: flex; align-items: center; gap: .6em; margin-top: 1em; padding: 0 1em; background: #fff; border: 1px solid #D7D4CB; border-radius: .7em; }
.d-search input { flex: 1; min-width: 0; height: 3em; border: 0; background: none; font-size: 1.3em !important; outline: none; }
.d-search:focus-within { border-color: var(--d-ink); }
.d-search .d-ico { width: 1.8em; height: 1.8em; color: var(--d-grey); }
.d-chips { display: flex; flex-wrap: wrap; gap: .5em; margin-top: 1em; }
.d-chip { padding: .45em .85em; background: #fff; border: 1px solid #D7D4CB; border-radius: 2em; font-size: 1.25em !important; font-weight: 500; transition: background-color .2s, color .2s; }
.d-chip.is-on { background: var(--d-ink); border-color: var(--d-ink); color: #fff !important; }
.d-chips + .d-card { margin-top: 1em; }
.d-empty { margin-top: 2.4em; text-align: center; }
.d-empty b { display: block; font-size: 1.5em; font-weight: 600; }
.d-empty small { display: block; font-size: 1.25em; color: var(--d-grey); margin-top: .2em; }
.d-banner { margin-top: 1em; padding: 1em 1.2em; background: #ECEAE4; border-radius: .7em; }
.d-banner--warn { background: #FBE6DC; }
.d-banner b { display: block; font-size: 1.35em; font-weight: 600; }
.d-banner small { display: block; font-size: 1.22em; margin-top: .15em; color: #55565A; }

/* Conversation */
.d-thread { flex: 1 0 auto; padding: 1.4em 1.6em; }
.d-msg { max-width: 86%; margin-top: 1.1em; padding: .9em 1.1em; background: #fff; border: 1px solid var(--d-line); border-radius: .3em 1em 1em 1em; }
.d-msg > p:not(.d-msg__who) { font-size: 1.35em; }
.d-msg__who { font-size: 1.05em; color: var(--d-grey); margin-bottom: .3em !important; }
.d-msg--me { margin-left: auto; background: #E9E7E0; border-color: #E9E7E0; border-radius: 1em .3em 1em 1em; }
.d-attach { display: flex; align-items: center; gap: .4em; margin-top: .6em; padding: .4em .6em; background: #fff; border: 1px solid #D7D4CB; border-radius: .5em; font-size: 1.15em !important; }
.d-attach .d-ico { width: 1.4em; height: 1.4em; }
.d-composer { position: sticky; bottom: 0; display: flex; align-items: center; gap: .6em; padding: .8em 1.2em; background: #fff; border-top: 1px solid #E7E5DF; }
.d-composer input { flex: 1; min-width: 0; height: 3em; padding: 0 .85em; background: var(--d-bg); border: 1px solid #D7D4CB; border-radius: .7em; font-size: 1.3em !important; }
.d-send { display: grid; place-items: center; width: 4em; height: 4em; flex: none; padding: 0; background: var(--d-ink); color: #fff !important; border: 0; border-radius: .7em; }
.d-closed { position: sticky; bottom: 0; padding: 1em 1.4em; background: #fff; border-top: 1px solid #E7E5DF; font-size: 1.25em; color: var(--d-ink-2); }

/* Form */
.d-field { display: block; margin-top: 1em; }
.d-field > span { display: block; font-size: 1.25em; font-weight: 500; margin-bottom: .3em; }
.d-field input, .d-field select, .d-field textarea { display: block; width: 100%; padding: .65em .8em; background: #fff; border: 1px solid #D7D4CB; border-radius: .6em; font-size: 1.35em !important; }
.d-field textarea { resize: none; }
.d-field input:focus, .d-field select:focus, .d-field textarea:focus { outline: none; border-color: var(--d-ink); }
.d-error { margin-bottom: .5em !important; padding: .6em .8em; background: #FBE6DC; color: #B4471C; border-radius: .5em; font-size: 1.25em; font-weight: 500; }

/* Document preview */
.d-paper { margin-top: 1.2em; padding: 1.8em 1.6em; background: #fff; border: 1px solid var(--d-line); }
.d-paper > b { display: block; font-size: 1.6em; font-weight: 600; }
.d-paper > small { display: block; font-size: 1.25em; color: var(--d-grey); margin-top: .2em; }
.d-paper dl { margin: 1.2em 0; }
.d-paper dl > div { display: flex; justify-content: space-between; gap: 1em; padding: .55em 0; border-top: 1px solid #EAE8E2; font-size: 1.2em; }
.d-paper dt { color: var(--d-grey); }
.d-paper dd { margin: 0; font-weight: 500; text-align: right; }
.d-paper > i { display: block; height: .55em; margin-top: .8em; background: #EDEBE5; }
.d-paper > i:last-child { width: 62%; }

/* Profile */
.d-toggle { display: flex; align-items: center; gap: 1em; width: 100%; padding: 1.1em 1.4em; background: none; border: 0; border-top: 1px solid #EAE8E2; text-align: left; }
.d-card > .d-toggle:first-child { border-top: 0; }
.d-toggle b { display: block; font-size: 1.4em; font-weight: 500; }
.d-toggle small { display: block; font-size: 1.18em; color: var(--d-grey); margin-top: .15em; }
.d-switch { position: relative; flex: none; width: 4.4em; height: 2.6em; background: #C8C5BC; border-radius: 2em; transition: background-color .25s; }
.d-switch::after { content: ""; position: absolute; left: .3em; top: .3em; width: 2em; height: 2em; background: #fff; border-radius: 50%; transition: transform .25s cubic-bezier(.22, .8, .2, 1); }
.d-switch.is-on { background: var(--d-ink); }
.d-switch.is-on::after { transform: translateX(1.8em); }

/* Bottom tabs */
.d-tabs { flex: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: .55em .5em .9em; background: #fff; border-top: 1px solid #E7E5DF; }
.d-tab { display: flex; flex-direction: column; align-items: center; gap: .2em; padding: .25em 0; background: none; border: 0; color: #6F6F68 !important; font-size: 1.05em !important; }
.d-tab__i { position: relative; display: grid; place-items: center; width: 5em; height: 2.9em; border-radius: .8em; transition: background-color .2s; }
.d-tab__i .d-ico { width: 2.2em; height: 2.2em; }
.d-tab.is-on { color: var(--d-ink) !important; font-weight: 600; }
.d-tab.is-on .d-tab__i { background: #EFEEE9; }
.d-badge { position: absolute; right: .9em; top: -.1em; min-width: 1.5em; padding: .08em .3em; background: #E8590C; color: #fff; font-style: normal; font-size: 1em; font-weight: 700; text-align: center; border-radius: .35em; }

/* Message for things a landing page cannot do */
.d-toast { position: absolute; left: 1.2em; right: 1.2em; bottom: 7.4em; z-index: 5; padding: .85em 1em; background: var(--d-ink); color: #fff; border-radius: .7em; font-size: 1.3em; line-height: 1.25; animation: dToast .25s cubic-bezier(.22, .8, .2, 1); }
.d-toast[hidden] { display: none; }
@keyframes dToast { from { opacity: 0; transform: translateY(.6em); } to { opacity: 1; transform: none; } }
