/**
 * 建设工程管理系统 — 主样式（源码）
 * 由 ThinkPHP 多页直接引用：/static/app/css/index.css
 * 补充样式见：/static/app/html/html.css
 */
:root {
  --bg: #edf5f0;
  --bg-strong: #d2ead8;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --line: rgba(15, 76, 46, 0.11);
  --line-strong: rgba(15, 76, 46, 0.2);
  --text: #123222;
  --muted: #5d7768;
  --accent: #18935d;
  --accent-gold: #2aa86d;
  --accent-green: #2f9c65;
  --accent-sky: #2e8fb5;
  --accent-olive: #5b9e3c;
  --accent-coral: #d16f5b;
  --accent-blue: #3b76c8;
  --accent-teal: #1f8b7c;
  --accent-red: #bc4f4f;
  --accent-violet: #6d63d3;
  --danger: #b54646;
  --shadow: 0 14px 36px rgba(24, 78, 52, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;
  --page-padding: clamp(16px, 2.5vw, 28px);
  --attachment-immersive-height: 100dvh;
  --app-font-default: system-ui, sans-serif;
  --app-font-sans: ui-sans-serif, system-ui, sans-serif;
  --app-font-serif: ui-serif, serif;
  --app-font-emphasis: fangsong, serif;
  --app-font-mono: ui-monospace, monospace;
  --app-text-topbarBrand-family: var(--app-font-sans);
  --app-text-topbarBrand-size: 11px;
  --app-text-topbarBrand-weight: 500;
  --app-text-topbarBrand-color: var(--muted);
  --app-text-topbarBrand-line-height: 1.35;
  --app-text-topbarTitle-family: var(--app-font-default);
  --app-text-topbarTitle-size: 17px;
  --app-text-topbarTitle-weight: 700;
  --app-text-topbarTitle-color: var(--text);
  --app-text-topbarTitle-line-height: 1.2;
  --app-text-pageEyebrow-family: var(--app-font-sans);
  --app-text-pageEyebrow-size: 12px;
  --app-text-pageEyebrow-weight: 600;
  --app-text-pageEyebrow-color: var(--accent);
  --app-text-pageEyebrow-line-height: 1.2;
  --app-text-pageTitle-family: var(--app-font-default);
  --app-text-pageTitle-size: 34px;
  --app-text-pageTitle-weight: 700;
  --app-text-pageTitle-color: var(--text);
  --app-text-pageTitle-line-height: 1.1;
  --app-text-sectionTitle-family: var(--app-font-default);
  --app-text-sectionTitle-size: 19px;
  --app-text-sectionTitle-weight: 700;
  --app-text-sectionTitle-color: var(--text);
  --app-text-sectionTitle-line-height: 1.25;
  --app-text-bodyText-family: var(--app-font-default);
  --app-text-bodyText-size: 14px;
  --app-text-bodyText-weight: 400;
  --app-text-bodyText-color: var(--text);
  --app-text-bodyText-line-height: 1.5;
  --app-text-helperText-family: var(--app-font-sans);
  --app-text-helperText-size: 13px;
  --app-text-helperText-weight: 400;
  --app-text-helperText-color: var(--muted);
  --app-text-helperText-line-height: 1.5;
  --app-text-menuText-family: var(--app-font-default);
  --app-text-menuText-size: 14px;
  --app-text-menuText-weight: 600;
  --app-text-menuText-color: var(--text);
  --app-text-menuText-line-height: 1.35;
  --app-text-formLabel-family: var(--app-font-sans);
  --app-text-formLabel-size: 14px;
  --app-text-formLabel-weight: 600;
  --app-text-formLabel-color: var(--text);
  --app-text-formLabel-line-height: 1.35;
  --app-text-formInput-family: var(--app-font-default);
  --app-text-formInput-size: 14px;
  --app-text-formInput-weight: 400;
  --app-text-formInput-color: var(--text);
  --app-text-formInput-line-height: 1.45;
  --app-text-buttonText-family: var(--app-font-sans);
  --app-text-buttonText-size: 14px;
  --app-text-buttonText-weight: 700;
  --app-text-buttonText-color: var(--text);
  --app-text-buttonText-line-height: 1.2;
  --app-text-statsText-family: var(--app-font-sans);
  --app-text-statsText-size: 12px;
  --app-text-statsText-weight: 600;
  --app-text-statsText-color: var(--muted);
  --app-text-statsText-line-height: 1.2;
  --app-text-recordTitle-family: var(--app-font-default);
  --app-text-recordTitle-size: 19px;
  --app-text-recordTitle-weight: 700;
  --app-text-recordTitle-color: var(--text);
  --app-text-recordTitle-line-height: 1.3;
  --app-project-overview-title-family: var(--app-text-recordTitle-family);
  --app-project-overview-title-size: 1.06rem;
  --app-project-overview-title-weight: var(--app-text-recordTitle-weight);
  --app-project-overview-title-color: var(--accent);
  --app-project-overview-title-line-height: 1.4;
  --app-text-recordDetail-family: var(--app-font-default);
  --app-text-recordDetail-size: 14px;
  --app-text-recordDetail-weight: 400;
  --app-text-recordDetail-color: var(--text);
  --app-text-recordDetail-line-height: 1.5;
  --app-text-codeText-family: var(--app-font-mono);
  --app-text-codeText-size: 14px;
  --app-text-codeText-weight: 700;
  --app-text-codeText-color: var(--text);
  --app-text-codeText-line-height: 1.3;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(24, 147, 93, 0.15), transparent 24%),
    radial-gradient(circle at right 10%, rgba(46, 143, 181, 0.08), transparent 20%),
    linear-gradient(180deg, #f4faf6 0%, #edf5f0 42%, #e6f0ea 100%);
  font-family: var(--app-font-default);
  line-height: 1.5;
  font-weight: 400;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
}

body.modal-open,
body.modal-sheet-open {
  overflow: hidden;
}

body.attachment-preview-immersive-active {
  overflow: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(48, 115, 78, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(48, 115, 78, 0.025) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 92%);
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

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

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button,
.secondary-button,
.primary-button,
.ghost-button,
.text-button {
  font-family: var(--app-text-buttonText-family);
  font-size: var(--app-text-buttonText-size);
  font-weight: var(--app-text-buttonText-weight);
  line-height: var(--app-text-buttonText-line-height);
}

label > span,
.field > span,
.module-settings-input-label {
  font-family: var(--app-text-formLabel-family);
  font-size: var(--app-text-formLabel-size);
  font-weight: var(--app-text-formLabel-weight);
  line-height: var(--app-text-formLabel-line-height);
  color: var(--app-text-formLabel-color);
}

input,
textarea,
select {
  font-family: var(--app-text-formInput-family);
  font-size: var(--app-text-formInput-size);
  font-weight: var(--app-text-formInput-weight);
  line-height: var(--app-text-formInput-line-height);
  color: var(--app-text-formInput-color);
}

#root {
  min-height: 100vh;
}

.button-reset {
  border: 0;
  padding: 0;
  background: transparent;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px var(--page-padding);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(245, 251, 247, 0.9);
  border-bottom: 1px solid rgba(17, 70, 44, 0.08);
  transition:
    transform 220ms ease,
    opacity 220ms ease,
    background 220ms ease;
}

.topbar.topbar-hidden {
  transform: translateY(calc(-100% - 8px));
  opacity: 0;
}

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

.topbar-home-link {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--accent);
  background: transparent;
  border: 0;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.topbar-home-link:hover {
  color: var(--accent-green);
}

.topbar-home-link:active,
.topbar-home-link:focus,
.topbar-home-link:focus-visible {
  background: transparent;
  box-shadow: none;
  outline: none;
}

.topbar-meta {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
}

.topbar-brand {
  display: block;
  max-width: 100%;
  margin: 0;
  font-family: var(--app-text-topbarBrand-family);
  font-size: var(--app-text-topbarBrand-size);
  font-weight: var(--app-text-topbarBrand-weight);
  line-height: var(--app-text-topbarBrand-line-height);
  letter-spacing: 0.08em;
  color: var(--app-text-topbarBrand-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-brand-placeholder {
  visibility: hidden;
  pointer-events: none;
}

.topbar-title {
  display: block;
  max-width: min(52vw, 24rem);
  font-family: var(--app-text-topbarTitle-family);
  font-size: var(--app-text-topbarTitle-size);
  font-weight: var(--app-text-topbarTitle-weight);
  line-height: var(--app-text-topbarTitle-line-height);
  color: var(--app-text-topbarTitle-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-title-marquee {
  text-overflow: clip;
}

.topbar-title-marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 48px;
  min-width: max-content;
  padding-right: 48px;
  animation: topbar-title-marquee 12s linear infinite;
}

.topbar-title-marquee-track > span {
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.projects-shell-page .topbar,
.module-records-shell-page .topbar,
.project-workspace-shell-page .topbar {
  min-height: 58px;
}

.project-workspace-shell-page .topbar-title {
  max-width: none;
  font-size: clamp(0.9rem, 1.1rem + 0.2vw, 1.0625rem);
}

@keyframes topbar-title-marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(-50% - 24px));
  }
}

.global-nav-fab {
  position: fixed;
  left: auto;
  top: auto;
  z-index: 36;
  width: 58px;
  height: 58px;
  min-width: 58px;
  min-height: 58px;
  color: #f6fff8;
  background: linear-gradient(135deg, #168856, #20a768);
  border: 1px solid rgba(24, 147, 93, 0.24);
  box-shadow: 0 18px 36px rgba(17, 70, 44, 0.2);
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  appearance: none;
  -webkit-appearance: none;
}

.global-nav-fab:hover {
  transform: translateY(-1px);
}

.global-nav-fab:active,
.global-nav-fab.pressing,
.global-nav-fab.dragging {
  cursor: grabbing;
}

.global-nav-fab.pressing,
.global-nav-fab.dragging,
.global-nav-fab.pressing:hover,
.global-nav-fab.dragging:hover,
.global-nav-fab.pressing:active,
.global-nav-fab.dragging:active {
  transform: none;
}

.global-nav-fab.suppressed,
.global-nav-fab.suppressed:hover,
.global-nav-fab.suppressed:active {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.96);
}

.global-search-fab {
  color: var(--accent);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.92), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 248, 243, 0.96));
  border: 1px solid rgba(24, 147, 93, 0.18);
  box-shadow: 0 18px 36px rgba(17, 70, 44, 0.12);
}

.global-search-fab:active,
.global-search-fab.pressing,
.global-search-fab.active:hover,
.global-search-fab.active:active {
  color: var(--accent);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.92), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 248, 243, 0.96));
  border: 1px solid rgba(24, 147, 93, 0.18);
  box-shadow: 0 18px 36px rgba(17, 70, 44, 0.12);
}

.global-search-fab.pressing,
.global-search-fab.dragging,
.global-search-fab.pressing:hover,
.global-search-fab.dragging:hover,
.global-search-fab.pressing:active,
.global-search-fab.dragging:active {
  color: var(--accent);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.92), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 248, 243, 0.96));
  border: 1px solid rgba(24, 147, 93, 0.18);
  box-shadow: 0 18px 36px rgba(17, 70, 44, 0.12);
}

.global-back-fab {
  color: var(--accent);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.92), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 248, 243, 0.96));
  border: 1px solid rgba(24, 147, 93, 0.18);
  box-shadow: 0 18px 36px rgba(17, 70, 44, 0.12);
}

