/* ==========================================================================
   KEPIN Table Builder
   A calm, precise workspace that sits alongside the KEPIN product family.
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/inter-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/inter-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/inter-600.woff2') format('woff2');
}

:root {
  --font-sans: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-mono: 'SFMono-Regular', 'Cascadia Code', Consolas, 'Liberation Mono', monospace;

  --ink: #101828;
  --ink-soft: #344054;
  --muted: #667085;
  --muted-light: #98a2b3;
  --faint: #b6becb;

  --line: #e7eaf0;
  --line-soft: #f0f2f6;
  --line-strong: #d5dce6;
  --canvas: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --surface-muted: #f2f4f7;

  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --blue-line: #dbeafe;

  --green: #067647;
  --green-bright: #0f9f6e;
  --green-soft: #ecfdf3;
  --green-line: #d1fadf;

  --amber: #b54708;
  --amber-bright: #dc6803;
  --amber-soft: #fffaeb;
  --amber-line: #fedf89;

  --red: #b42318;
  --red-bright: #d92d20;
  --red-soft: #fef3f2;
  --red-line: #fecdca;

  --violet: #6941c6;
  --violet-soft: #f4f1ff;
  --violet-line: #e9e2ff;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.03);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08), 0 2px 6px rgba(16, 24, 40, 0.03);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.16), 0 8px 20px rgba(16, 24, 40, 0.06);

  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --topbar-height: 64px;
  --sidebar-width: 240px;
  --transition: 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.lang-zh {
  font-family: 'Inter', 'Microsoft YaHei', 'PingFang SC', 'Noto Sans SC', 'Segoe UI', sans-serif;
  letter-spacing: 0;
}

body.lang-zh .page-heading h1,
body.lang-zh .fill-hero h1,
body.lang-zh .success-panel h1,
body.lang-zh .builder-form-title-wrap h1 {
  letter-spacing: -0.018em;
}

body.lang-zh .nav-section-label {
  letter-spacing: 0.06em;
}

body.overlay-open {
  overflow: hidden;
}

h1, h2, h3, h4, p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

img,
svg {
  flex: none;
}

::selection {
  color: #0b2c67;
  background: #dbeafe;
}

:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.65);
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: -50px;
  left: 12px;
  z-index: 10000;
  padding: 9px 13px;
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  transition: top var(--transition);
}

.skip-link:focus {
  top: 10px;
}

.hidden,
[hidden] {
  display: none !important;
}

.spin {
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Primitive components
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.btn:disabled {
  opacity: 0.52;
  pointer-events: none;
}

.btn-primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.16);
}

.btn-primary:hover {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
}

.btn-primary:active {
  transform: translateY(0.5px);
}

.btn-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  border-color: #bcc7d5;
  background: var(--surface-soft);
  color: var(--ink);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.btn-danger {
  border-color: var(--red-bright);
  background: var(--red-bright);
  color: #ffffff;
}

.btn-danger:hover {
  border-color: #b42318;
  background: #b42318;
}

.btn-ghost-danger {
  border-color: transparent;
  background: transparent;
  color: var(--red);
}

.btn-ghost-danger:hover {
  background: var(--red-soft);
}

.btn-sm {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12px;
  gap: 5px;
}

.btn-xs {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 11.5px;
  gap: 4px;
}

.btn-lg {
  min-height: 43px;
  padding: 0 18px;
  font-size: 13.5px;
}

.btn-block {
  width: 100%;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

.icon-button:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.icon-button-sm {
  width: 27px;
  height: 27px;
  border-radius: 6px;
}

.icon-button.danger-hover:hover {
  background: var(--red-soft);
  color: var(--red);
}

.link-button,
.text-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--transition);
}

.link-button:hover,
.text-action:hover {
  color: var(--blue-dark);
}

.text-action {
  color: var(--ink-soft);
}

.text-action:hover {
  color: var(--blue);
}

.text-action.is-sent {
  color: var(--green);
  opacity: 1;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 500;
}

.text-link:hover {
  color: var(--blue-dark);
}

.text-danger {
  color: var(--red) !important;
}

.mt-8 {
  margin-top: 8px;
}

/* Inputs */
.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input,
.select {
  height: 38px;
  padding: 0 11px;
}

.textarea {
  display: block;
  min-height: 92px;
  padding: 9px 11px;
  resize: vertical;
}

.textarea-sm {
  min-height: 70px;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-light);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #c4ccd8;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.11);
}

.input.is-invalid {
  border-color: var(--red-bright);
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.08);
}

.input-lg {
  height: 43px;
  font-size: 14px;
}

.select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

input[type='date'] {
  color-scheme: light;
}

input[type='date']::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted-light);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-field:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.search-field input::placeholder {
  color: var(--muted-light);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.form-help {
  color: var(--muted-light);
  font-size: 11.5px;
  line-height: 1.5;
}

.form-error {
  color: var(--red);
  font-size: 12px;
}

.label-note {
  color: var(--muted-light);
  font-weight: 400;
}

.form-row {
  display: grid;
  gap: 10px;
}

.form-row-2 {
  grid-template-columns: 1fr 1fr;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
}

.inline-check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--blue);
}

.inline-check.is-disabled {
  opacity: 0.6;
}

.required-mark {
  color: var(--red-bright);
  font-weight: 500;
}

.code-input {
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Chips and badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  min-height: 23px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.status-dot.success {
  color: var(--green-bright);
  background: var(--green-bright);
}

.status-published,
.status-submitted {
  color: var(--green);
  background: var(--green-soft);
}

.status-published .status-dot,
.status-submitted .status-dot {
  background: var(--green-bright);
}

.status-draft,
.status-not_started {
  color: #475467;
  background: var(--surface-muted);
}

.status-draft .status-dot,
.status-not_started .status-dot {
  background: #98a2b3;
}

.status-in_progress {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.status-in_progress .status-dot {
  background: var(--blue);
}

.status-overdue {
  color: var(--red);
  background: var(--red-soft);
}

.status-overdue .status-dot {
  background: var(--red-bright);
}

.version-pill {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  color: #475467;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.version-empty {
  color: var(--muted-light);
  background: transparent;
  font-style: italic;
}

.soft-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 23px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.rule-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.rule-chip {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-light);
  font-size: 11.5px;
  white-space: nowrap;
}

.save-indicator.is-saving {
  color: var(--amber-bright);
}

.save-indicator.is-error {
  color: var(--red);
}

/* Icons, avatars, form marks */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border-radius: 50%;
  background: var(--avatar-bg, var(--surface-muted));
  color: var(--avatar-color, var(--muted));
  font-weight: 600;
  letter-spacing: -0.02em;
  user-select: none;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 10px;
}

.avatar-md {
  width: 34px;
  height: 34px;
  font-size: 11px;
}

.avatar-lg {
  width: 42px;
  height: 42px;
  font-size: 13px;
}

.form-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--icon-border, var(--line));
  border-radius: 8px;
  background: var(--icon-bg, var(--surface-muted));
  color: var(--icon-color, var(--muted));
}

.form-icon-sm {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.form-icon-lg {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f4;
}

.progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.progress-track-lg {
  height: 6px;
}

/* ==========================================================================
   App shell
   ========================================================================== */

#app {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 460px) minmax(330px, 1fr);
  align-items: center;
  gap: 24px;
  height: var(--topbar-height);
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
}

.topbar-brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
  min-width: 0;
}

.brand-logo {
  width: 51px;
  height: auto;
  object-fit: contain;
}

.brand-divider {
  width: 1px;
  height: 21px;
  background: var(--line);
}

.brand-product {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.topbar-context-badge {
  display: inline-flex;
  align-items: center;
  height: 21px;
  margin-left: 2px;
  padding: 0 7px;
  border: 1px solid var(--blue-line);
  border-radius: 4px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.global-search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 38px;
  padding: 0 10px 0 12px;
  border: 1px solid #edf0f4;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted-light);
  text-align: left;
  transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
}

.global-search:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.global-search:focus-visible {
  border-color: var(--blue);
  background: #fff;
}

.global-search-label {
  flex: 1;
  overflow: hidden;
  color: var(--muted-light);
  font-size: 12.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.global-search kbd {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted-light);
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 500;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.btn-new {
  gap: 6px;
  padding: 0 10px 0 12px;
}

.btn-new svg:last-child {
  opacity: 0.78;
  margin-left: 1px;
}

.workspace-button,
.language-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--shadow-xs);
  transition: background-color var(--transition), border-color var(--transition);
}

.language-button {
  gap: 6px;
}

.workspace-button:hover,
.language-button:hover {
  border-color: #bcc7d5;
  background: var(--surface-soft);
}

.workspace-button > svg,
.language-button > svg {
  color: var(--muted-light);
}

.language-button > svg:first-child {
  color: var(--muted);
}

.language-label {
  max-width: 72px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.workspace-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.workspace-label {
  max-width: 88px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.avatar-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 3px 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-light);
}

.avatar-button:hover {
  background: var(--surface-soft);
}

.avatar-button .avatar {
  width: 31px;
  height: 31px;
  font-size: 10.5px;
}

.mobile-menu-button {
  display: none;
}

.app-body {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - var(--topbar-height));
}

.app-body-focus {
  min-height: calc(100vh - var(--topbar-height));
}

.main {
  flex: 1;
  min-width: 0;
  min-height: calc(100vh - var(--topbar-height));
  background: var(--surface);
}

.main-focus {
  background: var(--canvas);
}

.mobile-scrim {
  display: none;
}

.is-focus .mobile-menu-button {
  display: none;
}

.is-focus .mobile-scrim {
  display: none !important;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidebar {
  position: sticky;
  top: var(--topbar-height);
  display: flex;
  flex: 0 0 var(--sidebar-width);
  flex-direction: column;
  width: var(--sidebar-width);
  height: calc(100vh - var(--topbar-height));
  padding: 22px 14px 16px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-mobile-head {
  display: none;
}

.sidebar-mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.sidebar-mobile-brand img {
  width: 43px;
  height: auto;
}

.nav-section-label {
  margin: 21px 10px 7px;
  color: var(--muted-light);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  line-height: 1.2;
  text-transform: uppercase;
}

.sidebar-nav > .nav-section-label:first-child {
  margin-top: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #475467;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background-color var(--transition), color var(--transition);
}

.nav-link:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.nav-link.is-active {
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-weight: 500;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  color: #7d899b;
}

.nav-link.is-active .nav-icon {
  color: var(--blue);
}

.nav-label {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 500;
}

.nav-link.is-active .nav-count {
  background: rgba(37, 99, 235, 0.12);
  color: var(--blue-dark);
}

.nav-link-button {
  font-family: inherit;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
}

.sidebar-person {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin-bottom: 8px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: background-color var(--transition), border-color var(--transition);
}

.sidebar-person:hover {
  border-color: var(--line);
  background: var(--surface-soft);
}

.sidebar-person > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.sidebar-person strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-person small {
  overflow: hidden;
  color: var(--muted-light);
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-person > svg {
  color: var(--muted-light);
}

.sidebar-switch {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fbfcfe 0%, #f8fafc 100%);
  color: var(--muted);
  transition: border-color var(--transition), background-color var(--transition);
}

.sidebar-switch:hover {
  border-color: var(--blue-line);
  background: var(--blue-soft);
}

.sidebar-switch > svg {
  color: var(--muted-light);
}

.sidebar-switch-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-soft);
}

.sidebar-switch > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.sidebar-switch strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-switch small {
  overflow: hidden;
  color: var(--muted-light);
  font-size: 10.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-help {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 9px;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  text-align: left;
}

.sidebar-help:hover {
  background: var(--surface-soft);
  color: var(--ink-soft);
}

.sidebar-footer-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 0 4px;
  color: var(--muted-light);
  font-size: 9.5px;
  line-height: 1.4;
}

.environment-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 3px #ecfdf3;
}

