/* Able-Pro contrast skin (S10-3). Component patterns: repo Able-Pro-kit.
   Tokens from docs/THEME.md + docs/UI-SPEC-S10.md — slim custom CSS, no vendor bundle. */
:root,
[data-theme="light"] {
  color-scheme: light;
  --hz-primary: #4680ff;
  --hz-primary-hover: #1e4fd4;
  --hz-primary-subtle: #b6ceff;
  --hz-body-bg: #f4f6fa;
  --hz-surface: #ffffff;
  --hz-heading: #0b1220;
  --hz-body-text: #101820;
  --hz-muted: #334155;
  --hz-border: #8ea0b8;
  --hz-sidebar-border: #64748b;
  --hz-active-bg: #c9dbff;
  --hz-success: #15803d;
  --hz-warning: #c2410c;
  --hz-danger: #b91c1c;
  --hz-info: #0e7490;
  --hz-priority-high: #b91c1c;
  --hz-priority-medium: #c2410c;
  --hz-priority-low: #334155;
  --hz-list-line: #e4e9f0;
  --hz-row-hover: #eef2f8;
  --hz-unread-bg: #eef4ff;
  --hz-canvas: #f4f6fa;
  --hz-input-bg: #f4f6fa;
  --hz-topbar-bg: rgba(255, 255, 255, 0.9);
  --hz-radius: 8px;
  --hz-radius-sm: 6px;
  --hz-radius-lg: 10px;
  --hz-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  --hz-sidebar-w: 260px;
  --hz-topbar-h: 60px;
  --hz-font: "Inter", system-ui, sans-serif;
  --hz-avatar-1: #4680ff;
  --hz-avatar-2: #2ca87f;
  --hz-avatar-3: #e58a00;
  --hz-avatar-4: #3ec9d6;
  --hz-avatar-5: #6610f2;
  --hz-avatar-6: #04a9f5;
  --hz-avatar-7: #f4c22b;
  --hz-avatar-8: #dc2626;
  --hz-avatar-9: #5b6b79;
  --hz-avatar-10: #1d2630;

  --primary: var(--hz-primary);
  --primary-2: var(--hz-primary-hover);
  --surface: var(--hz-body-bg);
  --surface-2: var(--hz-active-bg);
  --paper: var(--hz-surface);
  --danger: var(--hz-danger);
  --warn: var(--hz-warning);
  --ok: var(--hz-success);
  --ink: var(--hz-body-text);
  --muted: var(--hz-muted);
  --line: var(--hz-border);
  --shadow: var(--hz-shadow);
  --tap: 44px;
  --radius: var(--hz-radius);
  --nav-h: 64px;
  --font: var(--hz-font);
}

[data-theme="dark"] {
  color-scheme: dark;
  --hz-primary: #7aa4ff;
  --hz-primary-hover: #9bbcff;
  --hz-primary-subtle: #243656;
  --hz-body-bg: #0e141d;
  --hz-surface: #161d2a;
  --hz-heading: #f4f7fb;
  --hz-body-text: #e8eef6;
  --hz-muted: #b4c0d0;
  --hz-border: #4a5c74;
  --hz-sidebar-border: #5b6e86;
  --hz-active-bg: #243656;
  --hz-success: #22c55e;
  --hz-warning: #fb923c;
  --hz-danger: #f87171;
  --hz-info: #22d3ee;
  --hz-priority-high: #f87171;
  --hz-priority-medium: #fb923c;
  --hz-priority-low: #b4c0d0;
  --hz-list-line: #2a3548;
  --hz-row-hover: #1c2534;
  --hz-unread-bg: #1a2740;
  --hz-canvas: #101722;
  --hz-input-bg: #0e141d;
  --hz-topbar-bg: rgba(22, 29, 42, 0.92);
  --hz-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}
@media (max-width: 767px) {
  html, body {
    overscroll-behavior-y: contain;
  }
}
html, body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
}
body {
  font-family: var(--font);
  font-size: 16px;
  background: var(--hz-body-bg);
  color: var(--hz-body-text);
  line-height: 1.45;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
/* iOS Safari zooms the page when a focused control is under 16px. */
input, select, textarea {
  font-size: max(16px, 1rem);
  max-width: 100%;
  min-width: 0;
}
img, svg, video { max-width: 100%; }
a { color: var(--hz-primary); }
a, button, input, select, textarea, label { touch-action: manipulation; }

#app {
  min-height: 100%;
  min-height: 100svh;
  max-width: 100%;
  overflow-x: hidden;
}

.ico {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: block;
}

.banner {
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  border-bottom: 1px solid transparent;
}
.banner.error {
  background: #fee2e2;
  border-color: #f87171;
  color: var(--hz-danger);
}
.banner.ok {
  background: #dcfce7;
  border-color: #4ade80;
  color: var(--hz-success);
}
.banner.warn {
  background: #ffedd5;
  border-color: #fb923c;
  color: var(--hz-heading);
}
.banner.net {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #e6f8fa;
  border-color: #b7ebf0;
  color: var(--hz-heading);
}
.banner .retry {
  margin-left: 8px;
  background: transparent;
  border: 0;
  color: inherit;
  text-decoration: underline;
  min-height: var(--tap);
}

.hz-app {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--hz-body-bg);
}
.hz-body {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  align-items: flex-start;
}
.hz-body > main,
.hz-body > .page {
  flex: 1 1 auto;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: var(--hz-topbar-h);
  padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  padding-top: max(8px, env(safe-area-inset-top));
  background: var(--hz-topbar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hz-border);
  color: var(--hz-heading);
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.topbar-logo {
  display: block;
  width: min(120px, 32vw);
  height: 24px;
  background-color: var(--hz-heading);
  -webkit-mask: url("/icons/logo.svg") center / contain no-repeat;
  mask: url("/icons/logo.svg") center / contain no-repeat;
  flex: 0 1 auto;
  min-width: 84px;
}
.topbar .who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 36vw;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.topbar .who strong,
.topbar .who span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar .who strong { font-size: 0.875rem; }
.topbar .who span { font-size: 0.72rem; color: var(--hz-muted); }
.topbar .burger {
  display: inline-flex;
  flex: 0 0 auto;
  flex-shrink: 0;
}
.topbar .btn {
  flex: 0 0 auto;
  flex-shrink: 0;
  white-space: nowrap;
}
.perm-grid {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.perm-grid .check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.88rem;
}
.role-card { text-align: left; }

.sidebar {
  display: none;
}
.side-nav {
  display: grid;
  gap: 2px;
  padding: 12px 8px 16px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--tap);
  padding: 0 12px;
  border-radius: var(--hz-radius);
  color: var(--hz-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
}
.nav-item:hover { background: var(--hz-active-bg); color: var(--hz-heading); }
.nav-item.on {
  background: var(--hz-active-bg);
  color: var(--hz-primary-hover);
  box-shadow: inset 3px 0 0 var(--hz-primary);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: flex-start;
}
.drawer {
  width: min(280px, 86vw);
  height: 100%;
  max-height: 100svh;
  background: var(--hz-surface);
  border-right: 2px solid var(--hz-sidebar-border);
  overflow: auto;
  padding-bottom: env(safe-area-inset-bottom);
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: var(--hz-topbar-h);
  padding: 8px 8px 8px 16px;
  padding-top: max(8px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--hz-sidebar-border);
}

.page {
  padding: 20px max(20px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  max-width: min(960px, 100%);
  min-width: 0;
  margin: 0 auto;
  overflow-wrap: break-word;
  container-type: inline-size;
  container-name: page;
}
.hz-app.has-bottom-nav .page {
  padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
}
.page.task-detail,
.page.doc-detail {
  max-width: min(1240px, 100%);
  padding-top: 12px;
}
.page.task-detail {
  container-name: task-detail;
}
.page.doc-detail {
  container-name: doc-detail;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
.page-head h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--hz-heading);
}
.page > h1 {
  margin: 0 0 16px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--hz-heading);
}
.breadcrumb {
  margin: 0 0 8px;
  color: var(--hz-muted);
  font-size: 0.78rem;
}

.login-wrap {
  min-height: 100%;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left));
  max-width: 100%;
  overflow-x: hidden;
  background: var(--hz-body-bg);
}
.login-card {
  width: min(100%, 420px);
  max-width: 100%;
  min-width: 0;
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius-lg);
  padding: 28px 22px 24px;
  box-shadow: var(--hz-shadow);
}
.brand-logo {
  display: block;
  width: min(100%, 228px);
  height: auto;
  color: var(--hz-heading);
  margin: 0 0 20px;
}
.login-card h1 {
  margin: 0 0 20px;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--hz-heading);
}
.login-card p.lede { margin: 0 0 20px; color: var(--hz-muted); }
.pwa-install {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 12px;
  background: var(--hz-active-bg);
  border-radius: var(--hz-radius);
  text-align: left;
}
.pwa-install img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}
.pwa-install .pwa-copy { min-width: 0; flex: 1; }
.pwa-install strong { display: block; font-size: 0.92rem; }
.pwa-install span { display: block; font-size: 0.78rem; color: var(--hz-muted); }
.pwa-install .btn { flex-shrink: 0; }

