/* Generated from shared shell and responsive sections of assets/workflow.css. */

/*
 * Feifei workflow surfaces
 * Editorial buying desk: paper ledgers, ink rules, coral actions, acid notes,
 * and cobalt controls. Loaded after styles.css.
 */

:root {
  --flow-paper: rgba(255, 253, 247, .94);
  --flow-paper-solid: #fffdf7;
  --flow-ink-soft: #343128;
  --flow-coral-wash: #ffe2d9;
  --flow-acid-wash: #f3fac4;
  --flow-cobalt-wash: #e4eafd;
  --flow-green-wash: #dfeee7;
  --flow-danger-wash: #f7dfdb;
  --flow-rule: 1px solid var(--ink);
  --flow-hairline: 1px solid var(--line);
  --flow-shadow-offset: 5px 5px 0 rgba(25, 24, 19, .14);
}

.flow-page,
.flow-page *,
.flow-dialog,
.flow-dialog * {
  min-width: 0;
}

.flow-page :is(button, input, select, textarea),
.flow-dialog :is(button, input, select, textarea) {
  max-width: 100%;
}

.flow-page :is(h1, h2, h3, p, strong, small, span),
.flow-dialog :is(h1, h2, h3, p, strong, small, span) {
  overflow-wrap: anywhere;
}

/* Keep all ten desktop destinations useful on shorter screens. */

.rail-section-label {
  display: block;
  margin: 12px 10px 3px;
  color: #858177;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.side-rail {
  padding: 18px 14px 12px;
}

.side-rail .brand-mark {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  font-size: 25px;
}

.rail-nav {
  min-height: 0;
  margin-top: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #555147 transparent;
  scrollbar-width: thin;
}

.rail-nav button {
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 36px;
  padding: 6px 9px;
  font-size: 12px;
}

.rail-nav button span {
  font-size: 8px;
}

.rail-foot {
  flex: 0 0 auto;
  padding-top: 9px;
}

.flow-dashboard-grid .tool-card {
  grid-column: span 3;
  min-height: 220px;
}

.flow-dashboard-grid .tool-card:nth-child(1) {
  background: var(--coral);
}

.flow-dashboard-grid .tool-card:nth-child(2) {
  background: var(--acid);
}

.flow-dashboard-grid .tool-card:nth-child(3) {
  background: #d5e0fa;
}

.flow-dashboard-grid .tool-card:nth-child(4) {
  background:
    linear-gradient(rgba(255, 253, 247, .85), rgba(255, 253, 247, .85)),
    repeating-linear-gradient(-45deg, var(--cobalt) 0 7px, transparent 7px 14px);
}

/* === Fei 柔花系品牌介面 v2.2 =========================================
 * 資料工具以留白與可讀性為主；柔花色只用於焦點、選取與狀態。
 */

:root {
  --flow-paper: rgba(255, 253, 252, .96);
  --flow-paper-solid: var(--fei-surface);
  --flow-ink-soft: var(--fei-muted);
  --flow-coral-wash: var(--fei-selected);
  --flow-acid-wash: rgba(248, 213, 220, .58);
  --flow-cobalt-wash: rgba(229, 210, 229, .58);
  --flow-green-wash: rgba(174, 181, 158, .24);
  --flow-danger-wash: rgba(183, 68, 97, .1);
  --flow-rule: 1px solid var(--fei-border);
  --flow-hairline: 1px solid var(--fei-border);
  --flow-shadow-offset: 0 8px 24px rgba(77, 58, 75, .07);
}

body {
  font-size: 14px;
  line-height: 1.7;
}

button,
input,
select,
textarea,
.numeric {
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 2px solid var(--fei-purple);
  outline-offset: 3px;
}

::selection {
  background: var(--fei-petal);
  color: var(--fei-text);
}

.skip-link {
  border: 1px solid var(--fei-primary);
  border-radius: 10px;
  background: var(--fei-primary);
  color: var(--fei-surface);
}

.side-rail {
  border-right: 1px solid var(--fei-border);
  background:
    radial-gradient(circle at 0 0, rgba(248, 213, 220, .5), transparent 11rem),
    rgba(255, 253, 252, .94);
  color: var(--fei-text);
  box-shadow: 8px 0 30px rgba(77, 58, 75, .035);
  backdrop-filter: blur(18px);
}

.rail-toggle {
  border-color: var(--fei-border);
  background: var(--fei-surface);
  color: var(--fei-primary);
  box-shadow: 0 8px 22px rgba(77, 58, 75, .16);
}

.rail-toggle:hover {
  background: var(--fei-selected);
  color: var(--fei-purple);
}

.brand-lockup {
  color: var(--fei-text);
}

.brand-mark {
  position: relative;
  border-radius: 15px 20px 15px 20px;
  background: linear-gradient(135deg, var(--fei-primary), var(--fei-purple));
  color: var(--fei-surface);
  box-shadow: 0 7px 18px rgba(143, 87, 138, .2);
  transform: none;
}

.brand-mark::after {
  position: absolute;
  right: -3px;
  top: -3px;
  width: 11px;
  height: 15px;
  border: 2px solid var(--fei-surface);
  border-radius: 70% 35% 65% 35%;
  background: var(--fei-petal);
  content: "";
  transform: rotate(35deg);
}