.global-search-fab.active {
  color: var(--accent);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.92), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 248, 243, 0.96));
  border: 1px solid rgba(24, 147, 93, 0.18);
  box-shadow: 0 18px 36px rgba(17, 70, 44, 0.12);
}

.global-nav-fab .ui-icon {
  width: 24px;
  height: 24px;
}

.topbar-user-block {
  display: flex;
  align-items: center;
}

.topbar-user-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: right;
}

.topbar-user-copy span,
.topbar-user-copy strong {
  max-width: 12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-user-copy span {
  font-size: 0.74rem;
  color: var(--muted);
}

.topbar-user-copy strong {
  font-size: 0.84rem;
  color: var(--text);
}

.page {
  padding: 12px var(--page-padding) 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-intro {
  display: block;
  min-height: 0;
  padding: 14px 18px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(17, 70, 44, 0.08);
  background:
    radial-gradient(circle at top right, rgba(24, 147, 93, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 252, 249, 0.92));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.page-intro::after {
  display: none;
}

.breadcrumb-link {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--accent);
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--app-text-pageEyebrow-family);
  color: var(--app-text-pageEyebrow-color);
  border: 1px solid rgba(24, 147, 93, 0.16);
  background: rgba(24, 147, 93, 0.08);
  font-size: var(--app-text-pageEyebrow-size);
  font-weight: var(--app-text-pageEyebrow-weight);
  line-height: var(--app-text-pageEyebrow-line-height);
}

.eyebrow.eyebrow-plain {
  color: var(--muted);
  background: rgba(24, 147, 93, 0.04);
}

.page-intro h1,
.hero-strip h2 {
  margin: 0;
  font-family: var(--app-font-sans);
}

.page-intro h1 {
  max-width: 24ch;
  font-family: var(--app-text-pageTitle-family);
  font-size: var(--app-text-pageTitle-size);
  font-weight: var(--app-text-pageTitle-weight);
  line-height: var(--app-text-pageTitle-line-height);
  color: var(--app-text-pageTitle-color);
}

.page-intro p {
  max-width: 52rem;
  margin: 6px 0 0;
  font-family: var(--app-text-bodyText-family);
  font-size: var(--app-text-bodyText-size);
  font-weight: var(--app-text-bodyText-weight);
  line-height: var(--app-text-bodyText-line-height);
  color: var(--app-text-bodyText-color);
}

.intro-badges,
.intro-actions-inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.intro-badges {
  margin-top: 10px;
}

.intro-badges span,
.stats-pills span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  font-family: var(--app-text-statsText-family);
  font-size: var(--app-text-statsText-size);
  font-weight: var(--app-text-statsText-weight);
  line-height: var(--app-text-statsText-line-height);
  color: var(--app-text-statsText-color);
  background: rgba(24, 147, 93, 0.07);
  border: 1px solid rgba(24, 147, 93, 0.12);
}

.hero-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.hero-strip > div,
.surface,
.record-item,
.module-tile,
.empty-state,
.modal,
.drawer {
  border: 1px solid rgba(31, 27, 18, 0.08);
  background: var(--surface);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.hero-strip > div {
  border-radius: var(--radius-lg);
  padding: 18px 18px;
  min-height: 0;
  animation: rise-in 420ms ease both;
}

.hero-strip > div:nth-child(2) {
  animation-delay: 80ms;
}

.hero-strip > div:nth-child(3) {
  animation-delay: 160ms;
}

.hero-label {
  display: inline-flex;
  font-size: 0.85rem;
  color: var(--muted);
}

.hero-strip h2 {
  margin-top: 8px;
  font-family: var(--app-text-pageTitle-family);
  font-size: var(--app-text-pageTitle-size);
  font-weight: var(--app-text-pageTitle-weight);
  color: var(--app-text-pageTitle-color);
  line-height: var(--app-text-pageTitle-line-height);
  overflow-wrap: anywhere;
}

.hero-strip p {
  margin-top: 6px;
  font-family: var(--app-text-bodyText-family);
  font-size: var(--app-text-bodyText-size);
  font-weight: var(--app-text-bodyText-weight);
  line-height: var(--app-text-bodyText-line-height);
  color: var(--app-text-bodyText-color);
}

.surface {
  border-radius: var(--radius-xl);
  padding: clamp(18px, 2.6vw, 24px);
}

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

.section-head.section-head-compact {
  margin-bottom: 14px;
}

.section-head-tools,
.breadcrumb-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.breadcrumb-head-actions-only {
  grid-template-columns: 1fr;
}

.breadcrumb-head-actions-only .section-head-tools {
  width: auto;
  justify-self: end;
}

.breadcrumb-head-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.breadcrumb-head-inline .section-head-tools {
  flex: 0 0 auto;
  min-width: max-content;
}

.breadcrumb-head .section-head-tools {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.section-head h3,
.empty-state h3,
.panel-head h3,
.record-item h4 {
  margin: 0;
  font-family: var(--app-text-sectionTitle-family);
  font-size: var(--app-text-sectionTitle-size);
  font-weight: var(--app-text-sectionTitle-weight);
  line-height: var(--app-text-sectionTitle-line-height);
  color: var(--app-text-sectionTitle-color);
}

.section-head p,
.empty-state p,
.panel-head p,
.record-notes,
.inline-notice {
  margin: 8px 0 0;
  font-family: var(--app-text-helperText-family);
  font-size: var(--app-text-helperText-size);
  font-weight: var(--app-text-helperText-weight);
  line-height: var(--app-text-helperText-line-height);
  color: var(--app-text-helperText-color);
}

.project-table,
.record-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.record-list-footer {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.table-row,
.record-item {
  display: grid;
  gap: 16px;
}

.table-row {
  grid-template-columns: minmax(0, 1.8fr) 0.6fr 1fr auto;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(17, 70, 44, 0.08);
  background: rgba(255, 255, 255, 0.76);
}

.project-row-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.project-row-main strong {
  font-family: var(--app-text-recordTitle-family);
  font-size: var(--app-text-recordTitle-size);
  font-weight: var(--app-text-recordTitle-weight);
  line-height: var(--app-text-recordTitle-line-height);
}

.project-row-subline {
  font-family: var(--app-text-recordDetail-family);
  font-size: var(--app-text-recordDetail-size);
  font-weight: var(--app-text-recordDetail-weight);
  line-height: var(--app-text-recordDetail-line-height);
  color: var(--app-text-recordDetail-color);
}

.table-header {
  color: var(--muted);
  background: transparent;
  border-style: dashed;
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.icon-row-actions {
  justify-content: flex-end;
}

.project-list-card {
  min-width: 0;
  width: 100%;
  display: grid;
  gap: 14px;
  align-items: start;
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(17, 70, 44, 0.08);
  background:
    radial-gradient(circle at top right, rgba(24, 147, 93, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 249, 0.92));
  box-shadow: 0 16px 32px rgba(17, 70, 44, 0.06);
}

.project-list-card-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-group-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-group-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.project-group-section.dragging {
  z-index: 4;
}

.project-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.project-group-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-group-head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.project-group-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-group-copy strong {
  font-size: 1rem;
  color: var(--text);
}

.project-group-copy span {
  color: var(--muted);
  font-size: 0.86rem;
}

.project-group-sort-toggle {
  min-width: 38px;
  min-height: 38px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(24, 147, 93, 0.14);
  box-shadow: 0 10px 20px rgba(17, 70, 44, 0.06);
}

.project-group-sort-toggle.active {
  color: #f6fff8;
  background: linear-gradient(135deg, #168856, #20a768);
  border-color: transparent;
}

.project-group-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-sortable-row {
  touch-action: manipulation;
}

.project-sortable-row.sort-enabled {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.project-sortable-row.sort-enabled .project-list-card {
  cursor: grab;
}

.project-sortable-row.sort-enabled .project-list-card,
.project-sortable-row.sort-enabled .project-card-name-button,
.project-sortable-row.sort-enabled .project-card-name-badge,
.project-sortable-row.sort-enabled .project-card-title,
.project-sortable-row.sort-enabled .project-card-edit-corner,
.project-sortable-row.sort-enabled .project-card-index-badge {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.project-sortable-row.sort-enabled:active .project-list-card {
  cursor: grabbing;
}

.project-sortable-row.dragging .project-list-card,
.group-manage-row.dragging,
.project-group-section.dragging .project-group-head {
  box-shadow: 0 22px 40px rgba(17, 70, 44, 0.14);
}

.project-row-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 0;
}

.project-row-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.project-group-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(24, 147, 93, 0.08);
  border: 1px solid rgba(24, 147, 93, 0.14);
  font-size: 0.75rem;
  font-weight: 700;
}

.drag-handle {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(17, 70, 44, 0.08);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

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

.drag-handle:disabled {
  cursor: default;
  opacity: 0.55;
}

.project-card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-card-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
}

.project-card-name-button {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.project-list-card-entry,
.project-grid-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  -webkit-tap-highlight-color: transparent;
}

.quick-project-mark.project-card-name-badge {
  position: relative;
  display: flex;
  min-width: 0;
  max-width: 100%;
  height: auto;
  min-height: 84px;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  padding: 16px 16px;
  border-radius: 18px;
  white-space: normal;
  overflow: visible;
}

.project-card-name-badge-text {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--app-project-overview-title-family);
  font-size: var(--app-project-overview-title-size);
  font-weight: var(--app-project-overview-title-weight);
  line-height: var(--app-project-overview-title-line-height);
  color: var(--app-project-overview-title-color);
  overflow-wrap: anywhere;
}

.project-record-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
}

.project-card-corner-pill {
  position: absolute;
  right: 0;
  bottom: 0;
  transform: translate(10px, 10px);
  z-index: 3;
  box-shadow: 0 8px 18px rgba(17, 70, 44, 0.08);
}

.project-card-index-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: rgba(17, 70, 44, 0.72);
  font-family: var(--app-text-codeText-family);
  font-size: var(--app-text-codeText-size);
  font-weight: var(--app-text-codeText-weight);
  line-height: var(--app-text-codeText-line-height);
  letter-spacing: 0.06em;
  box-shadow: 0 10px 22px rgba(22, 56, 39, 0.08);
  z-index: 2;
}

.project-card-edit-corner {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 22px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  z-index: 3;
  -webkit-tap-highlight-color: transparent;
}

.projects-head-action {
  min-width: 38px;
  min-height: 38px;
}

.projects-head-action.projects-head-action-primary,
.projects-head-action.projects-head-action-primary.active {
  color: #f6fff8;
  background: linear-gradient(135deg, #168856, #20a768);
  border-color: transparent;
}

.search-results-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-result-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid rgba(17, 70, 44, 0.08);
  border-radius: var(--radius-lg);
  color: inherit;
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease;
  background:
    radial-gradient(circle at top right, rgba(24, 147, 93, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 252, 249, 0.92));
  box-shadow: 0 16px 32px rgba(17, 70, 44, 0.06);
}

.search-result-card:hover {
  transform: translateY(-1px);
}

.search-result-card-head,
.search-result-card-body,
.search-result-match,
.search-result-entry {
  display: flex;
}

.search-result-card-head,
.search-result-card-body {
  flex-direction: column;
}

.search-result-card-head {
  gap: 10px;
}

.search-result-kind {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.search-result-kind.kind-project {
  color: var(--accent-green);
  background: rgba(47, 156, 101, 0.12);
}

.search-result-kind.kind-module {
  color: var(--accent-blue);
  background: rgba(59, 118, 200, 0.12);
}

.search-result-kind.kind-record {
  color: var(--accent-gold);
  background: rgba(42, 168, 109, 0.14);
}

.search-result-card-body {
  gap: 8px;
}

.search-result-title {
  font-family: var(--app-text-recordTitle-family);
  font-size: var(--app-text-recordTitle-size);
  font-weight: var(--app-text-recordTitle-weight);
  line-height: var(--app-text-recordTitle-line-height);
  color: var(--app-text-recordTitle-color);
  overflow-wrap: anywhere;
}

.search-result-updated,
.search-result-location {
  font-family: var(--app-text-helperText-family);
  font-size: var(--app-text-helperText-size);
  font-weight: var(--app-text-helperText-weight);
  line-height: var(--app-text-helperText-line-height);
  color: var(--app-text-helperText-color);
}

.search-result-match {
  flex-direction: column;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px dashed rgba(17, 70, 44, 0.12);
}

.search-result-match span:first-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.search-result-match span:last-child {
  color: var(--text);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.search-result-entry {
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
}

.search-results-notice {
  margin-bottom: 0;
}

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

.projects-overview-strip {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stats-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.project-switch-grid {
  margin-top: 4px;
}

.quick-project-tile {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(17, 70, 44, 0.08);
  background:
    radial-gradient(circle at top right, rgba(24, 147, 93, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 249, 0.92));
  box-shadow: 0 16px 32px rgba(17, 70, 44, 0.06);
}

.quick-project-mark {
  min-width: 42px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 14px;
  color: var(--accent);
  font-weight: 700;
  background: rgba(24, 147, 93, 0.1);
}

.project-grid-card {
  justify-content: space-between;
  gap: 14px;
}

.view-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(24, 147, 93, 0.06);
  border: 1px solid rgba(17, 70, 44, 0.08);
}

.view-mode-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(17, 70, 44, 0.08);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(24, 147, 93, 0.06);
}

.project-row-main-button {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.project-row-main-button:active,
.project-row-main-button:focus,
.project-row-main-button:focus-visible,
.project-card-name-button:active,
.project-card-name-button:focus,
.project-card-name-button:focus-visible,
.module-tile:active,
.module-tile:focus,
.module-tile:focus-visible {
  outline: none;
  box-shadow: none;
}

.project-table.compact .table-row {
  grid-template-columns: minmax(0, 1.8fr) 0.55fr 0.9fr auto;
}

.module-tile {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  padding: 16px;
  min-height: 158px;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  color: inherit;
  appearance: none;
}

.module-tile::before {
  content: '';
  position: absolute;
  inset: auto -10% -16% auto;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--module-accent) 32%, white), transparent 68%);
  opacity: 0.66;
}

.module-index,
.record-tag,
.record-sequence,
.attachment-kind {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-family: var(--app-text-codeText-family);
  font-size: var(--app-text-codeText-size);
  font-weight: var(--app-text-codeText-weight);
  line-height: var(--app-text-codeText-line-height);
  color: var(--app-text-codeText-color);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(31, 27, 18, 0.08);
}

.field-hint,
.security-section-head p,
.schema-section-head p {
  font-family: var(--app-text-helperText-family);
  font-size: var(--app-text-helperText-size);
  font-weight: var(--app-text-helperText-weight);
  line-height: var(--app-text-helperText-line-height);
  color: var(--app-text-helperText-color);
}

.security-section-head h3,
.schema-section-head h4,
.breadcrumb-current {
  font-family: var(--app-text-sectionTitle-family);
  font-size: var(--app-text-sectionTitle-size);
  font-weight: var(--app-text-sectionTitle-weight);
  line-height: var(--app-text-sectionTitle-line-height);
  color: var(--app-text-sectionTitle-color);
}

.security-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.record-title,
.record-detail-item,
.record-detail-label,
.attachment-item {
  font-family: var(--app-text-recordDetail-family);
  font-size: var(--app-text-recordDetail-size);
  font-weight: var(--app-text-recordDetail-weight);
  line-height: var(--app-text-recordDetail-line-height);
  color: var(--app-text-recordDetail-color);
}

.record-title {
  font-family: var(--app-text-recordTitle-family);
  font-size: var(--app-text-recordTitle-size);
  font-weight: var(--app-text-recordTitle-weight);
  line-height: var(--app-text-recordTitle-line-height);
  color: var(--app-text-recordTitle-color);
}

.module-tile p {
  margin: 8px 0 0;
  max-width: none;
  color: var(--muted);
  font-size: 0.9rem;
}

.module-footer {
  display: inline-flex;
  margin-top: auto;
  padding-top: 18px;
  color: var(--text);
  font-weight: 600;
}

.workspace-section-head {
  align-items: center;
}

.workspace-section-label {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: #178a57;
  background: rgba(23, 138, 87, 0.1);
}

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

.service-module-tile {
  min-height: 136px;
  padding: 14px 12px 12px;
  align-items: center;
  text-align: center;
  border: 1px solid rgba(31, 27, 18, 0.08);
}

.module-grid-service-cols-3 .service-module-tile {
  min-height: 126px;
  padding: 12px 12px 8px;
}

.module-grid-service-cols-3 .module-badge {
  width: 82px;
  min-height: 82px;
  border-radius: 22px;
  font-size: 1.08rem;
}

.module-grid-service-cols-3 .module-badge-multiline {
  font-size: 0.98rem;
}

.module-grid-service-cols-3 .service-module-footer {
  margin-top: 8px;
  padding-top: 0;
  font-size: 0.74rem;
}

.module-badge {
  width: 70px;
  min-height: 70px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  border-radius: 18px;
  font-family: var(--app-font-sans);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.05;
  color: color-mix(in srgb, var(--module-accent) 82%, #0d5337);
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--module-accent) 28%, white), transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), color-mix(in srgb, var(--module-accent) 12%, white));
  border: 1px solid color-mix(in srgb, var(--module-accent) 18%, white);
  box-shadow: 0 10px 24px rgba(22, 56, 39, 0.08);
  position: relative;
  overflow: visible;
  z-index: 1;
}

