/* QF AUTH 2026 visual system
   Inspired by Kirameku's calm composition and Liquid Glass UI's optical depth. */
:root {
  --color-bg: #e9eef0;
  --color-primary: #17252b;
  --color-secondary: #64747b;
  --color-border: rgba(255, 255, 255, .78);
  --color-brand: #168b84;
  --color-brand-2: #37b7c2;
  --color-card: rgba(249, 252, 252, .58);
  --color-card-strong: rgba(252, 254, 254, .78);
  --color-danger: #d9565b;
  --color-success: #238a63;
  --qf-ink: #17252b;
  --qf-muted: #64747b;
  --qf-line: rgba(42, 65, 73, .11);
  --qf-glass: rgba(249, 252, 252, .58);
  --qf-glass-strong: rgba(252, 254, 254, .78);
  --qf-teal: #168b84;
  --qf-cyan: #37b7c2;
  --qf-coral: #e76c5d;
  --qf-blue: #4e78bd;
  --qf-lime: #83ad54;
  --qf-radius: 8px;
  --qf-shadow-near: 0 8px 20px rgba(34, 52, 59, .08);
  --qf-shadow-far: 0 26px 64px rgba(34, 52, 59, .09);
  --shadow-card: var(--qf-shadow-near), var(--qf-shadow-far), inset 0 1px 0 rgba(255, 255, 255, .9);
}

/* Keep application notices above fixed mobile navigation and glass layers. */
.toast-wrap {
  position: fixed !important;
  z-index: 10000 !important;
  top: max(12px, env(safe-area-inset-top)) !important;
  right: max(12px, env(safe-area-inset-right)) !important;
  left: auto !important;
  bottom: auto !important;
  width: min(390px, calc(100vw - 24px));
  display: flex !important;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast-wrap .toast {
  width: 100%;
  max-width: none;
  min-height: 48px;
  padding: 13px 16px;
  background: rgba(250, 253, 253, .97);
  color: #17212b;
  border: 1px solid rgba(255,255,255,.92);
  border-left: 4px solid #22a06b;
  box-shadow: 0 16px 42px rgba(8,18,26,.25);
  font-weight: 650;
  line-height: 1.6;
  white-space: normal;
  overflow-wrap: anywhere;
  pointer-events: auto;
}
.toast-wrap .toast.error { color: #8f2632; border-left-color: #ef5b6e; }
@media (max-width: 640px) {
  .toast-wrap { top: max(10px, env(safe-area-inset-top)) !important; right: max(10px, env(safe-area-inset-right)) !important; width: min(350px, calc(100vw - 20px)); }
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(22, 139, 132, .28) transparent;
}

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(22, 139, 132, .25);
  border: 2px solid transparent;
  border-radius: 99px;
  background-clip: padding-box;
}

html { background: #e9eef0; }

body {
  min-height: 100%;
  color: var(--qf-ink);
  background-color: #e9eef0;
  background-image:
    linear-gradient(118deg, rgba(255, 255, 255, .9) 0 26%, transparent 26% 100%),
    linear-gradient(154deg, rgba(199, 227, 226, .54) 0 31%, rgba(239, 230, 225, .58) 31% 58%, rgba(220, 230, 238, .72) 58% 100%);
  background-attachment: fixed;
  letter-spacing: 0;
}

body::before {
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(255, 255, 255, .26) 48% 48.15%, transparent 48.15%),
    linear-gradient(0deg, transparent 0 61%, rgba(255, 255, 255, .2) 61% 61.1%, transparent 61.1%);
  opacity: .72;
}

body::after {
  content: "";
  position: fixed;
  right: 4vw;
  bottom: 4vh;
  z-index: 0;
  width: min(28vw, 360px);
  aspect-ratio: 335 / 358;
  background: url("glass-layers.png") center / contain no-repeat;
  opacity: .075;
  pointer-events: none;
}

.bubbles { display: none; }

.center-wrap,
.app-shell,
.calc-wrap,
.edl-shell,
.toast-wrap,
.modal-mask { position: relative; z-index: 1; }

.glass,
.stat-card,
.card-item,
.pricing-card,
.tbl-wrap,
.edl-panel {
  --qf-pointer-x: 50%;
  --qf-pointer-y: 0%;
  border: 1px solid var(--color-border);
  border-radius: var(--qf-radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .68), rgba(255, 255, 255, .29)),
    var(--qf-glass);
  -webkit-backdrop-filter: blur(26px) saturate(155%);
  backdrop-filter: blur(26px) saturate(155%);
  box-shadow: var(--shadow-card);
  isolation: isolate;
}