.brand-lockup strong {
  font-family: var(--latin);
  font-weight: 600;
  letter-spacing: .18em;
}

.brand-lockup small,
.rail-section-label {
  color: var(--fei-muted);
  font-family: var(--latin);
  font-weight: 600;
}

.rail-nav {
  scrollbar-color: var(--fei-border) transparent;
}

.rail-nav button {
  border: 0;
  border-radius: 10px;
  color: var(--fei-muted);
  font-weight: 500;
}

.rail-nav button span {
  color: #aa98a2;
  font-family: var(--latin);
  font-weight: 600;
}

.rail-nav button:hover {
  background: rgba(229, 210, 229, .35);
  color: var(--fei-purple);
  transform: none;
}

.rail-nav button[aria-current="page"] {
  background: var(--fei-selected);
  color: var(--fei-primary);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--fei-primary);
}

.rail-nav button[aria-current="page"] span {
  color: var(--fei-primary);
}

.rail-foot {
  border-top-color: var(--fei-border);
  color: var(--fei-muted);
}

.rail-foot small {
  color: #a08f98;
}

.status-dot {
  background: var(--fei-sage);
  box-shadow: 0 0 0 4px rgba(174, 181, 158, .2);
}

.tenant-pill {
  border-color: var(--fei-border);
  background: rgba(249, 232, 237, .55);
  color: var(--fei-text);
}

.tenant-pill:hover,
.tenant-pill-active {
  border-color: var(--fei-purple);
  color: var(--fei-purple);
}

.tenant-pill-active .tenant-pill-dot {
  background: var(--fei-sage);
  box-shadow: 0 0 0 3px rgba(174, 181, 158, .2);
}

.main-stage {
  padding: clamp(24px, 3.5vw, 54px);
}

.page-header,
.flow-header {
  align-items: flex-start;
  margin-bottom: 24px;
}

.eyebrow,
.dialog-kicker,
.flow-eyebrow,
.flow-dialog-header small {
  color: var(--fei-purple);
  font-family: var(--latin);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
}