.module-badge-multiline {
  font-size: 0.9rem;
}

.module-badge span {
  display: block;
  text-align: center;
}

.module-badge-type {
  position: absolute;
  right: -8px;
  bottom: -7px;
  min-width: 30px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(17, 70, 44, 0.1);
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px rgba(22, 56, 39, 0.08);
  z-index: 2;
}

.service-module-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  margin-top: auto;
  padding-top: 14px;
}

.module-grid-editing .service-module-tile {
  cursor: pointer;
}

.module-tile-editable {
  border-style: dashed;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 252, 248, 0.96));
}

.module-tile-editable:hover {
  transform: translateY(-2px);
}

.module-tile-selected {
  border-color: color-mix(in srgb, var(--module-accent) 58%, rgba(17, 70, 44, 0.14));
  box-shadow: 0 18px 32px rgba(22, 56, 39, 0.12);
}

.module-tile-inactive {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 247, 246, 0.98));
  border-style: dashed;
}

.module-tile-inactive .module-badge {
  color: rgba(60, 74, 68, 0.78);
  background:
    radial-gradient(circle at top right, rgba(180, 191, 186, 0.18), transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 243, 241, 0.96));
  border-color: rgba(120, 132, 126, 0.18);
  box-shadow: none;
}

.module-tile-edit-corner {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  z-index: 3;
}

.module-tile-add {
  cursor: pointer;
  border-style: dashed;
  border-color: rgba(24, 147, 93, 0.2);
  background:
    radial-gradient(circle at top right, rgba(24, 147, 93, 0.14), transparent 68%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 250, 246, 0.96));
}

.module-badge-add {
  color: var(--accent);
  background:
    radial-gradient(circle at top right, rgba(24, 147, 93, 0.16), transparent 68%),
    rgba(255, 255, 255, 0.96);
  border-style: dashed;
  border-color: rgba(24, 147, 93, 0.22);
  box-shadow: none;
}

.module-badge-add span {
  font-size: inherit;
  line-height: inherit;
}

.module-badge-add > span:first-child {
  font-size: 1.4rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
}

.module-badge-add .module-badge-type {
  min-width: 30px;
  padding: 2px 6px;
  font-size: 0.56rem;
  line-height: 1.2;
}

.workspace-module-edit-hint {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(24, 147, 93, 0.12);
  box-shadow: 0 10px 24px rgba(22, 56, 39, 0.06);
}