label.field { display: block; margin-bottom: 14px; font-size: 0.78rem; font-weight: 650; color: var(--hz-muted); }
label.field input, label.field select, label.field textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 6px;
  min-height: var(--tap);
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius);
  background: var(--hz-input-bg);
  padding: 10px 12px;
  font-size: max(16px, 1rem);
  color: var(--hz-body-text);
}
label.field input:focus, label.field select:focus, label.field textarea:focus,
.ctl-select:focus, .ctl select:focus, .handoff-row select:focus, .handoff-row input:focus {
  outline: 2px solid var(--hz-primary);
  outline-offset: 1px;
  border-color: var(--hz-primary);
}
label.field textarea { min-height: 96px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 16px;
  border: 0;
  border-radius: var(--hz-radius);
  background: var(--hz-primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(30, 79, 212, 0.35);
}
.btn:hover:not(:disabled) { background: var(--hz-primary-hover); }
.btn:disabled { opacity: 0.65; cursor: not-allowed; }
.btn.ghost {
  background: transparent;
  color: var(--hz-primary-hover);
  border: 2px solid var(--hz-primary);
  box-shadow: none;
}
.btn.ghost:hover:not(:disabled) { background: var(--hz-active-bg); }
.btn.warn { background: var(--hz-warning); color: #fff; }
.btn.danger { background: var(--hz-danger); color: #fff; }
.btn.ok { background: var(--hz-success); color: #fff; }
.btn.block { width: 100%; text-decoration: none; }
.btn.small { min-height: 40px; padding: 0 12px; font-size: 0.9rem; }
.muted-link {
  display: block;
  margin-top: 14px;
  text-align: center;
  color: var(--hz-muted);
  font-weight: 650;
  background: none;
  border: 0;
}
button.muted-link {
  width: 100%;
  background: none;
  border: 0;
  cursor: pointer;
}
.hint { color: var(--hz-muted); font-size: 0.9rem; margin: 0 0 12px; }
.ok-note { color: var(--hz-success); font-weight: 700; }
.staff-list { display: grid; gap: 0; margin-top: 16px; }
.stack-form { display: grid; gap: 12px; margin-top: 12px; min-width: 0; }
.stack-form .btn { margin-top: 4px; }
label.field.check {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-direction: row;
}
label.field.check input { width: auto; min-height: 20px; }

.spin {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ptr-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  transform: translateY(calc(var(--ptr-pull, 0px) - 8px));
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  color: var(--hz-heading);
  font-size: 0.82rem;
  font-weight: 650;
}
.ptr-indicator[hidden] { display: none; }
.ptr-indicator .ptr-spin {
  width: 16px;
  height: 16px;
  border: 2px solid var(--hz-primary);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@media (min-width: 768px) {
  .ptr-indicator { display: none !important; }
}

.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(29, 38, 48, 0.46);
  backdrop-filter: blur(2px);
  padding: 24px;
}
.busy-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: min(280px, 86vw);
  max-width: 360px;
  background: var(--hz-surface);
  border-radius: var(--hz-radius);
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(29, 38, 48, 0.22);
}
.busy-spin {
  width: 36px;
  height: 36px;
  border-width: 3px;
  border-color: var(--hz-primary);
  border-right-color: transparent;
}
.busy-card strong {
  color: var(--hz-heading);
  font-size: 1.05rem;
}
.busy-card span:last-child {
  color: var(--hz-muted);
  font-size: 0.9rem;
}

.tiles,
.hz-list,
.staff-list,
.sites-list,
.shop-product-list,
.stack.hz-list {
  display: grid;
  gap: 0;
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius);
  overflow: hidden;
  box-shadow: none;
}
.tile,
.hz-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hz-list-line);
  border-radius: 0;
  padding: 14px 16px;
  min-height: 64px;
  cursor: pointer;
  width: 100%;
  text-decoration: none;
  color: inherit;
  box-shadow: none;
}
.tile:has(.hz-row-media),
.hz-row:has(.hz-row-media) {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.tiles .tile,
.hz-list > .hz-row,
.hz-list > .card,
.hz-list > a.card,
.staff-list > .card,
.sites-list > .card,
.stack.hz-list > .card,
.shop-product-list > .card,
.list.hz-list > .card {
  margin-bottom: 0;
  border-radius: 0;
  box-shadow: none;
  border: 0;
  border-bottom: 1px solid var(--hz-list-line);
  background: transparent;
}
.tiles .tile:last-child,
.hz-list > :last-child,
.staff-list > :last-child,
.sites-list > :last-child,
.stack.hz-list > .card:last-child,
.shop-product-list > :last-child,
.list.hz-list > .card:last-child {
  border-bottom: 0;
}
.tile:hover,
.hz-row:hover,
.hz-list > .card:hover,
.staff-list > .card:hover,
.sites-list > .card:hover,
.stack.hz-list > .card:hover,
.shop-product-list > .card:hover,
.list.hz-list > .card:hover { background: var(--hz-row-hover); }
.tile h2,
.hz-row-title {
  display: block;
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--hz-heading);
  line-height: 1.3;
}
.tile p,
.hz-row-meta {
  display: block;
  margin: 0;
  color: var(--hz-muted);
  font-size: 0.82rem;
}
.hz-row-media {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--hz-canvas);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--hz-muted);
  font-weight: 800;
}
.hz-row-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
article.hz-row { cursor: default; }
.hz-row-body { min-width: 0; }
.hz-row-aside {
  color: var(--hz-heading);
  font-weight: 750;
  font-size: 0.92rem;
  text-align: right;
  min-width: 0;
  max-width: 48%;
}

.hello { margin: 8px 0 20px; }
.hello h1 {
  margin: 0 0 4px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--hz-heading);
  overflow-wrap: break-word;
}
.hello p { margin: 0; color: var(--hz-muted); }