.page-title,
.flow-title {
  color: var(--fei-text);
  font-size: clamp(30px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.25;
}

.page-title em,
.flow-title em {
  color: var(--fei-primary);
  font-style: normal;
}

.page-lead,
.flow-lead {
  margin-top: 10px;
  color: var(--fei-muted);
  font-size: 15px;
  line-height: 1.7;
}

.section-heading h2,
.panel-title,
.flow-section-heading h2,
.gb-section-intro h2 {
  color: var(--fei-purple);
  font-weight: 700;
  letter-spacing: -.015em;
}

.button,
.flow-header-actions > :is(button, a),
.flow-card-actions > :is(button, a),
.flow-dialog-footer > :is(button, a),
.flow-action,
.flow-action-primary,
.flow-action-secondary,
.flow-action-danger,
.flow-action-ghost {
  min-height: 42px;
  border: 1px solid var(--fei-border);
  border-radius: 10px;
  background: var(--fei-surface);
  color: var(--fei-purple);
  font-weight: 600;
  box-shadow: none;
}

.button-primary,
.button-acid,
.flow-action-primary,
.flow-catalog-buttons > :first-child {
  border-color: var(--fei-primary);
  background: var(--fei-primary);
  color: var(--fei-surface);
}

.button-ghost,
.flow-action-ghost {
  background: transparent;
}

.button-soft,
.flow-action-secondary {
  border-color: var(--fei-border);
  background: var(--fei-surface);
  color: var(--fei-purple);
}

.button-danger,
.flow-action-danger {
  border-color: var(--danger);
  background: var(--danger);
  color: var(--fei-surface);
}

.button:hover:not(:disabled),
.flow-header-actions > :is(button, a):hover:not(:disabled),
.flow-card-actions > :is(button, a):hover:not(:disabled),
.flow-dialog-footer > :is(button, a):hover:not(:disabled),
.flow-action-primary:hover:not(:disabled),
.flow-action-secondary:hover:not(:disabled),
.flow-action-danger:hover:not(:disabled),
.flow-action-ghost:hover:not(:disabled) {
  border-color: var(--fei-purple);
  background: var(--fei-selected);
  color: var(--fei-purple);
  box-shadow: 0 5px 16px rgba(77, 58, 75, .08);
  transform: translateY(-1px);
}

.button-primary:hover:not(:disabled),
.button-acid:hover:not(:disabled),
.flow-action-primary:hover:not(:disabled) {
  border-color: #9d3652;
  background: #9d3652;
  color: var(--fei-surface);
}

.icon-button,
.flow-action-icon {
  border: 1px solid var(--fei-border);
  border-radius: 10px;
  background: var(--fei-surface);
  color: var(--fei-purple);
  box-shadow: none;
}

.panel,
.flow-card,
.flow-pricing,
.flow-brand-panel,
.flow-brand-picker,
.flow-selection-group,
.flow-post-card,
.flow-example-card,
.flow-group-form,
.flow-example-form,
.gb-group-card,
.gb-quick-panel,
.gb-packing-card,
.gb-po-card,
.gb-product-section {
  border-color: var(--fei-border);
  background: rgba(255, 253, 252, .95);
  box-shadow: var(--shadow-small);
}

.panel,
.flow-card,
.flow-selection-group,
.flow-post-card,
.flow-example-card,
.gb-group-card,
.gb-quick-panel,
.gb-packing-card,
.gb-po-card,
.gb-product-section {
  border-radius: 14px;
}

.flow-card:hover,
.product-card:hover,
.tool-card:hover,
.brand-card:hover {
  border-color: #dbcbd1;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.input,
.select,
.textarea,
.flow-input,
.flow-select,
.flow-field :is(input, select, textarea),
.flow-dialog :is(input, select, textarea),
.data-table input,
.data-table select,
.gb-purchase-status {
  border-color: var(--fei-border);
  border-radius: 9px;
  background: var(--fei-surface);
  color: var(--fei-text);
}

.field label,
.field-label,
.flow-field > :is(label, span):first-child {
  color: var(--fei-muted);
  font-size: 12px;
  font-weight: 600;
}

.input:focus,
.select:focus,
.textarea:focus,
.flow-input:focus,
.flow-select:focus,
.flow-field :is(input, select, textarea):focus,
.flow-dialog :is(input, select, textarea):focus {
  border-color: var(--fei-purple);
  box-shadow: 0 0 0 3px rgba(143, 87, 138, .12);
}

.input::placeholder,
.textarea::placeholder,
.flow-page input::placeholder,
.flow-page textarea::placeholder {
  color: #b1a3aa;
}

.segmented,
.flow-mode-switch {
  border-color: var(--fei-border);
  background: rgba(249, 232, 237, .55);
  box-shadow: none;
}

.segmented button[aria-pressed="true"],
.flow-mode-switch > button:is(.is-active,
[aria-current="page"],
[aria-pressed="true"]),
.flow-mode-button:is(.is-active,
[aria-current="page"],
[aria-pressed="true"]),
.flow-mode-button.flow-mode-active {
  border-color: var(--fei-primary);
  background: var(--fei-selected);
  color: var(--fei-primary);
  box-shadow: none;
}

.flow-mode-switch > button:is(.is-active, [aria-current="page"], [aria-pressed="true"]) strong,
.flow-mode-button:is(.is-active, [aria-current="page"], [aria-pressed="true"]) strong,
.flow-mode-button.flow-mode-active strong {
  color: var(--fei-primary);
}

.toolbar-panel,
.flow-toolbar {
  border-color: var(--fei-border);
  background: rgba(251, 247, 243, .88);
  box-shadow: 0 8px 24px rgba(77, 58, 75, .06);
}

.data-table-wrap {
  border-color: var(--fei-border);
  background: var(--fei-surface);
  box-shadow: 0 5px 18px rgba(77, 58, 75, .045);
}

.data-table th {
  border-color: var(--fei-border);
  background: #f7eef2;
  color: var(--fei-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}

.data-table td {
  border-color: var(--fei-border);
}

.data-table tbody tr:hover {
  background: rgba(249, 232, 237, .42);
}

.metric-strip {
  border-color: var(--fei-border);
  background: rgba(255, 253, 252, .94);
  box-shadow: var(--shadow-small);
}

.metric {
  border-right-color: var(--fei-border);
}

.metric strong,
.rate-card strong {
  color: var(--fei-primary);
}

.notice {
  border-color: #dfd3bd;
  background: #fcf7e9;
  color: #6f5f43;
}

.task-status.is-active,
.flow-validation-valid,
.flow-catalog-status,
.flow-status {
  border-color: rgba(114, 128, 100, .38);
  background: rgba(174, 181, 158, .2);
  color: #5f6c54;
}

.notice-error,
.task-status.is-error,
.flow-validation-error {
  border-color: rgba(165, 61, 85, .32);
  background: rgba(183, 68, 97, .08);
  color: var(--danger);
}

.hero-board {
  min-height: 360px;
  border-color: var(--fei-border);
  background: rgba(255, 253, 252, .95);
  color: var(--fei-text);
  box-shadow: var(--shadow);
}

.hero-copy .eyebrow {
  color: var(--fei-purple);
}

.hero-title {
  color: var(--fei-text);
  font-size: clamp(44px, 6.5vw, 78px);
  font-weight: 700;
  line-height: 1.02;
}

.hero-title span {
  background: linear-gradient(90deg, var(--fei-primary), var(--fei-rose), var(--fei-purple));
  background-clip: text;
  color: transparent;
  font-style: normal;
}

.hero-bottom p {
  color: var(--fei-muted);
}

.hero-art {
  border-left-color: var(--fei-border);
  background:
    radial-gradient(ellipse at 74% 22%, rgba(255, 253, 252, .86) 0 8%, transparent 8.5%),
    radial-gradient(ellipse at 86% 34%, rgba(255, 253, 252, .72) 0 7%, transparent 7.5%),
    radial-gradient(ellipse at 64% 39%, rgba(255, 253, 252, .62) 0 6%, transparent 6.5%),
    linear-gradient(145deg, var(--fei-petal), var(--fei-lavender));
}

.hero-art::before {
  color: var(--fei-text);
  font-size: clamp(42px, 5vw, 68px);
  font-weight: 700;
  letter-spacing: -.035em;
  opacity: .9;
  transform: rotate(3deg);
}

.hero-art::after {
  background: var(--fei-primary);
  color: var(--fei-surface);
}

.tool-card {
  border-color: var(--fei-border);
  background: var(--fei-surface);
  box-shadow: var(--shadow-small);
}

.tool-card:nth-child(2),
.flow-dashboard-grid .tool-card:nth-child(1) {
  background: rgba(248, 213, 220, .72);
}

.tool-card:nth-child(3),
.flow-dashboard-grid .tool-card:nth-child(2) {
  background: rgba(229, 210, 229, .72);
}

.tool-card:nth-child(5),
.flow-dashboard-grid .tool-card:nth-child(3) {
  background: rgba(174, 181, 158, .22);
}

.flow-dashboard-grid .tool-card:nth-child(4) {
  background: linear-gradient(135deg, var(--fei-surface), var(--fei-selected));
}

.tool-card-index,
.tool-card p {
  color: var(--fei-muted);
}

.tool-card h3 {
  color: var(--fei-purple);
  font-size: 26px;
}

.brand-card {
  border-color: var(--fei-border);
  background: rgba(255, 253, 252, .9);
  box-shadow: none;
}

.brand-card:hover {
  border-color: var(--fei-purple);
}

.brand-code {
  background: color-mix(in srgb, var(--brand-accent) 42%, var(--fei-purple));
}

.flow-brand-heading {
  border-color: var(--fei-border);
  background: linear-gradient(145deg, var(--fei-primary), var(--fei-purple));
}

.flow-brand-heading p {
  color: rgba(255, 253, 252, .78);
}

.flow-brand-heading .flow-eyebrow {
  color: var(--fei-petal);
}

.flow-brand-picker {
  background: var(--fei-surface);
  box-shadow: none;
}

.flow-brand-picker::after {
  background: var(--fei-selected);
  color: var(--fei-primary);
}

.flow-brand-button {
  border-color: var(--fei-border);
  background: var(--fei-background);
}

.flow-brand-button:hover,
.flow-brand-button:is(.is-active, [aria-selected="true"], [aria-pressed="true"]),
.flow-brand-button.flow-brand-active {
  border-color: var(--fei-primary);
  background: var(--fei-selected);
  color: var(--fei-primary);
  box-shadow: none;
}

.flow-card-media {
  border-color: var(--fei-border);
  background: linear-gradient(145deg, var(--fei-background), var(--fei-selected));
}

.flow-card-status,
.product-badge {
  border-color: rgba(183, 68, 97, .25);
  background: var(--fei-selected);
  color: var(--fei-primary);
}

.flow-card-price {
  border-left-color: var(--fei-primary);
  background: var(--fei-selected);
}

.flow-card-price strong,
.flow-catalog-price,
.fx-result strong,
.fx-goods-price,
.fx-computed-cell {
  color: var(--fei-primary);
}

.flow-catalog-actions,
.flow-variant-list,
.flow-dialog-section,
.flow-dialog-header,
.flow-dialog-footer {
  border-color: var(--fei-border);
}

.flow-catalog-buttons > :is(button, a) {
  border-color: var(--fei-border);
  border-radius: 9px;
  background: var(--fei-surface);
  color: var(--fei-purple);
}

.flow-catalog-buttons > :is(button, a):hover:not(:disabled) {
  border-color: var(--fei-purple);
  background: var(--fei-selected);
}

.flow-pricing[open] > summary {
  background: rgba(229, 210, 229, .34);
}

.flow-quantity-grid button {
  border-color: rgba(143, 87, 138, .28);
  background: rgba(229, 210, 229, .42);
  color: var(--fei-purple);
}

.flow-quantity-grid button:hover:not(:disabled),
.flow-quantity-grid button:focus-visible {
  border-color: var(--fei-purple);
  background: var(--fei-purple);
  color: var(--fei-surface);
}

.flow-dialog,
.confirm-dialog,
.tenant-dialog {
  border-color: var(--fei-border);
  background: var(--fei-background);
  color: var(--fei-text);
  box-shadow: 0 28px 80px rgba(77, 58, 75, .24);
}

.flow-dialog {
  border: 1px solid var(--fei-border);
}

.flow-dialog::backdrop,
.confirm-dialog::backdrop,
.tenant-dialog::backdrop {
  background: rgba(77, 58, 75, .48);
  backdrop-filter: blur(6px);
}

.flow-dialog-header {
  background: linear-gradient(120deg, var(--fei-surface), var(--fei-selected));
}

.flow-dialog-footer {
  background: rgba(255, 253, 252, .94);
}

.confirm-dialog h2,
.flow-dialog-header h2,
.tenant-dialog-heading h2 {
  color: var(--fei-purple);
  font-weight: 700;
  letter-spacing: -.02em;
}

.toast {
  border-color: var(--fei-text);
  background: var(--fei-text);
  color: var(--fei-surface);
}

.toast-success {
  border-color: #65725b;
  background: #65725b;
}

.toast-error {
  border-color: var(--danger);
  background: var(--danger);
}

.advanced-assist,
.drop-zone {
  border-color: var(--fei-border);
  background: linear-gradient(110deg, var(--fei-surface), rgba(229, 210, 229, .34));
}

.advanced-mode-active,
.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--fei-purple);
  background: rgba(229, 210, 229, .42);
  box-shadow: 0 0 0 3px rgba(143, 87, 138, .1);
}

/* ---- 全站版面稽核：一致的資訊密度與響應式節奏 ---- */
.main-stage {
  padding: clamp(18px, 2.6vw, 40px);
}

#tool-root {
  width: min(1380px, 100%);
}

