:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color-scheme: light;
  color: var(--text);
  background: var(--canvas);
  font-size: var(--ui-font, 14px);
  line-height: 1.6;
  /* Shared semantic palette for desktop, mobile, dialogs and reports. */
  --canvas: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #f8f9fb;
  --text: #202939;
  --text-secondary: #475467;
  --muted: #667085;
  --line: #e4e7ec;
  --control-border: #838fa1;
  --blue: #245edb;
  --blue-hover: #1c4db8;
  --blue-soft: #edf3ff;
  --blue-line: #ceddff;
  --green: #18734b;
  --green-soft: #edf8f1;
  --orange: #955700;
  --orange-soft: #fff6e6;
  --orange-line: #ecd9b4;
  --red: #ba3434;
  --red-soft: #fff0f0;
  --chart: #4879da;
  --track: #e9edf3;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--blue);
}
button {
  cursor: pointer;
  border: 1px solid var(--control-border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 500;
}
button:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
.primary:hover {
  border-color: var(--blue-hover);
  background: var(--blue-hover);
  color: white;
}
.danger {
  color: var(--red);
}
.link {
  border: 0;
  background: transparent;
  padding: 2px 0;
  color: var(--blue);
  text-align: left;
}
.icon {
  width: 19px;
  height: 19px;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.layout {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  border-right: 1px solid var(--line);
  position: fixed;
  inset: 0 auto 0 0;
  width: 216px;
  background: var(--nav-bg, var(--surface));
  color: var(--nav-text, var(--text-secondary));
  display: flex;
  flex-direction: column;
  padding: 28px 16px;
  z-index: 10;
}
.brand {
  color: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 28px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0.5px;
}
.brand-mark {
  height: 32px;
  width: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: white;
}
.sidebar nav {
  display: grid;
  gap: 6px;
  overflow-y: auto;
  min-height: 0;
}
.nav-btn {
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 13px;
  font-weight: 400;
}
.nav-btn:hover {
  background: var(--surface-soft);
  border-color: transparent;
}
.nav-btn.active {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 600;
  box-shadow: inset 3px 0 var(--blue);
}
.sidebar-foot {
  margin-top: auto;
  padding: 18px 12px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: inherit;
}
.shell {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  min-height: 76px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 15px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.company {
  font-size: 16px;
  font-weight: 600;
}
.caption,
.muted {
  color: var(--muted);
}
.caption {
  font-size: 12px;
}
.demo-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.demo-tools select {
  max-width: 185px;
}
.demo-badge {
  background: var(--surface-soft);
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
}
select,
input,
textarea {
  border: 1px solid var(--control-border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  background: var(--surface);
  max-width: 100%;
}
input[type="checkbox"] {
  accent-color: var(--blue);
  width: 16px;
  height: 16px;
}
textarea {
  min-height: 98px;
  resize: vertical;
  width: 100%;
}
main {
  max-width: 1540px;
  padding: 28px 32px 44px;
  margin: auto;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
h1 {
  font-size: 25px;
  line-height: 1.4;
  margin: 0 0 6px;
  font-weight: 650;
}
h2 {
  font-size: 17px;
  line-height: 1.5;
  margin: 0;
  font-weight: 600;
}
h3 {
  font-size: 15px;
  margin: 0 0 12px;
}
p {
  margin: 0 0 12px;
}
.page-head p {
  margin: 0;
  color: var(--muted);
}
.actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.metric {
  padding: 19px 22px;
  text-align: left;
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.metric-label {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.metric strong {
  display: block;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  margin: 4px 0;
}
.metric small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}
.metric.overdue strong {
  color: var(--red);
}
.metric.good strong {
  color: var(--green);
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}
.panel-head {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.panel-body {
  padding: 22px;
}
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 22px;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.search {
  flex: 1;
  min-width: 180px;
  max-width: 350px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  text-align: left;
}
th {
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
th,
td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}
tr:last-child td {
  border: 0;
}
td .task-title {
  font-size: 14px;
  font-weight: 500;
  display: block;
  margin-bottom: 3px;
  max-width: 340px;
}
td {
  vertical-align: middle;
}
tbody tr:hover {
  background: var(--surface-soft);
}
.badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 12px;
  background: var(--track);
  color: var(--text-secondary);
  font-weight: 400;
}
.badge.in_progress {
  background: var(--blue-soft);
  color: var(--blue);
}
.badge.pending_review,
.badge.pending_approval {
  background: var(--orange-soft);
  color: var(--orange);
}
.badge.completed {
  background: var(--green-soft);
  color: var(--green);
}
.badge.overdue {
  background: var(--red-soft);
  color: var(--red);
}
.badge.blocked {
  background: var(--orange-soft);
  color: var(--orange);
}
.badge.cancelled {
  background: var(--surface-soft);
  color: var(--muted);
}
.status-cell {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.progress-track {
  height: 5px;
  background: var(--track);
  border-radius: 8px;
  overflow: hidden;
  width: 90px;
}
.progress-track span {
  display: block;
  height: 100%;
  background: var(--chart);
}
.progress-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}
.attention-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.attention-item:first-child {
  padding-top: 0;
}
.attention-item:last-child {
  border: 0;
  padding-bottom: 0;
}
.attention-item strong {
  display: block;
  margin: 5px 0;
  font-size: 14px;
  font-weight: 500;
}
.attention-item p {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}
.info {
  background: var(--blue-soft);
  border: 1px solid var(--blue-line);
  padding: 12px 15px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 18px;
}
.warning {
  background: var(--orange-soft);
  border-color: var(--orange-line);
  color: var(--orange);
}
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty strong {
  display: block;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 8px;
}
.tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 0 22px;
  overflow: auto;
}
.tab {
  border: 0;
  border-radius: 0;
  padding: 15px 0;
  background: transparent;
  white-space: nowrap;
  color: var(--muted);
}
.tab.active {
  color: var(--blue);
  box-shadow: inset 0 -2px var(--blue);
}
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child {
  border: 0;
}
.list-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.avatar {
  width: 31px;
  height: 31px;
  background: var(--blue-soft);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  color: var(--blue);
  flex: none;
}
.person {
  display: flex;
  align-items: center;
  gap: 8px;
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 0;
}
.meta-grid dt {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}
.meta-grid dd {
  margin: 0;
  font-size: 14px;
}
.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}
.record {
  padding: 0 0 20px 22px;
  border-left: 1px solid var(--line);
  position: relative;
  margin-left: 5px;
}
.record:before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--control-border);
  position: absolute;
  left: -4px;
  top: 8px;
}
.record:last-child {
  padding-bottom: 0;
  border-color: transparent;
}
.record p {
  margin: 5px 0;
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.record .caption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.detail-title {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.detail-title h1 {
  margin: 0;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.field {
  display: grid;
  gap: 7px;
  font-size: 13px;
}
.field > span {
  font-weight: 500;
}
.field.wide {
  grid-column: 1/-1;
}
.field small {
  font-size: 12px;
  color: var(--muted);
}
.checks {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}
.form-section {
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
  margin-bottom: 24px;
}
.form-section:last-child {
  border: 0;
  margin: 0;
}
.section-title {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 16px;
}
.step {
  font-size: 11px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  border-radius: 4px;
  padding: 1px 6px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  width: min(680px, calc(100vw - 32px));
  max-height: 90vh;
  color: var(--text);
  box-shadow: 0 20px 60px #00000020;
}
dialog::backdrop {
  background: #10182855;
  backdrop-filter: blur(2px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.dialog-head button {
  padding: 3px 10px;
  font-size: 21px;
  border: 0;
}
.dialog-body {
  padding: 24px;
}
.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 17px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}
.error {
  color: var(--red);
  white-space: pre-wrap;
  font-size: 13px;
  margin: 0 0 14px;
}
.schedule {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.schedule:last-child {
  border: 0;
}
.preview {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 35px;
  align-items: center;
  gap: 14px;
  margin: 17px 0;
  font-size: 13px;
}
.bar {
  height: 12px;
  background: var(--track);
  border-radius: 3px;
  overflow: hidden;
}
.bar span {
  height: 100%;
  display: block;
  background: var(--chart);
}
.scope {
  width: 130px;
}
.footer-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 20px;
}
.mobile-nav {
  display: none;
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 22px;
  border-radius: 7px;
  background: var(--text);
  color: white;
  z-index: 100;
  max-width: 90vw;
  box-shadow: 0 6px 24px #0000001a;
  display: none;
}
#toast.show {
  display: block;
}
.skip {
  position: fixed;
  left: 10px;
  top: -60px;
  z-index: 200;
  background: var(--surface);
  padding: 10px;
}
.skip:focus {
  top: 10px;
}
.summary-line {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 0 20px;
}
.title-icon {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.nowrap {
  white-space: nowrap;
}
.mobile-cards {
  display: none;
}
@media (min-width: 1500px) {
  main {
    padding-top: 35px;
  }
  .sidebar {
    width: 232px;
  }
  .layout {
    grid-template-columns: 232px minmax(0, 1fr);
  }
}
@media (max-width: 1100px) {
  .columns {
    grid-template-columns: 1fr;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 15px;
  }
  .topbar {
    padding: 15px 22px;
  }
  main {
    padding: 24px 22px;
  }
  .sidebar {
    width: 190px;
  }
  .layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .demo-tools {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .demo-badge {
    display: none;
  }
}
@media (max-width: 720px) {
  .layout {
    display: block;
  }
  .sidebar {
    display: none;
  }
  .shell {
    width: 100%;
  }
  .topbar {
    padding: 13px 16px;
    align-items: flex-start;
    gap: 10px;
  }
  .company {
    font-size: 14px;
  }
  .demo-tools {
    gap: 5px;
    max-width: 190px;
  }
  .demo-tools select {
    font-size: 12px;
    padding: 5px;
    width: 100%;
    max-width: 176px;
  }
  .demo-tools button {
    font-size: 12px;
    padding: 4px 8px;
  }
  main {
    padding: 22px 16px 90px;
  }
  .page-head {
    align-items: flex-start;
    margin-bottom: 20px;
  }
  .page-head p {
    font-size: 12px;
    max-width: 250px;
  }
  h1 {
    font-size: 22px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 18px;
  }
  .metric strong {
    font-size: 28px;
  }
  .metric small {
    font-size: 11px;
  }
  .columns {
    gap: 0;
  }
  .panel-head,
  .panel-body {
    padding: 17px;
  }
  .toolbar {
    padding: 13px;
    gap: 8px;
  }
  .toolbar input,
  .toolbar select {
    font-size: 13px;
  }
  .search {
    min-width: 140px;
  }
  .task-table {
    display: none;
  }
  .mobile-cards {
    display: block;
  }
  .task-card {
    padding: 17px;
    border-bottom: 1px solid var(--line);
  }
  .task-card:last-child {
    border: 0;
  }
  .task-card .link {
    font-size: 15px;
    font-weight: 500;
    display: block;
    margin: 10px 0;
  }
  .task-card .bottom {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field.wide {
    grid-column: auto;
  }
  .meta-grid {
    grid-template-columns: 1fr 1fr;
    gap: 17px;
  }
  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-around;
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
    z-index: 15;
  }
  .mobile-nav button {
    display: grid;
    justify-items: center;
    gap: 2px;
    border: 0;
    padding: 3px 15px;
    font-size: 11px;
    color: var(--muted);
  }
  .mobile-nav button.active {
    color: var(--blue);
  }
  .list-row {
    padding: 16px;
    gap: 12px;
  }
  .dialog-body {
    padding: 18px;
  }
  .dialog-head,
  .dialog-foot {
    padding: 15px 18px;
  }
  .tabs {
    gap: 20px;
    padding: 0 16px;
  }
  #toast {
    bottom: 80px;
  }
  .detail-title h1 {
    font-size: 21px;
  }
  .page-head > .actions .primary {
    white-space: nowrap;
  }
  .permission-table th,
  .permission-table td {
    padding: 12px;
  }
  .bar-row {
    grid-template-columns: 80px 1fr 25px;
  }
}

[hidden] {
  display: none !important;
}
dialog:modal {
  overscroll-behavior: contain;
}
dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
}
.task-table td:first-child {
  min-width: 230px;
}
.task-table th:nth-child(3) {
  min-width: 110px;
}
@media (min-width: 1101px) and (max-width: 1500px) {
  .columns {
    grid-template-columns: 1fr;
  }
}

.mobile-current-actions {
  display: none;
}
@media (max-width: 720px) {
  .mobile-current-actions {
    display: block;
  }
  .detail-columns > div:last-child > .panel:first-child {
    display: none;
  }
}

/* Keep selection visible when the OS replaces author colors. */
@media (forced-colors: active) {
  .nav-btn.active,
  .tab.active,
  .mobile-nav button.active {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }
  .progress-track span,
  .bar span {
    background: Highlight;
  }
}

/* Enterprise platform surfaces; semantic colors are mapped by the published theme. */
.brand-name { overflow-wrap: anywhere; font-size: 18px; line-height: 1.4; }
.brand { align-items: flex-start; }
.nav-group-label { font-size: 11px; padding: 16px 12px 4px; color: inherit; }
.nav-btn:hover { color: var(--text); }
.nav-btn.active { background: var(--blue-soft); }
button, input, select, textarea { border-radius: var(--ui-radius, 8px); }
.panel, .metric, .app-card, .config-card { border-radius: var(--ui-radius, 8px); }
th, td { padding-top: var(--row-space, 15px); padding-bottom: var(--row-space, 15px); }
.app-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 32px; }
.app-card { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); padding: 24px; min-width: 0; }
.app-card h2, .app-card p { margin: 0; overflow-wrap: anywhere; }
.app-card p { color: var(--muted); min-height: 44px; }
.app-card .actions { margin-top: auto; padding-top: 12px; }
.app-card-top, .section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.section-heading { margin: 28px 0 18px; }
.section-heading p { margin: 5px 0 0; }
.app-symbol { width: 42px; height: 42px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--blue-soft); color: var(--blue); flex: none; }
.app-symbol .icon { width: 23px; height: 23px; }
.setup-strip { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--ui-radius, 8px); }
.setup-strip h2 { margin-top: 12px; }
.setup-strip p { color: var(--muted); margin: 6px 0 0; }
.setup-steps { display: flex; gap: 10px; flex-wrap: wrap; }
.setup-steps button { display: flex; align-items: center; gap: 8px; }
.roadmap-apps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.roadmap-apps > div { display: flex; gap: 10px; justify-content: space-between; padding: 16px; border: 1px solid var(--line); background: var(--surface-soft); border-radius: var(--ui-radius, 8px); }
.config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.config-card { display: grid; justify-items: start; gap: 12px; padding: 24px; text-align: left; border-color: var(--line); }
.config-card strong { font-size: 17px; }
.config-card span.muted { font-weight: 400; }
.builder-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.builder-layout > * { min-width: 0; }
.builder-layout .form-grid { gap: 16px; }
#pf-theme-form input[type=color] { width: 100%; min-height: 44px; padding: 5px; }
.theme-sample { display: grid; grid-template-columns: 30% minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--sample-radius); overflow: hidden; min-height: 290px; }
.theme-sample aside { background: var(--sample-nav); color: var(--sample-text); display: flex; flex-direction: column; gap: 18px; padding: 18px 12px; font-size: 12px; overflow-wrap: anywhere; }
.theme-sample > div { background: var(--sample-bg); padding: 22px 14px; color: #202939; }
.theme-sample .sample-card { background: white; padding: 14px; border: 1px solid #e4e7ec; border-radius: var(--sample-radius); margin-bottom: 18px; }
.theme-sample .sample-card p { color: #667085; margin: 8px 0; font-size: 12px; }
.sample-primary { background: var(--sample-primary); color: white; border-color: var(--sample-primary); border-radius: var(--sample-radius); pointer-events: none; }
.theme-sample .sample-selected { text-decoration: underline; text-underline-offset: 5px; }
.field-designer { display: grid; gap: 12px; }
.field-design-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--ui-radius, 8px); }
.field-design-row > div { min-width: 0; overflow-wrap: anywhere; }
.message-variable-list { flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.login-shell { width: min(1120px, 100%); margin: 0 auto; padding: 64px 24px; display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: start; }
.login-intro { padding: 32px 0; }
.login-intro h1 { font-size: clamp(28px, 3vw, 40px); line-height: 1.4; margin: 24px 0; }
.login-intro > p { font-size: 16px; color: var(--muted); line-height: 1.8; }
.login-intro .info { margin-top: 32px; }
.login-panel { margin: 0; }
.login-panel .list-row { padding-left: 0; padding-right: 0; }
.login-panel form > button { margin-top: 18px; }
.platform-shell .sidebar { background: #14263e; color: #edf2f8; }
.platform-shell .brand, .platform-shell .nav-btn { color: #edf2f8; }
.platform-shell .nav-btn:hover, .platform-shell .nav-btn.active { background: #29435f; color: #ffffff; border-color: #6c8eb8; }
.platform-shell .sidebar-foot { color: #bccce0; }
.platform-mobile-nav { display: none; }
.maintenance-banner { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 12px 32px; background: #fff5df; color: #714910; border-bottom: 1px solid #e8d5a6; font-size: 13px; }
.permission-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 20px 0; }
@media(max-width: 1000px) {
  .platform-mobile-nav { display: flex; gap: 8px; padding: 12px 18px; overflow-x: auto; border-bottom: 1px solid var(--line); }
  .platform-mobile-nav button { white-space: nowrap; }
  .login-shell { gap: 24px; }
}
@media(max-width: 700px) {
  .login-shell { grid-template-columns: 1fr; padding: 24px 16px; }
  .login-intro { padding: 0; }
  .permission-options { grid-template-columns: 1fr; }
  .maintenance-banner { padding: 12px 18px; }
  .topbar > .actions { flex-wrap: wrap; }
}
#pf-rule-trial .info { margin-bottom: 20px; }
#pf-condition-logic { margin-bottom: 16px; }
.form-preview { display: grid; gap: 16px; padding: 22px; border: 1px solid var(--line); border-radius: var(--ui-radius, 8px); }
#pf-flow-form fieldset { border: 1px solid var(--line); border-radius: var(--ui-radius, 8px); padding: 20px; margin: 0 0 24px; min-width: 0; }
#pf-flow-form legend { font-weight: 600; padding: 0 8px; }
#pf-flow-form .form-grid { margin: 18px 0; }
#pf-flow-form .caption { margin: 14px 0 0; }
#pf-theme-form .actions, #pf-message-form .preview { margin-top: 20px; }
.table-wrap td { max-width: 340px; overflow-wrap: anywhere; }
.table-wrap td .actions { min-width: 100px; }
input:user-invalid, textarea:user-invalid, select:user-invalid { border-color: var(--red); }
@media (max-width: 1200px) {
  .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup-strip { align-items: flex-start; flex-direction: column; }
  .builder-layout { grid-template-columns: 1fr; }
  .roadmap-apps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .app-grid, .config-grid, .roadmap-apps { grid-template-columns: 1fr; }
  .app-card, .config-card { padding: 20px; }
  .setup-strip { padding: 20px; }
  .setup-steps { width: 100%; display: grid; }
  .setup-steps button { justify-content: space-between; }
  .field-design-row, .section-heading { align-items: flex-start; flex-direction: column; }
  .field-design-row .actions { gap: 7px; }
  .theme-sample { min-height: 260px; }
  .table-wrap { max-width: 100%; }
  .page-head { flex-wrap: wrap; }
  #pf-theme-form .form-grid { grid-template-columns: 1fr; }
  form[id^=pf-] input:not([type=checkbox]), form[id^=pf-] select, form[id^=pf-] textarea { font-size: 16px; min-height: 44px; }
  form[id^=pf-] button, button[data-pf] { min-height: 44px; }
}

/* Simple role assignment first; detailed authorization stays in disclosures. */
.role-guide { padding: 12px 24px 20px; border-bottom: 1px solid var(--line); }
.role-guide p { margin: 8px 0; }
.role-guide strong { display: inline-block; min-width: 7em; }
.role-editor { display: grid; gap: 20px; }
.role-editor > button { justify-self: start; }
.role-presets { border: 0; padding: 0; margin: 0; min-width: 0; }
.role-presets legend { font-weight: 600; padding: 0; margin-bottom: 8px; }
.role-preset { display: flex; align-items: flex-start; gap: 12px; padding: 12px 8px; min-height: 48px; cursor: pointer; border-bottom: 1px solid var(--line); }
.role-preset:has(input:checked) { background: var(--blue-soft); }
.role-preset input { margin: 4px 0 0; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--blue); }
.role-preset small { display: block; color: var(--muted); line-height: 1.6; margin-top: 4px; }
.role-disclosure > summary, .role-advanced > summary { cursor: pointer; padding: 20px 24px; font-weight: 600; min-height: 48px; }
.role-disclosure[open] > summary { border-bottom: 1px solid var(--line); }
.role-advanced { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.role-advanced > summary { padding-inline: 0; }
.role-advanced .permission-options { margin-block: 0 20px; }
.role-disclosure summary:focus-visible, .role-advanced summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -3px; }
.member-role-row { flex-wrap: wrap; }
.member-role-control { display: flex; align-items: end; gap: 12px; }
.member-role-row .error:empty { display: none; }
.member-role-row .error { width: 100%; margin: 0; }
.role-editor [data-tenant-list] { margin: 0; padding: 16px; border: 1px solid var(--line); min-width: 0; }
.role-editor [data-tenant-list][hidden] { display: none; }
@media (max-width: 720px) {
  .member-role-control { width: 100%; }
  .member-role-control .field { flex: 1; min-width: 0; }
  .member-role-control select { width: 100%; }
  .member-role-control select, .member-role-control button, .role-editor select, .role-editor input:not([type=radio]):not([type=checkbox]), .role-editor button { min-height: 48px; font-size: 1rem; }
  .role-disclosure .panel-head { align-items: flex-start; flex-direction: column; }
  .role-disclosure .actions { flex-wrap: wrap; }
}

/* Delivery layout: content-driven reflow, complete compact navigation and safe areas. */
html { scroll-padding-block: 24px calc(88px + env(safe-area-inset-bottom, 0px)); }
body { overflow-wrap: break-word; }
::selection { color: var(--text); background: var(--blue-line); }
input, textarea { caret-color: var(--blue); }
h1, h2, h3 { text-wrap: balance; }
button, select, input:not([type=checkbox]):not([type=radio]) { min-height: 36px; }
button { min-width: 28px; }
button .icon { pointer-events: none; }
main { width: 100%; max-width: 1720px; }
.panel, .metric, .columns > *, .form-grid > *, .page-head > *, .list-row > *, .topbar > *, .actions, .field { min-width: 0; }
.panel { overflow: visible; }
.panel-head, .page-head, .dialog-foot, .list-row, .record .caption { flex-wrap: wrap; }
.topbar { padding-inline: clamp(20px, 2.3vw, 40px); flex-wrap: wrap; }
.topbar .actions { justify-content: flex-end; }
.workspace-user { overflow-wrap: anywhere; }
.actions { flex-wrap: wrap; }
input:not([type=checkbox]):not([type=radio]), select, textarea { min-width: 0; }
.field > input, .field > select { width: 100%; }
.check { min-height: 36px; }
.table-wrap { max-width: 100%; min-width: 0; container-type: inline-size; border-radius: inherit; overscroll-behavior-inline: contain; }
.table-wrap:focus-visible { outline: 2px solid var(--blue); outline-offset: -3px; }
.table-wrap thead th { background: var(--surface-soft); }
.mobile-cell-label { display: none; }
.cell-content { min-width: 0; }
.cell-content > .link { white-space: normal; }
.permission-table select { width: 100%; }
.tabs { overflow-x: auto; max-width: 100%; flex-wrap: nowrap; gap: 24px; }
.tab { flex-shrink: 0; white-space: nowrap; }
.full-navigation { padding: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.full-navigation .nav-group-label { grid-column: 1 / -1; font-size: 13px; padding-top: 20px; }
.full-navigation .nav-btn { min-height: 48px; }
.workspace-info { margin: 0; }
.workspace-info > div { display: grid; grid-template-columns: 7em minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.workspace-info > div:last-child { border: 0; }
.workspace-info dt { color: var(--muted); }
.workspace-info dd { margin: 0; }
.login-shell { display: block; width: min(500px, 100%); padding-block: clamp(32px, 10vh, 120px); }
.login-intro { padding: 0; margin-bottom: 32px; }
.login-intro h1 { font-size: 30px; margin: 0 0 8px; }
.login-intro > p { margin: 0; }
.login-panel .role-editor { gap: 20px; }
.login-panel form > button { margin: 0; width: 100%; min-height: 48px; }
.login-panel .caption { margin: 0; line-height: 1.8; }
dialog { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
.dialog-head { gap: 16px; }
.dialog-head h2 { min-width: 0; }
.dialog-head button { flex-shrink: 0; min-width: 44px; min-height: 44px; }
dialog .dialog-foot { position: sticky; bottom: 0; z-index: 1; }
#modal-form .dialog-body { overflow-wrap: anywhere; }
#toast { width: max-content; max-width: min(560px, calc(100vw - 32px)); }
@container (max-width: 600px) {
  .responsive-table, .responsive-table tbody { display: block; width: 100%; }
  .responsive-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); }
  .responsive-table tbody tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .responsive-table tbody tr:last-child { border-bottom: 0; }
  .responsive-table tbody td { display: grid; grid-template-columns: minmax(5em, 30%) minmax(0, 1fr); gap: 12px; padding: 8px 0; border: 0; max-width: none; min-width: 0; white-space: normal; }
  .responsive-table tbody td[colspan] { display: block; }
  .responsive-table .mobile-cell-label { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
  .responsive-table .cell-content > button { max-width: 100%; }
}
@media (max-width: 1000px) {
  .layout { display: block; }
  .sidebar { display: none; }
  .shell { width: 100%; }
  main { padding: 24px max(20px, env(safe-area-inset-right, 0px)) calc(100px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); }
  .topbar { padding: max(12px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) 12px max(20px, env(safe-area-inset-left, 0px)); gap: 12px; }
  .mobile-nav { position: fixed; inset: auto 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--line); z-index: 15; padding: 6px max(8px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
  .mobile-nav button { display: grid; justify-items: center; gap: 3px; min-height: 52px; padding: 5px 2px; border: 0; font-size: 12px; color: var(--muted); background: transparent; }
  .mobile-nav button.active { color: var(--blue); background: var(--blue-soft); }
  .mobile-nav .icon { width: 21px; height: 21px; }
  .columns { grid-template-columns: 1fr; }
  .task-table { display: none; }
  .mobile-cards { display: block; }
  .task-card { padding: 18px 20px; border-bottom: 1px solid var(--line); }
  .task-card:last-child { border-bottom: 0; }
  .task-card > .link { display: block; font-size: 16px; font-weight: 600; margin: 8px 0; }
  .task-card .bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; color: var(--muted); font-size: 13px; }
  .mobile-current-actions { display: block; }
  .detail-columns > div:last-child > .panel:first-child { display: none; }
  #toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media (pointer: coarse), (max-width: 1000px) {
  button, .link, select, input:not([type=checkbox]):not([type=radio]), .check, .role-preset { min-height: 44px; }
  button, .link { min-width: 44px; }
  input, select, textarea, .toolbar input, .toolbar select { font-size: 16px; }
  .check input { flex-shrink: 0; }
}
@media (max-width: 600px) {
  main { padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
  .topbar { align-items: center; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
  .topbar .company { font-size: 16px; }
  .topbar .actions { flex: 1 1 100%; justify-content: space-between; font-size: 13px; }
  .topbar .actions button { padding: 7px 12px; }
  .page-head { gap: 16px; }
  .page-head > div { width: 100%; }
  .page-head p { max-width: none; font-size: 14px; }
  .page-head .actions:empty, .page-head p:empty { display: none; }
  .page-head .actions > button { flex: 1 1 auto; }
  h1 { font-size: 24px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 14px; }
  .metric .caption { font-size: 12px; }
  .metric-label { gap: 6px; align-items: start; }
  .panel-head, .panel-body, .task-card, .list-row { padding: 16px; }
  .panel-head { gap: 12px; }
  .toolbar { padding: 16px; }
  .toolbar .search { width: 100%; flex-basis: 100%; min-width: 0; }
  .toolbar select { flex: 1 1 auto; }
  .toolbar button { flex: 1 1 auto; }
  .form-grid, .meta-grid { grid-template-columns: 1fr; }
  .member-role-control { flex-wrap: wrap; gap: 8px; }
  .member-role-control .field { flex-basis: 160px; }
  .member-role-control button { flex: 1 1 auto; }
  .role-guide { padding-inline: 16px; }
  .role-guide strong { display: block; }
  .role-disclosure > summary { padding: 18px 16px; }
  .role-editor > button { justify-self: stretch; }
  .role-disclosure .panel-head .actions { width: 100%; }
  .role-disclosure .panel-head select { flex: 1; }
  .permission-table th, .permission-table td { padding: 12px 8px; white-space: normal; }
  .permission-table td:first-child { width: 48%; }
  .permission-table select { padding-inline: 6px; }
  .full-navigation { grid-template-columns: 1fr; }
  .full-navigation .nav-group-label { padding-top: 12px; }
  .workspace-info > div { grid-template-columns: 1fr; gap: 4px; }
  .schedule { flex-wrap: wrap; }
  .schedule b { margin-left: auto; }
  .login-shell { padding: 32px 16px; }
  .theme-sample { grid-template-columns: 1fr; }
  .theme-sample aside { flex-direction: row; flex-wrap: wrap; gap: 12px; padding: 14px; }
  .theme-sample aside strong { flex-basis: 100%; }
  dialog { width: calc(100vw - 24px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
  .dialog-head, .dialog-body, .dialog-foot { padding: 16px; }
  .dialog-foot button { flex: 1 1 auto; }
  .form-section { padding: 20px 16px; }
}
@media (max-height: 500px) and (max-width: 1000px) {
  .topbar .actions { flex: 0 1 auto; }
  .mobile-nav button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
  .login-shell { padding-block: 24px; }
  .login-intro { margin-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

.error:empty { display: none; }
.task-card-meta { margin: 0 0 10px; }