/* ==========================================================================
   Page scaffolding
   ========================================================================== */

.page {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 31px 40px 54px;
}

.employee-page {
  max-width: 1600px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.page-heading-copy {
  min-width: 0;
}

.page-heading h1 {
  color: var(--ink);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.032em;
  line-height: 1.2;
}

.page-heading p {
  max-width: 720px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.page-eyebrow {
  margin-bottom: 6px;
  color: var(--muted-light);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.page-meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
  color: var(--muted-light);
  font-size: 11.5px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: none;
}

.page-summary-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 13px;
  min-height: 24px;
  margin: 17px 0 20px;
  color: var(--muted);
  font-size: 11.5px;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
}

.summary-chip strong {
  font-weight: 600;
}

.summary-divider {
  width: 1px;
  height: 13px;
  background: var(--line);
}

.summary-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.summary-item .status-dot {
  width: 5px;
  height: 5px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 27px 0 13px;
}

.section-heading h2 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.35;
}

.section-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.section-heading-tight {
  margin-top: 25px;
}

.section-heading-row {
  align-items: center;
}

.page-hint {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 18px;
  color: var(--muted-light);
  font-size: 11.5px;
  line-height: 1.55;
}

.page-hint svg {
  margin-top: 1px;
}

.back-row {
  margin-bottom: 18px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.back-link:hover {
  color: var(--ink);
}

/* Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

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

.metric-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.metric-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 7px;
}

.tone-blue {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.tone-green {
  color: var(--green);
  background: var(--green-soft);
}

.tone-amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.tone-red {
  color: var(--red);
  background: var(--red-soft);
}

.tone-slate {
  color: var(--ink-soft);
  background: var(--surface-muted);
}

.metric-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.metric-label {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.metric-value {
  color: var(--ink);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.metric-hint {
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted-light);
  font-size: 10.5px;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Toolbars and tables
   ========================================================================== */

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.toolbar-filters {
  gap: 8px;
}

.toolbar-search {
  width: 295px;
  height: 36px;
}

.toolbar-search input {
  font-size: 12.5px;
}

.table-count {
  color: var(--muted-light);
  font-size: 11.5px;
  white-space: nowrap;
}

.select-inline {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow-xs);
}

.select-inline > svg:first-child {
  color: var(--muted-light);
}

.select-inline > svg:last-child {
  color: var(--muted-light);
  pointer-events: none;
}

.select-inline select {
  max-width: 160px;
  padding: 0 1px;
  border: 0;
  outline: 0;
  appearance: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  cursor: pointer;
}

.table-card {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  scrollbar-width: thin;
  scrollbar-color: #ccd5e1 transparent;
}

.table-card::-webkit-scrollbar {
  height: 8px;
}

.table-card::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #ccd5e1;
  background-clip: padding-box;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.data-table th {
  height: 42px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 18px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-soft);
  font-size: 13px;
  vertical-align: middle;
}

.data-table tbody tr:first-child td {
  border-top: 0;
}

.data-table tbody tr {
  transition: background-color 120ms ease;
}

.data-table tbody tr:hover {
  background: #fcfdff;
}

.data-table th:first-child,
.data-table td:first-child {
  padding-left: 20px;
}

.data-table th:last-child,
.data-table td:last-child {
  padding-right: 16px;
}

.forms-table td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.cell-form {
  min-width: 268px;
}

.form-cell {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
}

.form-cell-copy {
  min-width: 0;
}

.form-cell-title {
  display: inline-block;
  max-width: 100%;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.35;
}

.form-cell-title:hover {
  color: var(--blue);
}

.form-cell p {
  display: -webkit-box;
  max-width: 440px;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.form-category-inline {
  display: none;
}

.status-cell {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.status-subnote {
  padding-left: 2px;
  color: var(--amber);
  font-size: 9.5px;
  white-space: nowrap;
}

.version-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.draft-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber-bright);
  box-shadow: 0 0 0 3px var(--amber-soft);
}

.response-cell {
  width: 122px;
}

.response-number {
  display: flex;
  align-items: baseline;
  gap: 3px;
  line-height: 1.3;
}

.response-number strong {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}

.response-number span {
  color: var(--muted-light);
  font-size: 11px;
}

.response-cell .progress-track {
  margin-top: 5px;
}

.table-subtext {
  display: block;
  margin-top: 4px;
  color: var(--muted-light);
  font-size: 10.5px;
  line-height: 1.35;
}

.cell-subtle {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.cell-muted {
  color: var(--muted-light);
  font-size: 11.5px;
  white-space: nowrap;
}

.due-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
}

.due-chip.tone-warning {
  color: var(--amber);
  background: var(--amber-soft);
}

.due-chip.tone-danger {
  color: var(--red);
  background: var(--red-soft);
}

.due-chip.tone-blue {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.due-chip.tone-neutral {
  color: var(--muted);
  background: var(--surface-muted);
}

.cell-actions {
  white-space: nowrap;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}

.row-menu-button {
  width: 31px;
  height: 31px;
  color: var(--muted-light);
}

.row-menu-button:hover {
  color: var(--ink);
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}

.person-cell > div {
  min-width: 0;
}

.cell-title {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.person-cell .table-subtext {
  margin-top: 2px;
}

.form-inline {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 175px;
}

.form-inline > div {
  min-width: 0;
}

.form-inline .cell-title {
  max-width: 220px;
}

.date-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 86px;
}

.date-cell > span:first-child {
  color: var(--ink-soft);
  font-size: 12px;
  white-space: nowrap;
}

.date-cell .table-subtext {
  margin-top: 0;
}

.response-id {
  color: #475467;
  font-family: var(--font-mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.cell-number {
  color: var(--ink-soft);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.completion-cell {
  min-width: 145px;
}

.completion-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.completion-row > span {
  width: 31px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.completion-row .progress-track {
  width: 92px;
}

.table-empty-row td {
  padding: 0 !important;
  border: 0;
}

.table-empty-row .empty-state {
  border: 0;
  border-radius: 0;
  background: var(--surface);
}

.table-empty-row:hover {
  background: var(--surface) !important;
}

.row-text-danger {
  color: var(--red);
}

/* ==========================================================================
   Empty states
   ========================================================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  text-align: center;
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow-xs);
}

.empty-state h3 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.empty-state p {
  max-width: 380px;
  margin: 5px 0 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.table-empty-row .empty-state {
  border: 0;
  padding: 36px 24px;
}

.table-empty-row .empty-state h3 {
  font-size: 13px;
}

/* ==========================================================================
   Templates
   ========================================================================== */

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

.template-card {
  display: flex;
  flex-direction: column;
  min-height: 255px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: inherit;
  text-align: left;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

button.template-card {
  cursor: pointer;
}

.template-card:hover {
  border-color: #cdd7e5;
  box-shadow: var(--shadow-sm);
}

.template-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.template-card h3 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.template-description {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.template-preview-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 16px 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.template-preview-list span {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.template-preview-list svg {
  color: var(--muted-light);
}

.template-preview-list .template-more {
  color: var(--muted-light);
  padding-left: 20px;
}

.template-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-light);
  font-size: 10.5px;
}

.template-blank {
  align-items: center;
  justify-content: center;
  border-style: dashed;
  background: #fbfcfe;
  text-align: center;
}

.template-blank:hover {
  border-color: var(--blue-line);
  background: var(--blue-soft);
}

.template-blank-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
}

.template-blank h3 {
  font-size: 14px;
}

.template-blank .template-description {
  max-width: 230px;
}

.template-blank-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 17px;
  color: var(--blue);
  font-size: 11.5px;
  font-weight: 500;
}

/* ==========================================================================
   Audit
   ========================================================================== */

.audit-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  overflow-x: auto;
}

.segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--transition), background-color var(--transition), box-shadow var(--transition);
}

.segment:hover {
  color: var(--ink-soft);
}

.segment.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.audit-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.audit-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
  transition: background-color 120ms ease;
}

.audit-row:last-child {
  border-bottom: 0;
}

.audit-row:hover {
  background: #fcfdff;
}

.activity-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 31px;
  height: 31px;
  border-radius: 8px;
  background: var(--activity-bg, var(--surface-muted));
  color: var(--activity-color, var(--muted));
}

.audit-copy {
  flex: 1;
  min-width: 0;
}

.audit-copy p {
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.5;
}

.audit-copy p strong {
  color: var(--ink);
  font-weight: 500;
}

.audit-copy > span {
  display: block;
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 10.5px;
  line-height: 1.45;
}

.audit-row time {
  flex: none;
  padding-top: 2px;
  color: var(--muted-light);
  font-size: 10.5px;
  white-space: nowrap;
}

.audit-empty {
  padding: 20px;
}

.audit-empty .empty-state {
  border: 0;
  background: var(--surface);
}

/* ==========================================================================
   Employee portal
   ========================================================================== */

.employee-heading {
  align-items: flex-start;
  margin-bottom: 22px;
}

.employee-heading h1 {
  font-size: 26px;
}

.employee-metrics {
  margin-bottom: 9px;
}

.employee-task-heading {
  margin-top: 30px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.task-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 19px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.task-card:hover {
  border-color: #d0d9e5;
  box-shadow: var(--shadow-sm);
}

.task-card-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.task-card-main > .form-icon {
  margin-top: 1px;
}

.task-card-copy {
  min-width: 0;
}

.task-card-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 7px;
}

.task-new-label {
  color: var(--muted-light);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.task-draft-label {
  color: var(--amber);
  font-size: 9.5px;
  font-weight: 500;
}

.task-card h3 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.35;
}

.task-card-copy > p {
  max-width: 680px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.task-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 11px;
  color: var(--muted-light);
  font-size: 10.5px;
}

.task-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-card-side {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 11px;
  min-width: 145px;
  padding-top: 1px;
}