.page-header,
.flow-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px 24px;
  margin-bottom: 16px;
}

.page-header-copy,
.flow-header-copy {
  min-width: 0;
  max-width: 720px;
}

.page-title,
.flow-title {
  font-size: clamp(28px, 3vw, 32px);
  line-height: 1.18;
}

.page-lead,
.flow-lead {
  max-width: 680px;
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.6;
}

.flow-header-actions,
.page-actions {
  justify-content: flex-end;
  gap: 6px;
  max-width: 600px;
}

.flow-header-actions > :is(button, a),
.page-actions > :is(button, a) {
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 12px;
  white-space: nowrap;
}

.dashboard-section {
  margin-top: clamp(26px, 3.4vw, 42px);
}

.section-heading {
  align-items: center;
  gap: 14px 28px;
  margin-bottom: 12px;
}

.section-heading h2 {
  flex: 0 0 auto;
  font-size: clamp(27px, 3vw, 34px);
  line-height: 1.12;
}

.section-heading p {
  max-width: 680px;
  font-size: 13px;
  line-height: 1.6;
}

.dashboard-grid,
.flow-dashboard-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.tool-card,
.flow-dashboard-grid .tool-card {
  grid-column: auto;
  min-height: 158px;
  padding: 17px 18px;
  border-radius: 15px;
}