.glass::after,
.stat-card::after,
.card-item::after,
.pricing-card::after,
.tbl-wrap::after,
.edl-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(340px circle at var(--qf-pointer-x) var(--qf-pointer-y), rgba(255, 255, 255, .68), transparent 48%),
    linear-gradient(135deg, rgba(255, 255, 255, .62), transparent 38% 68%, rgba(255, 255, 255, .16));
  opacity: .58;
}

.glass-strong { background-color: var(--qf-glass-strong); }

.lift {
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}

.lift:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .94);
  box-shadow: 0 12px 26px rgba(34, 52, 59, .1), 0 34px 76px rgba(34, 52, 59, .08), inset 0 1px 0 #fff;
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.anim-pop { animation-duration: .42s; }
.anim-fade { animation-duration: .34s; }

/* Console layout */
.qf-console .app-shell {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: 16px;
  gap: 14px;
  grid-template-columns: 248px minmax(0, 1fr);
}

.qf-console .sidebar {
  position: sticky;
  top: 16px;
  height: calc(100dvh - 32px);
  align-self: start;
  padding: 14px;
  gap: 12px;
  overflow: auto;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .78), rgba(241, 248, 248, .46)),
    rgba(249, 252, 252, .6);
}

.qf-console .brand {
  min-height: 56px;
  padding: 5px 6px 11px;
  border-bottom: 1px solid var(--qf-line);
}

.brand-logo,
.login-head,
.calc-logo,
.edl-logo,
.stat-card .ico-wrap,
.ledger-icon {
  border-radius: 8px;
  background: linear-gradient(135deg, var(--qf-teal), var(--qf-cyan));
  box-shadow: 0 7px 18px rgba(22, 139, 132, .2), inset 0 1px 0 rgba(255, 255, 255, .62);
}

.brand-logo {
  width: 42px;
  height: 42px;
  letter-spacing: 0;
}

.brand-name { font-size: 15px; letter-spacing: 0; }
.brand-sub { margin-top: 2px; }

.qf-console .nav {
  gap: 4px;
  margin-top: 0;
}

.qf-console .nav-item {
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 6px;
  border-color: transparent;
  font-size: 13px;
  font-weight: 540;
}

.qf-console .nav-item:hover {
  color: var(--qf-ink);
  background: rgba(255, 255, 255, .58);
  border-color: rgba(255, 255, 255, .74);
}

.qf-console .nav-item.active {
  color: #fff;
  background: linear-gradient(115deg, #167d78, #289ca2);
  border-color: rgba(255, 255, 255, .42);
  box-shadow: 0 8px 18px rgba(22, 125, 120, .18), inset 0 1px 0 rgba(255, 255, 255, .3);
}

.qf-console .nav-item.active .dot {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .18);
}

.qf-console .sidebar > .glass {
  padding: 13px 4px 0 !important;
  border: 0;
  border-top: 1px solid var(--qf-line);
  border-radius: 0 !important;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.qf-console .sidebar > .glass::after { display: none; }

.qf-console #logoutBtn {
  width: 100%;
  min-height: 40px;
  color: #8b4044;
  border-color: rgba(217, 86, 91, .18);
  background: rgba(255, 249, 249, .58);
}