.task-due {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  text-align: right;
}

.task-due > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-light);
  font-size: 10.5px;
}

.task-due > strong {
  font-size: 11px;
  font-weight: 500;
}

.task-due.tone-warning > strong {
  color: var(--amber);
}

.task-due.tone-danger > strong {
  color: var(--red);
}

.task-due.tone-blue > strong {
  color: var(--blue-dark);
}

.task-due.tone-green > strong {
  color: var(--green);
}

.task-start {
  min-height: 34px;
  font-size: 12px;
}

.employee-completed-section {
  margin-top: 31px;
}

.completed-task-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.completed-task-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.completed-task-row:last-child {
  border-bottom: 0;
}

.completed-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.completed-task-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.completed-task-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.completed-task-copy span {
  color: var(--muted-light);
  font-size: 10.5px;
}

.completed-task-date {
  flex: none;
  color: var(--muted-light);
  font-size: 10.5px;
}

.completed-task-row .link-button {
  margin-left: 6px;
}

.employee-empty-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.employee-empty-card .empty-state {
  border: 0;
  background: transparent;
}

/* ==========================================================================
   Form builder
   ========================================================================== */

.is-builder {
  background: var(--canvas);
}

.builder-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-height));
  overflow: hidden;
  background: var(--canvas);
}

.builder-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 63px;
  gap: 16px;
  min-height: 63px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.builder-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.builder-back {
  width: 31px;
  height: 31px;
  background: var(--surface-soft);
  border-color: var(--line);
}

.builder-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted-light);
  font-size: 12px;
  white-space: nowrap;
}

.builder-breadcrumb a:hover {
  color: var(--ink-soft);
}

.builder-breadcrumb > span:nth-child(2) {
  color: #d0d5dd;
}

.builder-breadcrumb-current {
  display: block;
  max-width: 280px;
  overflow: hidden;
  color: var(--ink-soft);
  font-weight: 500;
  text-overflow: ellipsis;
}

.builder-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 3px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.draft-change-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--amber);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.draft-change-label > span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber-bright);
}

.builder-bar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
}

.builder-bar-actions .btn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 11.5px;
}

.builder-bar-actions .save-indicator {
  margin-right: 4px;
}

.builder-mobile-add {
  display: none;
}

.builder-body {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 332px;
  flex: 1;
  min-height: 0;
}

.builder-left,
.builder-right {
  height: 100%;
  overflow-y: auto;
  background: var(--surface);
}

.builder-left {
  padding: 20px 15px 24px;
  border-right: 1px solid var(--line);
}

.builder-right {
  border-left: 1px solid var(--line);
}

.builder-center {
  height: 100%;
  overflow-y: auto;
  background: var(--canvas);
}

.builder-canvas {
  width: 100%;
  max-width: 790px;
  margin: 0 auto;
  padding: 27px 30px 58px;
}

.builder-palette-head {
  padding: 0 3px 13px;
}

.builder-palette-head h2 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.builder-palette-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.inspector-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.palette-group {
  margin-top: 13px;
}

.palette-group-title {
  margin: 0 0 6px 2px;
  color: var(--muted-light);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.palette-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 54px;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.25;
  text-align: left;
  transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
}

.palette-item:hover {
  border-color: #bcd1fa;
  background: #fbfdff;
  box-shadow: var(--shadow-xs);
}

.palette-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.palette-plus {
  position: absolute;
  top: 8px;
  right: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--muted-light);
  opacity: 0;
  transition: opacity var(--transition);
}

.palette-item:hover .palette-plus {
  opacity: 1;
}

.builder-side-summary {
  margin-top: 21px;
  padding: 13px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.builder-summary-title {
  margin-bottom: 8px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.builder-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  color: var(--muted);
  font-size: 10.5px;
}

.builder-summary-row strong {
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 500;
}

.builder-side-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 14px;
  padding: 0 3px;
  color: var(--muted-light);
  font-size: 9.5px;
  line-height: 1.5;
}

.builder-side-note svg {
  margin-top: 1px;
  color: var(--muted-light);
}

/* Form canvas */
.builder-form-header {
  padding: 25px 26px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.builder-form-heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.builder-form-heading > .form-icon {
  width: 39px;
  height: 39px;
  margin-top: 2px;
}

.builder-form-title-wrap {
  min-width: 0;
  flex: 1;
}

.builder-form-kicker {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
  color: var(--muted-light);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.builder-form-title-wrap h1 {
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.28;
}

.builder-edit-header {
  flex: none;
  margin-top: 4px;
  opacity: 0.75;
}

.builder-form-header:hover .builder-edit-header {
  opacity: 1;
}

.builder-form-description {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.builder-instructions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 13px;
  padding: 9px 11px;
  border: 1px solid #e3edf9;
  border-radius: 7px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.builder-instructions svg {
  margin-top: 1px;
  color: var(--blue);
}

.builder-form-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-light);
  font-size: 9.5px;
}

.builder-form-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.builder-fields-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  margin-top: 10px;
}

.builder-field {
  position: relative;
  min-width: 0;
  grid-column: span 2;
  padding: 13px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.builder-field.is-half {
  grid-column: span 1;
}

.builder-field:hover {
  border-color: #ccd8e8;
}

.builder-field.is-selected {
  border-color: #9cbcfa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08), var(--shadow-xs);
}

.builder-field.is-dragging {
  opacity: 0.45;
}

.builder-field.is-drag-over {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.builder-field.is-section {
  padding-top: 15px;
  padding-bottom: 15px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.builder-field.is-section:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.builder-field.is-section.is-selected {
  border-color: #9cbcfa;
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.06);
}

.builder-field-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 21px;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  margin-left: -4px;
  color: #c1c9d4;
  cursor: grab;
}

.drag-handle:active {
  cursor: grabbing;
}

.field-index {
  color: #c3cbd6;
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.field-type-icon {
  display: inline-flex;
  align-items: center;
  color: var(--muted-light);
}

.builder-field-label {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.builder-field .required-mark {
  margin-left: -2px;
  font-size: 11px;
}

.field-type-label {
  margin-left: auto;
  color: var(--muted-light);
  font-size: 8.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.field-head-actions {
  display: flex;
  align-items: center;
  gap: 0;
  margin-right: -4px;
  opacity: 0;
  transition: opacity var(--transition);
}

.builder-field:hover .field-head-actions,
.builder-field.is-selected .field-head-actions,
.builder-field:focus-within .field-head-actions {
  opacity: 1;
}

.field-head-actions .icon-button {
  width: 24px;
  height: 24px;
  color: var(--muted-light);
}

.builder-field-help,
.builder-section-help {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.builder-field-help[hidden],
.builder-section-help[hidden] {
  display: none;
}

.builder-control-wrap {
  margin-top: 9px;
}

.dummy-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 33px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fcfdff;
  color: var(--muted-light);
  font-size: 10.5px;
  line-height: 1.3;
}

.dummy-control > span:first-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dummy-control svg {
  color: #aab4c2;
}

.dummy-textarea {
  height: 58px;
  align-items: flex-start;
  padding-top: 9px;
}

.dummy-textarea .dummy-grow {
  width: 60px;
  height: 1px;
}

.dummy-suffix {
  color: #c1c9d4;
}

.dummy-file {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 50px;
  padding: 0 10px;
  border: 1px dashed #d4dbe5;
  border-radius: 6px;
  background: #fbfcfe;
  color: var(--muted-light);
  font-size: 10.5px;
}

.dummy-file svg {
  color: #aab4c2;
}

.dummy-file-meta {
  margin-left: auto;
  color: #b8c1ce;
  font-size: 9px;
}

.dummy-checkbox {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.dummy-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 15px;
  height: 15px;
  border: 1px solid #cfd7e2;
  border-radius: 4px;
  background: var(--surface);
  color: var(--blue);
}

.builder-field .rule-chips {
  margin-top: 7px;
}

.builder-add-field {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 41px;
  margin-top: 10px;
  border: 1px dashed #cfd8e5;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  transition: border-color var(--transition), background-color var(--transition), color var(--transition);
}

.builder-add-field:hover {
  border-color: #a9c3ef;
  background: var(--surface);
  color: var(--blue-dark);
}

.builder-empty-fields {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 245px;
  padding: 30px;
  border: 1px dashed #d3dbe6;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.66);
  text-align: center;
}

.builder-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  margin-bottom: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
}

.builder-empty-fields h2 {
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 500;
}

.builder-empty-fields p {
  max-width: 330px;
  margin: 5px 0 15px;
  color: var(--muted);
  font-size: 11.5px;
}

.builder-canvas-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 21px;
  color: #b0b9c7;
  font-size: 9px;
}

/* Builder inspector */
.builder-right {
  scrollbar-gutter: stable;
}

.inspector-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 17px 19px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.inspector-head h2 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.inspector-version {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.inspector-head-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
}

.inspector-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.inspector-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
}

.inspector-back:hover {
  color: var(--blue-dark);
}

.inspector-body {
  padding: 17px 19px 36px;
}

.inspector-section {
  padding: 0 0 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.inspector-section:last-of-type {
  margin-bottom: 0;
}

.inspector-section-title {
  margin-bottom: 12px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.inspector-section .form-group {
  margin-bottom: 12px;
}

.inspector-section .form-group:last-child {
  margin-bottom: 0;
}

.inspector-section .input,
.inspector-section .select {
  height: 34px;
  font-size: 12px;
}

.inspector-section .textarea {
  min-height: 62px;
  font-size: 12px;
  padding: 8px 9px;
}

.inspector-section .form-label {
  font-size: 10.5px;
}

.inspector-section .form-help {
  font-size: 10px;
}

.inspector-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.inspector-note.amber {
  border-color: var(--amber-line);
  background: var(--amber-soft);
  color: #93370d;
}

.inspector-note svg {
  margin-top: 1px;
}

.switch-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: none;
  width: 30px;
  height: 17px;
  padding: 2px;
  border-radius: 999px;
  background: #d8dee7;
  transition: background-color var(--transition);
}

.switch-track span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.16);
  transition: transform var(--transition);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}

.setting-row:last-of-type {
  border-bottom: 0;
}

.setting-row > span:first-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.setting-row strong {
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 500;
}

.setting-row small {
  color: var(--muted-light);
  font-size: 9.5px;
  line-height: 1.4;
}

.setting-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.setting-row input:checked ~ .switch-track {
  background: var(--blue);
}

.setting-row input:checked ~ .switch-track span {
  transform: translateX(13px);
}

.setting-row.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.color-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: var(--swatch);
  color: #fff;
  transition: transform var(--transition), box-shadow var(--transition);
}

.color-swatch span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.23);
  opacity: 0;
}

.color-swatch:hover {
  transform: scale(1.08);
}

.color-swatch.is-selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--swatch);
}

.color-swatch.is-selected span {
  opacity: 1;
}