.tool-card h3,
.flow-dashboard-grid .tool-card h3 {
  margin: auto 0 6px;
  font-size: 23px;
  line-height: 1.12;
}

.tool-card p,
.flow-dashboard-grid .tool-card p {
  font-size: 12px;
  line-height: 1.55;
}

.tool-card-arrow {
  top: 13px;
  right: 15px;
  font-size: 22px;
}

.hero-board {
  min-height: 300px;
  border-radius: 20px;
}

.hero-copy {
  padding: clamp(24px, 3.2vw, 42px);
}

.hero-title {
  font-size: clamp(40px, 5vw, 62px);
  line-height: 1.02;
}

.hero-bottom {
  gap: 18px;
  margin-top: 26px;
}

.hero-bottom p {
  font-size: 13px;
  line-height: 1.6;
}

.hero-art::before {
  font-size: clamp(38px, 4.5vw, 58px);
}

.metric-strip {
  margin-top: 12px;
  border-radius: 14px;
}

.metric-strip.gb-metric-strip {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-block: 8px 12px;
}

.metric,
.gb-metric-strip .metric {
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--fei-border);
  border-bottom: 0;
}

.metric:last-child,
.gb-metric-strip .metric:last-child {
  border-right: 0;
}

.metric strong,
.gb-metric-strip .metric strong {
  overflow: hidden;
  font-size: clamp(23px, 2vw, 29px);
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric span,
.gb-metric-strip .metric span {
  margin-top: 4px;
  font-size: 11px;
  white-space: nowrap;
}

.gb-workspace-switch {
  gap: 8px;
  margin-block: 2px 8px;
}

.gb-workspace-tab {
  min-height: 60px;
  padding: 9px 12px;
  border-radius: 12px;
}

.gb-workspace-number {
  flex-basis: 30px;
  width: 30px;
  height: 30px;
  font-size: 11px;
}

.gb-workspace-tab strong {
  font-size: 13px;
}

.gb-workspace-tab small {
  font-size: 10px;
}

@media (max-width: 1180px) {
  .page-header,
  .flow-header {
    grid-template-columns: 1fr;
  }

  .flow-header-actions,
  .page-actions {
    justify-content: flex-start;
    max-width: none;
  }

  .dashboard-grid,
  .flow-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-strip.gb-metric-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gb-metric-strip .metric {
    border-right: 1px solid var(--fei-border);
    border-bottom: 1px solid var(--fei-border);
  }

  .gb-metric-strip .metric:nth-child(3n) {
    border-right: 0;
  }

  .gb-metric-strip .metric:nth-last-child(-n + 3) {
    border-bottom: 0;
  }
}

@media (max-width: 900px) {
  .section-heading {
    display: block;
  }

  .section-heading p {
    margin-top: 6px;
  }
}

@media (max-width: 680px) {
  .main-stage {
    padding: 14px 12px 34px;
  }

  .page-header,
  .flow-header {
    gap: 12px;
  }

  .flow-header-actions,
  .page-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .flow-header-actions > :is(button, a),
  .page-actions > :is(button, a) {
    width: 100%;
    white-space: normal;
  }

  .dashboard-grid,
  .flow-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .tool-card,
  .flow-dashboard-grid .tool-card {
    min-height: 132px;
  }

  .hero-board {
    min-height: 0;
  }

  .hero-copy {
    padding: 20px 18px;
  }

  .hero-title {
    font-size: clamp(34px, 10vw, 42px);
  }

  .hero-bottom {
    display: block;
    margin-top: 18px;
  }

  .hero-art {
    min-height: 105px;
  }

  .metric-strip.gb-metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gb-metric-strip .metric:nth-child(3n) {
    border-right: 1px solid var(--fei-border);
  }

  .gb-metric-strip .metric:nth-child(even) {
    border-right: 0;
  }

  .gb-metric-strip .metric:nth-last-child(-n + 3) {
    border-bottom: 1px solid var(--fei-border);
  }

  .gb-metric-strip .metric:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .gb-workspace-switch {
    grid-template-columns: 1fr;
  }
}

.catalog-more-filters,
.catalog-more-fields {
  display: contents;
}

.catalog-more-filters > summary {
  display: none;
}

/* ---- 手機版：優先顯示可操作內容，收起次要資訊 ---- */
@media (max-width: 680px) {
  body {
    padding-bottom: calc(56px + env(safe-area-inset-bottom));
  }

  .mobile-bar {
    min-height: 56px;
    padding: 7px 10px;
    gap: 7px;
  }

  .mobile-bar .brand-lockup {
    gap: 8px;
  }

  .mobile-bar .brand-mark {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
    border-radius: 12px 15px 12px 15px;
    font-size: 20px;
  }

  .mobile-bar .brand-lockup strong {
    font-size: 13px;
  }

  .mobile-bar .brand-lockup small {
    font-size: 8px;
  }

  .mobile-account {
    width: min(160px, 38vw);
    margin-right: 2px;
  }

  .mobile-account .tenant-pill {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 11px;
  }

  .mobile-bar .icon-button {
    min-height: 40px;
    padding: 6px 9px;
    border-radius: 10px;
    font-size: 12px;
  }

  .mobile-flow-nav {
    min-height: calc(52px + env(safe-area-inset-bottom));
    padding: 3px 2px max(3px, env(safe-area-inset-bottom));
  }

  .mobile-flow-nav button {
    grid-template-rows: 19px auto;
    min-height: 44px;
    padding: 2px;
    font-size: 8px;
  }

  .mobile-flow-nav button span {
    font-size: 16px;
  }

  .main-stage,
  .main-stage:has(.catalog-page) {
    padding: 10px 10px 24px;
  }

  .page-header,
  .flow-header,
  .catalog-page .page-header {
    gap: 8px;
    margin-bottom: 10px;
  }

  .eyebrow,
  .flow-eyebrow,
  .catalog-page .eyebrow {
    display: none;
  }

  .page-title,
  .flow-title,
  .catalog-page .page-title {
    font-size: 26px;
    line-height: 1.18;
  }

  .page-lead,
  .flow-lead,
  .catalog-page .page-lead {
    display: -webkit-box;
    margin-top: 4px;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .flow-header-actions,
  .page-actions {
    gap: 5px;
    margin-top: 0;
  }

  .flow-header-actions > :is(button, a),
  .page-actions > :is(button, a) {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .flow-header-actions:has(> :only-child) {
    grid-template-columns: 1fr;
  }

  .catalog-page .page-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .catalog-page .flow-mode-switch {
    grid-template-columns: 58px repeat(2, minmax(0, 1fr));
    width: 100%;
    margin-bottom: 8px;
  }

  .catalog-page .flow-mode-switch > span {
    grid-column: auto;
    align-self: center;
    padding: 0 6px;
    font-size: 8px;
    text-align: center;
  }

  .catalog-page .flow-mode-button {
    min-height: 38px;
    padding: 5px 8px;
  }

  .catalog-page .flow-mode-button strong {
    font-size: 11px;
  }

  .catalog-page .flow-mode-button small {
    display: none;
  }

  .catalog-page .toolbar-panel {
    padding: 10px;
  }

  .catalog-page .toolbar-top {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .catalog-page .field label {
    margin-bottom: 3px;
    font-size: 10px;
  }

  .catalog-page :is(.input, .select) {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 12px;
  }

  .catalog-more-filters {
    display: block;
    padding-top: 1px;
  }

  .catalog-more-filters > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 34px;
    padding: 6px 9px;
    border: 1px solid var(--fei-border);
    border-radius: 9px;
    background: var(--fei-surface);
    color: var(--fei-purple);
    font-size: 11px;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
  }

  .catalog-more-filters > summary::-webkit-details-marker {
    display: none;
  }

  .catalog-more-filters > summary::after {
    content: "＋";
    font-size: 15px;
    line-height: 1;
  }

  .catalog-more-filters[open] > summary::after {
    content: "−";
  }

  .catalog-more-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding-top: 7px;
  }

  .catalog-more-fields > .field:last-child {
    grid-column: 1 / -1;
  }

  .catalog-page .toolbar-bottom {
    gap: 5px;
    margin-top: 7px;
  }

  .catalog-page .switch-label {
    min-height: 28px;
    font-size: 11px;
  }

  .catalog-page .catalog-actions {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    align-items: center;
    gap: 5px;
    width: 100%;
  }

  .catalog-page .catalog-actions .button {
    min-height: 32px;
    padding: 5px 7px;
    font-size: 10px;
  }

  .catalog-page .flow-pricing {
    margin-bottom: 8px;
  }

  .catalog-page .flow-pricing > summary {
    min-height: 42px;
    padding: 7px 10px;
  }

  .catalog-page .flow-pricing > summary strong {
    font-size: 12px;
  }

  .gb-workspace-switch {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin-block: 0 7px;
  }

  .gb-workspace-tab {
    justify-content: center;
    gap: 6px;
    min-height: 48px;
    padding: 6px;
    border-radius: 10px;
  }

  .gb-workspace-number {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
    font-size: 9px;
  }

  .gb-workspace-tab strong {
    font-size: 11px;
    white-space: nowrap;
  }

  .gb-workspace-tab small {
    display: none;
  }

  .gb-process-guide {
    display: none;
  }

  .gb-group-grid {
    gap: 8px;
  }

  .gb-group-card {
    gap: 7px;
    padding: 12px;
  }

  .gb-group-card h2,
  .gb-group-card h3 {
    font-size: 20px;
  }
}

@media (min-width: 681px) {
  .catalog-page .toolbar-top {
    grid-template-columns: minmax(155px, .8fr) minmax(220px, 1.65fr) minmax(330px, 1.65fr);
  }

  .catalog-more-filters {
    display: block;
    min-width: 0;
  }

  .catalog-more-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (min-width: 681px) and (max-width: 1180px) {
  .catalog-page .toolbar-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-more-filters {
    grid-column: 1 / -1;
  }
}

/* 寬螢幕保留快速掃描的表格；一般筆電寬度會轉為不需橫向捲動的緊湊卡片。 */
.gb-purchase-table .data-table {
  width: 100%;
  min-width: 1020px;
  table-layout: fixed;
  font-size: 12px;
}

.gb-purchase-table .data-table :is(th, td) {
  padding: 8px 7px;
  vertical-align: middle;
}
.gb-purchase-table .data-table :is(th, td):nth-child(1) { width: 72px; }
.gb-purchase-table .data-table :is(th, td):nth-child(2) { width: 150px; }
.gb-purchase-table .data-table :is(th, td):nth-child(3) { width: 62px; }
.gb-purchase-table .data-table :is(th, td):nth-child(4) { width: 54px; }
.gb-purchase-table .data-table :is(th, td):nth-child(5) { width: 96px; }
.gb-purchase-table .data-table :is(th, td):nth-child(6) { width: 82px; }
.gb-purchase-table .data-table :is(th, td):nth-child(7) { width: 118px; }
.gb-purchase-table .data-table :is(th, td):nth-child(8) { width: 154px; }
.gb-purchase-table .data-table :is(th, td):nth-child(9) { width: 88px; }
.gb-purchase-table .data-table :is(th, td):nth-child(10) { width: 148px; }

.gb-purchase-table .gb-thumb {
  width: 56px;
  height: 56px;
  flex-basis: 56px;
  border-radius: 10px;
}
.gb-purchase-table .gb-cost-cell-input {
  width: 82px;
  min-height: 34px;
  padding: 5px 7px;
}
.gb-purchase-table .gb-note-cell-input {
  width: 102px;
  min-height: 34px;
  padding: 5px 7px;
}
.gb-purchase-table .flow-action {
  min-height: 34px;
  padding: 6px 9px;
  border-radius: 9px;
  font-size: 11px;
}
.gb-purchase-table td:nth-child(2),
.gb-purchase-table td:nth-child(7) {
  overflow-wrap: anywhere;
}
.gb-purchase-select-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
}
.gb-purchase-select-label input {
  width: 17px;
  min-width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin: 0;
  padding: 0;
}
.gb-purchase-product-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.gb-purchase-table .data-table tr:has(.gb-purchase-select-label input:checked) {
  border-color: color-mix(in srgb, var(--fei-primary) 55%, var(--line));
  background: color-mix(in srgb, var(--fei-primary) 5%, var(--flow-paper-solid));
}

@media (max-width: 1400px) {
  .gb-purchase-table {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .gb-purchase-table .data-table {
    display: block;
    width: 100%;
    min-width: 0;
    table-layout: auto;
  }

  .gb-purchase-table .data-table thead { display: none; }

  .gb-purchase-table .data-table tbody {
    display: grid;
    gap: 10px;
  }

  .gb-purchase-table .data-table tr {
    display: grid;
    grid-template-columns: 96px minmax(142px, 1.3fr) minmax(46px, .35fr) minmax(84px, .65fr) minmax(78px, .55fr) minmax(160px, 1.2fr) minmax(72px, .5fr) minmax(126px, .8fr);
    gap: 9px 12px;
    align-items: center;
    padding: 14px;
    border: var(--flow-hairline);
    border-radius: 14px;
    background: var(--flow-paper-solid);
    box-shadow: var(--shadow-small);
  }

  .gb-purchase-table .data-table td {
    width: auto !important;
    min-width: 0 !important;
    padding: 0;
    border: 0;
  }

  .gb-purchase-table .gb-purchase-photo {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: start;
  }

  .gb-purchase-table .gb-thumb {
    width: 88px;
    height: 88px;
    flex-basis: 88px;
    border-radius: 13px;
  }

  .gb-purchase-table .gb-purchase-product {
    grid-column: 2 / 6;
    grid-row: 1;
    overflow-wrap: anywhere;
    font-weight: 750;
  }

  .gb-purchase-table .gb-purchase-progress {
    display: flex;
    grid-column: 6;
    grid-row: 1;
    align-items: center;
    gap: 8px;
    min-width: 0;
    white-space: nowrap;
  }

  .gb-purchase-table .gb-purchase-supplier-payment {
    grid-column: 7;
    grid-row: 1;
    justify-self: center;
  }

  .gb-purchase-table .gb-purchase-actions {
    grid-column: 8;
    grid-row: 1;
    justify-self: end;
  }

  .gb-purchase-table .gb-purchase-spec { grid-column: 2; grid-row: 2; }
  .gb-purchase-table .gb-purchase-quantity { grid-column: 3; grid-row: 2; }
  .gb-purchase-table .gb-purchase-cost { grid-column: 4; grid-row: 2; }
  .gb-purchase-table .gb-purchase-subtotal { grid-column: 5; grid-row: 2; }
  .gb-purchase-table .gb-purchase-note { grid-column: 6 / 9; grid-row: 2; }

  .gb-purchase-table .gb-purchase-progress-copy {
    margin-top: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .gb-purchase-table .gb-awaiting-row :is(
    .gb-purchase-note,
    .gb-purchase-progress,
    .gb-purchase-supplier-payment,
    .gb-purchase-actions
  ) {
    display: none;
  }

  .gb-purchase-table :is(
    .gb-purchase-spec,
    .gb-purchase-quantity,
    .gb-purchase-cost,
    .gb-purchase-subtotal,
    .gb-purchase-note
  )::before {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;
  }

  .gb-purchase-table .gb-purchase-spec::before { content: '規格'; }
  .gb-purchase-table .gb-purchase-quantity::before { content: '數量'; }
  .gb-purchase-table .gb-purchase-cost::before { content: '成本單價'; }
  .gb-purchase-table .gb-purchase-subtotal::before { content: '成本小計'; }
  .gb-purchase-table .gb-purchase-note::before { content: '備註'; }

  .gb-purchase-table .gb-cost-cell-input,
  .gb-purchase-table .gb-note-cell-input {
    width: 100%;
    min-width: 0;
  }

  .gb-purchase-table .gb-row-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
  }
}

@media (min-width: 641px) and (max-width: 1050px) {
  .gb-purchase-sortbar > strong { flex: 0 0 auto; }
  .gb-purchase-progress-filters { flex-basis: calc(100% - 100px); }
  .gb-purchase-search {
    flex: 1 1 240px;
    max-width: none;
  }
  .gb-purchase-bulk-controls {
    flex: 1 0 100%;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }

  .gb-purchase-table .data-table tr {
    grid-template-columns: 88px repeat(6, minmax(0, 1fr));
    gap: 8px 10px;
    padding: 12px;
  }
  .gb-purchase-table .gb-thumb {
    width: 80px;
    height: 80px;
    flex-basis: 80px;
    border-radius: 12px;
  }
  .gb-purchase-table .gb-purchase-photo { grid-column: 1; grid-row: 1 / 3; }
  .gb-purchase-table .gb-purchase-product { grid-column: 2 / 5; grid-row: 1; }
  .gb-purchase-table .gb-purchase-progress { grid-column: 5 / 7; grid-row: 1; }
  .gb-purchase-table .gb-purchase-supplier-payment { grid-column: 7; grid-row: 1; }
  .gb-purchase-table .gb-purchase-spec { grid-column: 2; grid-row: 2; }
  .gb-purchase-table .gb-purchase-quantity { grid-column: 3; grid-row: 2; }
  .gb-purchase-table .gb-purchase-cost { grid-column: 4 / 5; grid-row: 2; }
  .gb-purchase-table .gb-purchase-subtotal { grid-column: 5 / 6; grid-row: 2; }
  .gb-purchase-table .gb-purchase-actions { grid-column: 6 / 8; grid-row: 2; }
  .gb-purchase-table .gb-purchase-note { grid-column: 1 / 8; grid-row: 3; }
}

@media (max-width: 680px) {
  .flow-procurement-page .flow-header-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .flow-procurement-page .flow-header-actions > :is(button, a) {
    padding-inline: 5px;
    font-size: 10px;
    white-space: nowrap;
  }

  .flow-procurement-page .flow-toolbar {
    gap: 7px;
    padding: 10px;
  }

  .flow-procurement-page .flow-toolbar-footer {
    grid-column: 1 / -1;
  }

  .flow-procurement-page .flow-toolbar-footer .flow-status {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .flow-procurement-page .flow-toolbar-footer .flow-action {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 5px 9px;
    font-size: 10px;
  }

  .flow-quick-purchase {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    align-items: end;
    padding-top: 10px;
  }

  .flow-quick-prices {
    min-width: 116px;
    min-height: 40px;
  }

  .flow-quick-quantity {
    grid-column: 1 / -1;
  }

  .flow-quantity-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 3px;
  }

  .flow-quantity-grid button {
    min-height: 32px;
    height: 32px;
    font-size: 10px;
  }

  .gb-purchase-table {
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .dashboard-section {
    margin-top: 20px;
  }

  .section-heading {
    margin-bottom: 8px;
  }

  .section-heading h2 {
    font-size: 25px;
  }

  .dashboard-grid,
  .flow-dashboard-grid {
    gap: 8px;
    margin-top: 8px;
  }

  .tool-card,
  .flow-dashboard-grid .tool-card {
    min-height: 104px;
    padding: 12px 14px;
    border-radius: 13px;
  }

  .tool-card-index {
    font-size: 10px;
  }

  .tool-card h3,
  .flow-dashboard-grid .tool-card h3 {
    margin: auto 0 4px;
    font-size: 20px;
  }

  .tool-card p,
  .flow-dashboard-grid .tool-card p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .tool-card-arrow {
    top: 10px;
    right: 12px;
    font-size: 18px;
  }
}