.workspace-module-settings-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.workspace-module-settings-toggle.editing {
  color: #f6fff8;
  background: linear-gradient(135deg, #168856, #20a768);
  border-color: transparent;
  width: 38px;
  padding: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
}

.workspace-module-settings-toggle .ui-icon {
  width: 16px;
  height: 16px;
}

.workspace-module-grid-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 38px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(17, 70, 44, 0.12);
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.workspace-module-grid-select button {
  min-width: 34px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
}

.workspace-module-grid-select button.active {
  color: #f6fff8;
  background: linear-gradient(135deg, #168856, #20a768);
  box-shadow: 0 8px 18px rgba(24, 147, 93, 0.18);
}

.breadcrumb-surface {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.breadcrumb-trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumb-trail a:hover {
  color: var(--accent);
}

.breadcrumb-separator {
  opacity: 0.45;
}

.breadcrumb-current {
  color: var(--text);
}

.breadcrumb-pills {
  margin-top: 0;
}

.breadcrumb-pills-inline {
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.breadcrumb-pills-inline::-webkit-scrollbar {
  display: none;
}

.breadcrumb-pills-inline span {
  white-space: nowrap;
  font-size: 0.92rem;
}

.projects-search-shell {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px solid rgba(17, 70, 44, 0.1);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.projects-search-shell:focus-within {
  border-color: rgba(24, 147, 93, 0.28);
  box-shadow:
    0 0 0 3px rgba(24, 147, 93, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.projects-search-icon {
  flex: 0 0 auto;
  color: var(--muted);
}

.projects-search-input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
}

.projects-search-input::placeholder {
  color: color-mix(in srgb, var(--muted) 85%, white);
}

.projects-search-input:focus {
  outline: none;
}

.global-search-hero {
  display: grid;
  gap: 18px;
  padding: 22px;
  background:
    radial-gradient(circle at top right, rgba(24, 147, 93, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 252, 249, 0.94));
}

.global-search-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.global-search-copy h1,
.global-search-copy p {
  margin: 0;
}

.global-search-copy h1 {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  line-height: 1.15;
}

.global-search-copy p {
  max-width: 42rem;
  color: var(--muted);
  line-height: 1.55;
}

.global-search-entry {
  width: 100%;
}

.global-search-input {
  font-size: 1rem;
}

.global-search-results-surface {
  min-height: 260px;
}

.workspace-module-surface,
.module-records-surface {
  padding-top: 16px;
}

.record-item {
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 0.85fr);
  align-items: start;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  position: relative;
}

.record-item.compact {
  padding: 16px;
}

.record-item-highlight {
  border: 1px solid rgba(24, 147, 93, 0.22);
  background:
    radial-gradient(circle at top right, rgba(24, 147, 93, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(237, 248, 241, 0.94));
  box-shadow:
    0 0 0 2px rgba(24, 147, 93, 0.12),
    0 18px 36px rgba(17, 70, 44, 0.08);
}

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

.record-main-head > div:first-child {
  min-width: 0;
}

.record-main-header-copy,
.record-main {
  min-width: 0;
}

.record-main-header-copy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.record-head-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.record-sequence {
  color: var(--accent);
  background: rgba(24, 147, 93, 0.08);
  border-color: rgba(24, 147, 93, 0.16);
}

.record-main h4 {
  margin: 0;
  font-size: 1.08rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: break-word;
}

.record-field-value {
  display: block;
  overflow-wrap: anywhere;
}

.record-field-copy-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.record-field-copy-button .record-field-value {
  flex: 1 1 auto;
  min-width: 0;
}

.record-field-copy-button:focus-visible {
  outline: 2px solid rgba(24, 147, 93, 0.22);
  outline-offset: 3px;
  border-radius: 8px;
}

.record-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  color: var(--muted);
  text-align: right;
}

.record-side.compact {
  gap: 12px;
}

.record-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.record-detail-grid.compact {
  margin-top: 14px;
  gap: 10px;
}

.record-detail-item {
  min-width: 0;
}

.record-detail-grid dt {
  font-size: 0.84rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.record-detail-grid dd {
  margin: 5px 0 0;
  font-weight: 600;
  min-width: 0;
}

.record-detail-item.is-inline {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  column-gap: 6px;
}

.record-detail-item.is-inline .record-detail-label {
  white-space: nowrap;
  overflow-wrap: normal;
}

.record-detail-item.is-inline dd {
  margin: 0;
}

.record-detail-item.is-inline .record-field-value {
  display: inline;
}

.record-detail-item.is-inline .record-field-copy-button {
  display: inline-flex;
  width: auto;
  max-width: 100%;
}

.record-attachments {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(17, 70, 44, 0.12);
}

.record-attachments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
}

.record-attachments-head > div {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.record-attachments-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.record-attachments-switcher {
  flex: 0 0 auto;
}

.record-attachments-head p {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(31, 27, 18, 0.56);
}

.record-attachments-head strong {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.empty-state {
  border-radius: var(--radius-lg);
  padding: 34px;
  text-align: center;
}

.empty-state.compact {
  padding: 20px;
}

.empty-state button {
  margin-top: 18px;
}

.inline-notice {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(165, 59, 59, 0.18);
  background: rgba(165, 59, 59, 0.08);
  color: var(--danger);
}

.inline-notice.danger {
  border-color: rgba(165, 59, 59, 0.22);
  background: rgba(165, 59, 59, 0.1);
}

.copy-toast {
  position: fixed;
  left: 50%;
  top: calc(20px + env(safe-area-inset-top));
  z-index: 120;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(17, 70, 44, 0.92);
  color: #f6fff8;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 14px 32px rgba(17, 70, 44, 0.18);
  transform: translateX(-50%);
  pointer-events: none;
}

.auth-screen {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background: #edf4f0;
}

.auth-card {
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 28px;
  border: 1px solid rgba(17, 70, 44, 0.1);
  background: var(--surface-strong);
  box-shadow: 0 12px 28px rgba(17, 70, 44, 0.06);
}

.auth-card-compact {
  width: min(360px, 100%);
}

.auth-copy {
  margin-bottom: 18px;
}

.auth-copy h1 {
  margin-bottom: 10px;
}

.auth-copy p,
.auth-footnote {
  color: var(--muted);
}

.auth-actions {
  justify-content: stretch;
}

.auth-submit-button {
  width: 100%;
  justify-content: center;
}

.auth-footnote {
  margin: 14px 0 0;
  font-size: 0.92rem;
}

.drawer-notice {
  margin-bottom: 4px;
}

.primary-button,
.ghost-button,
.text-button,
.icon-button {
  border-radius: 999px;
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    border-color 180ms ease;
}

.primary-button:hover,
.ghost-button:hover,
.text-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  border: 0;
  padding: 13px 18px;
  color: #f6fff8;
  background: linear-gradient(135deg, #168856, #20a768);
}

.ghost-button {
  border: 1px solid rgba(17, 70, 44, 0.12);
  padding: 11px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.84);
}

.text-button,
.icon-button {
  border: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ui-icon {
  width: 18px;
  height: 18px;
}

.icon-button {
  min-width: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(24, 147, 93, 0.1);
  border: 1px solid rgba(24, 147, 93, 0.12);
  -webkit-tap-highlight-color: transparent;
}

.icon-button-sm {
  min-width: 34px;
  min-height: 34px;
}

.icon-button.active {
  background: rgba(24, 147, 93, 0.16);
}

.icon-button-label {
  display: none;
}

.action-menu {
  position: relative;
  flex-shrink: 0;
}

.action-menu-popover {
  position: fixed;
  min-width: 168px;
  max-width: min(280px, calc(100vw - 16px));
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(17, 70, 44, 0.12);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  z-index: 60;
}

.action-menu-popover-right {
  right: 0;
}

.action-menu-popover-left {
  left: 0;
}

.action-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font-family: var(--app-text-menuText-family);
  font-size: var(--app-text-menuText-size);
  font-weight: var(--app-text-menuText-weight);
  line-height: var(--app-text-menuText-line-height);
  color: var(--app-text-menuText-color);
  text-align: left;
}

.action-menu-item:hover {
  background: rgba(24, 147, 93, 0.08);
}

.action-menu-item.danger {
  color: var(--danger);
}

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

.danger-button {
  background: linear-gradient(135deg, #c44f35, #a8322a);
  box-shadow: 0 16px 30px rgba(168, 50, 42, 0.22);
}

.danger-button:hover {
  box-shadow: 0 20px 34px rgba(168, 50, 42, 0.26);
}

.overlay,
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 27, 18, 0.38);
  backdrop-filter: blur(8px);
  z-index: 30;
}

.overlay {
  display: grid;
  place-items: center;
  padding: 20px;
}

.overlay-bottom-sheet {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.modal,
.drawer {
  border-radius: 26px;
  background: var(--surface-strong);
}

.modal {
  width: min(560px, 100%);
  padding: 24px;
  display: flex;
  flex-direction: column;
  max-height: min(calc(100dvh - 40px), 880px);
  overflow: hidden;
}

.modal-bottom-sheet {
  width: min(720px, 100%);
  max-height: min(82dvh, 880px);
  margin: 0;
  border-radius: 28px 28px 0 0;
  padding: 12px 18px 20px;
  box-shadow: 0 -20px 44px rgba(17, 70, 44, 0.18);
  animation: modal-sheet-rise 220ms ease;
}

.modal-sheet-handle {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: rgba(18, 50, 34, 0.16);
  margin: 0 auto 12px;
  flex: 0 0 auto;
}

@keyframes modal-sheet-rise {
  from {
    transform: translateY(28px);
    opacity: 0.82;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-wide {
  width: min(980px, 100%);
}

.module-settings-dialog {
  gap: 16px;
}

.module-settings-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(24, 147, 93, 0.14), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 246, 0.94));
  border: 1px solid rgba(24, 147, 93, 0.1);
}

.module-settings-hero-create {
  background:
    radial-gradient(circle at top left, rgba(24, 147, 93, 0.16), transparent 40%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 250, 245, 0.96));
}

.module-settings-hero-badge {
  width: 72px;
  min-width: 72px;
  height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  color: color-mix(in srgb, var(--module-accent, var(--accent)) 82%, #0d5337);
  font-size: 1.15rem;
  font-weight: 800;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--module-accent, var(--accent)) 22%, white), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), color-mix(in srgb, var(--module-accent, var(--accent)) 12%, white));
  border: 1px solid color-mix(in srgb, var(--module-accent, var(--accent)) 18%, white);
  box-shadow: 0 14px 32px rgba(22, 56, 39, 0.08);
}

.module-settings-hero-badge.inactive {
  color: rgba(60, 74, 68, 0.8);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 243, 241, 0.98));
  border-color: rgba(120, 132, 126, 0.16);
  box-shadow: none;
}

.module-settings-hero-copy strong,
.module-settings-hero-copy span,
.module-settings-hero-copy p {
  display: block;
}

.module-settings-hero-copy strong {
  margin-top: 4px;
  font-size: 1.15rem;
  line-height: 1.15;
  color: var(--text);
}

.module-settings-hero-copy p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.module-settings-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.module-settings-note {
  background: rgba(255, 255, 255, 0.66);
}

.module-settings-error {
  color: #8a3c32;
  background: rgba(168, 50, 42, 0.06);
  border-color: rgba(168, 50, 42, 0.12);
}