.icon-picker {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}

.icon-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 33px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  transition: border-color var(--transition), color var(--transition), background-color var(--transition);
}

.icon-choice:hover {
  border-color: #c7d2e2;
  color: var(--ink-soft);
}

.icon-choice.is-selected {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.segmented-fill {
  display: flex;
  width: 100%;
  padding: 2px;
}

.segmented-fill .segment {
  flex: 1;
  height: 27px;
  padding: 0 5px;
  font-size: 10px;
}

.segmented-fill .segment:disabled {
  opacity: 0.45;
}

.option-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.option-grip {
  display: inline-flex;
  color: #c5ceda;
}

.option-input {
  height: 31px !important;
  padding: 0 8px !important;
  font-size: 11px !important;
}

.option-row .icon-button {
  color: var(--muted-light);
}

.distribution-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.distribution-summary > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.distribution-summary span {
  overflow: hidden;
  color: var(--muted-light);
  font-size: 8.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.distribution-summary strong {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.inspector-footnote {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 18px;
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.5;
}

.inspector-footnote svg {
  margin-top: 1px;
}

.inspector-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0 17px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted-light);
  font-size: 9.5px;
}

.inspector-meta code {
  max-width: 190px;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.inspector-danger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.inspector-danger > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.inspector-danger strong {
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 500;
}

.inspector-danger span {
  color: var(--muted-light);
  font-size: 9px;
}

.inspector-move {
  display: flex;
  gap: 7px;
  padding-top: 13px;
}

.inspector-move .btn {
  flex: 1;
  height: 30px;
  min-height: 30px;
  font-size: 10px;
}

/* ==========================================================================
   Fill experience
   ========================================================================== */

.fill-page {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 32px 68px;
}

.fill-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.fill-topline-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.secure-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-light);
  font-size: 10px;
  white-space: nowrap;
}

.preview-label {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--blue-line);
  border-radius: 4px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.preview-banner {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 20px;
  padding: 11px 14px;
  border: 1px solid var(--blue-line);
  border-radius: var(--radius-md);
  background: #f6faff;
  color: var(--blue-dark);
}

.preview-banner > svg {
  flex: none;
}

.preview-banner > div {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.preview-banner strong {
  color: #1849a9;
  font-size: 11px;
  font-weight: 500;
}

.preview-banner span {
  color: #5c7ba6;
  font-size: 10px;
}

.fill-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  align-items: start;
  gap: 30px;
}

.fill-main {
  min-width: 0;
}

.fill-hero {
  position: relative;
  padding-bottom: 22px;
}

.fill-hero > .form-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: 11px;
}

.fill-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
  color: var(--muted-light);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fill-hero h1 {
  max-width: 760px;
  color: var(--ink);
  font-size: 29px;
  font-weight: 600;
  letter-spacing: -0.038em;
  line-height: 1.22;
}

.fill-lead {
  max-width: 680px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.fill-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 15px;
  color: var(--muted-light);
  font-size: 10px;
}

.fill-meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.fill-instructions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 13px 15px;
  border: 1px solid #e4ebf4;
  border-radius: var(--radius-md);
  background: #f9fbfe;
  color: var(--muted);
}

.fill-instructions > svg {
  margin-top: 1px;
  color: var(--blue);
}

.fill-instructions strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 500;
}

.fill-instructions p {
  font-size: 11.5px;
  line-height: 1.6;
}

.fill-form {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.fill-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 19px 23px 17px;
  border-bottom: 1px solid var(--line-soft);
}

.fill-form-head h2 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.018em;
}

.fill-form-head p {
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 10.5px;
}

.fill-form-head .required-mark {
  font-size: 11px;
}

.fill-required-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 23px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.fill-required-pill > span {
  color: var(--ink-soft);
  font-weight: 500;
}

.fill-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 21px 20px;
  padding: 23px;
}

.fill-field {
  min-width: 0;
}

.fill-field.span-full,
.fill-section {
  grid-column: 1 / -1;
}

.fill-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 0 1px;
  border-top: 1px solid var(--line-soft);
}

.fill-field:first-child .fill-section,
.fill-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.fill-section h2 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.018em;
}

.fill-section p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.fill-label {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
}

.fill-label .required-mark {
  font-size: 11px;
}

.fill-help {
  margin: -1px 0 7px;
  color: var(--muted-light);
  font-size: 10.5px;
  line-height: 1.5;
}

.fill-help[hidden] {
  display: none;
}

.fill-control {
  width: 100%;
  min-height: 38px;
  font-size: 12.5px;
}

.fill-field .textarea {
  min-height: 103px;
  resize: vertical;
}

.fill-field .input {
  height: 38px;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  padding-right: 33px;
  appearance: none;
  background-image: none;
}

.select-wrap > svg {
  position: absolute;
  top: 50%;
  right: 11px;
  color: var(--muted-light);
  pointer-events: none;
  transform: translateY(-50%);
}

.field-rule-hint {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-top: 5px;
  color: #98a2b3;
  font-size: 9.5px;
  line-height: 1.45;
}

.field-rule-hint svg {
  margin-top: 1px;
}

.field-counter {
  margin-top: 4px;
  color: var(--muted-light);
  font-size: 9px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.field-error {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-top: 5px;
  color: var(--red);
  font-size: 10.5px;
  line-height: 1.45;
}

.field-error::before {
  display: inline-block;
  width: 3px;
  height: 3px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--red-bright);
  content: '';
}

.fill-field.has-error .fill-control {
  border-color: var(--red-bright);
  background: #fffdfd;
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.06);
}

.fill-field.has-error .file-drop {
  border-color: var(--red-bright);
  background: #fffdfd;
}

.fill-field.has-error .fill-label {
  color: var(--red);
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.choice-card,
.confirmation-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 37px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
}

.choice-card:hover,
.confirmation-card:hover {
  border-color: #cfd9e5;
}

.choice-card input,
.confirmation-card input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice-check,
.confirmation-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 16px;
  height: 16px;
  border: 1px solid #ccd4df;
  border-radius: 4px;
  background: var(--surface);
  color: transparent;
  transition: border-color var(--transition), background-color var(--transition), color var(--transition);
}

.choice-card input:checked + .choice-check,
.confirmation-card input:checked + .confirmation-check {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.choice-card:has(input:checked),
.confirmation-card:has(input:checked) {
  border-color: #b8cff8;
  background: #fafdff;
}

.confirmation-card {
  align-items: flex-start;
  padding: 11px 12px;
}

.confirmation-card .confirmation-check {
  margin-top: 1px;
  border-radius: 50%;
}

.confirmation-copy {
  display: block;
  color: var(--ink-soft);
  font-size: 11.5px;
}

.file-drop {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 11px;
  border: 1px dashed #cdd7e3;
  border-radius: 7px;
  background: #fcfdff;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
}

.file-drop:hover,
.file-drop.is-dragover {
  border-color: #7aa7f0;
  background: #f4f9ff;
}

.file-drop.is-dragover {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-drop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
}

.file-drop.has-file .file-drop-icon {
  background: var(--green-soft);
  color: var(--green);
}

.file-drop-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.file-drop-copy strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.file-drop-copy small {
  color: var(--muted-light);
  font-size: 9.5px;
}

.file-browse {
  flex: none;
  padding-left: 9px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 500;
}

.fill-form > .empty-state {
  margin: 23px;
}

.fill-privacy {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 13px;
  color: var(--muted-light);
  font-size: 9.5px;
  line-height: 1.5;
}

.fill-privacy svg {
  margin-top: 1px;
}

.fill-aside {
  position: sticky;
  top: calc(var(--topbar-height) + 23px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fill-aside-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.aside-card-label {
  margin-bottom: 11px;
  color: var(--muted-light);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.assignee-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 11px;
  margin-bottom: 5px;
  border-bottom: 1px solid var(--line-soft);
}

.assignee-row > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.assignee-row strong {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
}

.assignee-row span {
  color: var(--muted-light);
  font-size: 9.5px;
}

.aside-meta-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
}

.aside-meta-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.aside-meta-row > span {
  color: var(--muted-light);
  font-size: 9.5px;
}

.aside-meta-row > strong {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 500;
  text-align: right;
}

.fill-progress-card .progress-head {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 8px;
}

.fill-progress-card .progress-head strong {
  color: var(--ink);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.fill-progress-card .progress-head span {
  color: var(--muted-light);
  font-size: 9.5px;
}

.progress-caption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.5;
}

.fill-submit-card {
  border-color: #dbe4f1;
}

.submit-help {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.submit-help .ready-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--green);
}

.submit-note {
  margin-top: 8px;
  color: var(--muted-light);
  font-size: 8.5px;
  line-height: 1.55;
  text-align: center;
}

#fill-submit.is-ready {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.09);
}

.fill-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--red-line);
  border-radius: var(--radius-md);
  background: var(--red-soft);
  color: var(--red);
}

.fill-alert-icon {
  margin-top: 1px;
}

.fill-alert > div {
  flex: 1;
}

.fill-alert strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
}

.fill-alert p {
  margin-top: 2px;
  color: #7d241c;
  font-size: 10.5px;
  line-height: 1.5;
}

.fill-alert-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.fill-alert-links button {
  padding: 2px 6px;
  border: 1px solid #f7c7c2;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.6);
  color: #912018;
  font-size: 9.5px;
}

.fill-alert-links button:hover {
  background: #fff;
}

/* Preview success */
.preview-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 6px 18px;
  text-align: center;
}

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  box-shadow: 0 0 0 6px #f6fef9;
}

.success-icon.small {
  width: 44px;
  height: 44px;
  margin-bottom: 13px;
}

.preview-success h3 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.preview-success p {
  max-width: 330px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

/* ==========================================================================
   Success page
   ========================================================================== */

.success-page {
  display: flex;
  justify-content: center;
  min-height: calc(100vh - var(--topbar-height));
  padding: 58px 24px 72px;
  background: var(--canvas);
}

.success-panel {
  width: 100%;
  max-width: 590px;
  text-align: center;
}

.success-orbit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 82px;
  height: 82px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: radial-gradient(circle, #f3fdf7 0%, rgba(236, 253, 243, 0) 70%);
}

.success-orbit .success-icon {
  width: 58px;
  height: 58px;
  font-size: 0;
  box-shadow: 0 0 0 5px #effbf4;
}

.success-panel h1 {
  color: var(--ink);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.038em;
  line-height: 1.25;
}

.success-lead {
  max-width: 470px;
  margin: 9px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.success-summary {
  margin-top: 27px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: left;
  box-shadow: var(--shadow-xs);
}

.success-summary-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.success-summary-head > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.success-summary-head strong {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
}

.success-summary-head span {
  color: var(--muted-light);
  font-size: 10px;
}

.success-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
  padding-top: 15px;
}

.success-meta-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.success-meta-grid span {
  color: var(--muted-light);
  font-size: 9.5px;
}

.success-meta-grid strong {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.success-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.success-footnote {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  margin-top: 18px;
  color: var(--muted-light);
  font-size: 9.5px;
  line-height: 1.5;
}

.success-footnote svg {
  margin-top: 1px;
}

/* ==========================================================================
   Not found
   ========================================================================== */

.not-found-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--topbar-height));
}