.toolbar {
  margin-bottom: 16px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.toolbar.card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin-bottom: 16px;
}
.toolbar .page-head { margin-bottom: 12px; }
.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0;
}
.filters select {
  width: 100%;
  min-width: 0;
  font-size: max(16px, 1rem);
}
.filters .site { grid-column: 1 / -1; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.chip {
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid var(--hz-border);
  background: var(--hz-surface);
  padding: 0 12px;
  font-weight: 650;
  color: var(--hz-muted);
  flex: 0 0 auto;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}
.chip.on {
  background: var(--hz-primary-subtle);
  color: var(--hz-primary-hover);
  border-color: var(--hz-primary);
}

.card {
  background: var(--hz-surface);
  border-radius: var(--hz-radius-lg);
  padding: 16px;
  margin-bottom: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  border: 1px solid var(--hz-border);
  overflow-wrap: break-word;
  box-shadow: none;
}
.form-card,
.login-card,
.dialog,
.sheet,
.busy-card {
  box-shadow: var(--hz-shadow);
}
button.card { cursor: pointer; }
button.card:hover,
table.board tbody tr:hover { background: var(--hz-active-bg); }
.card h3 {
  margin: 6px 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--hz-heading);
}
.task-card { border-left: 5px solid var(--hz-priority-low); }
.task-card.prio-high { border-left-color: var(--hz-priority-high); }
.task-card.prio-medium { border-left-color: var(--hz-priority-medium); }
.task-card.prio-low { border-left-color: var(--hz-priority-low); }
.meta { color: var(--hz-muted); font-size: 0.88rem; }
.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--hz-active-bg);
  color: var(--hz-heading);
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}
.badge.high { background: #fee2e2; color: var(--hz-priority-high); }
.badge.medium { background: #ffedd5; color: var(--hz-priority-medium); }
.badge.low { background: #e2e8f0; color: var(--hz-priority-low); }
.badge.open, .badge.assigned { background: #dbeafe; color: var(--hz-primary-hover); }
.badge.in_progress { background: var(--hz-primary-subtle); color: var(--hz-primary-hover); }
.badge.need_info { background: #ffedd5; color: var(--hz-warning); }
.badge.done { background: #dcfce7; color: var(--hz-success); }
.badge.rejected, .badge.denied { background: #fee2e2; color: var(--hz-danger); }
.badge.pending { background: var(--hz-active-bg); color: var(--hz-heading); }
.badge.ok { background: #dcfce7; color: var(--hz-success); }

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.card-actions select {
  min-height: 40px;
  min-width: 0;
  max-width: 100%;
  border-radius: var(--hz-radius);
  border: 1px solid var(--hz-border);
  background: var(--hz-surface);
  font-size: max(16px, 1rem);
}

.empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--hz-muted);
}

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 6;
  display: none;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  width: 100%;
  max-width: 100%;
  background: var(--hz-surface);
  border-top: 1px solid var(--hz-border);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.hz-app.has-bottom-nav .bottom-nav { display: grid; }
.bottom-nav a, .bottom-nav button {
  min-height: var(--nav-h);
  background: transparent;
  border: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--hz-muted);
  text-decoration: none;
}
.bottom-nav .on { color: var(--hz-primary); }
.bottom-nav .plus {
  font-size: 1.6rem;
  line-height: 1;
}

.section { margin: 20px 0; }
.section h2 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hz-muted);
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dialog .actions { justify-content: flex-end; }

.media-list { display: block; }
.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.media-tile {
  position: relative;
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius);
  overflow: hidden;
  min-width: 0;
}
.tile-preview {
  display: block;
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.tile-visual {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  background: var(--hz-active-bg);
  overflow: hidden;
}
.tile-visual img,
.tile-visual video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tile-glyph {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--hz-primary);
}
.tile-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(29, 38, 48, 0.72);
  color: #fff;
  font-size: 0.9rem;
}
.tile-kind {
  position: absolute;
  left: 8px;
  top: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--hz-surface);
  color: var(--hz-primary);
  border: 1px solid var(--hz-border);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}
.tile-del {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  min-width: var(--tap);
  min-height: var(--tap);
  border: 0;
  border-radius: var(--hz-radius);
  background: var(--hz-surface);
  color: var(--hz-heading);
  cursor: pointer;
}
.tile-meta {
  padding: 8px 10px 10px;
  min-width: 0;
}
.tile-meta strong {
  display: block;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile-meta span {
  color: var(--hz-muted);
  font-size: 0.75rem;
}
.preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100svh;
  overflow: hidden;
  background: rgba(19, 25, 32, 0.94);
  color: #fff;
  display: flex;
  flex-direction: column;
}
.preview-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  padding-top: max(8px, env(safe-area-inset-top));
}
.preview-bar p {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.preview-close {
  color: #fff;
  font-size: 1.8rem;
}
.preview-stage {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px calc(16px + env(safe-area-inset-bottom));
}
.preview-stage img,
.preview-stage video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.preview-stage iframe {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  border: 0;
  background: #111;
}
.preview-stage.has-pdf {
  display: block;
  padding: 0;
  height: 100%;
}
.preview-pdf {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.preview-audio {
  display: grid;
  gap: 16px;
  place-items: center;
  width: min(420px, 100%);
}
.preview-audio audio { width: 100%; }
.preview-audio .tile-glyph { font-size: 3rem; color: #fff; }
@media (min-width: 1100px) {
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 12;
  background: var(--hz-heading);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: var(--hz-shadow);
}
.hz-app.has-bottom-nav .toast {
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: var(--tap);
  padding: 0 12px;
  border-radius: 999px;
  background: var(--hz-primary-subtle);
  border: 0;
  color: var(--hz-primary);
  font-weight: 650;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}
.pill .x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
}
.avatar-stack { display: flex; gap: 4px; margin-top: 8px; }
.avatar-chip {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--hz-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}
.avatar-chip.more { background: var(--hz-active-bg); color: var(--hz-heading); }
.detail-head { margin-bottom: 12px; }
.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.task-detail h1,
.doc-detail h1 {
  margin: 2px 0 10px;
  font-size: 1.28rem;
  line-height: 1.2;
  font-weight: 700;
  color: var(--hz-heading);
}
.task-load-card {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 10px;
  padding: 32px 20px;
}
.task-load-card strong {
  font-size: 1.15rem;
  color: var(--hz-heading);
}
.task-load-card > span:last-child {
  color: var(--hz-muted);
  max-width: 22rem;
}
.task-load-skel .skel { height: 88px; }
.task-skel-hero { height: 112px; }
.task-skel-story { height: 140px; }
.task-skel-files { height: 180px; }
.task-hero {
  position: relative;
  overflow: hidden;
  border-left-width: 6px;
  margin-bottom: 12px;
  padding-bottom: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--hz-primary) 16%, var(--hz-surface)) 0 72px, var(--hz-surface) 72px);
}
.task-hero::before {
  content: "";
  display: block;
  height: 8px;
  margin: -16px -16px 14px;
  background: var(--hz-primary);
}
.task-hero.status-open::before { background: #64748b; }
.task-hero.status-assigned::before { background: var(--hz-primary-hover); }
.task-hero.status-in_progress::before { background: var(--hz-primary); }
.task-hero.status-need_info::before { background: var(--hz-warning); }
.task-hero.status-done::before { background: var(--hz-success); }
.task-hero.status-rejected::before { background: var(--hz-danger); }
.task-hero.prio-high { border-left-color: var(--hz-priority-high); }
.task-hero.prio-medium { border-left-color: var(--hz-priority-medium); }
.task-hero.prio-low { border-left-color: var(--hz-priority-low); }
.task-hero h1 {
  margin: 4px 0 0;
  font-size: 1.62rem;
  line-height: 1.15;
  color: var(--hz-heading);
}
.task-hero-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.task-hero .back { margin-bottom: 0; }
.detail-core {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.detail-story {
  border-left: 5px solid var(--hz-primary);
}
.detail-story h2,
.detail-files h2 {
  margin: 0 0 10px;
  font-size: 1.12rem;
  color: var(--hz-heading);
}
.detail-desc {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--hz-heading);
  white-space: pre-wrap;
}
.detail-desc.is-empty {
  color: var(--hz-muted);
  font-size: 0.95rem;
}
.detail-files {
  border-left: 5px solid #6610f2;
}
.task-detail .media-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.task-detail .tile-visual {
  aspect-ratio: 4 / 3;
}
.task-detail .detail-secondary {
  background: color-mix(in srgb, var(--hz-surface) 88%, var(--hz-body-bg));
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
  padding: 10px 12px;
}
.task-meta-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: var(--tap);
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.task-meta-toggle-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.task-meta-toggle-copy strong {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hz-muted);
}
.task-meta-summary {
  color: var(--hz-heading);
  font-size: 0.92rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-meta-chevron {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--hz-primary);
  color: #fff;
  flex: 0 0 auto;
  transition: transform 0.16s ease;
}
.detail-secondary.is-open .task-meta-chevron {
  transform: rotate(180deg);
}
.task-secondary-body {
  display: none;
  padding-top: 8px;
}
.detail-secondary.is-open .task-secondary-body {
  display: block;
}
.task-meta-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 0 0 4px;
}
.task-meta-item {
  min-width: 0;
}
.task-meta-item dt {
  margin: 0 0 2px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hz-muted);
}
.task-meta-item dd {
  margin: 0;
  font-size: 0.86rem;
  color: var(--hz-heading);
  font-weight: 650;
}
.task-meta-item dd em {
  display: block;
  font-style: normal;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--hz-muted);
}
.task-meta-who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.task-meta-who strong { font-size: 0.86rem; }
.task-meta-time {
  display: inline;
  margin-left: 4px;
  font-weight: 800;
  color: var(--hz-primary-hover);
  white-space: nowrap;
}
.task-meta-default {
  color: var(--hz-muted);
  font-weight: 500;
}
.task-meta-list .badge {
  font-size: 0.68rem;
  padding: 3px 7px;
}
@media (max-width: 767px) {
  .task-meta-list { grid-template-columns: 1fr; }
}
@media (min-width: 768px) {
  .task-meta-toggle {
    pointer-events: none;
    min-height: auto;
    margin-bottom: 8px;
  }
  .task-meta-summary,
  .task-meta-chevron { display: none; }
  .task-secondary-body,
  .detail-secondary.is-open .task-secondary-body,
  .detail-secondary .task-secondary-body {
    display: block;
  }
  .task-detail .media-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.task-steer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--hz-border);
}
.task-steer h2 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hz-muted);
}
.task-steer .detail-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.task-steer .ctl { min-width: 0; }
.task-steer .ctl-select,
.task-steer .ctl select,
.task-steer .ctl > strong {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
.task-media-wait {
  display: flex;
  align-items: center;
  gap: 8px;
}
.task-detail .detail-col {
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius);
  padding: 14px;
  box-shadow: var(--hz-shadow);
}
.task-detail .detail-col.detail-story,
.task-detail .detail-col.detail-files {
  padding: 16px;
}
.task-detail .detail-col.detail-secondary {
  background: color-mix(in srgb, var(--hz-surface) 88%, var(--hz-body-bg));
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
  padding: 10px 12px;
}
.task-detail .handoff-compact {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--hz-primary-subtle);
  background: color-mix(in srgb, var(--hz-primary) 12%, var(--hz-surface));
  border-radius: var(--hz-radius);
}
.task-detail .handoff-compact h2 {
  color: var(--hz-primary-hover);
}
.detail-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: end;
  margin: 0 0 4px;
}
.doc-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 8px;
  color: var(--hz-muted);
  font-size: 0.9rem;
}
.doc-kicker-site {
  font-weight: 600;
  color: var(--hz-heading);
}
.doc-kicker .badge { font-weight: 700; }
.doc-kicker-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 14px;
  color: var(--hz-muted);
  font-size: 0.82rem;
}
.doc-approval-chip {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--hz-muted);
}
.doc-extract {
  display: grid;
  gap: 2px;
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--hz-heading);
}
.doc-extract span {
  color: var(--hz-muted);
  font-weight: 600;
}
.doc-approval-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.doc-approval-inline > span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hz-muted);
}
.doc-approval-inline .ctl-select,
.doc-approval-inline select {
  min-width: 7.5rem;
}
.ctl {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.ctl > span:first-child {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hz-muted);
}
.ctl-select,
.ctl select {
  min-height: var(--tap);
  min-width: 9.5rem;
  max-width: 100%;
  border-radius: var(--hz-radius);
  border: 1px solid var(--hz-border);
  background: var(--hz-input-bg);
  padding: 0 10px;
  font-weight: 700;
  color: var(--hz-body-text);
}
.detail-grid,
.doc-grid { display: grid; gap: 14px; }
.doc-meta-form { display: grid; gap: 12px; }
.doc-table-wrap { overflow: auto; }
.doc-lines {
  display: grid;
  gap: 12px;
  container-type: inline-size;
  container-name: doc-lines;
}
.doc-lines-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.doc-lines-head h2 { margin: 0; }
.line-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius-lg);
  background: var(--hz-surface);
  box-shadow: var(--hz-shadow);
}
.line-table {
  width: 100%;
  min-width: 40rem;
  border-collapse: separate;
  border-spacing: 0;
}
.line-table th,
.line-table td {
  text-align: left;
  padding: 12px 12px;
  border-bottom: 1px solid var(--hz-border);
  font-size: 0.9rem;
  vertical-align: middle;
}
.line-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hz-muted);
  white-space: nowrap;
  background: var(--hz-surface);
}
.line-table tbody tr:last-child td { border-bottom: 0; }
.line-table tbody tr:hover td { background: var(--hz-active-bg); }
.line-table tbody tr[data-open-line] { cursor: pointer; }
.line-table tr.exception td {
  background: color-mix(in srgb, var(--hz-danger) 12%, var(--hz-surface));
  box-shadow: inset 4px 0 0 var(--hz-danger);
}
.line-table tr.exception:hover td {
  background: color-mix(in srgb, var(--hz-danger) 14%, var(--hz-active-bg));
}
.line-table td:nth-child(1),
.line-table td:nth-child(2),
.line-table td:nth-child(3) {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.line-table td:nth-child(4) { word-break: break-word; }
.line-table .badge { white-space: nowrap; }
.line-actions-cell { white-space: nowrap; width: 1%; }
.line-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sheet-backdrop.modal-center {
  align-items: center;
  justify-items: center;
}
.line-edit-dialog {
  max-width: 560px;
  max-height: min(92dvh, 760px);
  overflow: auto;
  box-shadow: var(--hz-shadow);
  border: 1px solid var(--hz-border);
}
.line-edit-dialog h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
  color: var(--hz-heading);
}
.line-edit-dialog form { display: grid; gap: 4px; }
.line-edit-dialog .actions { margin-top: 8px; }
.line-edit-dialog textarea {
  min-height: 88px;
}
@media (max-width: 479px) {
  .line-table-wrap {
    border: 0;
    box-shadow: none;
    background: transparent;
    overflow: visible;
  }
  .line-table { min-width: 0; }
  .line-table thead { display: none; }
  .line-table,
  .line-table tbody {
    display: grid;
    gap: 12px;
    width: 100%;
  }
  .line-table tr {
    display: grid;
    width: 100%;
    padding: 14px;
    border: 1px solid var(--hz-border);
    border-radius: var(--hz-radius-lg);
    background: var(--hz-surface);
    box-shadow: var(--hz-shadow);
  }
  .line-table tbody tr:last-child { border-bottom: 1px solid var(--hz-border); }
  .line-table td {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 8px;
    border: 0;
    padding: 5px 0;
    box-shadow: none !important;
    background: transparent !important;
  }
  .line-table td[data-label]::before {
    content: attr(data-label);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hz-muted);
    font-weight: 700;
  }
  .line-table td.line-actions-cell {
    display: block;
    padding-top: 10px;
  }
  .line-table tr.exception {
    border-color: color-mix(in srgb, var(--hz-danger) 45%, var(--hz-border));
    box-shadow: var(--hz-shadow), inset 4px 0 0 var(--hz-danger);
  }
  .line-row-actions { justify-content: stretch; }
  .line-row-actions .btn { flex: 1; }
}
.doc-preview {
  display: grid;
  gap: 10px;
}
.doc-preview-seg {
  display: flex;
  gap: 0;
  padding: 4px;
  border: 1px solid var(--hz-border);
  border-radius: 999px;
  background: var(--hz-active-bg);
}
.doc-preview-seg button {
  flex: 1;
  min-height: 40px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  font-weight: 700;
  color: var(--hz-muted);
}
.doc-preview-seg button.on {
  background: var(--hz-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(30, 79, 212, 0.28);
}
.doc-preview-seg button:disabled { opacity: 0.45; }
.doc-preview-frame {
  min-height: 280px;
  background: #1d2630;
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius-lg);
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: var(--hz-shadow);
}
.doc-preview-frame img,
.doc-preview-frame object {
  width: 100%;
  height: min(72vh, 760px);
  max-width: 100%;
  object-fit: contain;
  background: #1d2630;
}
.badge.uploaded { background: var(--hz-active-bg); color: var(--hz-muted); }
.badge.processing { background: #fff4e0; color: var(--hz-warning); }
.badge.ready { background: #e4f6ef; color: var(--hz-success); }
.badge.failed { background: #fde8e8; color: var(--hz-danger); }
.line-qty {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.doc-status-banner {
  padding: 12px 14px;
  border-radius: var(--hz-radius-lg);
  margin: 0 0 14px;
  background: color-mix(in srgb, var(--hz-warning) 16%, var(--hz-surface));
  color: var(--hz-heading);
  font-weight: 650;
  border: 1px solid var(--hz-warning);
}
.doc-status-banner.failed {
  background: color-mix(in srgb, var(--hz-danger) 16%, var(--hz-surface));
  border-color: var(--hz-danger);
}
.doc-hero {
  margin-bottom: 14px;
  border-left: 6px solid var(--hz-primary);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--hz-primary) 16%, var(--hz-surface)) 0 72px, var(--hz-surface) 72px);
}
.doc-hero.status-ready { border-left-color: var(--hz-success); }
.doc-hero.status-processing,
.doc-hero.status-uploaded { border-left-color: var(--hz-warning); }
.doc-hero.status-failed { border-left-color: var(--hz-danger); }
.doc-hero h1 {
  margin: 8px 0 10px;
  font-size: 1.48rem;
  color: var(--hz-heading);
}
.doc-detail .detail-col h2:not(:first-child),
.doc-files h2,
.doc-data-col .doc-lines-head { margin-top: 18px; }
.detail-col h2,
.doc-files h2 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hz-muted);
}
.doc-files {
  margin-top: 16px;
}
.doc-preview-col,
.doc-data-col,
.doc-files,
.doc-lines-panel {
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius-lg);
  padding: 16px;
  box-shadow: var(--hz-shadow);
  min-width: 0;
}
.doc-lines-panel { margin-top: 14px; }
.doc-lines-panel .doc-lines-head { margin-top: 0; }
.meta-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 0;
}
.meta-grid dt {
  color: var(--hz-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-top: 2px;
}
.meta-grid dd { margin: 0; font-size: 0.9rem; }
.detail-desc { margin: 0; }
.actions.compact { gap: 6px; margin-bottom: 8px; }
.handoff-compact {
  margin-top: 12px;
  container-type: inline-size;
  container-name: task-handoff;
}
.handoff-row {
  display: grid;
  gap: 8px;
}
.handoff-row .btn { width: 100%; }
.handoff-row select,
.handoff-row input {
  min-height: var(--tap);
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius);
  background: var(--hz-input-bg);
  padding: 0 10px;
  font-size: max(16px, 1rem);
  color: var(--hz-body-text);
}
.task-detail .composer {
  position: sticky;
  bottom: 0;
  margin-top: 8px;
}
.task-detail .composer textarea { min-height: 72px; }
.overflow-menu { position: relative; }
.icon-btn {
  min-width: var(--tap);
  min-height: var(--tap);
  border: 0;
  background: transparent;
  font-size: 1.3rem;
  cursor: pointer;
  color: inherit;
  display: inline-grid;
  place-items: center;
  border-radius: var(--hz-radius);
}
.icon-btn:hover { background: var(--hz-active-bg); }
.menu-pop {
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius);
  box-shadow: var(--hz-shadow);
  min-width: 160px;
  display: grid;
  z-index: 7;
}
.menu-pop button {
  min-height: var(--tap);
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0 14px;
}
.menu-pop button:hover { background: var(--hz-active-bg); }
.danger-text { color: var(--hz-danger); font-weight: 700; }
.chip-row.inline { display: inline-flex; }
.media-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--hz-active-bg);
  border-radius: var(--hz-radius);
  padding: 8px 10px;
}
.media-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
}
.file-icon { font-size: 1.4rem; }
.comment.reply {
  margin-left: 16px;
  border-left: 3px solid var(--hz-border);
}
.linkish {
  background: none;
  border: 0;
  color: var(--hz-primary);
  font-weight: 700;
  min-height: var(--tap);
  padding: 0;
  cursor: pointer;
}
.composer {
  position: sticky;
  bottom: 0;
  background: var(--hz-surface);
  padding: 10px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 4;
}
.hz-app.has-bottom-nav .composer,
.hz-app.has-bottom-nav .task-detail .composer {
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
.mention-suggest {
  max-height: 40vh;
  overflow: auto;
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius);
  box-shadow: var(--hz-shadow);
  margin-bottom: 8px;
}
.mention-suggest button,
.suggest-list button {
  display: block;
  width: 100%;
  text-align: left;
  min-height: var(--tap);
  border: 0;
  background: transparent;
  padding: 0 12px;
}
.mention-suggest button:hover,
.suggest-list button:hover { background: var(--hz-active-bg); }
.suggest-list {
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius);
  box-shadow: var(--hz-shadow);
  max-height: 40vh;
  overflow: auto;
  margin-bottom: 10px;
}
.form-card { padding: 16px; }
.task-form-grid { display: grid; gap: 8px; }
.create-media {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 2px solid var(--hz-primary, #4680ff);
  border-radius: var(--hz-radius, 12px);
  background: color-mix(in srgb, var(--hz-primary, #4680ff) 12%, var(--hz-surface));
}
.create-media-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dept-assign {
  border: 1px solid var(--hz-border, #d0d5dd);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 8px;
}
.dept-assign legend { font-weight: 700; }
.dept-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.dept-row select { flex: 1 1 140px; min-width: 0; }
.sticky-form-actions {
  position: sticky;
  bottom: 0;
  background: var(--hz-surface);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
@media (min-width: 768px) {
  .sticky-form-actions { position: static; padding: 8px 0 0; }
}
@container page (min-width: 900px) {
  .task-form-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .task-form-grid .btn.block,
  .task-form-grid .sticky-form-actions { grid-column: 1 / -1; }
}
.media-item img, .media-item video {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #ccc;
}
.comment {
  background: var(--hz-active-bg);
  border-radius: var(--hz-radius-lg);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.comment .when { font-size: 0.78rem; color: var(--hz-muted); }
.mention { color: var(--hz-primary); font-weight: 700; }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 30;
  display: grid;
  align-items: end;
}
.sheet {
  background: var(--hz-surface);
  border-radius: var(--hz-radius-lg) var(--hz-radius-lg) 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  max-height: 92dvh;
  overflow: auto;
}
.dialog {
  background: var(--hz-surface);
  border-radius: var(--hz-radius-lg);
  padding: 20px;
  margin: auto 16px;
  max-width: 420px;
  width: calc(100% - 32px);
}
.skel {
  height: 72px;
  border-radius: var(--hz-radius);
  background: linear-gradient(90deg, var(--hz-active-bg), var(--hz-surface), var(--hz-active-bg));
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  margin-bottom: 10px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.table-wrap { display: none; overflow: auto; }
table.board {
  width: 100%;
  border-collapse: collapse;
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius);
  overflow: hidden;
}
table.board th, table.board td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hz-border);
  font-size: 0.875rem;
}
table.board th {
  color: var(--hz-muted);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
table.board tr { cursor: pointer; }

.back {
  background: transparent;
  border: 0;
  min-height: var(--tap);
  padding: 0;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--hz-primary);
  cursor: pointer;
}

.fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 7;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--hz-primary);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  box-shadow: var(--hz-shadow);
  cursor: pointer;
}
.hz-app.has-bottom-nav .fab {
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
}

.sites-list { display: grid; gap: 0; }
.site-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; }