.module-settings-input-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(17, 70, 44, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.module-settings-input-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.module-settings-name-input {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid rgba(24, 147, 93, 0.14);
  background: linear-gradient(180deg, rgba(247, 252, 249, 0.98), rgba(255, 255, 255, 0.96));
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

.module-settings-name-input:focus {
  border-color: rgba(24, 147, 93, 0.32);
  box-shadow:
    0 0 0 4px rgba(24, 147, 93, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.92);
}

.module-settings-input-shell small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.module-settings-actions {
  justify-content: flex-end;
}

.security-modal-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(24, 147, 93, 0.06);
  border: 1px solid rgba(24, 147, 93, 0.12);
}

.drawer-backdrop {
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  width: min(620px, 100%);
  height: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 240ms ease;
}

.drawer-backdrop.open .drawer {
  transform: translateX(0);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 22px;
  flex-shrink: 0;
}

.panel-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.modal-head-action {
  min-width: 38px;
  min-height: 38px;
}

.modal-head-action.modal-head-action-primary {
  color: #f6fff8;
  background: linear-gradient(135deg, #168856, #20a768);
  border-color: transparent;
}

.modal-head-action.modal-head-action-danger {
  color: #b84b4b;
  background: rgba(255, 244, 244, 0.96);
  border-color: rgba(197, 77, 77, 0.18);
}

.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.drawer .stack-form {
  min-height: 100%;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal > .stack-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span {
  font-weight: 600;
}

.field .field-hint {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(31, 27, 18, 0.12);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid rgba(157, 107, 41, 0.24);
  border-color: rgba(157, 107, 41, 0.5);
}

.field input:read-only {
  background: rgba(246, 248, 247, 0.92);
  color: var(--muted);
  cursor: default;
}

.inline-select {
  position: relative;
}

.inline-select-trigger {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid rgba(24, 147, 93, 0.14);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(247, 252, 249, 0.98), rgba(255, 255, 255, 0.96));
  color: var(--text);
  text-align: left;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

.inline-select-trigger strong {
  font-size: 0.98rem;
  font-weight: 700;
}

.inline-select-trigger span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.inline-select-trigger:focus {
  outline: none;
  border-color: rgba(24, 147, 93, 0.32);
  box-shadow:
    0 0 0 4px rgba(24, 147, 93, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.92);
}

.inline-select-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(17, 70, 44, 0.08);
  background:
    radial-gradient(circle at top right, rgba(24, 147, 93, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 252, 249, 0.94));
  box-shadow: 0 18px 36px rgba(17, 70, 44, 0.1);
}

.inline-select-option {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.inline-select-option strong {
  font-size: 0.92rem;
}

.inline-select-option span {
  color: var(--muted);
  font-size: 0.78rem;
}

.inline-select-option:hover,
.inline-select-option.active {
  background: rgba(24, 147, 93, 0.08);
}

.schema-color-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.schema-color-control input[type='color'] {
  width: 56px;
  min-width: 56px;
  padding: 4px;
  border-radius: 14px;
}

.upload-zone {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border-radius: 20px;
  border: 1px dashed rgba(31, 27, 18, 0.18);
  background: rgba(255, 255, 255, 0.62);
}

.upload-zone input {
  margin-bottom: 8px;
}

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.attachment-list-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.attachment-list-toolbar {
  display: flex;
  justify-content: flex-end;
}

.attachment-view-switcher {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(31, 27, 18, 0.08);
  box-shadow: 0 10px 24px rgba(17, 70, 44, 0.05);
}

.attachment-view-switcher-button {
  min-width: 48px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.attachment-view-switcher-button:hover {
  transform: translateY(-1px);
  color: var(--accent);
  background: rgba(24, 147, 93, 0.06);
}

.attachment-view-switcher-button.active {
  color: var(--accent);
  background: rgba(24, 147, 93, 0.1);
  border-color: rgba(24, 147, 93, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.attachment-view-switcher-button span {
  font-size: 0.8rem;
  font-weight: 700;
}

.attachment-item {
  display: grid;
  align-items: stretch;
  padding: 14px 16px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(24, 147, 93, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 249, 0.92));
  border: 1px solid rgba(31, 27, 18, 0.08);
  box-shadow: 0 14px 30px rgba(17, 70, 44, 0.06);
}

.attachment-item.editable {
  grid-template-columns: minmax(168px, 212px) minmax(0, 1fr);
}

.attachment-item.readonly {
  grid-template-columns: minmax(0, 1fr);
  align-items: flex-start;
}

.attachment-item.card-mode.readonly {
  align-items: center;
}

.attachment-item.list-mode.readonly {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  cursor: default;
}

.attachment-item.readonly.previewable {
  cursor: pointer;
}

.attachment-item.readonly.previewable .attachment-meta,
.attachment-item.readonly.previewable .attachment-meta-head,
.attachment-item.readonly.previewable .attachment-meta-head-main,
.attachment-item.readonly.previewable .attachment-title-block,
.attachment-item.readonly.previewable .attachment-list-mode-meta,
.attachment-item.readonly.previewable .attachment-serial,
.attachment-item.readonly.previewable .attachment-kind,
.attachment-item.readonly.previewable .attachment-preview-button,
.attachment-item.readonly.previewable .attachment-tile {
  cursor: pointer;
}

.attachment-item,
.attachment-title-block,
.attachment-link,
.attachment-summary-trigger,
.attachment-preview-button,
.attachment-preview-link,
.attachment-tile {
  -webkit-tap-highlight-color: transparent;
}

.attachment-preview-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.attachment-preview-link {
  display: block;
}

.attachment-preview-button.disabled {
  cursor: default;
}

.attachment-card-thumb-with-overlay {
  position: relative;
  display: block;
  width: 100%;
}

.attachment-inline-preview-trigger {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  box-sizing: border-box;
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(31, 27, 18, 0.12);
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent);
  box-shadow: 0 8px 18px rgba(17, 70, 44, 0.14);
  cursor: pointer;
}

.attachment-inline-preview-trigger:hover {
  box-shadow: 0 10px 22px rgba(17, 70, 44, 0.18);
}

@media (hover: hover) and (pointer: fine) {
  .attachment-item.card-mode.readonly.previewable:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(17, 70, 44, 0.08);
  }

  .attachment-preview-link:hover .attachment-tile {
    transform: translateY(-1px);
  }
}

@media (hover: none), (pointer: coarse) {
  .attachment-item.card-mode.readonly.previewable:hover,
  .attachment-item.list-mode.readonly:hover,
  .attachment-preview-link:hover .attachment-tile,
  .attachment-link:hover,
  .attachment-tile.clickable:hover,
  .attachment-item:active,
  .attachment-preview-button:active,
  .attachment-preview-link:active,
  .attachment-link:active,
  .attachment-summary-trigger:active,
  .attachment-tile.clickable:active {
    transform: none;
    box-shadow: none;
  }

  .attachment-item,
  .attachment-link,
  .attachment-preview-link,
  .attachment-preview-button,
  .attachment-tile {
    transition: none;
  }

  .attachment-item:focus,
  .attachment-item:focus-visible,
  .attachment-preview-button:focus,
  .attachment-preview-button:focus-visible,
  .attachment-preview-link:focus,
  .attachment-preview-link:focus-visible,
  .attachment-link:focus,
  .attachment-link:focus-visible,
  .attachment-summary-trigger:focus,
  .attachment-summary-trigger:focus-visible {
    outline: none;
    box-shadow: none;
  }
}

.attachment-tile {
  position: relative;
  width: 100%;
  min-height: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(31, 27, 18, 0.08);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 245, 0.88));
  overflow: hidden;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.attachment-tile.clickable:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 14px 24px rgba(17, 70, 44, 0.08);
}

.attachment-tile strong,
.attachment-tile span {
  position: relative;
  z-index: 1;
}

.attachment-tile strong {
  font-size: 1.12rem;
}

.attachment-tile span {
  color: var(--muted);
  font-size: 0.84rem;
}

.attachment-tile-watermark {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  max-width: calc(100% - 24px);
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}

.attachment-tile-watermark span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: #fffdf9;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: rgba(45, 26, 21, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 22px rgba(20, 10, 8, 0.14);
}

.attachment-pdf-thumbnail {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 248, 246, 0.92), rgba(239, 221, 217, 0.84));
}

.attachment-pdf-thumbnail::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(52, 22, 18, 0.04), rgba(52, 22, 18, 0.12) 52%, rgba(52, 22, 18, 0.42));
}

.attachment-pdf-thumbnail.ready::after {
  background:
    linear-gradient(180deg, rgba(52, 22, 18, 0.02), rgba(52, 22, 18, 0.1) 56%, rgba(52, 22, 18, 0.54));
}

.attachment-pdf-thumbnail-canvas,
.attachment-pdf-thumbnail-image,
.attachment-pdf-thumbnail-fallback {
  position: relative;
  z-index: 0;
}

.attachment-pdf-thumbnail-canvas,
.attachment-pdf-thumbnail-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  background: #fffdfb;
  box-shadow: 0 14px 28px rgba(86, 35, 28, 0.18);
}

.attachment-pdf-thumbnail-image {
  object-fit: contain;
}

.attachment-pdf-thumbnail-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 112px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #9c3728;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: 0 12px 24px rgba(86, 35, 28, 0.14);
}

.attachment-tile-image {
  padding: 0;
}

.attachment-tile-image img,
.attachment-tile-image-generated {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 列表内缩略图不接收指针事件，避免微信等环境对图片触发另存为/转发；点击由外层卡片统一处理 */
.attachment-list .attachment-tile img,
.attachment-list .attachment-tile canvas {
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.attachment-list .attachment-inline-preview-trigger {
  pointer-events: auto;
}

.attachment-tile-activate-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.attachment-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.attachment-meta-head-main {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.attachment-item.list-mode .attachment-meta {
  justify-content: center;
}

.attachment-item.card-mode .attachment-meta {
  align-self: stretch;
  justify-content: space-between;
}

.attachment-item.list-mode .attachment-meta-head,
.attachment-item.list-mode .attachment-meta-head-main {
  align-items: center;
}

.attachment-item.card-mode.readonly .attachment-meta-head,
.attachment-item.card-mode.readonly .attachment-meta-head-main {
  align-items: center;
}

.attachment-title-block {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attachment-list-mode-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.84rem;
  flex-wrap: wrap;
  line-height: 1.2;
}

.attachment-name-suffix {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.9em;
  font-weight: 500;
}

.attachment-meta-preview {
  width: min(212px, 100%);
  margin-top: 0;
}

.attachment-serial {
  flex: 0 0 auto;
  min-width: 56px;
  min-height: 48px;
  padding: 4px 8px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border-radius: 14px;
  background: rgba(24, 147, 93, 0.12);
  border: 1px solid rgba(24, 147, 93, 0.16);
  color: var(--accent);
  font-weight: 700;
  line-height: 1;
}

.attachment-serial-prefix {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

.attachment-serial-index {
  font-size: 0.98rem;
  letter-spacing: 0.08em;
  line-height: 1;
}

.attachment-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-link {
  display: block;
  color: var(--accent);
  font-weight: 600;
  word-break: break-word;
  line-height: 1.25;
  transition: transform 180ms ease;
}

.attachment-link-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.attachment-summary-trigger {
  min-width: 0;
  display: block;
  flex: 1 1 auto;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.attachment-link-static {
  color: var(--text);
}

.attachment-kind {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.attachment-kind {
  color: var(--accent);
  background: rgba(24, 147, 93, 0.08);
  border: 1px solid rgba(24, 147, 93, 0.12);
}

.attachment-item input {
  width: 100%;
  border: 1px solid rgba(31, 27, 18, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.attachment-item input:focus {
  outline: 2px solid rgba(157, 107, 41, 0.24);
  border-color: rgba(157, 107, 41, 0.5);
}

.attachment-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
}

.attachment-item.list-mode.readonly .attachment-actions {
  margin-top: 0;
}

.attachment-action-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(24, 147, 93, 0.08);
  border: 1px solid rgba(24, 147, 93, 0.12);
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.attachment-action-button span {
  white-space: nowrap;
}

.attachment-action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 16px rgba(17, 70, 44, 0.08);
}

.attachment-action-button:disabled {
  opacity: 0.56;
  transform: none;
  box-shadow: none;
}

.attachment-action-danger {
  color: var(--danger);
  background: rgba(196, 79, 53, 0.08);
  border-color: rgba(196, 79, 53, 0.14);
}

.attachment-action-dialog,
.attachment-qr-dialog {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.attachment-sheet-overlay {
  z-index: 80;
  background: rgba(20, 28, 24, 0.34);
  backdrop-filter: blur(14px);
}

.attachment-sheet-modal {
  width: min(100%, 100vw);
}

.attachment-sheet-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 8px 2px;
  text-align: center;
}

.attachment-sheet-title strong {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
  color: rgba(18, 50, 34, 0.84);
}

.attachment-sheet-title span {
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--muted);
}

.attachment-action-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(18, 50, 34, 0.08);
  box-shadow: 0 10px 22px rgba(17, 70, 44, 0.06);
}

.attachment-action-list-item {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.3;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.attachment-action-list-item + .attachment-action-list-item {
  position: relative;
}

.attachment-action-list-item + .attachment-action-list-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: rgba(18, 50, 34, 0.075);
}

.attachment-action-list-item .ui-icon {
  width: 19px;
  height: 19px;
  color: rgba(24, 147, 93, 0.92);
}

.attachment-action-list-item:hover {
  transform: translateY(-1px);
  background: rgba(24, 147, 93, 0.08);
}

.attachment-action-list-item:active {
  transform: scale(0.985);
  background: rgba(24, 147, 93, 0.12);
}

.attachment-action-list-item:disabled {
  opacity: 0.5;
  transform: none;
  background: transparent;
}

.attachment-action-list-item-danger {
  color: var(--danger);
}

.attachment-action-list-item-danger .ui-icon {
  color: var(--danger);
}

.attachment-action-list-item-danger:hover {
  background: rgba(196, 79, 53, 0.08);
}

.attachment-action-list-item-danger:active {
  background: rgba(196, 79, 53, 0.12);
}

.attachment-share-revoke-list {
  margin-top: 2px;
}

.attachment-qr-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attachment-action-notice {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--accent);
  background: rgba(24, 147, 93, 0.08);
  border: 1px solid rgba(24, 147, 93, 0.12);
}

.attachment-qr-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(24, 147, 93, 0.08), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 250, 246, 0.96));
  border: 1px solid rgba(24, 147, 93, 0.12);
}