.qf-console .main {
  gap: 14px;
  min-width: 0;
}

.qf-console .topbar {
  position: sticky;
  top: 16px;
  z-index: 30;
  min-height: 64px;
  padding: 10px 14px 10px 18px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, .82), rgba(248, 252, 252, .54)),
    rgba(249, 252, 252, .64);
}

.topbar .title {
  font-size: 17px;
  letter-spacing: 0;
}

.user-chip {
  min-height: 42px;
  max-width: min(56vw, 430px);
  padding: 5px 9px;
  border-radius: 7px;
  border-color: rgba(255, 255, 255, .76);
  background: rgba(255, 255, 255, .46);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--qf-teal), var(--qf-cyan));
}

.tab-panel { min-width: 0; }

.panel {
  padding: 20px;
  overflow: visible;
}

.panel h3 {
  margin-bottom: 9px;
  font-size: 16px;
  letter-spacing: 0;
}

.panel .desc { margin-bottom: 14px; }

.qf-console .tab-panel > .quote {
  min-height: 54px;
  margin-bottom: 14px !important;
  padding: 10px 16px;
}

.quote { font-style: normal; }

.quote .mark {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  color: var(--qf-teal);
  background: rgba(255, 255, 255, .62);
  border-color: rgba(255, 255, 255, .78);
}

.qf-console .stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  min-height: 116px;
  padding: 16px;
  gap: 4px;
  border-radius: 8px;
  overflow: hidden;
}