@media (min-width: 768px) {
  body { font-size: 0.875rem; }
  .cards { display: none; }
  .table-wrap { display: block; }
  .sheet-backdrop { align-items: center; }
  .sheet {
    border-radius: var(--hz-radius-lg);
    margin: 0 auto;
    width: min(520px, 100%);
    max-height: 80dvh;
  }
  .topbar {
    gap: 12px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  .topbar .burger { display: none; }
  .topbar .brand { gap: 10px; flex: 0 0 auto; }
  .topbar-logo {
    width: 148px;
    height: 28px;
    flex-shrink: 0;
  }
  .topbar .who { max-width: 220px; }
  .sidebar {
    display: flex;
    flex-direction: column;
    width: var(--hz-sidebar-w);
    flex: 0 0 var(--hz-sidebar-w);
    position: sticky;
    top: var(--hz-topbar-h);
    align-self: flex-start;
    min-height: calc(100svh - var(--hz-topbar-h));
    background: var(--hz-surface);
    border-right: 2px solid var(--hz-sidebar-border);
  }
  .fab { display: none; }
  .task-steer .detail-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
  }
  .task-steer .ctl-select,
  .task-steer .ctl select {
    min-width: 9.5rem;
    width: auto;
  }
  .task-detail .composer { position: sticky; bottom: 0; }
}
@media (min-width: 1100px) {
  .filters { grid-template-columns: 1fr 1fr 1fr auto; align-items: end; }
  .filters .site { grid-column: auto; }
}