.attachment-qr-image {
  width: min(100%, 280px);
  height: auto;
  display: block;
  border-radius: 16px;
}

.attachment-qr-sheet-modal {
  width: min(100%, 520px);
}

.attachment-qr-action-list {
  margin-top: 4px;
}

.attachment-sheet-cancel {
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(17, 70, 44, 0.06);
  margin-top: 6px;
  -webkit-tap-highlight-color: transparent;
}

.attachment-sheet-cancel:hover {
  transform: translateY(-1px);
}

.attachment-sheet-cancel:active {
  transform: scale(0.99);
  background: rgba(248, 251, 249, 0.98);
}

.attachment-share-dialog {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.attachment-share-hint {
  margin: 0;
  color: var(--muted);
}

.attachment-share-status-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(24, 147, 93, 0.08);
  border: 1px solid rgba(24, 147, 93, 0.12);
}

.attachment-share-status-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.attachment-share-status-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.attachment-share-status-card strong {
  color: var(--accent);
}

.attachment-share-status-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

.attachment-share-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.attachment-share-limit-type-field {
  margin: 0;
  padding: 0;
  border: 0;
}

.attachment-share-limit-type-field legend {
  margin-bottom: 8px;
  font-weight: 600;
}

.attachment-share-limit-type-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.attachment-share-limit-type-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(24, 147, 93, 0.16);
  background: rgba(255, 255, 255, 0.98);
  font-weight: 600;
}

.attachment-share-limit-type-option:has(input:checked) {
  border-color: rgba(24, 147, 93, 0.42);
  background: rgba(24, 147, 93, 0.08);
  color: var(--accent);
}

.attachment-share-password-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attachment-share-password-field label,
.attachment-share-expiry-field {
  font-weight: 600;
}

.attachment-share-password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.attachment-share-password-row input,
.attachment-share-expiry-select {
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(24, 147, 93, 0.16);
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.98);
}

.attachment-share-inline-button {
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(24, 147, 93, 0.16);
  background: rgba(255, 255, 255, 0.98);
  color: var(--accent);
  font-weight: 700;
}

.attachment-share-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attachment-share-revoke-button {
  color: #b42318;
}

.attachment-share-error {
  margin: 0;
  color: #b42318;
}

.attachment-share-result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.16);
}

.attachment-share-result strong {
  font-size: 15px;
}

.attachment-share-result-field {
  font-size: 13px;
  color: var(--text-muted, #667085);
}

.attachment-share-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-share-gate {
  display: flex;
  justify-content: center;
  padding: 24px 16px 40px;
}

.attachment-share-gate-card {
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 24px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(24, 147, 93, 0.08), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 250, 246, 0.96));
  border: 1px solid rgba(24, 147, 93, 0.12);
  text-align: center;
}

.attachment-share-gate-card .ui-icon {
  width: 42px;
  height: 42px;
  color: var(--accent);
}

.attachment-share-gate-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.attachment-share-gate-card p {
  margin: 0;
  color: var(--muted);
}

.attachment-share-gate-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attachment-share-gate-form input {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(24, 147, 93, 0.16);
  padding: 0 14px;
}

.attachment-list[data-view-mode='card'] {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.attachment-list[data-view-mode='list'] {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.attachment-item.list-mode > .attachment-preview-button,
.attachment-item.list-mode .attachment-meta-preview {
  display: none;
}

.attachment-open {
  color: var(--accent);
}

.attachment-viewer {
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  border: 1px solid rgba(31, 27, 18, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 248, 0.92));
  overflow: hidden;
  min-height: 42vh;
}

.attachment-viewer-immersive {
  min-height: var(--attachment-immersive-height);
  height: var(--attachment-immersive-height);
  border: 0;
  border-radius: 0;
  background: transparent;
}

.attachment-viewer-image {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  background: #f8f5ee;
}

.attachment-viewer-image.clickable {
  cursor: zoom-in;
}

.attachment-image-viewer {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  min-height: 0;
}

.attachment-image-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.attachment-image-toolbar-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attachment-image-toolbar span {
  font-weight: 600;
}

.attachment-image-toolbar-copy small {
  color: var(--muted);
  font-size: 0.82rem;
}

.attachment-image-toolbar button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(17, 70, 44, 0.12);
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent);
  font-weight: 600;
}

.attachment-image-stage {
  display: grid;
  place-items: center;
  flex: 1 1 auto;
  min-height: 320px;
  padding: 18px;
  border-radius: 20px;
  background: #f8f5ee;
  overflow: auto;
}

.attachment-image-stage.interactive {
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

.attachment-image-stage.interactive .attachment-viewer-image {
  user-select: none;
  will-change: transform;
}

.attachment-image-stage.interactive:active {
  cursor: grabbing;
}

.attachment-image-viewer.is-fullscreen {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 24px;
  background: rgba(12, 17, 14, 0.98);
}

.attachment-image-viewer.is-fullscreen .attachment-image-toolbar span {
  color: #f2f6f3;
}

.attachment-image-viewer.is-fullscreen .attachment-image-toolbar-copy small {
  color: rgba(242, 246, 243, 0.74);
}

.attachment-image-viewer.is-fullscreen .attachment-image-toolbar button {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.12);
  color: #f2f6f3;
}

.attachment-image-viewer.is-fullscreen .attachment-image-stage {
  padding: 0;
  background: transparent;
}

.attachment-image-viewer.is-fullscreen .attachment-viewer-image {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 120px);
  background: transparent;
  user-select: none;
  will-change: transform;
}

.attachment-viewer-immersive .attachment-image-viewer {
  gap: 0;
  padding: 0;
  min-height: var(--attachment-immersive-height);
  height: var(--attachment-immersive-height);
  background: #f4f6f5;
}

.attachment-viewer-immersive .attachment-image-stage {
  min-height: var(--attachment-immersive-height);
  height: var(--attachment-immersive-height);
  padding: 0;
  border-radius: 0;
  background: #f4f6f5;
}

.attachment-viewer-immersive .attachment-viewer-image {
  width: auto;
  max-width: 100vw;
  max-height: var(--attachment-immersive-height);
  background: transparent;
  user-select: none;
  will-change: transform;
}

.attachment-viewer-loading,
.attachment-viewer-error {
  padding: 18px 20px;
  color: var(--muted);
}

.attachment-viewer-immersive .attachment-viewer-loading,
.attachment-viewer-immersive .attachment-viewer-error {
  padding-top: calc(64px + env(safe-area-inset-top));
  padding-bottom: env(safe-area-inset-bottom);
}

.attachment-viewer-error {
  color: var(--danger);
}

.attachment-viewer-fallback,
.attachment-preview-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 320px;
  padding: 28px 24px;
  text-align: center;
}

.attachment-preview-fallback p {
  margin: 0;
  max-width: 36rem;
  color: var(--muted);
  line-height: 1.6;
}

.attachment-preview-fallback p strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 1.05rem;
}

.attachment-preview-fallback .primary-button {
  margin-top: 8px;
}

.attachment-fullscreen-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  z-index: 80;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  color: #f2f6f3;
  background: rgba(12, 17, 14, 0.78);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 28px rgba(12, 17, 14, 0.18);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

.security-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.security-alert-surface,
.security-tabs-surface,
.security-form-surface {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.security-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}

.security-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(24, 147, 93, 0.08);
  border: 1px solid rgba(24, 147, 93, 0.12);
}

.security-tab {
  min-width: 118px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.security-tab.active {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 26px rgba(17, 70, 44, 0.08);
}

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

.security-lockscreen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(24, 147, 93, 0.16), transparent 32%),
    radial-gradient(circle at bottom right, rgba(196, 79, 53, 0.16), transparent 28%),
    rgba(17, 22, 16, 0.7);
  backdrop-filter: blur(18px);
}

.security-lockscreen-card {
  width: min(520px, 100%);
  padding: 28px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 250, 247, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.48);
  box-shadow: 0 28px 60px rgba(13, 28, 18, 0.26);
}

.security-lockscreen-card h1 {
  margin: 6px 0 10px;
}

.security-lockscreen-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.security-lockscreen-meta {
  font-size: 0.86rem;
  color: var(--muted);
}

.modal {
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 960px);
  overflow: visible;
}

.attachment-preview-modal {
  width: min(1180px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}

.attachment-preview-modal .attachment-viewer {
  flex: 1 1 auto;
  min-height: 0;
}

.preview-surface {
  padding: 16px;
}

.preview-surface-full {
  min-height: calc(100vh - 160px);
}

.attachment-preview-immersive {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #f4f6f5;
  height: var(--attachment-immersive-height);
  overflow: hidden;
}

.attachment-preview-immersive .attachment-preview-close {
  position: fixed;
  z-index: 81;
}

.attachment-preview-immersive .attachment-viewer {
  min-height: var(--attachment-immersive-height);
  height: var(--attachment-immersive-height);
}

body.attachment-preview-web-fullscreen .attachment-preview-share-actions,
body.attachment-preview-web-fullscreen .attachment-preview-mobile-actions,
body.attachment-preview-chrome-hidden .attachment-preview-share-actions,
body.attachment-preview-chrome-hidden .attachment-preview-mobile-actions,
body.attachment-preview-chrome-hidden .attachment-preview-toolbar a[target="_blank"] {
  display: none !important;
}

.attachment-preview-shell:has(.attachment-image-viewer[data-fullscreen-active="true"]) .attachment-preview-toolbar a[target="_blank"] {
  display: none;
}

.attachment-preview-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  z-index: 63;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  color: #f2f6f3;
  background: rgba(12, 17, 14, 0.78);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 28px rgba(12, 17, 14, 0.18);
}

.attachment-preview-close .ui-icon {
  width: 19px;
  height: 19px;
}

.attachment-fullscreen-close .ui-icon {
  width: 19px;
  height: 19px;
}