.not-found {
  max-width: 440px;
  text-align: center;
}

.not-found-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.not-found h1 {
  color: var(--ink);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.not-found p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.not-found .btn {
  margin-top: 20px;
}

/* ==========================================================================
   Modal, drawer and command palette
   ========================================================================== */

.modal-backdrop,
.drawer-backdrop,
.command-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(16, 24, 40, 0.34);
  backdrop-filter: blur(2.5px);
  animation: overlay-in 140ms ease-out both;
}

.modal-backdrop {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop.is-closing,
.drawer-backdrop.is-closing,
.command-backdrop.is-closing {
  animation: overlay-out 140ms ease-in both;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes overlay-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.modal {
  display: flex;
  flex-direction: column;
  width: min(590px, 100%);
  max-height: min(840px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modal-in 170ms cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

.modal-sm {
  width: min(440px, 100%);
}

.modal-md {
  width: min(620px, 100%);
}

.modal-lg {
  width: min(920px, 100%);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-backdrop.is-closing .modal {
  animation: modal-out 140ms ease-in both;
}

@keyframes modal-out {
  to { opacity: 0; transform: translateY(4px) scale(0.99); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex: none;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-header h2,
.drawer-header h2 {
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.modal-header p,
.drawer-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.modal-close {
  margin: -4px -4px 0 0;
  color: var(--muted-light);
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: none;
  min-height: 64px;
  padding: 13px 22px;
  border-top: 1px solid var(--line-soft);
  background: #fcfdff;
}

.modal-body > .form-group {
  margin-bottom: 15px;
}

.confirm-message {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.modal-body form > .form-group {
  margin-bottom: 18px;
}

.modal-body form > .form-group:last-of-type {
  margin-bottom: 0;
}

.create-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.create-category-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.create-category-option:hover {
  border-color: var(--blue-line);
  background: #fbfdff;
}

.create-category-option:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 1px var(--blue) inset;
}

.create-category-option:has(input:focus-visible) {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.create-category-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.create-category-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  border-radius: 8px;
}

.create-category-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.create-category-copy strong {
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
}

.create-category-copy small {
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.35;
}

.tone-violet {
  color: #7c3aed;
  background: #f5f3ff;
}

.tone-slate {
  color: var(--muted);
  background: var(--surface-muted);
}

.create-form-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 11px;
  border: 1px solid #e5ecf7;
  border-radius: 7px;
  background: #f9fbfe;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.create-form-hint svg {
  margin-top: 1px;
  color: var(--blue);
}

.create-form-import {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10.5px;
}

.create-form-import svg {
  color: var(--blue);
}

.create-form-import .text-action {
  margin-left: auto;
  font-size: 10.5px;
}

@media (max-width: 520px) {
  .create-form-import {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .create-form-import .text-action {
    width: 100%;
    margin-left: 22px;
    text-align: left;
  }
}

/* Drawer */
.drawer-backdrop {
  display: flex;
  justify-content: flex-end;
}

.drawer {
  display: flex;
  flex-direction: column;
  width: 440px;
  max-width: 100%;
  height: 100%;
  background: var(--surface);
  box-shadow: -18px 0 50px rgba(16, 24, 40, 0.15);
  animation: drawer-in 180ms cubic-bezier(0.2, 0.85, 0.25, 1) both;
}

@keyframes drawer-in {
  from { transform: translateX(24px); opacity: 0.7; }
  to { transform: translateX(0); opacity: 1; }
}

.drawer-backdrop.is-closing .drawer {
  animation: drawer-out 140ms ease-in both;
}

@keyframes drawer-out {
  to { transform: translateX(26px); opacity: 0; }
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex: none;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-body {
  flex: 1;
  padding: 18px 22px 30px;
  overflow-y: auto;
}

.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: none;
  padding: 13px 22px;
  border-top: 1px solid var(--line);
  background: #fcfdff;
}

/* Command palette */
.command-backdrop {
  z-index: 3500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 11vh 20px 30px;
}

.command-palette {
  width: min(610px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modal-in 170ms cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

.command-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 55px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-light);
}

.command-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.command-search input::placeholder {
  color: var(--muted-light);
}

.command-search kbd {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--muted-light);
  font-family: var(--font-sans);
  font-size: 9px;
}

.command-results {
  max-height: min(480px, 60vh);
  padding: 7px;
  overflow-y: auto;
}

.command-group {
  padding: 3px 0 5px;
}

.command-group + .command-group {
  border-top: 1px solid var(--line-soft);
  margin-top: 3px;
}

.command-group-title {
  padding: 8px 9px 5px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.command-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
  transition: background-color 100ms ease;
}

.command-item:hover,
.command-item.is-selected {
  background: var(--surface-soft);
}

.command-item > svg:first-child {
  color: var(--muted);
}

.command-item > .form-icon,
.command-item > .avatar {
  flex: none;
}

.command-item > span:nth-child(2) {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.command-item strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.command-item small {
  overflow: hidden;
  color: var(--muted-light);
  font-size: 9.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.command-item > svg:last-child {
  color: var(--muted-light);
}

.command-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 38px 20px;
  color: var(--muted-light);
  text-align: center;
}

.command-empty.compact {
  padding: 22px 16px;
}

.command-empty p {
  color: var(--muted);
  font-size: 11px;
}

.command-empty span {
  color: var(--muted-light);
  font-size: 9.5px;
}

.command-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 35px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted-light);
  font-size: 8.5px;
}

.command-footer span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.command-footer span:last-child {
  margin-left: auto;
}

/* Menus */
.popover-menu {
  position: fixed;
  z-index: 4000;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(16, 24, 40, 0.02);
  opacity: 0;
  transform: translateY(-3px);
  animation: menu-in 110ms ease-out forwards;
}

@keyframes menu-in {
  to { opacity: 1; transform: translateY(0); }
}

.menu-heading {
  padding: 7px 9px 6px;
  color: var(--muted-light);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 35px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
  transition: background-color 100ms ease;
}

.menu-item:hover {
  background: var(--surface-soft);
}

.menu-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  color: var(--muted);
}

.menu-item-icon.is-danger {
  color: var(--red);
}

.menu-item-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.menu-item-copy strong {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.35;
}

.menu-item-copy small {
  color: var(--muted-light);
  font-size: 9.5px;
  line-height: 1.4;
}

.menu-item.is-danger .menu-item-copy strong {
  color: var(--red);
}

.menu-item.is-active .menu-item-copy strong {
  color: var(--blue-dark);
}

.menu-check {
  color: var(--blue);
}

.menu-trailing {
  color: var(--muted-light);
  font-size: 9.5px;
}

.menu-divider {
  height: 1px;
  margin: 5px 4px;
  background: var(--line-soft);
}

/* Toasts */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(350px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toast-in 200ms cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

.toast.is-leaving {
  animation: toast-out 160ms ease-in both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(4px); }
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex: none;
}

.toast-success .toast-icon {
  background: var(--green-soft);
  color: var(--green);
}

.toast-error .toast-icon {
  background: var(--red-soft);
  color: var(--red);
}

.toast-info .toast-icon {
  background: var(--blue-soft);
  color: var(--blue);
}

.toast-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
  padding-top: 1px;
}

.toast-copy strong {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 500;
}

.toast-copy span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-light);
}

.toast-close:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

/* Guide */
.employee-switcher {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.employee-switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  text-align: left;
  transition: background-color var(--transition), border-color var(--transition);
}

.employee-switch-row:hover {
  border-color: var(--line-soft);
  background: var(--surface-soft);
}

.employee-switch-row.is-current {
  border-color: var(--blue-line);
  background: var(--blue-soft);
}

.employee-switch-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.employee-switch-copy strong {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 500;
}

.employee-switch-copy small {
  color: var(--muted-light);
  font-size: 9.5px;
}

.employee-switch-counts {
  display: flex;
  flex: none;
  gap: 7px;
  color: var(--muted-light);
  font-size: 9px;
}

.employee-switch-counts > span {
  min-width: 37px;
  text-align: right;
}

.employee-switch-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  color: var(--muted-light);
}

.employee-switch-row.is-current .employee-switch-check {
  color: var(--blue);
}

.guide-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.guide-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.guide-step > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 1px;
}

.guide-step strong {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
}

.guide-step p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.guide-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 18px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.guide-note svg {
  margin-top: 1px;
}

/* ==========================================================================
   Publish modal
   ========================================================================== */

.publish-modal .modal-header {
  padding-top: 21px;
}

.publish-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(245px, 0.8fr);
  align-items: start;
  gap: 24px;
}

.publish-main {
  min-width: 0;
}

.publish-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 2px;
}

.publish-form-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.publish-form-summary > div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.publish-form-summary strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.publish-form-summary span {
  overflow: hidden;
  color: var(--muted-light);
  font-size: 9.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.publish-section {
  margin-top: 18px;
}

.publish-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.publish-section-head h3 {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.publish-section-head > span {
  color: var(--muted-light);
  font-size: 9.5px;
}

.version-choice {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.version-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
}

.version-option input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--blue);
}

.version-option > span {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.version-option strong {
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 500;
}

.version-option small {
  color: var(--muted-light);
  font-size: 9.5px;
}

.version-option code {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.version-option.is-selected {
  border-color: var(--blue-line);
  background: #f8fbff;
}

.first-release {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.first-release > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
}

.first-release > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.first-release strong {
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 500;
}

.first-release p {
  color: var(--muted-light);
  font-size: 9.5px;
  line-height: 1.45;
}

.first-release code {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.audience-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 1px;
  margin-bottom: 4px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.audience-toolbar > span {
  color: var(--muted-light);
  font-size: 9.5px;
}

.audience-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 8px;
  max-height: 212px;
  padding: 6px 2px;
  overflow-y: auto;
}

.audience-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 5px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color var(--transition);
}

.audience-row:hover {
  background: var(--surface-soft);
}

.audience-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.audience-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 14px;
  height: 14px;
  border: 1px solid #cfd7e2;
  border-radius: 3px;
  background: var(--surface);
  color: transparent;
}

.audience-row input:checked + .audience-check {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.audience-row .avatar {
  width: 22px;
  height: 22px;
  font-size: 8px;
}

.audience-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0;
}

.audience-copy strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.audience-copy small {
  overflow: hidden;
  color: var(--muted-light);
  font-size: 8.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.audience-note {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 7px;
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.5;
}

.publish-side-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.publish-side-card .aside-meta-row {
  border-bottom-color: var(--line);
}

.publish-side-card .aside-meta-row > strong {
  font-size: 9.5px;
}

.publish-side-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 0 2px;
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.5;
}