@container doc-detail (min-width: 960px) {
  .doc-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 18px;
    align-items: start;
  }
  .doc-meta-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
  }
  .doc-meta-form .btn { grid-column: 1 / -1; }
  .doc-grid .doc-preview-col,
  .doc-grid .doc-data-col {
    max-height: calc(100svh - var(--hz-topbar-h) - 120px);
    overflow: auto;
  }
}

/* Task detail: stack on tablet / crushed panes; comments become a column only when wide. */
@container task-detail (min-width: 840px) {
  .detail-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
    gap: 16px;
    align-items: start;
  }
  .detail-talk {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 8px;
    max-height: calc(100svh - var(--hz-topbar-h) - 80px);
    overflow: auto;
  }
}
@container task-detail (min-width: 1080px) {
  .detail-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
    gap: 18px;
  }
}
@container task-handoff (min-width: 560px) {
  .handoff-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center;
  }
  .handoff-row .btn { width: auto; }
}

/* S11 Able-Pro UX: login-v2, avatar, shell, kanban */
.auth-main {
  min-height: 100svh;
  background: var(--hz-body-bg);
}
.auth-wrapper.v2 {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}
.auth-sidecontent {
  height: 160px;
  max-height: 160px;
  overflow: hidden;
  background: var(--hz-heading);
}
.img-auth-side {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.auth-form {
  display: grid;
  place-items: start center;
  padding: 20px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left));
  flex: 1 1 auto;
}
.topbar-end {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex: 0 0 auto;
}
.topbar-pop { position: relative; }
.avatar-chip-btn {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.hz-avatar {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--hz-avatar-bg, var(--hz-avatar-1));
  color: #fff;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  overflow: hidden;
  position: relative;
  flex: 0 0 auto;
}
.hz-avatar > span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: inherit;
  line-height: 1;
  text-align: center;
}
.hz-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hz-avatar-chip { width: 36px; height: 36px; font-size: 0.72rem; }
.hz-avatar-side { width: 44px; height: 44px; font-size: 0.78rem; }
.hz-avatar-profile { width: 72px; height: 72px; font-size: 1.1rem; }
.hz-avatar-mini { width: 28px; height: 28px; font-size: 0.65rem; }
.hz-avatar-chat { width: 48px; height: 48px; font-size: 0.85rem; }
.avatar-spin {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
}
.avatar-spin::after {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: hz-spin 0.7s linear infinite;
}
@keyframes hz-spin { to { transform: rotate(360deg); } }
.pc-user-card {
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--hz-sidebar-border);
}
.user-card-main {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 4px 4px 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.user-card-main:disabled { cursor: default; }
.user-card-text {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
}
.user-card-text strong {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-card-text span {
  font-size: 0.75rem;
  color: var(--hz-muted);
}
.user-card-chevron {
  color: var(--hz-muted);
  transition: transform 0.15s ease;
}
.user-card-chevron.open { transform: rotate(180deg); }
.user-card-menu { display: none; padding: 4px 0 8px; }
.user-card-menu.open { display: grid; gap: 2px; }
.user-card-menu a,
.user-card-menu button {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--hz-radius);
  background: transparent;
  color: var(--hz-heading);
  text-decoration: none;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.user-card-menu a:hover,
.user-card-menu button:hover { background: var(--hz-active-bg); }
.user-menu,
.bell-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 16;
  width: min(320px, calc(100vw - 24px));
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius);
  box-shadow: var(--hz-shadow);
  padding: 10px;
}
.user-menu-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 4px 10px;
  border-bottom: 1px solid var(--hz-border);
  margin-bottom: 6px;
}
.user-menu-row strong { display: block; }
.user-menu-row > div span { display: block; font-size: 0.78rem; color: var(--hz-muted); }
.user-menu a,
.user-menu button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  text-align: left;
  font-weight: 600;
  color: var(--hz-heading);
  text-decoration: none;
  cursor: pointer;
}
.bell-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.bell-empty { margin: 8px 0 4px; font-weight: 650; }
.bell-hint { margin: 0; color: var(--hz-muted); font-size: 0.82rem; }
.profile-avatar {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.avatar-upload-btn {
  position: relative;
  width: 72px;
  height: 72px;
  min-height: 44px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.camera-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--hz-primary);
  color: #fff;
  display: grid;
  place-items: center;
}
.camera-badge .ico { width: 14px; height: 14px; }
.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
}
.swatch.on { box-shadow: 0 0 0 2px var(--hz-primary); }
.profile-grid { display: grid; gap: 16px; }
.kanban-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  padding: 4px 0 12px;
}
.kanban-stage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  min-height: 36px;
  padding: 6px 10px 6px 12px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: var(--hz-surface);
  color: var(--hz-heading);
  font-weight: 650;
  font-size: 0.85rem;
  line-height: 1.2;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  cursor: pointer;
}
.kanban-stage-label,
.kanban-stage-count {
  display: inline-block;
  white-space: nowrap;
}
.kanban-stage-count {
  min-width: 1.5em;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 800;
  text-align: center;
  background: rgba(15, 23, 42, 0.1);
}
.kanban-stage.stage-open,
.kanban-stage.stage-assigned {
  background: #dbeafe;
  color: var(--hz-primary-hover);
  border-color: #60a5fa;
}
.kanban-stage.stage-in_progress {
  background: var(--hz-primary-subtle);
  color: var(--hz-primary-hover);
  border-color: var(--hz-primary);
}
.kanban-stage.stage-need_info {
  background: #ffedd5;
  color: var(--hz-warning);
  border-color: #fb923c;
}
.kanban-stage.stage-done {
  background: #dcfce7;
  color: var(--hz-success);
  border-color: #4ade80;
}
.kanban-stage.stage-rejected {
  background: #fee2e2;
  color: var(--hz-danger);
  border-color: #f87171;
}
.kanban-stage.on {
  box-shadow: 0 0 0 2px var(--hz-heading);
  font-weight: 800;
}
.kanban-board { display: none; }
.kanban-mobile { display: block; }
.kanban-col header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.kanban-col h2 {
  margin: 0;
  font-size: 0.95rem;
}
.kanban-col header span { color: var(--hz-muted); font-weight: 700; }
.kanban-cards { display: grid; gap: 8px; }
.kanban-card { text-align: left; cursor: pointer; }
.kanban-card.is-moving { opacity: 0.6; }
.kanban-who {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  color: var(--hz-muted);
  font-size: 0.82rem;
}
.kanban-skel { display: none; }
.empty.mini { padding: 16px; font-size: 0.85rem; }
.sheet-list { display: grid; gap: 4px; margin: 8px 0 16px; }
.sheet-item {
  min-height: 44px;
  border: 0;
  background: var(--hz-active-bg);
  border-radius: var(--hz-radius);
  text-align: left;
  padding: 0 12px;
  font-weight: 650;
  cursor: pointer;
}
@media (max-width: 767px) {
  .bell-panel {
    position: fixed;
    top: calc(var(--hz-topbar-h) + env(safe-area-inset-top));
    left: 0;
    right: 0;
    width: auto;
    max-height: 70vh;
    overflow: auto;
    border-radius: 0 0 var(--hz-radius-lg) var(--hz-radius-lg);
  }
}
@media (min-width: 768px) {
  .auth-wrapper.v2 { flex-direction: row; min-height: 100svh; }
  .auth-sidecontent {
    flex: 1 1 50%;
    height: auto;
    max-height: none;
    min-height: 100svh;
  }
  .auth-form {
    flex: 1 1 50%;
    place-items: center;
    padding: 40px 32px;
  }
}
@media (min-width: 1100px) {
  .kanban-chips,
  .kanban-mobile { display: none; }
  .kanban-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
    align-items: stretch;
  }
  .kanban-col {
    flex: 0 0 280px;
    min-width: 280px;
    background: var(--hz-active-bg);
    border: 1px solid var(--hz-border);
    border-radius: var(--hz-radius);
    padding: 12px;
    box-shadow: var(--hz-shadow);
  }
  .kanban-skel {
    display: flex;
    gap: 12px;
  }
  .kanban-skel .skel {
    flex: 0 0 280px;
    min-height: 220px;
  }
  .profile-grid {
    grid-template-columns: 1fr 1fr;
    max-width: 960px;
    margin: 0 auto;
  }
}

.capture-launch {
  display: grid;
  gap: 8px;
  margin: 12px 0 16px;
}
.capture-launch .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
}
.page.doc-capture {
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - var(--hz-topbar-h) - env(safe-area-inset-top));
  max-width: min(720px, 100%);
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.capture-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0 0 12px;
}
@media (min-width: 1100px) {
  .capture-meta { grid-template-columns: 1fr 1fr; }
}
.capture-preview {
  flex: 1 1 auto;
  min-height: 240px;
  display: grid;
  place-items: center;
  background: var(--hz-body-bg);
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius);
  overflow: hidden;
}
.capture-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 52vh;
}
.capture-dock {
  margin-top: 12px;
  padding-top: 8px;
}
.capture-film {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 10px;
  min-height: 72px;
}
.capture-thumb {
  position: relative;
  flex: 0 0 64px;
  width: 64px;
}
.capture-thumb img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--hz-border);
  background: var(--hz-surface);
}
.capture-thumb span {
  display: block;
  font-size: 0.7rem;
  color: var(--hz-muted);
  text-align: center;
  margin-top: 2px;
}
.capture-thumb-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 99px;
  background: var(--hz-heading);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.capture-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.capture-ico,