.admin-users-page,
.admin-users-surface {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-users-surface {
  padding-top: 14px;
}

.admin-users-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-users-notice {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.admin-users-add-button {
  flex-shrink: 0;
  padding: 7px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 999px;
}

.admin-profile-compact-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.admin-user-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(17, 70, 44, 0.08);
  background: rgba(255, 255, 255, 0.94);
}

.admin-user-card-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.admin-user-name {
  display: block;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.admin-user-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.admin-user-username {
  color: var(--muted);
}

.admin-user-meta-sep {
  opacity: 0.55;
}

.admin-user-meta-warn {
  color: var(--danger);
  font-weight: 600;
}

.admin-user-meta-flag {
  color: #a56a24;
  font-weight: 600;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 2px;
}

.admin-user-actions .text-button {
  font-size: 0.8rem;
  font-weight: 600;
}

.full-preview-viewer {
  min-height: 62vh;
}

.full-preview-viewer-immersive {
  min-height: var(--attachment-immersive-height);
  height: var(--attachment-immersive-height);
}

.schema-callout,
.schema-section {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(31, 27, 18, 0.08);
  background: rgba(255, 255, 255, 0.62);
}

.schema-callout strong,
.schema-section h4 {
  margin: 0;
  font-size: 1rem;
}

.schema-callout p,
.schema-section p {
  margin: 6px 0 0;
  color: var(--muted);
}

.schema-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.schema-settings-form .schema-settings-notice {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(31, 27, 18, 0.08);
  background: rgba(255, 255, 255, 0.62);
}

.schema-settings-form .schema-section-compact {
  padding: 12px 14px;
}

.schema-settings-form .schema-section-compact .schema-section-head-tight {
  margin-bottom: 10px;
  align-items: center;
}

.schema-settings-form .schema-section-hint {
  font-family: var(--app-text-helperText-family);
  font-size: var(--app-text-helperText-size);
  font-weight: var(--app-text-helperText-weight);
  line-height: var(--app-text-helperText-line-height);
  color: var(--app-text-helperText-color);
}

.schema-settings-form .schema-inline-setting {
  margin: 0;
}

.schema-settings-form .schema-field-card {
  padding: 12px;
}

.schema-settings-form .schema-field-toolbar {
  margin-bottom: 10px;
}

.schema-settings-form .checkbox-field-surface {
  padding: 10px 12px;
}

.plugin-card {
  padding: 14px 16px;
  background:
    radial-gradient(circle at top right, rgba(24, 147, 93, 0.08), transparent 30%),
    rgba(255, 255, 255, 0.7);
}

.plugin-card-head {
  align-items: center;
  margin-bottom: 10px;
}

.plugin-card-title-block {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plugin-card-pills {
  gap: 6px;
}

.plugin-card-pills span {
  padding: 5px 9px;
  background: rgba(24, 147, 93, 0.06);
}

.plugin-card-summary {
  margin: 0;
  line-height: 1.45;
}

.plugin-card-actions {
  justify-content: flex-end;
  margin-left: auto;
}

.plugin-card-actions .secondary-button {
  padding: 10px 14px;
}

.schema-field-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.schema-field-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(31, 27, 18, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

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

.schema-field-key {
  font-family: var(--app-font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.schema-field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(180px, 0.8fr);
  gap: 12px;
}

.schema-field-appearance-grid {
  margin-top: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(180px, 0.8fr);
  align-items: stretch;
}

.schema-font-size-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schema-font-size-controls input[type='range'] {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.schema-font-size-controls input[type='range']:focus {
  outline: none;
  border-color: transparent;
}

.schema-font-size-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.schema-font-size-row input[type='number'] {
  flex: 1 1 auto;
}

.schema-font-size-controls p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

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

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.checkbox-field-surface {
  min-height: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(31, 27, 18, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.checkbox-field input {
  width: 16px;
  height: 16px;
}

.schema-field-preview {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed rgba(17, 70, 44, 0.14);
  background: rgba(245, 250, 247, 0.9);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schema-field-preview-caption,
.schema-field-preview-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.schema-field-preview-value {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schema-field-preview-value.inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.schema-field-preview strong {
  font-size: 0.96rem;
  color: var(--text);
}

.card-display-preview-badge {
  align-self: flex-start;
}

.card-display-stats-preview {
  width: 100%;
  overflow: visible;
  flex-wrap: wrap;
}

.schema-field-options-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

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

.drawer .dialog-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-top: auto;
  padding-top: 16px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
  background: linear-gradient(
    180deg,
    rgba(255, 252, 247, 0),
    rgba(255, 252, 247, 0.92) 26%,
    rgba(255, 252, 247, 1) 100%
  );
}

.manage-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(31, 27, 18, 0.08);
  background: rgba(255, 255, 255, 0.62);
}

.manage-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 1.05rem;
}

.manage-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.manage-warning {
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
  border: 1px dashed rgba(17, 70, 44, 0.12);
  background: rgba(255, 255, 255, 0.48);
}

.panel-head-compact {
  margin-bottom: 0;
}

.panel-head-compact h4 {
  margin: 0;
  font-size: 1rem;
}

.panel-head-compact p {
  margin: 4px 0 0;
}

.module-manage-shell {
  gap: 18px;
}

.module-manage-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.module-manage-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.module-manage-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(17, 70, 44, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.module-manage-row-inactive {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.56);
}

.module-manage-row-main {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(110px, 150px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.module-manage-row-inactive .module-manage-row-main {
  grid-template-columns: minmax(0, 1fr);
}

.module-manage-row-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.module-manage-row-copy strong {
  color: var(--text);
  font-size: 0.95rem;
}

.module-manage-row-copy span {
  color: var(--muted);
  font-size: 0.8rem;
}

.module-manage-input {
  width: 100%;
  min-width: 0;
}

.module-manage-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.module-manage-create {
  display: flex;
  align-items: center;
  gap: 12px;
}

.module-manage-create .module-manage-input {
  flex: 1;
}

.group-manage-shell {
  gap: 18px;
}

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

.group-manage-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.group-manage-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.group-manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(17, 70, 44, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.group-manage-row-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.group-manage-row-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
}

.group-manage-row-copy-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.group-manage-row-copy strong {
  color: var(--text);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
  flex: 1 1 auto;
}

.group-manage-row-copy span {
  color: var(--muted);
  font-size: 0.8rem;
}

.group-manage-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.group-manage-row-actions-inline {
  width: auto;
  justify-content: flex-end;
}

.record-actions-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.workspace-page,
.projects-page,
.attachment-preview-page {
  gap: 12px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .record-item {
    grid-template-columns: 1fr;
  }

  .record-side {
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
  }

  .hero-strip {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 860px) {
  input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not([type='color']):not([type='button']):not([type='submit']):not([type='reset']),
  textarea,
  select {
    font-size: 16px;
  }

  .topbar,
  .page {
    padding-left: 18px;
    padding-right: 18px;
  }

  .topbar {
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 14px;
    align-items: center;
  }

  .global-nav-fab {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
  }

  .page-intro {
    min-height: auto;
    padding: 14px 16px;
  }

  .page-intro h1 {
    max-width: none;
    font-size: clamp(1.3rem, 6vw, 1.7rem);
  }

  .page-intro p {
    font-size: 0.88rem;
  }

  .table-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: flex-start;
  }

  .table-header {
    display: none;
  }

  .project-list-entry {
    padding: 0;
  }

  .project-list-card {
    gap: 12px;
  }

  .module-grid {
    gap: 12px;
  }

  .project-row-main-button {
    width: 100%;
  }

  .project-row-toolbar {
    align-items: center;
  }

  .project-group-head {
    min-height: 38px;
    padding: 0 52px 0 0;
  }

  .project-group-head-actions {
    position: absolute;
    top: 0;
    right: 0;
    width: auto;
  }

  .schema-field-grid,
  .schema-list-grid,
  .schema-field-options-grid {
    grid-template-columns: 1fr;
  }

  .attachment-item {
    grid-template-columns: minmax(148px, 188px) minmax(0, 1fr);
  }

  .search-result-card {
    grid-template-columns: 1fr;
  }

  .search-result-entry {
    justify-content: flex-start;
  }

  .attachment-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .record-detail-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 680px) {
  .page {
    gap: 12px;
  }

  .page-intro,
  .surface,
  .empty-state,
  .modal,
  .drawer {
    border-radius: 20px;
  }

  .overlay-bottom-sheet {
    align-items: flex-end;
  }

  .modal-bottom-sheet {
    width: 100%;
    max-height: min(88dvh, 88vh);
    border-radius: 24px 24px 0 0;
    padding: 10px 12px 14px;
  }

  .attachment-sheet-modal .panel-head {
    margin-bottom: 8px;
  }

  .attachment-sheet-modal .panel-head h3 {
    font-size: 1.02rem;
  }

  .attachment-sheet-modal .panel-head p {
    margin-top: 4px;
  }

  .attachment-action-dialog {
    gap: 10px;
  }

  .attachment-action-list {
    padding: 3px;
    border-radius: 16px;
  }

  .attachment-action-list-item {
    min-height: 52px;
    border-radius: 12px;
    font-size: 1rem;
  }

  .attachment-action-list-item .ui-icon {
    width: 18px;
    height: 18px;
  }

  .attachment-sheet-title {
    padding-bottom: 0;
  }

  .attachment-sheet-title strong {
    font-size: 0.86rem;
  }

  .attachment-sheet-title span {
    font-size: 0.74rem;
  }

  .attachment-sheet-cancel {
    min-height: 50px;
    border-radius: 16px;
    margin-top: 8px;
  }

  .attachment-qr-card {
    min-height: 264px;
    border-radius: 18px;
  }

  .page-intro h1 {
    font-size: clamp(1.24rem, 7vw, 1.6rem);
  }

  .page-intro p {
    margin-top: 6px;
    font-size: 0.84rem;
  }

  .hero-strip {
    gap: 10px;
  }

  .hero-strip > div {
    min-height: 0;
    padding: 14px 14px;
    border-radius: 18px;
  }

  .attachment-qr-card {
    min-height: 280px;
    padding: 14px;
  }

  .hero-label {
    font-size: 0.72rem;
  }

  .hero-strip h2 {
    margin-top: 8px;
    font-size: clamp(1.1rem, 5.6vw, 1.5rem);
    line-height: 1.15;
  }

  .hero-strip p {
    margin-top: 6px;
    font-size: 0.76rem;
    line-height: 1.35;
  }

  .surface {
    padding: 18px 16px;
  }

  .module-records-surface,
  .breadcrumb-surface,
  .record-item,
  .attachment-item {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .record-item,
  .attachment-item,
  .record-attachments {
    content-visibility: auto;
    contain: layout paint style;
  }

  .record-item {
    contain-intrinsic-size: 960px;
  }

  .attachment-item {
    contain-intrinsic-size: 420px;
  }

  .record-attachments {
    contain-intrinsic-size: 520px;
  }

  

  .projects-search-shell {
    min-height: 50px;
    padding: 0 14px;
  }

  .global-search-hero {
    gap: 16px;
    padding: 18px 16px;
  }

  .global-search-copy h1 {
    font-size: clamp(1.25rem, 6vw, 1.6rem);
  }

  .global-search-copy p {
    font-size: 0.84rem;
    line-height: 1.5;
  }

  .section-head {
    margin-bottom: 14px;
    align-items: flex-start;
    flex-direction: column;
  }

  .section-head-tools,
  .breadcrumb-head {
    width: 100%;
    justify-content: space-between;
  }

  .breadcrumb-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .breadcrumb-head-inline {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
  }

  .breadcrumb-head .section-head-tools {
    width: auto;
    min-width: max-content;
    justify-content: flex-end;
  }

  .breadcrumb-head-inline .section-head-tools {
    align-self: auto;
  }

  .schema-section-head,
  .schema-field-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .security-section-head {
    align-items: flex-start;
  }

  .section-head h3,
  .empty-state h3,
  .panel-head h3,
  .record-item h4 {
    font-size: 1.1rem;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

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

  .module-grid-service {
    grid-template-columns: repeat(var(--workspace-module-columns, 4), minmax(0, 1fr));
    gap: 10px;
  }

  .module-tile {
    min-height: 0;
    padding: 16px 14px;
    border-radius: 18px;
  }

  .service-module-tile {
    min-height: 0;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    padding: 14px 8px 10px;
    text-align: center;
    border-radius: 22px;
  }

  .service-module-tile::before {
    display: none;
  }

  .module-badge {
    width: 56px;
    min-height: 56px;
    border-radius: 16px;
    font-size: 0.92rem;
  }

  .module-badge-type {
    right: -6px;
    bottom: -6px;
    min-width: 26px;
    padding: 2px 5px;
    font-size: 0.52rem;
  }

  .module-badge-add > span:first-child {
    min-height: 52px;
  }

  .module-badge-add .module-badge-type {
    min-width: 26px;
    padding: 2px 5px;
    font-size: 0.52rem;
  }

  .module-tile p {
    max-width: none;
  }

  .service-module-tile p {
    display: none;
  }

  .module-footer {
    padding-top: 18px;
  }

  .service-module-footer {
    margin-top: 6px;
    padding-top: 0;
    flex-direction: row;
    gap: 4px;
    font-size: 0.66rem;
    color: var(--muted);
    flex-wrap: wrap;
  }

  .module-tile-edit-corner {
    top: 6px;
    right: 6px;
    min-width: 34px;
    min-height: 20px;
    padding: 0 6px;
    font-size: 0.62rem;
  }

  .module-settings-summary {
    grid-template-columns: 1fr;
  }

  .workspace-module-grid-select {
    min-height: 34px;
    padding: 3px;
    font-size: 0.72rem;
  }

  .workspace-module-grid-select span {
    padding: 0 5px 0 7px;
  }

  .workspace-module-grid-select button {
    min-width: 30px;
    height: 28px;
  }

  .workspace-module-settings-toggle {
    width: auto;
  }

  .module-settings-hero {
    grid-template-columns: 1fr;
  }

  .module-settings-hero-badge {
    width: 60px;
    min-width: 60px;
    height: 60px;
    border-radius: 20px;
  }

  .module-settings-input-shell {
    padding: 16px;
    border-radius: 20px;
  }

  .module-settings-name-input {
    min-height: 50px;
    font-size: 1rem;
  }

  .project-group-head,
  .project-row-toolbar,
  .group-manage-row,
  .group-manage-form-actions,
  .module-manage-row,
  .module-manage-create {
    flex-direction: column;
    align-items: stretch;
  }

  .project-row-toolbar-actions,
  .group-manage-row-actions,
  .module-manage-row-actions {
    width: 100%;
    justify-content: space-between;
  }

  .group-manage-row-actions-inline {
    width: auto;
    justify-content: flex-end;
  }

  .project-card-name-badge {
    width: 100%;
  }

  .project-group-heading,
  .group-manage-row-main,
  .module-manage-row-main {
    width: 100%;
  }

  .group-manage-row-main {
    align-items: flex-start;
  }

  .group-manage-row-copy-head {
    width: 100%;
  }

  .module-manage-row-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-user-copy {
    display: none;
  }

  .topbar-user-block {
    padding-left: 0;
    border-left: 0;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .manage-summary {
    grid-template-columns: 1fr;
  }

  .dialog-actions button,
  .dialog-actions .button-link,
  .primary-button,
  .ghost-button {
    width: 100%;
    justify-content: center;
  }

  .record-item {
    padding: 16px;
  }

  .auth-screen {
    padding: 20px 14px;
  }

  .auth-card {
    padding: 22px 18px;
    border-radius: 22px;
  }

  .admin-users-toolbar {
    justify-content: space-between;
  }

  .admin-users-add-button {
    width: auto;
  }

  .admin-user-grid {
    grid-template-columns: 1fr;
  }

  .security-layout,
  .security-checkbox-grid {
    grid-template-columns: 1fr;
  }

  .security-tabs {
    width: 100%;
    justify-content: stretch;
  }

  .security-tab {
    flex: 1 1 0;
    min-width: 0;
  }

  .record-actions-inline {
    position: absolute;
    top: 14px;
    right: 14px;
    width: auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .record-main-head.has-record-actions {
    padding-right: 84px;
  }

  .record-attachments-head {
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .record-attachments-head > div {
    min-width: 0;
    flex: 1 1 auto;
  }

  .record-attachments-switcher.attachment-view-switcher {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
    flex: 0 0 auto;
    gap: 4px;
  }

  .attachment-list-toolbar {
    justify-content: stretch;
  }

  .attachment-view-switcher {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .record-attachments-switcher.attachment-view-switcher .attachment-view-switcher-button {
    flex: 0 0 auto;
    min-width: 0;
    padding: 0 10px;
  }

  .attachment-view-switcher-button {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 8px;
  }

  .attachment-item {
    grid-template-columns: 1fr;
  }

  .attachment-item.readonly,
  .attachment-item.readonly * {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  .project-list-surface .project-list-card,
  .project-list-surface .project-list-card *,
  .project-list-surface .project-card-name-button,
  .project-list-surface .project-card-name-button *,
  .project-list-surface .project-card-name-badge,
  .project-list-surface .project-card-name-badge *,
  .project-list-surface .project-card-title,
  .project-list-surface .project-card-title *,
  .project-list-surface .project-card-index-badge,
  .project-list-surface .project-card-index-badge *,
  .project-list-surface .project-card-corner-pill,
  .project-list-surface .project-card-corner-pill *,
  .workspace-module-surface .module-tile,
  .workspace-module-surface .module-tile *,
  .workspace-module-surface .module-badge,
  .workspace-module-surface .module-badge *,
  .workspace-module-surface .module-footer,
  .workspace-module-surface .module-footer *,
  .workspace-module-surface .service-module-footer,
  .workspace-module-surface .service-module-footer *,
  .workspace-module-surface .module-tile-edit-corner,
  .workspace-module-surface .module-tile-edit-corner * {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  .project-list-surface .project-list-card button,
  .project-list-surface .project-list-card a,
  .workspace-module-surface .module-tile button,
  .workspace-module-surface .module-tile a {
    -webkit-touch-callout: none;
  }

  .global-search-results-surface .search-result-card,
  .global-search-results-surface .search-result-card *,
  .global-search-results-surface .search-result-card-head,
  .global-search-results-surface .search-result-card-head *,
  .global-search-results-surface .search-result-card-body,
  .global-search-results-surface .search-result-card-body *,
  .global-search-results-surface .search-result-title,
  .global-search-results-surface .search-result-title *,
  .global-search-results-surface .search-result-location,
  .global-search-results-surface .search-result-location *,
  .global-search-results-surface .search-result-match,
  .global-search-results-surface .search-result-match *,
  .global-search-results-surface .search-result-entry,
  .global-search-results-surface .search-result-entry * {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  .global-search-results-surface .search-result-card button,
  .global-search-results-surface .search-result-card a {
    -webkit-touch-callout: none;
  }

  .record-attachments .attachment-item.readonly .attachment-serial,
  .record-attachments .attachment-item.readonly .attachment-serial *,
  .record-attachments .attachment-item.readonly .attachment-title-block,
  .record-attachments .attachment-item.readonly .attachment-title-block *,
  .record-attachments .attachment-item.readonly .attachment-link,
  .record-attachments .attachment-item.readonly .attachment-link *,
  .record-attachments .attachment-item.readonly .attachment-summary-trigger,
  .record-attachments .attachment-item.readonly .attachment-summary-trigger *,
  .record-attachments .attachment-item.readonly .attachment-list-mode-meta,
  .record-attachments .attachment-item.readonly .attachment-list-mode-meta *,
  .record-attachments .attachment-item.readonly .attachment-kind,
  .record-attachments .attachment-item.readonly .attachment-kind * {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  .record-attachments .attachment-item.readonly a,
  .record-attachments .attachment-item.readonly button {
    -webkit-touch-callout: none;
  }

  .module-records-surface.mobile-copy-lock .record-main-header-copy,
  .module-records-surface.mobile-copy-lock .record-detail-grid,
  .module-records-surface.mobile-copy-lock .record-side {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  .module-records-surface.mobile-copy-lock .record-field-copy-button,
  .module-records-surface.mobile-copy-lock .record-field-copy-button * {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  .attachment-preview-button {
    width: 100%;
  }

  .attachment-tile {
    aspect-ratio: 16 / 9;
  }

  .attachment-meta-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .attachment-item.list-mode .attachment-meta-head {
    flex-direction: row;
    align-items: center;
  }

  .attachment-item.list-mode.readonly {
    cursor: default;
  }

  .attachment-item.readonly .attachment-badges {
    display: none;
  }

  

  

  

  .attachment-item.list-mode .attachment-meta-head-main {
    width: auto;
    flex: 1 1 auto;
    align-items: center;
  }

  .attachment-actions {
    justify-content: stretch;
  }

  

  

  .attachment-action-button {
    flex: 1 1 calc(50% - 6px);
  }

  

  

  

  .drawer {
    width: 100%;
    border-radius: 24px 24px 0 0;
    margin-top: auto;
    height: min(92vh, 860px);
    padding: 20px 16px 12px;
    transform: translateY(100%);
  }

  .drawer .dialog-actions {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .drawer-backdrop {
    align-items: flex-end;
  }

  .drawer-backdrop.open .drawer {
    transform: translateY(0);
  }

  .attachment-viewer {
    min-height: 280px;
  }

  

  

  .attachment-image-viewer {
    padding: 12px;
  }

  .attachment-image-stage {
    min-height: 260px;
    padding: 12px;
  }

  

  .preview-surface-full {
    min-height: calc(100svh - 132px);
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .attachment-preview-page {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .attachment-preview-shell .topbar {
    display: none;
  }

  .attachment-preview-page {
    padding: 0;
    gap: 0;
  }

  .preview-surface-mobile {
    min-height: 100svh;
    width: 100vw;
    max-width: 100vw;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #0c110e;
    box-shadow: none;
    overflow-x: hidden;
  }

  .attachment-preview-mobile-shell {
    position: relative;
    min-height: 100svh;
    width: 100vw;
    max-width: 100vw;
    background: #0c110e;
    overflow: hidden;
  }

  .attachment-preview-mobile-shell .attachment-preview-close {
    position: fixed;
    z-index: 81;
  }

  .attachment-preview-mobile-shell .attachment-viewer {
    min-height: 100svh;
    width: 100%;
    max-width: 100vw;
    border: 0;
    border-radius: 0;
    background: #0c110e;
  }

  .attachment-preview-mobile-shell .full-preview-viewer {
    min-height: 100svh;
    width: 100%;
    max-width: 100vw;
  }

  

  .attachment-preview-mobile-shell .attachment-image-stage {
    min-height: 100svh;
    padding: 0;
    border-radius: 0;
    background: #0c110e;
  }

  .attachment-preview-mobile-shell .attachment-viewer-image {
    max-height: 100svh;
    background: transparent;
  }

  

  

  

  

  

  

  

  

  

  .attachment-preview-modal {
    width: min(100vw, calc(100vw - 12px));
    max-height: calc(100dvh - 12px);
    padding: 16px;
    border-radius: 22px;
  }

  

  

  .attachment-preview-enter-hitbox {
    position: absolute;
    inset: 0;
    z-index: 2;
    border: 0;
    padding: 0;
    background: transparent;
  }

  .attachment-preview-mobile-shell.is-fullscreen .attachment-preview-enter-hitbox {
    display: none;
  }

  .attachment-preview-immersive.is-fullscreen .attachment-preview-enter-hitbox {
    display: none;
  }

  body.attachment-preview-web-fullscreen .attachment-preview-share-actions,
  body.attachment-preview-web-fullscreen .attachment-preview-mobile-actions,
  body.attachment-preview-chrome-hidden .attachment-preview-share-actions,
  body.attachment-preview-chrome-hidden .attachment-preview-mobile-actions,
  body.attachment-preview-chrome-hidden .attachment-preview-toolbar a[target="_blank"] {
    display: none !important;
  }

  .attachment-preview-shell:has(.attachment-image-viewer[data-fullscreen-active="true"]) .attachment-preview-toolbar a[target="_blank"] {
    display: none;
  }

  

  .breadcrumb-surface {
    padding: 14px 16px;
  }

  .view-toggle-group {
    width: 100%;
    justify-content: flex-end;
  }

  .view-mode-button {
    flex: 1;
    justify-content: center;
  }
}