.publish-error {
  padding: 8px 9px;
  border: 1px solid var(--red-line);
  border-radius: 6px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 9.5px;
  line-height: 1.45;
}

.modal-footer-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-right: auto;
  color: var(--muted-light);
  font-size: 10px;
}

.modal-footer-actions {
  display: flex;
  gap: 8px;
}

/* ==========================================================================
   Version history drawer
   ========================================================================== */

.version-drawer-intro {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.version-drawer-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
}

.version-drawer-summary > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.version-drawer-summary strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}

.version-drawer-summary span {
  color: var(--muted-light);
  font-size: 9.5px;
}

.version-drawer-intro > p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.draft-version-card {
  margin: 15px 0;
  padding: 13px;
  border: 1px solid var(--amber-line);
  border-radius: var(--radius);
  background: var(--amber-soft);
}

.draft-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin-bottom: 7px;
  padding: 0 6px;
  border: 1px solid #fedf89;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--amber);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.draft-version-card strong {
  display: block;
  color: #93370d;
  font-size: 11px;
  font-weight: 500;
}

.draft-version-card p {
  margin-top: 2px;
  color: #b54708;
  font-size: 9.5px;
  line-height: 1.5;
}

.version-timeline {
  position: relative;
  padding: 10px 0 0 2px;
}

.version-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  padding-bottom: 17px;
}

.version-item:last-child {
  padding-bottom: 0;
}