.capture-go {
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 99px;
  border: 1px solid var(--hz-border);
  background: var(--hz-surface);
  color: var(--hz-heading);
  cursor: pointer;
}
.capture-go {
  margin-left: auto;
  border-color: var(--hz-primary);
  background: var(--hz-primary);
  color: #fff;
}
.capture-go:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Catalog article form — Able-Pro stacked fields, mobile-first */
.catalog-form {
  display: grid;
  gap: 16px;
  min-width: 0;
  overflow-wrap: break-word;
}
.catalog-form-head .hint { margin-bottom: 0; }
.catalog-form .form-section {
  display: grid;
  gap: 12px;
  margin: 0;
  min-width: 0;
  padding: 14px 12px 16px;
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius);
  background: color-mix(in srgb, var(--hz-active-bg) 28%, var(--hz-surface));
}
.catalog-form .form-section legend,
.catalog-form .field-legend {
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hz-primary-hover);
}
.catalog-form .field { margin-bottom: 0; }
.catalog-form .field-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 550;
  color: var(--hz-muted);
}
.site-picker { display: grid; gap: 10px; min-width: 0; }
.site-picker[hidden] { display: none; }
.site-picker-region {
  margin: 4px 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--hz-heading);
}
.site-picker-grid {
  display: grid;
  gap: 8px;
}
.site-picker-grid .field.check {
  min-height: var(--tap);
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius);
  background: var(--hz-surface);
  font-size: 1rem;
  font-weight: 650;
  color: var(--hz-heading);
}
.catalog-form .form-section > .field.check {
  min-height: var(--tap);
  font-size: 1rem;
  font-weight: 650;
  color: var(--hz-heading);
}
.catalog-form .sticky-form-actions { margin-top: 4px; }
.catalog-form-error {
  margin: 0;
  border-radius: var(--hz-radius);
  border: 1px solid #f87171;
}
@media (min-width: 1100px) {
  .site-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.shop-assign-list {
  display: grid;
  gap: 12px;
  margin: 20px 0 28px;
}
.shop-assign-list h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--hz-heading);
}
.shop-assign-kind {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.shop-assign-add {
  margin: 0;
}
.shop-assign-staff {
  display: grid;
  gap: 12px;
}

/* Shop-like orders / catalog / warehouse — one field per row on mobile */
.shop-page .page-head {
  display: grid;
  justify-items: start;
  gap: 4px;
}
.shop-page .page-head h1 { margin-top: 4px; }
a.back {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.shop-toolbar {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.shop-form {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.shop-form h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--hz-heading);
}
.shop-form .field { margin-bottom: 0; }
.shop-product-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  text-decoration: none;
  color: inherit;
}
.shop-thumb,
.shop-hero-empty,
.shop-thumb-fallback {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: var(--hz-radius);
  background: var(--hz-active-bg);
  color: var(--hz-heading);
  font-weight: 800;
  font-size: 1.4rem;
  overflow: hidden;
}
.shop-thumb img,
.shop-hero img,
.shop-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.shop-product-copy h3 { margin-top: 6px; }
.shop-excerpt,
.shop-desc {
  margin: 8px 0 0;
  color: var(--hz-body-text);
  line-height: 1.45;
}
.shop-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shop-hero {
  padding: 0;
  overflow: hidden;
  background: var(--hz-surface);
}
.shop-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  background: var(--hz-surface);
  border-top: 1px solid var(--hz-border);
}
.shop-hero-actions .field-hint {
  flex: 1 1 100%;
  margin: 0;
  color: var(--hz-muted);
}
.shop-photo-pick {
  position: relative;
  cursor: pointer;
}
.shop-photo-pick input[hidden] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.shop-variant-photo-ctl {
  max-width: none;
}
.shop-hero img,
.shop-hero-empty {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  max-height: 320px;
}
.shop-hero-empty {
  width: 100%;
  height: 180px;
  font-size: 2.4rem;
}
.shop-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.shop-photo {
  margin: 0;
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius);
  overflow: hidden;
}
.shop-photo img { aspect-ratio: 1; }
.shop-photo .linkish,
.shop-file .linkish {
  display: block;
  width: 100%;
  padding: 8px;
  text-align: center;
}
.shop-files { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.shop-file {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.shop-variant-list { display: grid; gap: 10px; margin: 12px 0; }
.shop-variant-head {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.shop-variant-head:has(h3):not(:has(img)) { grid-template-columns: minmax(0, 1fr); }
.shop-variant-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
}
.shop-price { font-weight: 750; color: var(--hz-heading); }
@media (min-width: 1100px) {
  .shop-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-product-card { grid-template-columns: 120px minmax(0, 1fr); }
  .shop-thumb { width: 120px; height: 120px; }
  .shop-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.shop-filters {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}
.shop-filter-label {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--hz-muted);
}
.shop-filter-kind .chip-row { margin: 0; }
.shop-order-list { gap: 12px; }
.shop-order-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--hz-border);
  box-shadow: var(--hz-shadow);
}
.shop-order-head h3 {
  margin: 8px 0 0;
  color: var(--hz-heading);
}
.shop-qty-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.shop-qty-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0 0;
  border-top: 1px solid var(--hz-border);
}
.shop-qty-media {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--hz-active-bg);
  display: grid;
  place-items: center;
  color: var(--hz-heading);
  font-weight: 800;
}
.shop-qty-media img,
.shop-qty-media .shop-thumb-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.shop-qty-media .shop-thumb-fallback {
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}
@media (max-width: 379px) {
  .shop-qty-row {
    grid-template-columns: 56px minmax(0, 1fr);
  }
  .shop-qty-row .shop-qty {
    grid-column: 1 / -1;
    justify-self: start;
  }
}
.shop-qty-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.shop-qty-copy strong {
  color: var(--hz-heading);
}
.shop-stock {
  display: grid;
  gap: 4px;
  margin: 4px 0 2px;
}
.shop-stock-qty {
  font-weight: 800;
  color: var(--hz-heading);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.shop-stock-qty.is-empty {
  color: var(--hz-warning);
}
.shop-stock-break,
.shop-qty-copy .shop-stock-qty {
  display: block;
  font-size: 0.92rem;
}
.shop-stock-break {
  color: var(--hz-muted);
}
.shop-stock-ctl {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  align-items: start;
}
.shop-stock-ctl select,
.shop-stock-reason input {
  background: var(--hz-input-bg);
  color: var(--hz-heading);
  border: 1px solid var(--hz-border);
}
.shop-stock-reason {
  margin: 0;
}
.shop-stock-reason input {
  min-height: 40px;
}
.shop-wh-article {
  margin: 16px 0 0;
}
.shop-wh-article h2 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--hz-heading);
}
@media (min-width: 768px) {
  .shop-stock-ctl {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }
  .shop-stock-reason {
    grid-column: 1 / -1;
  }
}
.shop-qty {
  display: inline-grid;
  grid-template-columns: 44px minmax(56px, 72px) 44px;
  align-items: center;
  border: 2px solid var(--hz-heading);
  border-radius: 10px;
  overflow: hidden;
  background: var(--hz-surface);
}
.shop-qty button {
  width: 44px;
  height: 44px;
  border: 0;
  background: var(--hz-active-bg);
  color: var(--hz-heading);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.shop-qty button:hover { background: var(--hz-primary-subtle); }
.shop-qty input {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--hz-heading);
  background: var(--hz-surface);
  -moz-appearance: textfield;
}
.shop-qty input::-webkit-outer-spin-button,
.shop-qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.shop-cart-bar {
  position: sticky;
  bottom: 12px;
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 2px solid var(--hz-heading);
  box-shadow: var(--hz-shadow);
  background: var(--hz-surface);
  z-index: 3;
}
.shop-cart-summary {
  margin: 0;
  font-weight: 800;
  color: var(--hz-heading);
}
@media (min-width: 1100px) {
  .shop-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-filters .field:nth-child(3) { grid-column: 1 / -1; }
}

/* Slice 15 Nachrichten — Able Application/Chat rebuilt with contrast tokens.
   Kit Chat-Sidebar stays Out; this is the Application Chat pattern. */
.hz-app:has(.hz-messages-page) {
  height: 100svh;
  max-height: 100svh;
  overflow: hidden;
}
.hz-body:has(.hz-messages-page) {
  align-items: stretch;
  min-height: 0;
  height: calc(100svh - var(--hz-topbar-h));
  max-height: calc(100svh - var(--hz-topbar-h));
  overflow: hidden;
}
.hz-body:has(.hz-messages-page) .sidebar {
  align-self: stretch;
  min-height: 0;
  overflow: auto;
}
.hz-body:has(.hz-messages-page) > main,
.hz-body:has(.hz-messages-page) > .page {
  min-height: 0;
  height: 100%;
}
.page.hz-messages-page {
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: 100%;
  padding: 12px max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.hz-app-chat {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  box-shadow: var(--hz-shadow);
  border-radius: 16px;
  overflow: hidden;
}
.hz-chat-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--hz-surface);
  border-right: 1px solid var(--hz-border);
}
.hz-chat-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 8px;
}
.hz-chat-kicker {
  margin: 0 0 2px;
  color: var(--hz-primary-hover);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hz-chat-list-head h1 {
  margin: 0;
  font-size: 1.45rem;
  color: var(--hz-heading);
}
.hz-chat-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--hz-primary);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(70, 128, 255, 0.38);
}
.hz-chat-new:hover { background: var(--hz-primary-hover); }
.hz-chat-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 16px 10px;
  padding: 0 14px;
  min-height: 46px;
  border: 1px solid var(--hz-border);
  border-radius: 999px;
  background: var(--hz-canvas);
  color: var(--hz-muted);
}
.hz-chat-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--hz-body-text);
  outline: none;
}
.hz-chat-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 10px;
}
.hz-chat-filter {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--hz-border);
  border-radius: 999px;
  background: var(--hz-surface);
  color: var(--hz-muted);
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
}
.hz-chat-filter.on {
  background: var(--hz-primary);
  border-color: var(--hz-primary);
  color: #fff;
  box-shadow: 0 6px 14px rgba(70, 128, 255, 0.28);
}
.hz-inbox-list {
  display: grid;
  align-content: start;
  overflow: auto;
  padding-bottom: 12px;
}
.hz-inbox-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hz-list-line);
  color: var(--hz-body-text);
  padding: 14px 16px;
  text-decoration: none;
  min-height: 84px;
  position: relative;
}
.hz-inbox-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--hz-primary);
}
.hz-inbox-row.task::before { background: var(--hz-warning); }
.hz-inbox-row.unknown { border-bottom-style: dashed; }
.hz-inbox-row.unknown::before { background: var(--hz-muted); }
.hz-inbox-row.unread { background: var(--hz-unread-bg); }
.hz-inbox-row.unread .hz-inbox-copy strong { font-weight: 800; }
.hz-inbox-row.on {
  background: var(--hz-active-bg);
}
.hz-inbox-row:hover { background: var(--hz-row-hover); }
.hz-inbox-copy { min-width: 0; }
.hz-inbox-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.hz-inbox-copy strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--hz-heading);
  font-size: 0.98rem;
  line-height: 1.25;
}
.hz-inbox-topline time {
  flex: 0 0 auto;
  color: var(--hz-muted);
  font-size: 0.72rem;
  font-weight: 750;
}
.hz-inbox-copy p {
  margin: 4px 0 0;
  color: var(--hz-muted);
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hz-inbox-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}
.hz-kind-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}
.hz-kind-chip.dm { background: #c9dbff; color: #1e4fd4; }
.hz-kind-chip.task { background: #ffedd5; color: #c2410c; }
.hz-kind-chip.unknown { background: #e2e8f0; color: #334155; }
.hz-badge-ack {
  display: inline-block;
  background: var(--hz-danger);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 800;
}
.hz-unread {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--hz-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(70, 128, 255, 0.35);
}
.hz-chat-avatar {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}
.hz-chat-avatar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--hz-primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(70, 128, 255, 0.25);
}
.hz-chat-avatar.task::after { background: var(--hz-warning); }
.hz-chat-avatar.unknown::after { background: var(--hz-muted); }
.hz-chat-avatar-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #4680ff, #6610f2);
  color: #fff;
  box-shadow: 0 8px 18px rgba(70, 128, 255, 0.35);
}
.hz-chat-avatar-mark::after { display: none; }
.hz-bell-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--hz-danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}
.icon-btn { position: relative; }
.hz-chat-stage,
.hz-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: var(--hz-canvas);
}
.hz-chat-head {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--hz-surface);
  border-bottom: 3px solid var(--hz-primary);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}