.stat-card .value {
  max-width: calc(100% - 44px);
  font-size: 24px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.stat-card .ico-wrap {
  width: 34px;
  height: 34px;
  right: 12px;
  top: 12px;
}

.stat-card.v6 .ico-wrap { background: linear-gradient(135deg, #168b84, #37b7c2); }
.stat-card.fdl .ico-wrap { background: linear-gradient(135deg, #4e78bd, #6e96d7); }
.stat-card.frp .ico-wrap { background: linear-gradient(135deg, #e76c5d, #e99a68); }
.stat-card.qc .ico-wrap { background: linear-gradient(135deg, #558b4c, #91bb61); }

/* Flat sub-sections avoid card-inside-card visual clutter. */
.panel > .grid-2 > .glass,
.panel .grid-2 > .glass:not(.panel) {
  border: 0;
  border-left: 2px solid rgba(22, 139, 132, .24);
  border-radius: 0 !important;
  background: rgba(255, 255, 255, .18);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.panel > .grid-2 > .glass::after,
.panel .grid-2 > .glass:not(.panel)::after { display: none; }

.grid-2 { gap: 12px; }

.input,
.textarea,
.select {
  min-height: 42px;
  border-radius: 7px;
  border-color: rgba(255, 255, 255, .82);
  background: rgba(255, 255, 255, .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .82), 0 1px 2px rgba(34, 52, 59, .04);
}

.textarea { min-height: 128px; }

.input:focus,
.textarea:focus,
.select:focus {
  border-color: rgba(22, 139, 132, .45);
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 0 0 3px rgba(22, 139, 132, .12), inset 0 1px 0 #fff;
}

.btn {
  min-height: 40px;
  padding: 10px 15px;
  border-radius: 7px;
  letter-spacing: 0;
  background: linear-gradient(125deg, #157f79, #299ca3);
  box-shadow: 0 7px 16px rgba(22, 125, 120, .17), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.btn:hover {
  transform: translateY(-1px);
  filter: saturate(1.04) brightness(1.03);
  box-shadow: 0 10px 20px rgba(22, 125, 120, .2), inset 0 1px 0 rgba(255, 255, 255, .42);
}

.btn.ghost {
  color: var(--qf-ink);
  border: 1px solid rgba(255, 255, 255, .78);
  background: rgba(255, 255, 255, .52);
  box-shadow: 0 4px 12px rgba(34, 52, 59, .05), inset 0 1px 0 rgba(255, 255, 255, .8);
}

.btn.ghost:hover { background: rgba(255, 255, 255, .78); }

.btn.danger {
  background: linear-gradient(125deg, #c94c53, #df6b62);
  box-shadow: 0 7px 16px rgba(201, 76, 83, .16), inset 0 1px 0 rgba(255, 255, 255, .32);
}

.btn.sm {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 6px;
}

.result {
  border-radius: 7px;
  border-color: rgba(255, 255, 255, .82);
  background: rgba(255, 255, 255, .58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .82);
}

.chips { gap: 7px; }

.chip {
  padding: 8px 10px;
  border-radius: 6px;
  border-color: rgba(255, 255, 255, .78);
  background: rgba(255, 255, 255, .46);
}

.toolbar {
  gap: 5px;
  padding: 5px;
  margin: 0 0 12px;
  border: 1px solid rgba(255, 255, 255, .66);
  border-radius: 7px;
  background: rgba(255, 255, 255, .22);
}

.toolbar .filter {
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
}

.toolbar .filter:hover { color: var(--qf-ink); background: rgba(255, 255, 255, .42); }

.toolbar .filter.active {
  color: #fff;
  border-color: rgba(255, 255, 255, .36);
  background: #277f7c;
  box-shadow: 0 4px 10px rgba(22, 125, 120, .14);
}

.tbl-wrap {
  overflow: auto;
  border-radius: 7px;
  background: rgba(255, 255, 255, .36);
}

.tbl { min-width: 680px; }

.tbl thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #506168;
  background: rgba(239, 246, 246, .94);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.tbl th,
.tbl td {
  padding: 11px 12px;
  border-bottom-color: rgba(42, 65, 73, .08);
}

.tbl tbody tr { background: rgba(255, 255, 255, .28); }
.tbl tbody tr:hover { background: rgba(255, 255, 255, .62); }

.cards-grid {
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 10px;
}

.card-item {
  padding: 14px;
  border-radius: 7px;
  background: rgba(249, 252, 252, .52);
}

.card-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(34, 52, 59, .1), 0 28px 58px rgba(34, 52, 59, .07);
}

.badge { border-radius: 99px; }
.tbadge { border-radius: 5px; }

.pricing-grid { gap: 10px; }

.pricing-card {
  padding: 15px;
  border-radius: 7px;
}

.ledger-list { gap: 5px; }

.ledger-row {
  padding: 11px 12px;
  border-radius: 6px;
  border-color: rgba(255, 255, 255, .68);
  background: rgba(255, 255, 255, .4);
}

.ledger-icon { border-radius: 7px; }

.empty-state {
  border-radius: 7px;
  background: rgba(255, 255, 255, .22);
}

.modal-mask {
  position: fixed;
  background: rgba(20, 34, 39, .32);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  backdrop-filter: blur(12px) saturate(120%);
}

.modal {
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .9), rgba(245, 250, 250, .76)),
    rgba(249, 252, 252, .86);
  -webkit-backdrop-filter: blur(34px) saturate(150%);
  backdrop-filter: blur(34px) saturate(150%);
  box-shadow: 0 28px 70px rgba(20, 34, 39, .22), inset 0 1px 0 #fff;
}

.toast {
  border-radius: 7px;
  background: rgba(250, 253, 253, .88);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  backdrop-filter: blur(24px) saturate(145%);
}

.role-pill { border-radius: 99px; }
.role-pill.author { background: linear-gradient(125deg, #cf5558, #df8267); }
.role-pill.agent { background: linear-gradient(125deg, #4e78bd, #37a0b2); }

/* Login and account entry */
.qf-auth .center-wrap {
  width: min(100%, 1180px);
  margin: 0 auto;
  justify-content: flex-end;
  padding: 34px 40px;
}

.qf-auth::after {
  left: clamp(36px, 14vw, 220px);
  right: auto;
  bottom: 50%;
  width: min(34vw, 410px);
  opacity: .88;
  transform: translateY(50%);
  filter: drop-shadow(0 28px 42px rgba(48, 54, 84, .18));
}

.qf-auth .login-card {
  max-width: 452px;
  padding: 30px 30px 26px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .78), rgba(246, 251, 251, .48)),
    rgba(249, 252, 252, .62);
}

.qf-auth .login-head {
  width: 58px;
  height: 58px;
  margin-bottom: 13px;
}

.qf-auth .login-title { font-size: 21px; }
.qf-auth .login-sub { margin-bottom: 17px; }

.qf-auth .login-card > .quote {
  padding: 2px 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.qf-auth .login-card > .quote::after { display: none; }

.brand-text {
  background: linear-gradient(120deg, #126f6a 15%, #29a6ad 58%, #4e78bd);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Manual calculator */
.qf-calc .calc-wrap,
.qf-calc .edl-shell {
  min-height: 100dvh;
  padding: 24px;
}

.qf-calc .calc-card {
  max-width: 1020px;
  padding: 26px;
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 13px 24px;
}

.qf-calc .calc-head,
.qf-calc .calc-tools,
.qf-calc .calc-card > .divider,
.qf-calc .calc-card > .quote { grid-column: 1 / -1; }

.qf-calc .calc-head {
  margin-bottom: 4px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--qf-line);
}

.qf-calc .calc-logo,
.qf-calc .edl-logo { border-radius: 8px; }

.qf-calc .calc-tools { margin-bottom: 2px !important; }
.qf-calc .calc-input-card { grid-column: 1; }
.qf-calc .calc-blob-card { grid-column: 1; }
.qf-calc .calc-actions { grid-column: 1; flex-wrap: wrap; }

.qf-calc .calc-result-card {
  grid-column: 2;
  grid-row: 3 / span 3;
  min-width: 0;
  margin-top: 0 !important;
  padding: 16px;
  border-left: 2px solid rgba(22, 139, 132, .24);
  background: rgba(255, 255, 255, .18);
}

.qf-calc .calc-result-card .result { min-height: 218px; }

.qf-calc .calc-card > .divider { margin: 3px 0 0; }
.qf-calc .calc-card > .quote { padding: 2px 0 0; }

.qf-edl .edl-card { max-width: 1120px; }

.qf-edl .edl-grid {
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
}

.qf-edl .edl-panel {
  border-radius: 7px;
  background: rgba(249, 252, 252, .48);
}

.qf-edl .status-line,
.qf-edl .step-item {
  border-radius: 6px;
  background: rgba(255, 255, 255, .46);
}

.qf-edl .step-index { border-radius: 6px; }

.qf-edl .edl-log {
  border-radius: 7px;
  color: #d6f2eb;
  background: rgba(16, 28, 31, .94);
}

@media (max-width: 1180px) {
  .qf-console .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  body::after { width: 220px; opacity: .05; }

  .qf-console .app-shell {
    display: block;
    padding: 8px;
  }

  .qf-console .sidebar {
    top: 8px;
    z-index: 40;
    width: 100%;
    height: auto;
    max-height: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 9px;
    overflow: hidden;
  }

  .qf-console .brand {
    min-height: 42px;
    padding: 0;
    border: 0;
  }

  .qf-console .brand-logo { width: 38px; height: 38px; }

  .qf-console .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-direction: row;
    gap: 5px;
    width: 100%;
    padding-top: 7px;
    overflow-x: auto;
    border-top: 1px solid var(--qf-line);
    scroll-snap-type: x proximity;
  }

  .qf-console .nav-item {
    flex: 0 0 auto;
    min-height: 42px;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .qf-console .sidebar > div[style="flex:1"],
  .qf-console .sidebar > .glass { display: none; }

  .qf-console #logoutBtn {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    min-height: 42px;
    align-self: center;
  }

  .qf-console .main { margin-top: 10px; gap: 10px; }

  .qf-console .topbar {
    position: static;
    min-height: 56px;
    padding: 9px 11px;
  }

  .panel { padding: 17px; }
  .grid-2 { grid-template-columns: 1fr; }

  .qf-auth .center-wrap {
    justify-content: center;
    padding: 22px;
  }

  .qf-auth::after { display: none; }

  .qf-calc .calc-card {
    display: flex;
    max-width: 680px;
    flex-direction: column;
    padding: 22px;
  }

  .qf-calc .calc-result-card {
    width: 100%;
    margin-top: 5px !important;
  }

  .qf-calc .calc-result-card .result { min-height: 120px; }

  .qf-edl .edl-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { background-attachment: scroll; }

  .qf-console .brand-name { font-size: 14px; }
  .qf-console .brand-sub { font-size: 11px; }

  .qf-console .nav-item {
    padding: 8px 9px;
    font-size: 12px;
  }

  .qf-console .topbar {
    align-items: center;
    flex-wrap: nowrap;
  }

  .qf-console .topbar .title {
    min-width: 0;
    font-size: 15px;
  }

  .qf-console .user-chip {
    min-width: 0;
    max-width: 66%;
  }

  .qf-console .user-chip > div:last-child { min-width: 0; }
  .qf-console .user-chip [id="uName"],
  .qf-console .user-chip [id="uMeta"] {
    display: block;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .qf-console .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stat-card {
    min-height: 108px;
    padding: 13px;
  }

  .stat-card .value { font-size: 21px; }
  .stat-card .ico-wrap { width: 30px; height: 30px; }

  .panel { padding: 15px; }

  .row { flex-wrap: wrap; }

  .row > .field,
  .row > .input,
  .row > .select {
    min-width: 0;
  }

  .qf-console .tab-panel .row > .field[style] {
    width: 100% !important;
    max-width: none !important;
    flex: 1 1 100% !important;
  }

  .toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .toolbar > * { flex: 0 0 auto; }
  .toolbar .grow { display: none; }
  .toolbar .input { width: 170px; }

  .chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .chip {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .ledger-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .ledger-after { display: none; }

  .modal-mask {
    align-items: flex-end;
    padding: 8px;
  }

  .modal {
    max-height: calc(100dvh - 16px);
    padding: 18px;
  }

  .modal .kv { grid-template-columns: 76px minmax(0, 1fr); }

  .qf-auth .center-wrap { padding: 10px; }

  .qf-auth .login-card {
    max-width: 100%;
    padding: 24px 18px 20px;
  }

  .qf-auth .login-card .field > div[style*="display:flex"] {
    min-width: 0;
  }

  .qf-auth .login-card .field > div[style*="display:flex"] > .input { min-width: 0; }

  .qf-auth .login-card .field > div[style*="display:flex"] > .btn,
  .qf-auth .login-card .field > div[style*="display:flex"] > div[id$="Box"] {
    width: 116px !important;
    flex: 0 0 116px;
  }

  .qf-calc .calc-wrap,
  .qf-calc .edl-shell {
    align-items: flex-start;
    padding: 8px;
  }

  .qf-calc .calc-card,
  .qf-edl .edl-card { padding: 17px; }

  .qf-calc .calc-title,
  .qf-edl .edl-title { font-size: 18px; }

  .qf-calc .calc-head,
  .qf-edl .edl-brand { align-items: flex-start; }

  .qf-calc .calc-actions .btn,
  .qf-edl .edl-actions .btn { flex: 1 1 auto !important; }

  .qf-edl .edl-log { min-height: 240px; }
}

@media (max-width: 380px) {
  .qf-console .stats-grid { grid-template-columns: 1fr; }
  .chips { grid-template-columns: 1fr; }
  .qf-console .user-chip [id="uName"],
  .qf-console .user-chip [id="uMeta"] { max-width: 105px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