.version-marker {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.version-marker::before {
  position: absolute;
  top: 16px;
  bottom: -16px;
  left: 50%;
  width: 1px;
  background: var(--line);
  content: '';
}

.version-item:last-child .version-marker::before {
  display: none;
}

.version-marker > span {
  position: relative;
  z-index: 1;
  width: 7px;
  height: 7px;
  border: 1.5px solid #b7c3d2;
  border-radius: 50%;
  background: var(--surface);
}

.version-item.is-current .version-marker > span {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.version-content {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.version-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.version-head > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.version-head strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.current-badge {
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 8px;
  font-weight: 500;
}

.version-date {
  color: var(--muted-light);
  font-size: 9px;
}

.version-author {
  flex: none;
  color: var(--muted-light);
  font-size: 8.5px;
}

.version-content > p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.version-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  color: var(--muted-light);
  font-size: 8.5px;
}

.version-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.version-actions .btn {
  color: var(--muted);
}

.version-actions .btn:hover {
  color: var(--ink-soft);
}

.version-empty {
  padding-top: 15px;
}

.version-empty .empty-state {
  padding: 35px 18px;
}

/* ==========================================================================
   Response drawer
   ========================================================================== */

.response-drawer-lead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.response-drawer-lead > div {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.response-drawer-lead h3 {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.response-drawer-lead > div > span {
  color: var(--muted-light);
  font-size: 9.5px;
}

.response-person-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.response-person-card > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.response-person-card strong {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 500;
}

.response-person-card span {
  color: var(--muted);
  font-size: 9.5px;
}

.response-person-card small {
  color: var(--muted-light);
  font-size: 9px;
}

.response-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line-soft);
}

.response-meta-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 11px;
  background: var(--surface);
}

.response-meta-grid span {
  color: var(--muted-light);
  font-size: 8.5px;
}

.response-meta-grid strong {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.drawer-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 10px;
}

.drawer-section-title h3 {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.drawer-section-title span {
  color: var(--muted-light);
  font-size: 9px;
}

.response-answers {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.answer-block {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.answer-block:last-child {
  border-bottom: 0;
}

.answer-label {
  display: block;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 500;
}

.answer-value {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
  word-break: break-word;
}

.answer-empty {
  color: var(--muted-light);
}

.answer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.answer-chips > span {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  font-size: 10px;
}

.answer-file {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--blue);
}

.answer-file > div {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.answer-file strong {
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 500;
}

.answer-file span {
  color: var(--muted-light);
  font-size: 8.5px;
}

.answer-confirmed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--green);
  font-size: 10.5px;
}

.drawer-empty {
  padding: 24px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1440px) {
  .page {
    padding-left: 32px;
    padding-right: 32px;
  }

  .data-table th,
  .data-table td {
    padding-left: 16px;
    padding-right: 16px;
  }

  .data-table th:first-child,
  .data-table td:first-child {
    padding-left: 18px;
  }

  .cell-form {
    min-width: 250px;
  }

  .builder-body {
    grid-template-columns: 238px minmax(0, 1fr) 318px;
  }

  .builder-canvas {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 1220px) {
  .topbar {
    grid-template-columns: minmax(240px, 1fr) minmax(260px, 380px) minmax(290px, 1fr);
    gap: 18px;
  }

  .brand-product {
    font-size: 15px;
  }

  .brand-logo {
    width: 46px;
  }

  .workspace-label {
    max-width: 62px;
  }

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

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

  .builder-body {
    grid-template-columns: 218px minmax(0, 1fr) 300px;
  }

  .builder-bar-actions .save-indicator {
    display: none;
  }

  .builder-bar-actions .btn span {
    display: none;
  }

  .builder-bar-actions .btn {
    width: 34px;
    padding: 0;
  }

  .builder-bar-actions .btn-primary {
    width: 37px;
  }

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

  .task-card-copy > p {
    max-width: 550px;
  }
}

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 220px;
  }

  .topbar {
    grid-template-columns: minmax(205px, 0.9fr) minmax(230px, 340px) minmax(265px, 1fr);
    padding: 0 18px;
    gap: 12px;
  }

  .topbar-context-badge,
  .brand-divider {
    display: none;
  }

  .btn-new span {
    display: none;
  }

  .btn-new {
    width: 36px;
    padding: 0;
  }

  .btn-new svg:last-child {
    display: none;
  }

  .language-label,
  .language-button > svg:last-child {
    display: none;
  }

  .language-button {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .page {
    padding: 27px 24px 48px;
  }

  .toolbar-search {
    width: 240px;
  }

  .data-table th,
  .data-table td {
    padding-left: 14px;
    padding-right: 14px;
  }

  .data-table th:first-child,
  .data-table td:first-child {
    padding-left: 16px;
  }

  .cell-form {
    min-width: 260px;
  }

  .form-cell p {
    max-width: 330px;
  }

  .fill-grid {
    grid-template-columns: minmax(0, 1fr) 264px;
    gap: 22px;
  }

  .fill-page {
    padding-left: 24px;
    padding-right: 24px;
  }

  .builder-body {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .builder-left {
    display: none;
  }

  .builder-canvas {
    max-width: 740px;
  }

  .fill-fields {
    gap: 19px 16px;
    padding: 20px;
  }

  .fill-form-head {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 880px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    padding: 0 14px;
    height: 60px;
  }

  :root {
    --topbar-height: 60px;
  }

  .mobile-menu-button {
    display: inline-flex;
    width: 32px;
    height: 32px;
  }

  .brand {
    gap: 0;
  }

  .brand-logo {
    width: 43px;
  }

  .brand-product {
    display: none;
  }

  .topbar-brand-wrap {
    gap: 5px;
  }

  .global-search {
    width: 38px;
    min-height: 38px;
    padding: 0;
    justify-content: center;
    justify-self: center;
    background: transparent;
    border-color: transparent;
  }

  .global-search-label,
  .global-search kbd {
    display: none;
  }

  .global-search:hover {
    background: var(--surface-soft);
    border-color: var(--line);
  }

  .workspace-button {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .workspace-label,
  .workspace-button > svg:last-child {
    display: none;
  }

  .topbar-actions {
    gap: 5px;
  }

  .avatar-button > svg {
    display: none;
  }

  .app-body {
    position: relative;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 2000;
    width: 264px;
    height: 100vh;
    padding-top: 16px;
    transform: translateX(-104%);
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 18px 0 40px rgba(16, 24, 40, 0.12);
  }

  .sidebar-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 38px;
    margin: 0 2px 17px;
  }

  .nav-open .sidebar {
    transform: translateX(0);
  }

  .mobile-scrim {
    position: fixed;
    inset: 0;
    z-index: 1900;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(16, 24, 40, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .nav-open .mobile-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .main {
    min-height: calc(100vh - var(--topbar-height));
  }

  .page {
    padding: 24px 18px 45px;
  }

  .page-heading {
    flex-direction: column;
    gap: 14px;
  }

  .page-actions {
    justify-content: flex-start;
  }

  .employee-heading {
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
  }

  .employee-heading .date-chip {
    min-height: 30px;
    font-size: 10.5px;
  }

  .employee-heading .page-actions {
    flex: none;
  }

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

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

  .task-card {
    flex-direction: column;
    gap: 15px;
  }

  .task-card-side {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    padding-top: 11px;
    border-top: 1px solid var(--line-soft);
  }

  .task-due {
    align-items: flex-start;
    text-align: left;
  }

  .task-start {
    width: auto;
  }

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

  .fill-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .fill-aside {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    order: 2;
    align-items: stretch;
  }

  .fill-submit-card {
    grid-column: 1 / -1;
  }

  .fill-page {
    padding: 20px 18px 50px;
  }

  .fill-topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .fill-topline-right {
    width: 100%;
    justify-content: space-between;
  }

  .fill-hero h1 {
    font-size: 26px;
  }

  .builder-shell {
    height: auto;
    min-height: calc(100vh - var(--topbar-height));
    overflow: visible;
  }

  .builder-bar {
    position: sticky;
    top: var(--topbar-height);
    z-index: 30;
    flex-wrap: wrap;
    height: auto;
    min-height: 59px;
    padding: 10px 14px;
    gap: 8px;
  }

  .builder-bar-left {
    flex: 1;
    min-width: 0;
  }

  .builder-bar-actions {
    flex: none;
  }

  .builder-bar-actions .builder-mobile-add {
    display: inline-flex;
  }

  .builder-breadcrumb {
    max-width: 145px;
    overflow: hidden;
    white-space: nowrap;
  }

  .builder-current-title {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .builder-status {
    border-left: 0;
    padding-left: 0;
    margin-left: 0;
  }

  .builder-status .status-pill {
    display: none;
  }

  .builder-body {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .builder-center {
    height: auto;
    overflow: visible;
    order: 1;
  }

  .builder-right {
    height: auto;
    overflow: visible;
    order: 2;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .builder-canvas {
    padding: 16px 14px 38px;
  }

  .builder-form-header {
    padding: 19px;
  }

  .builder-form-title-wrap h1 {
    font-size: 20px;
  }

  .builder-edit-header {
    width: 30px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
    gap: 0;
  }

  .builder-fields-list {
    grid-template-columns: 1fr;
  }

  .builder-field,
  .builder-field.is-half {
    grid-column: span 1;
  }

  .builder-field.is-half {
    grid-column: span 1;
  }

  .inspector-head {
    min-height: auto;
  }

  .publish-layout {
    grid-template-columns: 1fr;
  }

  .publish-side {
    padding-top: 0;
    border-top: 1px solid var(--line);
    padding-top: 14px;
  }

  .audience-grid {
    grid-template-columns: 1fr 1fr;
    max-height: 210px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: calc(100vh - 28px);
    border-radius: 14px 14px 0 0;
  }

  .modal-backdrop.is-closing .modal {
    animation: modal-out 140ms ease-in both;
  }

  .drawer {
    width: 100% !important;
  }

  .modal-footer {
    flex-wrap: wrap;
  }

  .modal-footer-note {
    width: 100%;
    margin-bottom: 2px;
  }

  .data-table {
    min-width: 760px;
  }

  .forms-table {
    min-width: 940px;
  }

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

@media (max-width: 620px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 4px;
    padding: 0 12px;
    height: 58px;
  }

  :root {
    --topbar-height: 58px;
  }

  .topbar-brand-wrap {
    min-width: 0;
  }

  .global-search {
    justify-self: end;
  }

  .topbar-actions {
    justify-self: end;
  }

  .btn-new {
    display: none;
  }

  .workspace-button {
    display: none;
  }

  .metric-hint {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
  }

  .avatar-button .avatar {
    width: 30px;
    height: 30px;
  }

  .page {
    padding: 20px 14px 40px;
  }

  .page-heading h1 {
    font-size: 22px;
  }

  .page-heading p {
    font-size: 12.5px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
  }

  .page-summary-row {
    gap: 9px;
    margin: 14px 0 16px;
  }

  .summary-divider {
    display: none;
  }

  .table-toolbar {
    align-items: stretch;
    gap: 9px;
  }

  .toolbar-left,
  .toolbar-right {
    width: 100%;
    flex-wrap: wrap;
  }

  .toolbar-search {
    width: 100%;
  }

  .table-count {
    margin-left: 2px;
  }

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

  .select-inline {
    width: 100%;
    justify-content: space-between;
  }

  .select-inline select {
    max-width: 100%;
    flex: 1;
  }

  .metrics-grid,
  .metrics-grid-3 {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .employee-heading {
    flex-direction: column;
    gap: 10px;
  }

  .employee-heading .page-actions {
    display: none;
  }

  .employee-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .employee-metrics .metric-card:last-child {
    grid-column: 1 / -1;
  }

  .metric-card {
    padding: 12px;
  }

  .metric-value {
    font-size: 19px;
  }

  .task-card {
    padding: 15px;
  }

  .task-card-main {
    gap: 9px;
  }

  .task-card-copy > p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .task-card-side {
    align-items: stretch;
    flex-direction: column;
  }

  .task-start {
    width: 100%;
  }

  .completed-task-row {
    flex-wrap: wrap;
  }

  .completed-task-date {
    display: none;
  }

  .completed-task-copy {
    flex-basis: calc(100% - 90px);
  }

  .completed-task-row .link-button {
    margin-left: 36px;
  }

  .fill-page {
    padding: 16px 13px 42px;
  }

  .fill-hero h1 {
    font-size: 23px;
  }

  .fill-lead {
    font-size: 12px;
  }

  .fill-meta-row {
    gap: 8px 12px;
  }

  .fill-fields {
    grid-template-columns: 1fr;
    padding: 17px;
    gap: 18px;
  }

  .fill-field.span-half {
    grid-column: 1 / -1;
  }

  .fill-form-head {
    padding: 16px 17px 14px;
  }

  .fill-aside {
    display: flex;
    flex-direction: column;
  }

  .fill-submit-card {
    grid-column: auto;
  }

  .fill-topline-right {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .preview-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .preview-banner .btn {
    margin-left: 28px;
  }

  .success-page {
    padding: 36px 15px 50px;
  }

  .success-panel h1 {
    font-size: 26px;
  }

  .success-meta-grid {
    gap: 12px;
  }

  .success-actions {
    flex-direction: column;
  }

  .success-actions .btn {
    width: 100%;
  }

  .builder-bar {
    top: var(--topbar-height);
  }

  .builder-canvas {
    padding: 12px 10px 30px;
  }

  .builder-form-header {
    padding: 16px;
  }

  .builder-form-heading {
    gap: 9px;
  }

  .builder-form-heading > .form-icon {
    width: 34px;
    height: 34px;
  }

  .builder-form-title-wrap h1 {
    font-size: 18px;
  }

  .builder-form-meta {
    gap: 8px;
  }

  .builder-form-meta span:nth-child(3) {
    display: none;
  }

  .field-head-actions {
    opacity: 1;
  }

  .builder-field-head {
    gap: 5px;
  }

  .field-type-label {
    display: none;
  }

  .builder-right {
    margin: 0;
  }

  .inspector-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .add-field-form {
    width: 100%;
  }

  .audience-grid {
    grid-template-columns: 1fr;
  }

  .response-meta-grid {
    grid-template-columns: 1fr;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-header,
  .modal-footer,
  .drawer-header,
  .drawer-body,
  .drawer-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .modal-footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .modal-footer-note {
    justify-content: center;
  }

  .modal-footer-actions {
    display: flex;
    flex-direction: column-reverse;
    width: 100%;
  }

  .modal-footer-actions .btn {
    width: 100%;
  }

  .drawer-footer {
    flex-wrap: wrap;
  }

  .drawer-footer .btn {
    flex: 1;
  }

  .command-backdrop {
    padding: 7vh 12px 20px;
  }

  .command-footer {
    display: none;
  }

  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }

  .not-found-page {
    min-height: 60vh;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .section-heading-row {
    flex-direction: row;
    align-items: center;
  }

  .audit-row {
    gap: 9px;
    padding: 14px;
  }

  .audit-row time {
    display: none;
  }

  .audit-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .segmented-control {
    width: 100%;
  }
}

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

/* ==========================================================================
   Authentication
   ========================================================================== */

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  min-height: 100vh;
  background: var(--surface);
}

.auth-story {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 38px 56px 30px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(900px 500px at 12% 4%, rgba(37, 99, 235, 0.11), transparent 68%),
    radial-gradient(700px 420px at 100% 100%, rgba(15, 118, 110, 0.08), transparent 72%),
    var(--surface-soft);
}

.auth-story::before {
  position: absolute;
  inset: 0;
  content: '';
  pointer-events: none;
  opacity: 0.5;
  background-image: linear-gradient(rgba(16, 24, 40, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(16, 24, 40, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), transparent 62%);
}

.auth-story-top,
.auth-story-copy,
.auth-story-footer {
  position: relative;
  z-index: 1;
}

.auth-brand,
.auth-mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.auth-brand img {
  width: 82px;
  height: 28px;
  object-fit: contain;
}

.auth-brand-divider {
  width: 1px;
  height: 22px;
  background: var(--line);
}

.auth-brand span:last-child {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth-story-copy {
  width: min(530px, 100%);
  margin: auto 0;
  padding: 56px 0;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-story-copy h1 {
  max-width: 500px;
  margin: 17px 0 16px;
  color: var(--ink);
  font-size: clamp(34px, 3.2vw, 50px);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

body.lang-zh .auth-story-copy {
  width: min(600px, 100%);
}

body.lang-zh .auth-story-copy h1 {
  max-width: 590px;
  font-size: clamp(30px, 2.65vw, 42px);
  line-height: 1.2;
  letter-spacing: -0.018em;
}

.auth-story-copy > p {
  max-width: 470px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
}

.auth-points {
  display: grid;
  gap: 19px;
  margin-top: 44px;
}

.auth-point {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.auth-point > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.72);
}

.auth-point strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}

.auth-point p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.auth-story-footer {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-light);
  font-size: 10.5px;
}

.auth-form-side {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.auth-form-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 26px 30px 0;
}

.auth-mobile-brand {
  display: none;
  margin-right: auto;
}

.auth-mobile-brand img {
  width: 74px;
  height: 25px;
  object-fit: contain;
}

.auth-mobile-brand span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.auth-language {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 10px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.auth-language:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.auth-card {
  width: min(390px, calc(100% - 48px));
  margin: auto;
  padding: 34px 0 22px;
}

.auth-card-head {
  margin-bottom: 24px;
}

.auth-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 17px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--blue);
  background: var(--blue-soft);
}

.auth-card-head h2 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.auth-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-form .form-group {
  margin: 0;
}

.auth-form .input {
  height: 44px;
  background: var(--surface);
}

.auth-password-wrap {
  position: relative;
  display: block;
}

.auth-password-wrap .input {
  padding-right: 43px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--muted);
  border: 0;
  border-radius: 6px;
  background: transparent;
  transform: translateY(-50%);
  cursor: pointer;
}

.auth-password-toggle:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.auth-submit {
  margin-top: 4px;
}

.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 17px;
  padding: 10px 12px;
  color: var(--red);
  font-size: 11.5px;
  line-height: 1.5;
  border: 1px solid var(--red-line);
  border-radius: 8px;
  background: var(--red-soft);
}

.auth-error svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

.auth-help {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 24px 0 0;
  color: var(--muted-light);
  font-size: 10.5px;
  line-height: 1.5;
}

.auth-copyright {
  margin: 0;
  padding: 0 30px 24px;
  color: var(--muted-light);
  font-size: 10px;
  text-align: center;
}

.auth-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-left: 3px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   User administration
   ========================================================================== */

.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 240px;
  color: var(--muted);
  font-size: 12px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  border-radius: 5px;
  background: var(--surface-soft);
}

.role-badge.role-admin {
  color: #0f766e;
  background: #f0fdfa;
}

.role-badge.role-manager {
  color: var(--blue);
  background: var(--blue-soft);
}

.role-badge.role-employee {
  color: var(--ink-soft);
  background: var(--surface-soft);
}

.sidebar-person {
  width: 100%;
}

a.answer-file {
  color: inherit;
  text-decoration: none;
}

a.answer-file:hover strong {
  color: var(--blue);
  text-decoration: underline;
}

.file-drop.is-uploading {
  opacity: 0.72;
  pointer-events: none;
}

@media (max-width: 1050px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 0.9fr);
  }

  .auth-story {
    padding: 30px 34px 26px;
  }

  .auth-story-copy h1 {
    font-size: 36px;
  }
}

@media (max-width: 840px) {
  .auth-shell {
    display: block;
  }

  .auth-story {
    display: none;
  }

  .auth-form-side {
    min-height: 100vh;
  }

  .auth-mobile-brand {
    display: inline-flex;
  }

  .auth-form-top {
    justify-content: space-between;
  }

  .auth-card {
    padding-top: 12vh;
  }
}

@media (max-width: 480px) {
  .auth-form-top {
    padding: 20px 20px 0;
  }

  .auth-card {
    width: calc(100% - 40px);
    padding-top: 8vh;
  }

  .auth-copyright {
    padding-bottom: 18px;
  }
}

.app-boot {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(620px 440px at 12% 0%, rgba(37, 99, 235, 0.09), transparent 65%),
    var(--surface-soft);
}

.app-boot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  color: var(--muted);
}

.app-boot img {
  width: 96px;
  height: 32px;
  object-fit: contain;
}

.app-boot p {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
}

.app-boot-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}

.auth-feishu-retry {
  margin-top: 16px;
}

.feishu-source-badge {
  color: var(--blue);
  border-color: var(--blue-line);
  background: var(--blue-soft);
}

/* Numeric field units */
.input-with-unit {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.input-with-unit .fill-control {
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-unit {
  display: inline-flex;
  flex: none;
  align-items: center;
  max-width: 36%;
  padding: 0 12px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line-strong);
  border-left: 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--surface-muted);
}

.answer-unit {
  margin-left: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

/* ==========================================================================
   Form summary / results
   ========================================================================== */

.summary-meta-row {
  margin-top: 2px;
}

.summary-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.summary-field-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.summary-field-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.summary-field-head > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.summary-field-head strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-field-head span {
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 500;
}

.summary-answered {
  flex: none;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
  white-space: nowrap;
}

.summary-bars {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.summary-bar-row {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) minmax(60px, 2fr) 26px;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.summary-bar-label {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-bar-track {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.summary-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.summary-bar-fill-muted {
  background: var(--line-strong);
}

.summary-bar-count {
  color: var(--ink-soft);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

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

.summary-stats > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.summary-stats span {
  color: var(--muted);
  font-size: 10px;
}

.summary-stats strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.summary-answer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-answer-list > div {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.summary-answer-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.summary-answer-person {
  flex: none;
  max-width: 95px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-answer-value {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.summary-empty {
  margin: 0;
  color: var(--muted-light);
  font-size: 11px;
}

@media (max-width: 900px) {
  .summary-field-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .summary-field-card {
    padding: 15px;
  }

  .summary-field-head {
    flex-direction: column;
    gap: 5px;
  }

  .summary-answered {
    text-align: left;
  }

  .summary-stats {
    gap: 7px;
  }

  .summary-stats > div {
    padding: 9px;
  }

  .summary-stats strong {
    font-size: 16px;
  }
}

/* ==========================================================================
   Feishu H5 container
   ========================================================================== */

.feishu-boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 30px 24px calc(30px + env(safe-area-inset-bottom));
  background:
    radial-gradient(700px 480px at 15% 0%, rgba(37, 99, 235, 0.1), transparent 65%),
    radial-gradient(600px 380px at 100% 100%, rgba(15, 118, 110, 0.08), transparent 70%),
    var(--surface-soft);
}

.feishu-boot-brand {
  position: absolute;
  top: calc(22px + env(safe-area-inset-top));
  left: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.feishu-boot-brand img {
  width: 78px;
  height: 26px;
  object-fit: contain;
}

.feishu-boot-brand span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.feishu-boot-card {
  width: min(360px, 100%);
  padding: 30px 26px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
}

.feishu-boot-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  color: var(--blue);
  border: 1px solid var(--blue-line);
  border-radius: 13px;
  background: var(--blue-soft);
}

.feishu-boot-card h1 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.feishu-boot-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.feishu-boot-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-top: 22px;
  border: 2px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}

.feishu-boot-foot {
  position: absolute;
  bottom: calc(22px + env(safe-area-inset-bottom));
  margin: 0;
  color: var(--muted-light);
  font-size: 10px;
}

body.feishu-client .topbar {
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}

body.feishu-client .sidebar,
body.feishu-client .page,
body.feishu-client .fill-page {
  padding-bottom: env(safe-area-inset-bottom);
}

body.feishu-client .btn,
body.feishu-client .icon-button,
body.feishu-client .nav-link {
  touch-action: manipulation;
}

@media (max-width: 620px) {
  body.feishu-client .topbar {
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
  }

  body.feishu-client .fill-submit-card {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .feishu-boot-brand {
    left: 20px;
  }
}

/* Mobile information density: keep the primary action visible instead of
   horizontal table scrolling. */
@media (max-width: 620px) {
  .forms-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .forms-table th:nth-child(3),
  .forms-table td:nth-child(3),
  .forms-table th:nth-child(4),
  .forms-table td:nth-child(4),
  .forms-table th:nth-child(5),
  .forms-table td:nth-child(5),
  .forms-table th:nth-child(6),
  .forms-table td:nth-child(6) {
    display: none;
  }

  .forms-table th:nth-child(2),
  .forms-table td:nth-child(2) {
    width: 78px;
    padding-right: 4px;
  }

  .forms-table th:last-child,
  .forms-table td:last-child {
    display: table-cell;
    width: 40px;
    padding-right: 8px;
    padding-left: 2px;
  }

  .forms-table .cell-form {
    min-width: 0;
    padding-right: 4px;
  }

  .forms-table .form-cell {
    min-width: 0;
    gap: 9px;
  }

  .forms-table .form-cell-copy {
    min-width: 0;
  }

  .forms-table .form-cell-title {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .forms-table .form-cell-copy p {
    display: -webkit-box;
    max-width: 100%;
    margin-bottom: 2px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .forms-table .form-category-inline {
    display: none;
  }

  .forms-table .cell-actions .btn {
    display: none;
  }

  .forms-table .cell-actions .row-actions {
    justify-content: flex-end;
  }

  .forms-table .cell-actions .icon-button {
    width: 34px;
    height: 34px;
  }

  .users-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .users-table th:nth-child(3),
  .users-table td:nth-child(3),
  .users-table th:nth-child(4),
  .users-table td:nth-child(4),
  .users-table th:nth-child(5),
  .users-table td:nth-child(5) {
    display: none;
  }

  .users-table th:nth-child(2),
  .users-table td:nth-child(2) {
    display: table-cell;
    width: 72px;
    padding-right: 4px;
    padding-left: 4px;
  }

  .users-table th:last-child,
  .users-table td:last-child {
    display: table-cell;
    width: 38px;
    padding-right: 8px;
    padding-left: 0;
  }

  .users-table .person-cell {
    min-width: 0;
    gap: 9px;
  }

  .users-table .person-cell > div {
    min-width: 0;
  }

  .users-table .cell-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .users-table .table-subtext {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.35;
  }

  .users-table .role-badge {
    padding: 3px 7px;
    font-size: 9px;
  }

  .users-table .cell-actions .icon-button {
    width: 34px;
    height: 34px;
  }

  .summary-page .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .summary-page .metrics-grid .metric-card {
    min-height: 94px;
    padding: 12px;
  }

  .summary-page .metrics-grid .metric-value {
    font-size: 23px;
  }

  .summary-page .metrics-grid .metric-hint {
    font-size: 9px;
  }

  .summary-page .page-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .summary-page .page-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

.builder-field.is-new-field {
  animation: field-added 1.8s ease-out both;
}

@keyframes field-added {
  0% {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  }
  100% {
    border-color: var(--line);
    box-shadow: none;
  }
}

.field-mobile-settings {
  display: none;
}

.inspector-close-mobile,
.inspector-mobile-footer,
.mobile-inspector-backdrop,
.mobile-record-list {
  display: none;
}

.mobile-record-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.mobile-record-top,
.mobile-record-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-record-top .person-cell {
  min-width: 0;
}

.mobile-record-top .person-cell > div {
  min-width: 0;
}

.mobile-record-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.mobile-record-form .cell-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-record-meta,
.mobile-record-due {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10.5px;
}

.mobile-record-meta .response-id {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-record-due .table-subtext {
  width: 100%;
  margin-left: 18px;
}

.mobile-record-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.mobile-record-footer .link-button,
.mobile-record-action {
  margin-left: auto;
}

.mobile-record-action {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.mobile-record-empty {
  padding: 8px 0;
}

@media (max-width: 780px) {
  .field-mobile-settings {
    display: inline-flex;
  }

  body.mobile-field-open {
    overflow: hidden;
  }

  .mobile-inspector-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3100;
    background: rgba(16, 24, 40, 0.38);
    backdrop-filter: blur(2px);
  }

  body.mobile-field-open .mobile-inspector-backdrop {
    display: block;
  }

  .builder-right {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3200;
    display: block;
    width: 100%;
    max-height: 86dvh;
    height: auto;
    margin: 0;
    overflow-y: auto;
    border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 50px rgba(16, 24, 40, 0.18);
    transform: translateY(105%);
    transition: transform 220ms ease;
    padding-bottom: env(safe-area-inset-bottom);
  }

  body.mobile-field-open .builder-right {
    transform: translateY(0);
  }

  .inspector-close-mobile {
    position: sticky;
    top: 8px;
    z-index: 2;
    display: inline-flex;
    float: right;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 8px 10px 0 0;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
  }

  .builder-right .inspector-head {
    padding-right: 54px;
  }

  .inspector-mobile-footer {
    position: sticky;
    bottom: 0;
    z-index: 3;
    display: flex;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--surface);
  }

  .inspector-mobile-footer .btn {
    width: 100%;
  }

  .submissions-table,
  .assignments-table,
  .team-table {
    display: none;
  }

  .table-card:has(.submissions-table),
  .table-card:has(.assignments-table),
  .table-card:has(.team-table) {
    display: none;
  }

  .mobile-team-progress {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
  }

  .mobile-record-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mobile-record-top .person-cell,
  .mobile-record-top .person-cell > div {
    min-width: 0;
  }

  .mobile-record-top .cell-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-record-top .version-pill,
  .mobile-record-top .status-pill {
    flex: none;
  }

  .mobile-record-top .table-subtext {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 620px) {
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
  }

  .modal-body {
    flex: 1;
    min-height: 0;
    padding: 18px;
    overflow-y: auto;
  }

  .modal-footer {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  }

  .modal-footer .btn {
    width: auto;
    flex: 1;
  }

  .create-category-option {
    padding: 10px;
  }

  .create-category-copy small {
    display: none;
  }

  .create-form-hint {
    margin-top: 15px;
  }

  .toast-stack {
    top: auto;
    bottom: 12px;
    align-items: stretch;
  }

  body:has(.modal-backdrop) .toast-stack,
  body.mobile-field-open .toast-stack {
    top: calc(62px + env(safe-area-inset-top));
    bottom: auto;
  }

  .toast {
    width: 100%;
    max-width: none;
  }

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

  .metrics-grid .metric-card,
  .metrics-grid-3 .metric-card {
    min-height: 0;
    padding: 12px;
  }

  .metrics-grid-3 .metric-card:last-child {
    grid-column: 1 / -1;
  }

  .metrics-grid .metric-value,
  .metrics-grid-3 .metric-value {
    font-size: 24px;
  }
}
}