.hz-chat.hz-chat-stage:has(.hz-kind-chip.task) .hz-chat-head {
  border-bottom-color: var(--hz-warning);
}
.hz-chat-head h1 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--hz-heading);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}
.hz-chat-head-copy { min-width: 0; flex: 1 1 12rem; }
.hz-chat-head-copy p {
  margin: 4px 0 0;
  color: var(--hz-muted);
  font-size: 0.8rem;
  font-weight: 650;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.hz-chat-task-link { flex: 0 0 auto; }
.hz-chat-back {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--hz-active-bg);
  color: var(--hz-primary-hover);
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
.hz-chat-back .ico { transform: rotate(180deg); }
.hz-chat-canvas {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}
.hz-chat-thread {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--hz-canvas);
  overscroll-behavior: contain;
}
.hz-chat-thread::before {
  content: "";
  flex: 1 1 auto;
  min-height: 0;
}
.hz-jump-latest {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 14px 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--hz-primary);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(30, 79, 212, 0.4);
  cursor: pointer;
}
.hz-jump-latest[hidden] { display: none !important; }
.hz-jump-latest .ico { transform: rotate(90deg); }
.hz-chat-day {
  display: grid;
  place-items: center;
  margin: 4px 0;
}
.hz-chat-day span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  color: var(--hz-muted);
  font-size: 0.72rem;
  font-weight: 800;
}
.hz-chat-line {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  max-width: 100%;
}
.hz-chat-line.me { justify-content: flex-end; }
.hz-chat-bubble {
  max-width: min(82%, 560px);
  min-width: min(48%, 160px);
  background: var(--hz-surface);
  border: 1px solid #9db6e8;
  color: var(--hz-body-text);
  border-radius: 18px 18px 18px 6px;
  padding: 12px 14px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1);
}
.hz-chat-line.me .hz-chat-bubble {
  background: var(--hz-primary);
  color: #fff;
  border-color: var(--hz-primary-hover);
  border-radius: 18px 18px 6px 18px;
  box-shadow: 0 12px 22px rgba(30, 79, 212, 0.38);
}
.hz-chat-bubble { position: relative; }
.hz-chat-bubble p { margin: 0; overflow-wrap: anywhere; }
.hz-chat-link {
  color: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.hz-chat-line.me .hz-chat-link { color: #fff; }
.hz-chat-quote {
  display: grid;
  gap: 2px;
  margin: 0 0 8px;
  padding: 8px 10px;
  border-left: 4px solid #e58a00;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 0.82rem;
}
.hz-chat-line:not(.me) .hz-chat-quote {
  background: #efe7ff;
  border-left-color: #6610f2;
}
.hz-chat-quote strong { display: block; }
.hz-chat-quote span { opacity: 0.88; }
.hz-chat-deleted { font-style: italic; opacity: 0.8; }
.hz-chat-edited { margin-left: 6px; font-weight: 650; opacity: 0.8; }
.hz-chat-fwd {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.85;
}
.hz-msg-more {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.12);
  color: inherit;
  cursor: pointer;
}
.hz-chat-line.me .hz-msg-more { background: rgba(255, 255, 255, 0.18); }
.hz-msg-check {
  width: 28px;
  height: 28px;
  border: 2px solid #8ea0b8;
  border-radius: 999px;
  background: var(--hz-surface);
  color: transparent;
  align-self: center;
  cursor: pointer;
}
.hz-msg-check.on {
  background: var(--hz-primary);
  border-color: var(--hz-primary);
  color: #fff;
}
.hz-chat-line.selected .hz-chat-bubble { outline: 2px solid var(--hz-warning); }
.hz-chat-context {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.hz-chat-context .hz-chat-quote { flex: 1; margin: 0; }
.hz-chat-selectbar p { margin: 0 0 8px; }
.hz-select-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hz-emoji-btn { background: #2ca87f; }
.hz-emoji-btn.on { outline: 3px solid #9be7c8; }
.hz-emoji-pop {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid var(--hz-border);
  border-radius: 16px;
  background: var(--hz-surface);
  box-shadow: var(--hz-shadow);
}
.hz-emoji-pop button {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--hz-canvas);
  font-size: 1.15rem;
  cursor: pointer;
}
.hz-emoji-pop button:hover { background: var(--hz-row-hover); }
.hz-msg-sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: end;
}
.hz-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(11, 18, 32, 0.45);
}
.hz-msg-sheet-card {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100% - 24px));
  margin: 0 auto max(12px, env(safe-area-inset-bottom));
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--hz-border);
  border-radius: 20px 20px 16px 16px;
  background: var(--hz-surface);
  box-shadow: var(--hz-shadow);
}
.hz-msg-sheet-card header {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px 10px;
}
.hz-msg-sheet-card button[data-act],
.hz-forward-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: var(--hz-canvas);
  color: var(--hz-heading);
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}
.hz-msg-sheet-card button[data-act]:hover,
.hz-forward-list button:hover { background: var(--hz-row-hover); }
.hz-forward-list {
  max-height: 42vh;
  overflow: auto;
  display: grid;
  gap: 4px;
}
.hz-chat-bubble audio,
.hz-chat-bubble img {
  max-width: 100%;
  display: block;
  margin-top: 6px;
  border-radius: 10px;
}
.hz-chat-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}
.hz-chat-line:not(.me) .hz-chat-file {
  background: #efe7ff;
  color: #6610f2;
}
.hz-chat-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 4px;
  opacity: 0.82;
}
.hz-chat-composer {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 4;
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  background: var(--hz-surface);
  border-top: 1px solid var(--hz-border);
}
.hz-chat-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.hz-chat-composer textarea {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  max-height: 168px;
  padding: 14px 16px;
  border: 1px solid var(--hz-border);
  border-radius: 20px;
  background: var(--hz-canvas);
  font-size: max(16px, 1rem);
  line-height: 1.35;
  resize: none;
  overflow-y: auto;
}
.hz-chat-composer.is-edit textarea,
.hz-chat-composer textarea.is-edit {
  min-height: calc(1.35em * 4 + 28px);
  max-height: calc(1.35em * 4 + 28px);
  border-radius: 16px;
}
.hz-chat-tools {
  display: none;
  flex: 0 0 auto;
  gap: 8px;
  padding: 0 2px 10px;
}
.hz-chat-tools.open {
  display: flex;
}
.hz-tool {
  display: inline-grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.2);
}
.hz-tool-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.hz-tool-plus {
  background: var(--hz-heading);
  flex: 0 0 auto;
  transition: transform 0.15s ease, background 0.15s ease;
}
.hz-tool-plus.on {
  background: var(--hz-primary);
  transform: rotate(45deg);
}
.hz-tool-rec { background: #e58a00; }
.hz-tool-rec.on { outline: 3px solid #ffd79a; animation: hz-rec-pulse 1s ease-in-out infinite; }
.hz-tool-photo { background: #04a9f5; }
.hz-tool-file { background: #6610f2; }
@keyframes hz-rec-pulse {
  50% { box-shadow: 0 0 0 6px rgba(229, 138, 0, 0.28); }
}
.hz-send {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 48px;
  min-height: 48px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--hz-primary);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(70, 128, 255, 0.4);
  cursor: pointer;
}
.hz-send:disabled { opacity: 0.65; cursor: not-allowed; }
.hz-chat-blank {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px;
}
.hz-chat-thread .hz-chat-blank {
  min-height: 240px;
}
.hz-chat-blank-card {
  width: min(420px, 100%);
  text-align: center;
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  box-shadow: var(--hz-shadow);
  border-radius: 20px;
  padding: 32px 24px;
}
.hz-chat-blank-card .hz-blank-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(135deg, #4680ff 0%, #04a9f5 52%, #6610f2 100%);
  color: #fff;
  box-shadow: 0 12px 24px rgba(70, 128, 255, 0.38);
}
.hz-chat-blank-card h2 {
  margin: 0 0 8px;
  color: var(--hz-heading);
}
.hz-chat-blank-card p { margin: 0 0 16px; color: var(--hz-muted); }
.hz-chat-quiet {
  margin: auto;
  padding: 24px 12px;
  text-align: center;
  color: var(--hz-muted);
  font-size: 0.92rem;
}
.hz-peer-list { display: grid; gap: 0; padding: 0 0 20px; overflow: auto; }
.hz-peer-list button {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  text-align: left;
  min-height: 72px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--hz-list-line);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}
.hz-peer-list button:hover { background: var(--hz-row-hover); }
.hz-peer-list strong { display: block; color: var(--hz-heading); }
.bell-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
  color: var(--hz-heading);
  text-decoration: none;
}
.bell-row:hover { background: var(--hz-active-bg); }
.pref-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pref-chips button.on {
  background: var(--hz-primary);
  color: #fff;
}
@media (max-width: 1099px) {
  .hz-app-chat.is-thread .hz-chat-list,
  .hz-app-chat.is-new .hz-chat-list { display: none; }
  .hz-app-chat.is-list .hz-chat-stage { display: none; }
  .page.hz-messages-page { padding: 0; }
  .hz-app-chat { border: 0; border-radius: 0; box-shadow: none; min-height: 0; height: 100%; }
  .hz-emoji-btn,
  .hz-emoji-pop,
  button[data-act="msg-emoji"] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}
@media (min-width: 1100px) {
  .hz-app-chat {
    grid-template-columns: minmax(320px, 360px) 1fr;
    min-height: 0;
    height: 100%;
  }
  .hz-chat-back { display: none; }
}

/* Digitec-clear lists + dark surfaces (S16-1) */
.hz-app-chat {
  box-shadow: none;
  border-radius: 12px;
}
.shop-filters.card,
.shop-order-card,
.shop-list-card,
.shop-product-card,
.kanban-card {
  box-shadow: none;
}
.kanban-cards {
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius);
  overflow: hidden;
}
.kanban-card {
  margin: 0;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--hz-list-line);
  background: transparent;
  padding: 12px 14px;
}
.kanban-card:last-child { border-bottom: 0; }
.kanban-col {
  background: transparent;
}
.kanban-col header {
  background: transparent;
}
.shop-filters.card {
  background: transparent;
  border: 0;
  padding: 0;
  margin-bottom: 12px;
}
.more-block {
  margin: 12px 0;
}
.more-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: var(--tap);
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.more-toggle-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.more-toggle-copy strong {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hz-muted);
}
.more-summary {
  color: var(--hz-heading);
  font-size: 0.88rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.more-chevron {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--hz-primary);
  color: #fff;
  flex: 0 0 auto;
  transition: transform 0.16s ease;
}
.more-block.is-open .more-chevron { transform: rotate(180deg); }
.more-body { display: none; padding-top: 8px; }
.more-block.is-open .more-body { display: block; }
.task-steer-visible {
  margin: 8px 0 12px;
}
.task-steer-visible .detail-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}
@media (min-width: 768px) {
  .more-toggle {
    pointer-events: none;
    min-height: auto;
    margin-bottom: 6px;
  }
  .more-summary,
  .more-chevron { display: none; }
  .more-body,
  .more-block.is-open .more-body,
  .more-block .more-body { display: block; }
}
[data-theme="dark"] .more-chevron { color: #0b1220; }
.role-list { display: grid; gap: 10px; }
.role-block,
.alloc-block {
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius);
  box-shadow: none;
  padding: 4px 12px 12px;
}
.role-block .hz-row,
.alloc-block .hz-row {
  border: 0;
  min-height: 48px;
  padding: 10px 4px;
  cursor: default;
}
.role-block .perm-grid { margin: 8px 0 12px; }
.role-apply {
  margin: 8px 0 4px;
  padding: 12px;
  border: 2px solid var(--hz-primary, #4680ff);
  border-radius: var(--hz-radius);
  background: var(--hz-surface);
}
.role-apply h2 {
  font-size: 1rem;
  margin: 0 0 6px;
}
.role-apply .chip-row { margin: 8px 0; }
.role-apply-list { display: grid; gap: 4px; margin: 8px 0; }
.role-apply-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.alloc-list { display: grid; gap: 10px; }
.alloc-block .settle-form { padding: 0 4px; }
.shop-variant-list.hz-list .hz-row { cursor: default; }
.shop-order-list.hz-list {
  gap: 0;
}
.shop-order-list.hz-list .shop-order-card {
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--hz-list-line);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.shop-order-list.hz-list .shop-order-card:last-child { border-bottom: 0; }
.hz-list > .muted { padding: 16px; }
.theme-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-chips .chip.on {
  background: var(--hz-primary);
  color: #fff;
  border-color: var(--hz-primary);
}
.task-hero,
.doc-hero {
  box-shadow: none;
}
.login-card {
  box-shadow: var(--hz-shadow);
}
.topbar-logo {
  background-color: var(--hz-heading);
}
[data-theme="dark"] .hz-kind-chip.dm { background: #243656; color: #9bbcff; }
[data-theme="dark"] .hz-kind-chip.task { background: #3b2614; color: #fdba74; }
[data-theme="dark"] .hz-kind-chip.unknown { background: #243041; color: #cbd5e1; }
[data-theme="dark"] .badge.high { background: #3f1d1d; color: #fecaca; }
[data-theme="dark"] .badge.medium { background: #3b2614; color: #fdba74; }
[data-theme="dark"] .badge.low { background: #243041; color: #cbd5e1; }
[data-theme="dark"] .badge.open,
[data-theme="dark"] .badge.assigned { background: #1e3a5f; color: #bfdbfe; }
[data-theme="dark"] .badge.in_progress { background: #243656; color: #9bbcff; }
[data-theme="dark"] .badge.need_info { background: #3b2614; color: #fdba74; }
[data-theme="dark"] .badge.done { background: #163226; color: #86efac; }
[data-theme="dark"] .badge.rejected,
[data-theme="dark"] .badge.denied { background: #3f1d1d; color: #fecaca; }
[data-theme="dark"] .badge.pending { background: #243041; color: #e2e8f0; }
[data-theme="dark"] .badge.ok { background: #163226; color: #86efac; }
[data-theme="dark"] .banner.error { background: #3f1d1d; border-color: #f87171; }
[data-theme="dark"] .banner.ok { background: #163226; border-color: #4ade80; }
[data-theme="dark"] .banner.warn { background: #3b2614; border-color: #fb923c; }
[data-theme="dark"] .banner.net { background: #16343a; border-color: #22d3ee; color: var(--hz-heading); }
[data-theme="dark"] .hz-chat-line:not(.me) .hz-chat-file { background: #2a2150; color: #c4b5fd; }
[data-theme="dark"] .hz-chat-avatar-mark {
  background: linear-gradient(135deg, #7aa4ff, #8b5cf6);
}
[data-theme="dark"] .auth-sidecontent { background: #0b1220; }
[data-theme="dark"] .hz-chat-new { color: #0b1220; }
[data-theme="dark"] .btn { color: #0b1220; }
[data-theme="dark"] .btn.ghost { color: var(--hz-primary); }
[data-theme="dark"] .btn.warn,
[data-theme="dark"] .btn.danger,
[data-theme="dark"] .btn.ok { color: #fff; }
[data-theme="dark"] .pref-chips button.on,
[data-theme="dark"] .theme-chips .chip.on { color: #0b1220; }
[data-theme="dark"] .hz-unread { color: #0b1220; }
[data-theme="dark"] .chip.on {
  background: var(--hz-primary-subtle);
  color: var(--hz-primary);
}
[data-theme="dark"] .badge.uploaded { background: #243041; color: #cbd5e1; }
[data-theme="dark"] .badge.processing { background: #3b2614; color: #fdba74; }
[data-theme="dark"] .badge.ready { background: #163226; color: #86efac; }
[data-theme="dark"] .badge.failed { background: #3f1d1d; color: #fecaca; }
[data-theme="dark"] .kanban-stage.stage-open,
[data-theme="dark"] .kanban-stage.stage-assigned { background: #1e3a5f; color: #bfdbfe; border-color: #60a5fa; }
[data-theme="dark"] .kanban-stage.stage-in_progress { background: #243656; color: #9bbcff; border-color: #7aa4ff; }
[data-theme="dark"] .kanban-stage.stage-need_info { background: #3b2614; color: #fdba74; border-color: #fb923c; }
[data-theme="dark"] .kanban-stage.stage-done { background: #163226; color: #86efac; border-color: #4ade80; }
[data-theme="dark"] .kanban-stage.stage-rejected { background: #3f1d1d; color: #fecaca; border-color: #f87171; }
[data-theme="dark"] .hz-chat-line:not(.me) .hz-chat-quote { background: #2a2150; color: #e9d5ff; }
.voucher-remaining {
  font-size: 1.2rem;
  color: var(--hz-heading);
  margin: 8px 0 0;
}
.voucher-receipt {
  margin-top: 16px;
  padding: 16px;
  border: 2px solid var(--hz-success);
  background: var(--hz-surface);
}
.voucher-receipt h2 {
  margin: 0 0 8px;
  color: var(--hz-heading);
}
.voucher-scanner {
  margin-top: 12px;
  padding: 8px;
  border: 2px solid var(--hz-primary);
  border-radius: 12px;
  background: #0b1020;
}
.voucher-scanner video {
  display: block;
  width: 100%;
  min-height: 220px;
  max-height: 55vh;
  object-fit: cover;
  background: #000;
  border-radius: 8px;
}
.voucher-scanner .hint {
  color: #fff;
  margin: 8px 4px;
}
.btn-row {
  display: grid;
  gap: 8px;
}
@media (min-width: 640px) {
  .btn-row { grid-template-columns: 1fr 1fr; }
}
.badge.active { background: #dbeafe; color: #1e4fd4; }
.badge.partially_redeemed { background: #ffedd5; color: #c2410c; }
.badge.redeemed { background: #dcfce7; color: #15803d; }
.badge.expired, .badge.cancelled { background: #fee2e2; color: #b91c1c; }
[data-theme="dark"] .badge.active { background: #1e3a5f; color: #bfdbfe; }
[data-theme="dark"] .badge.partially_redeemed { background: #3b2614; color: #fdba74; }
[data-theme="dark"] .badge.redeemed { background: #163226; color: #86efac; }
[data-theme="dark"] .badge.expired,
[data-theme="dark"] .badge.cancelled { background: #3f1d1d; color: #fecaca; }
[data-theme="dark"] .banner.error { color: #fecaca; }
[data-theme="dark"] .banner.ok { color: #86efac; }
