:root {
  color-scheme: light;
  --bg: #f2efe7;
  --bg-2: #e4ebdf;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --surface-dark: rgba(20, 34, 27, 0.86);
  --text: #1f2d24;
  --muted: #647466;
  --line: rgba(31, 45, 36, 0.12);
  --shadow: 0 24px 80px rgba(25, 40, 31, 0.16);
  --accent: #6d8d59;
  --accent-2: #c19c58;
  --danger: #9d4d4d;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --content-width: clamp(1200px, 82vw, 1440px);
  --page-gap: clamp(1rem, 1.8vw, 1.5rem);
  --page-gutter: clamp(1rem, 2vw, 1.5rem);
  --sidebar-rail-width: clamp(4.75rem, 5vw, 5.5rem);
  --sidebar-width: clamp(16rem, 20vw, 18rem);
  --font-display: "Iowan Old Style", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --font-body: "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: clamp(15px, 0.35vw + 13.5px, 17px);
}

html,
body {
  margin: 0;
  min-height: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(109, 141, 89, 0.14), transparent 32%),
    radial-gradient(circle at right 15%, rgba(193, 156, 88, 0.14), transparent 22%),
  linear-gradient(135deg, var(--bg), var(--bg-2));
  overflow-x: hidden;
}

body.is-sidebar-open {
  overflow: hidden;
}

body.is-field-sheet-open {
  overflow: auto;
}

body.is-pin-sheet-open {
  overflow: auto;
}

body.is-entity-modal-open {
  overflow: auto;
}

body.is-delete-modal-open {
  overflow: hidden;
}

body.is-fields-fullscreen {
  overflow: hidden;
}

body.is-loading-overlay-visible {
  overflow: hidden;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.table-card::-webkit-scrollbar {
  width: 0;
  height: 0;
}

html,
body,
.table-card {
  scrollbar-color: transparent transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(31, 45, 36, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 45, 36, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent);
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.hero {
  display: none !important;
}

.bg-orb {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(10px);
  pointer-events: none;
  opacity: 0.38;
}

.bg-orb-a {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(109, 141, 89, 0.35), transparent 70%);
  top: -140px;
  right: -80px;
}

.bg-orb-b {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(193, 156, 88, 0.26), transparent 68%);
  bottom: -120px;
  left: -100px;
}

.app-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.auth-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 2rem);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 2rem);
  background:
    radial-gradient(circle at 18% 18%, rgba(109, 141, 89, 0.24), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(193, 156, 88, 0.18), transparent 28%),
    radial-gradient(circle at 50% 112%, rgba(31, 45, 36, 0.16), transparent 30%),
    rgba(242, 239, 231, 0.72);
  backdrop-filter: blur(22px) saturate(118%);
  -webkit-backdrop-filter: blur(22px) saturate(118%);
}

.loading-overlay-card {
  position: relative;
  width: min(42rem, 100%);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid rgba(31, 45, 36, 0.12);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.72)),
    rgba(255, 255, 255, 0.88);
  box-shadow: 0 34px 100px rgba(21, 35, 27, 0.22);
  overflow: hidden;
}

.loading-overlay-card::before,
.loading-overlay-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.loading-overlay-card::before {
  background:
    linear-gradient(130deg, rgba(109, 141, 89, 0.18), transparent 28%),
    linear-gradient(230deg, transparent 58%, rgba(193, 156, 88, 0.12) 100%);
  mix-blend-mode: screen;
  opacity: 0.9;
}

.loading-overlay-card::after {
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 34px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.loading-overlay-visual {
  position: relative;
  width: 6.75rem;
  height: 6.75rem;
}

.loading-orbit {
  position: absolute;
  inset: 0;
  border-radius: 999px;
}

.loading-orbit--outer {
  border: 1px solid rgba(109, 141, 89, 0.18);
  animation: loadingSpin 16s linear infinite;
}

.loading-orbit--outer::after {
  content: "";
  position: absolute;
  top: -0.34rem;
  left: 50%;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), #7fa266);
  box-shadow: 0 0 0 6px rgba(109, 141, 89, 0.12);
}

.loading-orbit--inner {
  inset: 0.78rem;
  border: 1px solid rgba(193, 156, 88, 0.18);
  animation: loadingSpinReverse 11s linear infinite;
}

.loading-orbit--pulse {
  inset: 1.68rem;
  border: 1px solid rgba(31, 45, 36, 0.08);
  animation: loadingPulse 2.4s ease-in-out infinite;
}

.loading-core {
  position: absolute;
  inset: 1.72rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(235, 243, 231, 0.96));
  box-shadow: 0 16px 30px rgba(31, 45, 36, 0.14);
}

.loading-core svg {
  width: 1.95rem;
  height: 1.95rem;
  color: var(--accent);
}

.loading-overlay-card > * {
  position: relative;
  z-index: 1;
}

.loading-overlay-copy {
  margin-top: 1rem;
}

.loading-overlay-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
}

.loading-overlay-copy p {
  margin: 0.6rem 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.loading-overlay-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.loading-overlay-chips span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.48rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(109, 141, 89, 0.16);
  background: rgba(109, 141, 89, 0.1);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.loading-overlay-chips span:nth-child(2) {
  animation: loadingChipPulse 2.8s ease-in-out infinite;
}

.loading-overlay-chips span:nth-child(3) {
  animation: loadingChipPulse 2.8s ease-in-out infinite 0.5s;
}

.loading-overlay-meter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.72rem;
  margin-top: 1.4rem;
}

.loading-overlay-meter span {
  position: relative;
  height: 0.5rem;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(31, 45, 36, 0.08);
}

.loading-overlay-meter span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(109, 141, 89, 0.92), rgba(193, 156, 88, 0.88), transparent);
  transform: translateX(-110%);
  animation: loadingSweep 1.8s ease-in-out infinite;
}

.loading-overlay-detail {
  margin: 0.95rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.loading-overlay-shell {
  display: grid;
  justify-items: center;
  gap: 1rem;
  width: min(26rem, 100%);
}

.loading-spinner {
  position: relative;
  width: clamp(4.5rem, 10vw, 5.8rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(from 90deg, var(--accent), var(--accent-2), var(--accent), rgba(255, 255, 255, 0.12) 78%, rgba(255, 255, 255, 0) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
  animation: loadingSpin 0.9s linear infinite;
  filter: drop-shadow(0 14px 24px rgba(109, 141, 89, 0.18));
}

.loading-spinner::before {
  content: "";
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.96), rgba(246, 241, 230, 0.76));
  box-shadow: inset 0 0 0 1px rgba(31, 45, 36, 0.08);
}

.loading-spinner::after {
  content: "";
  position: absolute;
  inset: -0.65rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(193, 156, 88, 0.24), rgba(109, 141, 89, 0.14), transparent 72%);
  filter: blur(8px);
  opacity: 0.85;
  z-index: -1;
}

.loading-spinner--mini {
  width: 2.4rem;
  filter: none;
  animation-duration: 0.8s;
}

.loading-spinner--mini::before {
  inset: 26%;
}

.loading-overlay-copy {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  text-align: center;
  margin-top: 0;
}

.skeleton {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 45, 36, 0.08);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.44), transparent);
  transform: translateX(-120%);
  animation: skeletonShimmer 1.5s ease-in-out infinite;
}

.skeleton-line {
  height: 0.9rem;
}

.skeleton-line--xl {
  width: min(16rem, 100%);
  height: 1.05rem;
}

.skeleton-line--lg {
  width: 100%;
  height: 0.95rem;
}

.skeleton-line--md {
  width: 72%;
}

.skeleton-line--sm {
  width: 48%;
  height: 0.72rem;
}

.skeleton-chip {
  width: 4.8rem;
  height: 1.4rem;
}

.skeleton-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
}

.skeleton-pill {
  width: 4.8rem;
  height: 1.15rem;
}

.skeleton-block {
  min-height: 3.25rem;
  border-radius: 18px;
}

.loading-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 6px rgba(109, 141, 89, 0.12);
  animation: loadingPulse 1.8s ease-in-out infinite;
  flex: none;
}

.field-detail-loading-note {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.92rem;
  padding: 0 4px;
}

.field-detail-head--loading,
.field-detail-actions--loading {
  align-items: center;
}

.field-detail-loading-copy {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

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

.field-detail-stat--loading strong {
  min-height: 1.2rem;
}

.field-detail-alert--loading {
  min-height: 3rem;
}

.field-detail-record-skeleton {
  display: grid;
  gap: 0.55rem;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.76);
}

.weather-card--loading {
  gap: 14px;
}

.weather-pill--loading {
  background: rgba(31, 45, 36, 0.06);
  color: var(--muted);
}

.weather-pill-spinner {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: loadingSpin 0.8s linear infinite;
  flex: none;
}

.weather-loading {
  display: grid;
  gap: 14px;
}

.weather-loading-hero {
  display: flex;
  align-items: center;
  gap: 12px;
}

.weather-loading-lines {
  display: grid;
  gap: 8px;
  width: min(18rem, 100%);
}

.weather-loading-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.weather-loading-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(31, 45, 36, 0.08);
  background: rgba(255, 255, 255, 0.58);
}

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

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

@keyframes loadingPulse {
  0%,
  100% {
    transform: scale(0.98);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

@keyframes loadingSweep {
  0% {
    transform: translateX(-110%);
  }
  50% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(110%);
  }
}

@keyframes loadingChipPulse {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 0 rgba(109, 141, 89, 0);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 0 0 6px rgba(109, 141, 89, 0.08);
  }
}

@keyframes skeletonShimmer {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@media (max-width: 720px) {
  .loading-overlay-card {
    padding: 1.25rem;
    border-radius: 28px;
  }

  .loading-overlay-visual {
    width: 6rem;
    height: 6rem;
  }

  .loading-overlay-copy h2 {
    font-size: clamp(1.5rem, 7vw, 2.1rem);
  }

  .loading-overlay-chips {
    justify-content: center;
  }

  .loading-overlay-shell {
    width: min(22rem, 100%);
  }

  .weather-loading-grid {
    grid-template-columns: 1fr;
  }

  .field-detail-grid--loading {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner,
  .loading-spinner::after,
  .loading-spinner--mini,
  .weather-pill-spinner,
  .skeleton::after,
  .loading-dot {
    animation: none !important;
  }
}

.auth-card {
  width: min(34rem, 100%);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface-strong);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}

.auth-card h1,
.hero h1,
.panel h3,
.chart-card h4 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}

.auth-card h1 {
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  line-height: 1.05;
  margin-bottom: 16px;
}

.lede {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
}

.login-form,
.editor {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.login-form label,
.editor label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.login-form span,
.editor span {
  font-size: 0.86rem;
  color: var(--muted);
}

.login-form input,
.editor input,
.editor select,
.editor textarea {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(31, 45, 36, 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.login-form input:focus,
.editor input:focus,
.editor select:focus,
.editor textarea:focus {
  border-color: rgba(109, 141, 89, 0.72);
  box-shadow: 0 0 0 4px rgba(109, 141, 89, 0.12);
}

.primary,
.ghost,
.nav-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.primary {
  color: white;
  background: linear-gradient(135deg, var(--accent), #567244);
  box-shadow: 0 14px 28px rgba(86, 114, 68, 0.26);
}

.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
}

.primary:hover,
.ghost:hover,
.nav-btn:hover {
  transform: translateY(-1px);
}

.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.workspace {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: var(--page-gap);
  padding: var(--page-gutter);
}

.sidebar-backdrop {
  display: none;
}

.sidebar {
  position: sticky;
  top: var(--page-gutter);
  height: calc(100dvh - (var(--page-gutter) * 2));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--page-gap);
  padding: var(--page-gutter);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface-dark);
  color: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  overflow: hidden;
  overscroll-behavior: auto;
}

.mobile-topbar {
  display: none;
}

.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.mobile-menu-icon {
  display: grid;
  gap: 4px;
}

.mobile-menu-icon span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.brand {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
}

.sidebar-brand-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.9rem;
  height: 2.9rem;
  min-width: 2.9rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.sidebar-brand-toggle:focus-visible {
  outline: 2px solid rgba(109, 141, 89, 0.6);
  outline-offset: 3px;
}

.sidebar-brand-mark {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.brand-copy h2,
.hero h1 {
  font-family: var(--font-display);
  margin: 0;
}

.brand-copy h2 {
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
  line-height: 1.05;
}

.brand-copy .eyebrow {
  margin: 0;
  font-size: 0.72rem;
}

.nav {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: auto;
  padding-right: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  text-align: left;
  text-decoration: none;
  padding: 9px 12px;
  min-height: 40px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-label,
.button-label {
  display: inline;
}

.nav-btn .sidebar-icon,
#logout-btn .sidebar-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-btn.is-active {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
  display: grid;
  gap: 14px;
  min-height: 0;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-card {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.muted {
  color: var(--muted);
}

.main {
  display: grid;
  gap: clamp(1rem, 1.6vw, 1.25rem);
  align-content: start;
  justify-self: center;
  width: min(var(--content-width), 100%);
  min-width: 0;
}

body.is-fields-fullscreen .workspace {
  display: block;
  height: 100dvh;
  width: 100%;
  padding: 0;
  overflow: hidden;
}

body.is-fields-fullscreen .main {
  width: 100%;
  max-width: none;
  min-height: 0;
}

.hero,
.panel,
.chart-card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px 30px;
}

.hero h1 {
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  line-height: 0.95;
  margin-bottom: 12px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.panel {
  display: none;
  padding: clamp(1rem, 1.8vw, 1.5rem);
}

.panel.is-active {
  display: grid;
  gap: clamp(1rem, 1.4vw, 1.25rem);
}

body.is-fields-fullscreen .panel[data-panel="fields"].is-active {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.panel-header,
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.chart-card--ring .chart-head {
  display: grid;
  gap: 4px;
  align-items: start;
  justify-items: start;
}

#dashboard-composition-label {
  display: grid;
  gap: 4px;
  max-width: min(48ch, 100%);
  white-space: normal;
  line-height: 1.5;
  text-wrap: balance;
}

#dashboard-composition-label .dashboard-composition-main {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

#dashboard-composition-label .dashboard-composition-sub {
  font-size: 0.84rem;
  color: var(--muted);
}

.panel-header h3 {
  font-size: clamp(1.3rem, 1.8vw, 1.6rem);
}

.panel-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.panel-toolbar > .filter-bar {
  flex: 1 1 100%;
}

body.is-filter-ui-ready .panel-toolbar > .filter-bar {
  display: none;
}

.filter-launcher-slot {
  position: fixed;
  top: clamp(0.85rem, 1.6vw, 1.25rem);
  right: clamp(0.85rem, 1.6vw, 1.25rem);
  z-index: 1150;
  display: inline-flex;
  width: auto;
  height: auto;
  pointer-events: none;
}

.filter-launcher-button {
  width: 3.15rem;
  height: 3.15rem;
  min-width: 3.15rem;
  padding: 0;
  border-radius: 999px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  border: 1px solid rgba(31, 45, 36, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 10px 20px rgba(25, 40, 31, 0.08);
  backdrop-filter: blur(12px) saturate(125%);
  -webkit-backdrop-filter: blur(12px) saturate(125%);
  pointer-events: auto;
}

.filter-launcher-button.icon-button svg {
  width: 2.35rem;
  height: 2.35rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  shape-rendering: geometricPrecision;
  display: block;
  transform: none;
}

.filter-launcher-button.is-active {
  border-color: rgba(109, 141, 89, 0.34);
  background: rgba(255, 255, 255, 0.72);
  color: #446033;
  box-shadow:
    0 0 0 3px rgba(109, 141, 89, 0.12),
    0 10px 20px rgba(25, 40, 31, 0.08);
}

.filter-drawer {
  position: fixed;
  inset: 0;
  z-index: 3020;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.filter-drawer[hidden] {
  display: none !important;
}

.filter-drawer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(17, 29, 22, 0.42);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 240ms ease;
  cursor: pointer;
}

.filter-drawer-panel {
  position: relative;
  z-index: 1;
  width: min(34rem, calc(100vw - 1.5rem));
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-left: 1px solid rgba(31, 45, 36, 0.12);
  border-radius: 24px 0 0 24px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  box-shadow: -28px 0 48px rgba(25, 40, 31, 0.2);
  transform: translateX(104%);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
}

.filter-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.1rem 0.85rem;
}

.filter-drawer-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  line-height: 1.15;
}

.filter-drawer-lead {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.filter-drawer-close {
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  padding: 0;
}

.filter-drawer-close svg {
  width: 1.15rem;
  height: 1.15rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.filter-drawer-body {
  min-height: 0;
  overflow: auto;
  padding: 0 1.1rem 1.1rem;
}

.filter-drawer .filter-bar {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.7rem 0.8rem;
}

.filter-drawer .button-row.compact {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

body.is-filter-drawer-open {
  overflow: auto;
}

body.is-filter-drawer-open .filter-drawer {
  pointer-events: auto;
}

body.is-filter-drawer-open .filter-drawer-backdrop {
  opacity: 1;
}

body.is-filter-drawer-open .filter-drawer-panel {
  transform: translateX(0);
}

.section-actions {
  position: fixed;
  right: clamp(0.85rem, 1.6vw, 1.25rem);
  bottom: clamp(0.85rem, 1.6vw, 1.25rem);
  z-index: 1150;
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
  pointer-events: none;
}

.section-actions .create-launcher-button {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.35rem;
  height: 3.35rem;
  min-width: 3.35rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--accent), #567244);
  box-shadow: 0 14px 28px rgba(86, 114, 68, 0.26), 0 8px 16px rgba(25, 40, 31, 0.08);
}

.section-actions .create-launcher-button svg {
  width: 1.7rem;
  height: 1.7rem;
  fill: currentColor;
  stroke: none;
  display: block;
}

.section-actions .create-launcher-button:hover {
  transform: translateY(-1px);
}

.panel[data-panel="bojo"],
.panel[data-panel="staff"],
.panel[data-panel="assistant_income"],
.panel[data-panel="expenses"],
.panel[data-panel="categories"],
.panel[data-panel="crop_masters"],
.panel[data-panel="pesticide_masters"] {
  padding-bottom: clamp(4rem, 6vw, 4.75rem);
}

.page-summary {
  --summary-accent: var(--accent);
  --summary-accent-soft: rgba(109, 141, 89, 0.12);
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 16px;
  margin-top: 12px;
  padding: 18px 20px 20px;
  border-radius: 24px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.8)),
    radial-gradient(circle at top right, var(--summary-accent-soft), transparent 60%);
  box-shadow: 0 18px 40px rgba(25, 40, 31, 0.08);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.page-summary::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, var(--summary-accent), rgba(255, 255, 255, 0));
}

.page-summary::after {
  content: "";
  position: absolute;
  top: -42px;
  right: -46px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--summary-accent-soft), transparent 70%);
  opacity: 0.9;
  pointer-events: none;
}

.page-summary--bojo {
  --summary-accent: #6d8d59;
  --summary-accent-soft: rgba(109, 141, 89, 0.14);
}

.page-summary--staff {
  --summary-accent: #4f6d8a;
  --summary-accent-soft: rgba(79, 109, 138, 0.14);
}

.page-summary--assistant_income {
  --summary-accent: #b08a3d;
  --summary-accent-soft: rgba(176, 138, 61, 0.14);
}

.page-summary--expenses {
  --summary-accent: #9d4d4d;
  --summary-accent-soft: rgba(157, 77, 77, 0.14);
}

.page-summary__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.page-summary__heading {
  min-width: 0;
}

.page-summary__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  color: var(--summary-accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.page-summary__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
}

.page-summary__period {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.page-summary__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  position: relative;
  z-index: 1;
}

.page-summary__amount-block {
  display: grid;
  gap: 6px;
  align-content: start;
}

.page-summary__label {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-summary__amount {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1;
  font-weight: 900;
  color: var(--summary-accent);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.page-summary__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.summary-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--summary-accent);
  box-shadow: 0 0 0 4px var(--summary-accent-soft);
}

.summary-pill--strong {
  background: linear-gradient(135deg, var(--summary-accent-soft), rgba(255, 255, 255, 0.94));
  border-color: rgba(31, 45, 36, 0.08);
}

.toolbar-actions {
  margin-left: auto;
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.toolbar-actions.wrap {
  flex-wrap: wrap;
  gap: 10px;
}

.page-summary--fields {
  --summary-accent: #4f7c91;
  --summary-accent-soft: rgba(79, 124, 145, 0.16);
}

.page-summary--workdays {
  --summary-accent: #5d6f93;
  --summary-accent-soft: rgba(93, 111, 147, 0.16);
}

.field-layout {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.field-sidebar {
  position: absolute;
  inset: 1rem auto 1rem 1rem;
  width: min(31rem, 54vw);
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
  padding: 18px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(31, 45, 36, 0.12);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  z-index: 800;
}

.field-list-card,
.field-detail-card,
.field-map-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.field-map-card {
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  min-width: 0;
  height: 100%;
  min-height: 0;
}

.field-list-head,
.field-detail-head {
  display: grid;
  gap: 10px;
}

.field-detail-head-main {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.field-list-head h4,
.field-detail-head h4 {
  margin: 0;
  font-size: 1.05rem;
}

.field-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-right: 4px;
}

body.is-fields-fullscreen .field-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.field-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.8);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.field-item:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 124, 145, 0.32);
  box-shadow: 0 10px 24px rgba(25, 40, 31, 0.08);
}

.field-item.is-selected {
  border-color: rgba(79, 124, 145, 0.42);
  box-shadow: 0 12px 30px rgba(79, 124, 145, 0.12);
}

.field-item-top,
.field-activity-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.field-item-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.7);
}

.field-item-name {
  font-weight: 700;
}

.field-item-meta,
.field-activity-sub,
.field-activity-date {
  color: var(--muted);
  font-size: 0.86rem;
}

.field-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(109, 141, 89, 0.12);
  color: #4d6840;
  font-size: 0.8rem;
  font-weight: 700;
  width: fit-content;
}

.field-chip.alert {
  background: rgba(193, 156, 88, 0.14);
  color: #805f21;
}

.field-panel-head {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field-panel-head-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.field-panel-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.field-panel-back-button {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.field-panel-toolbar {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.field-panel-toolbar > .filter-bar {
  width: 100%;
}

.field-panel-toolbar .toolbar-actions {
  margin-left: 0;
  width: 100%;
  justify-content: flex-start;
}

.field-list-card,
.field-detail-card {
  min-width: 0;
}

.field-list-card {
  display: grid;
  gap: 0;
}

.field-detail-card {
  display: grid;
  gap: 14px;
}

.field-detail-body {
  display: grid;
  gap: 14px;
  min-width: 0;
}

#field-detail {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100%;
}

#field-detail > .field-empty,
#field-detail > .field-detail-head,
#field-detail > .field-detail-body,
#field-detail > .weather-card {
  min-width: 0;
}

#field-detail > .weather-card {
  padding: clamp(14px, 1.8vw, 20px);
  border-radius: clamp(22px, 2vw, 28px);
  border: 1px solid rgba(79, 124, 145, 0.18);
  background:
    radial-gradient(circle at top right, rgba(193, 156, 88, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(79, 124, 145, 0.16), rgba(255, 255, 255, 0.94));
  box-shadow: 0 18px 42px rgba(25, 40, 31, 0.1);
  min-height: clamp(24rem, 48vh, 34rem);
}

#field-detail > .field-detail-head {
  order: 0;
  padding: 14px 16px;
  border-radius: 24px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

#field-detail > .field-detail-body {
  order: 1;
}

#field-detail > .field-empty {
  order: 2;
}

.field-panel-toolbar[hidden],
.field-list-card[hidden],
.field-detail-card[hidden],
.field-panel-back-button[hidden] {
  display: none !important;
}

body.is-fields-fullscreen .field-map-card,
body.is-fields-fullscreen .field-map-shell,
body.is-fields-fullscreen .field-map {
  height: 100%;
}

.field-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  align-items: center;
}

.field-workdocs-switcher {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
}

.field-workdocs-switcher.is-open .ghost.icon-button {
  border-color: rgba(31, 45, 36, 0.18);
  background: rgba(255, 255, 255, 0.98);
  color: #214d37;
}

.field-workdocs-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 720;
  width: min(15rem, calc(100vw - 2rem));
  padding: 10px;
  border-radius: 20px;
  border: 1px solid rgba(31, 45, 36, 0.12);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 36px rgba(25, 40, 31, 0.12);
  display: grid;
  gap: 8px;
}

.field-workdocs-menu[hidden] {
  display: none !important;
}

.field-workdocs-menu-item {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  color: #214d37;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.field-workdocs-menu-item:hover {
  background: rgba(248, 250, 248, 0.98);
  border-color: rgba(31, 45, 36, 0.14);
}

.field-workdocs-menu-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  flex: none;
}

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

.workday-day-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.field-detail-stat {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.75);
}

.field-detail-stat span {
  color: var(--muted);
  font-size: 0.85rem;
}

.field-detail-stat strong {
  font-size: 1.1rem;
}

.field-detail-alert {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(79, 124, 145, 0.1);
  color: #35525f;
  font-size: 0.92rem;
}

.field-detail-alert.is-warning {
  background: rgba(193, 156, 88, 0.14);
  color: #7b5a1b;
}

.weather-card {
  display: grid;
  gap: 16px;
  min-width: 0;
}

#field-detail > .weather-card .weather-card-head {
  gap: 10px 14px;
}

#field-detail > .weather-card .weather-card-head > div {
  min-width: 0;
}

#field-detail > .weather-card .weather-current {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(14px, 1.6vw, 18px);
  min-height: clamp(11rem, 18vh, 13.5rem);
  border-radius: 22px;
  border-color: rgba(79, 124, 145, 0.14);
  background:
    linear-gradient(180deg, rgba(79, 124, 145, 0.14), rgba(255, 255, 255, 0.9)),
    rgba(255, 255, 255, 0.75);
}

#field-detail > .weather-card .weather-current-hero {
  gap: 14px;
}

#field-detail > .weather-card .weather-current-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

#field-detail > .weather-card .weather-current-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 22px;
}

#field-detail > .weather-card .weather-current-icon svg {
  width: 2rem;
  height: 2rem;
}

#field-detail > .weather-card .weather-current-speed strong {
  font-size: clamp(2.05rem, 4.6vw, 2.8rem);
}

#field-detail > .weather-card .weather-current-side {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#field-detail > .weather-card .weather-section-head strong {
  font-size: 1rem;
}

#field-detail > .weather-card .weather-section-head span {
  font-size: 0.75rem;
}

#field-detail > .weather-card .weather-section {
  gap: 8px;
}

#field-detail > .weather-card .weather-short-term,
#field-detail > .weather-card .weather-weekly {
  gap: 10px;
  padding: 2px 0 6px;
}

#field-detail > .weather-card .weather-short-term {
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}

#field-detail > .weather-card .weather-weekly {
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}

#field-detail > .weather-card .weather-time-card,
#field-detail > .weather-card .weather-weekly-card {
  min-width: 0;
  min-height: 8.4rem;
  padding: 10px 11px;
  border-radius: 16px;
  align-self: start;
  height: auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 248, 243, 0.95));
}

#field-detail > .weather-card .weather-time-card-top,
#field-detail > .weather-card .weather-weekly-card-top {
  gap: 6px;
}

#field-detail > .weather-card .weather-time-card-figure,
#field-detail > .weather-card .weather-weekly-figure {
  gap: 2px;
}

#field-detail > .weather-card .weather-time-card-body,
#field-detail > .weather-card .weather-weekly-card-body {
  gap: 4px;
}

#field-detail > .weather-card .weather-time-card-time,
#field-detail > .weather-card .weather-weekly-date {
  font-size: 0.78rem;
}

#field-detail > .weather-card .weather-time-card-pop,
#field-detail > .weather-card .weather-time-card-weather,
#field-detail > .weather-card .weather-weekly-weather,
#field-detail > .weather-card .weather-weekly-pop,
#field-detail > .weather-card .weather-weekly-reliability {
  font-size: 0.8rem;
}

#field-detail > .weather-card .weather-weekly-temp {
  font-size: 0.84rem;
}

#field-detail > .weather-card .weather-time-card-temp {
  font-size: 0.8rem;
}

#field-detail > .weather-card .weather-condition-icon {
  width: 2.9rem;
  height: 2.9rem;
}

#field-detail > .weather-card .weather-condition-icon svg {
  width: 1.55rem;
  height: 1.55rem;
}

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

.weather-card-head h4 {
  margin: 0;
}

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

.weather-pill,
.weather-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.weather-pill {
  background: rgba(31, 45, 36, 0.08);
  color: var(--muted);
}

.weather-pill.is-ok {
  background: rgba(79, 124, 145, 0.14);
  color: #35525f;
}

.weather-pill.is-warning {
  background: rgba(193, 156, 88, 0.16);
  color: #7b5a1b;
}

.weather-pill.is-caution {
  background: rgba(193, 156, 88, 0.16);
  color: #7b5a1b;
}

.weather-pill.is-danger {
  background: rgba(205, 62, 67, 0.18);
  color: #7f232a;
}

.weather-pill.is-unknown {
  background: rgba(31, 45, 36, 0.08);
  color: var(--muted);
}

.weather-status-badge.is-ok {
  background: rgba(79, 124, 145, 0.14);
  color: #35525f;
}

.weather-status-badge.is-caution {
  background: rgba(193, 156, 88, 0.18);
  color: #7b5a1b;
}

.weather-status-badge.is-danger {
  background: rgba(205, 62, 67, 0.2);
  color: #7f232a;
}

.weather-status-badge.is-unknown {
  background: rgba(31, 45, 36, 0.08);
  color: var(--muted);
}

.weather-status-icon {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.weather-current {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: linear-gradient(180deg, rgba(79, 124, 145, 0.08), rgba(255, 255, 255, 0.72));
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.weather-current.is-wind-ok {
  background: linear-gradient(135deg, rgba(200, 225, 245, 0.7), rgba(230, 245, 255, 0.5)) !important;
  border: 1px solid rgba(150, 195, 225, 0.8);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.9), 0 4px 12px rgba(100, 155, 195, 0.15);
  color: #2a5275;
}
.weather-current.is-wind-ok .weather-current-speed span { color: #507b9e; }
.weather-current.is-wind-ok .weather-current-meta > span { background: rgba(255, 255, 255, 0.6); color: #2a5275; }
.weather-current.is-wind-ok .weather-current-icon { background: rgba(255, 255, 255, 0.5); color: #2a5275; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8); border: 1px solid rgba(150, 195, 225, 0.4); }

.weather-current.is-wind-caution {
  background: linear-gradient(135deg, rgba(250, 230, 185, 0.7), rgba(255, 245, 215, 0.5)) !important;
  border: 1px solid rgba(225, 195, 140, 0.8);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.9), 0 4px 12px rgba(195, 155, 90, 0.15);
  color: #755f2a;
}
.weather-current.is-wind-caution .weather-current-speed span { color: #9e8550; }
.weather-current.is-wind-caution .weather-current-meta > span { background: rgba(255, 255, 255, 0.6); color: #755f2a; }
.weather-current.is-wind-caution .weather-current-icon { background: rgba(255, 255, 255, 0.5); color: #755f2a; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8); border: 1px solid rgba(225, 195, 140, 0.4); }

.weather-current.is-wind-ng {
  background: linear-gradient(135deg, rgba(255, 194, 197, 0.95), rgba(255, 242, 243, 0.84)) !important;
  border: 1px solid rgba(205, 62, 67, 0.78);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.92), 0 6px 18px rgba(177, 62, 67, 0.18);
  color: #7a2228;
}
.weather-current.is-wind-ng .weather-current-speed strong,
.weather-current.is-wind-ng .weather-current-speed span { color: #9b3840; }
.weather-current.is-wind-ng .weather-current-meta > span { background: rgba(255, 255, 255, 0.72); color: #7a2228; border: 1px solid rgba(205, 62, 67, 0.14); }
.weather-current.is-wind-ng .weather-current-icon { background: rgba(255, 255, 255, 0.62); color: #7a2228; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86); border: 1px solid rgba(205, 62, 67, 0.28); }

.weather-current.is-wind-unknown {
  background: linear-gradient(135deg, rgba(230, 230, 230, 0.7), rgba(245, 245, 245, 0.5)) !important;
  border: 1px solid rgba(200, 200, 200, 0.8);
  color: #4a4a4a;
}
.weather-current.is-wind-unknown .weather-current-speed span { color: #7a7a7a; }
.weather-current.is-wind-unknown .weather-current-meta > span { background: rgba(255, 255, 255, 0.6); color: #4a4a4a; }
.weather-current.is-wind-unknown .weather-current-icon { background: rgba(255, 255, 255, 0.5); color: #4a4a4a; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8); border: 1px solid rgba(200, 200, 200, 0.4); }

.weather-current-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.weather-current-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.weather-current-speed {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 6px;
}

.weather-current-speed strong {
  font-size: clamp(1.4rem, 6vw, 2.35rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.weather-current-speed span {
  font-size: 0.8rem;
}

.weather-current-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 18px;
  flex: none;
  background: rgba(79, 124, 145, 0.12);
  color: #35525f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.weather-current-icon svg {
  width: 1.7rem;
  height: 1.7rem;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.weather-current-icon.is-ok {
  background: rgba(79, 124, 145, 0.14);
  color: #35525f;
}

.weather-current-icon.is-caution {
  background: rgba(193, 156, 88, 0.18);
  color: #7b5a1b;
}

.weather-current-icon.is-danger {
  background: rgba(179, 73, 67, 0.16);
  color: #8a2d27;
}

.weather-current-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  color: var(--muted);
  font-size: 0.75rem;
}

.weather-current-meta > span {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

.weather-current-meta .weather-wind,
.weather-time-card .weather-wind,
.weather-weekly-card .weather-wind {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: #35525f;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.weather-time-card .weather-wind,
.weather-weekly-card .weather-wind {
  background: rgba(79, 124, 145, 0.08);
}

.weather-wind-arrow {
  width: 16px;
  height: 16px;
  display: block;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(var(--wind-angle, 0deg));
  transform-origin: 50% 50%;
}

.weather-current-side {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(31, 45, 36, 0.08);
}

.weather-current-label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.weather-current-side strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
}

.weather-current-side small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.weather-current-observed,
.weather-current-threshold {
  color: var(--muted);
  font-size: 0.84rem;
}

.weather-current-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.weather-section {
  display: grid;
  gap: 10px;
}

.weather-section-head {
  display: grid;
  gap: 4px;
  align-items: start;
}

.weather-section-head strong {
  font-size: 0.95rem;
}

.weather-section-head span {
  color: var(--muted);
  font-size: 0.8rem;
}

.weather-short-term,
.weather-weekly {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 0 12px 0;
  -webkit-overflow-scrolling: touch;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  cursor: grab;
}

.weather-short-term *,
.weather-weekly * {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.weather-short-term:active,
.weather-weekly:active,
.weather-short-term.is-dragging,
.weather-weekly.is-dragging {
  cursor: grabbing;
}


.weather-time-card,
.weather-weekly-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex: 0 0 auto;
  width: 8rem;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.76);
  min-width: 0;
  min-height: 9rem;
  height: 100%;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-drag: none;
  user-select: none;
}

.weather-time-card-top,
.weather-weekly-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.weather-time-card-figure,
.weather-weekly-figure {
  display: grid;
  gap: 4px;
  justify-items: center;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.weather-time-card-body,
.weather-weekly-card-body {
  display: flex;
  flex-direction: column;
  margin-top: auto;
  gap: 6px;
  align-items: flex-start;
  min-width: 0;
}

.weather-time-card-time,
.weather-weekly-date {
  color: var(--muted);
  font-size: 0.82rem;
}

.weather-time-card-pop,
.weather-time-card-weather,
.weather-weekly-weather,
.weather-weekly-pop,
.weather-weekly-reliability {
  color: var(--muted);
  font-size: 0.85rem;
}

.weather-time-card-weather,
.weather-weekly-weather {
  color: var(--text);
  font-weight: 700;
  line-height: 1.2;
}

.weather-weekly-temp {
  color: #35525f;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.weather-weekly-temp-max {
  color: #c95f5f;
}

.weather-time-card-temp {
  color: #35525f;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.weather-condition-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 999px;
  flex: none;
  background: rgba(79, 124, 145, 0.12);
  color: #35525f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.weather-condition-icon svg {
  width: 1.45rem;
  height: 1.45rem;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.weather-condition-icon--sun {
  background: rgba(222, 169, 45, 0.18);
  color: #a96d00;
}

.weather-condition-icon--partly {
  background: rgba(209, 183, 102, 0.18);
  color: #8a6b07;
}

.weather-condition-icon--cloud {
  background: rgba(79, 124, 145, 0.12);
  color: #35525f;
}

.weather-condition-icon--rain {
  background: rgba(79, 124, 145, 0.18);
  color: #2f5f7a;
}

.weather-condition-icon--snow {
  background: rgba(170, 198, 222, 0.22);
  color: #4f6e8d;
}

.weather-condition-icon--storm {
  background: rgba(179, 73, 67, 0.16);
  color: #8a2d27;
}

.weather-condition-icon--fog {
  background: rgba(120, 128, 134, 0.16);
  color: #566069;
}

.weather-time-card > span,
.weather-weekly-card > span {
  color: var(--muted);
  font-size: 0.83rem;
}

.weather-time-card-body > span,
.weather-weekly-card-body > span {
  flex: 0 0 auto;
}

.weather-empty {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(79, 124, 145, 0.08);
  color: #35525f;
  font-size: 0.9rem;
}

.weather-empty.is-error {
  background: rgba(179, 73, 67, 0.12);
  color: #8a2d27;
}

@media (max-width: 1023px) {
  #field-detail > .weather-card .weather-current {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 840px) {
  .weather-current {
    grid-template-columns: minmax(0, 1fr);
  }

  .weather-card-badges {
    justify-content: flex-end;
  }

  .weather-short-term,
  .weather-weekly {
    grid-template-columns: minmax(0, 1fr);
  }
}

.field-activity-list {
  display: grid;
  gap: 10px;
}

.field-activity-groups {
  display: grid;
  gap: 12px;
}

.workdays-list {
  display: grid;
  gap: 12px;
}

.field-activity-group {
  border-radius: 18px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.field-activity-group summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-left: 4px solid var(--field-activity-accent, var(--accent));
}

.field-activity-group summary::-webkit-details-marker {
  display: none;
}

.field-activity-group-heading {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.field-activity-group-heading strong {
  font-size: 0.98rem;
}

.field-activity-group-heading span {
  color: var(--muted);
  font-size: 0.84rem;
}

.field-activity-group-summary {
  display: block;
}

.field-activity-group-meta {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.field-activity-group-toggle {
  color: var(--muted);
  font-size: 1rem;
  transition: transform 200ms ease;
  transform-origin: center;
  display: inline-flex;
  width: 1.3rem;
  height: 1.3rem;
  align-items: center;
  justify-content: center;
}

.field-activity-group-toggle svg {
  width: 100%;
  height: 100%;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 200ms ease;
  transform-origin: center;
}

.field-activity-group.is-open > summary .field-activity-group-toggle svg {
  transform: rotate(180deg);
}

.field-activity-group-body {
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: height 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease;
}

.field-activity-group[open] > .field-activity-group-body {
  height: auto;
  opacity: 1;
}

.field-activity-group-body-inner {
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 12px 16px 16px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 220ms ease, transform 220ms ease;
  will-change: opacity, transform;
}

.field-detail-records .field-activity-group-body-inner {
  background: linear-gradient(180deg, rgba(79, 124, 145, 0.12), rgba(255, 255, 255, 0.9));
  border-radius: 0;
  overflow: hidden;
}

.field-detail-records .field-activity-item {
  color: var(--text);
  background: rgba(248, 250, 244, 0.96);
  border-color: rgba(79, 124, 145, 0.14);
  box-shadow: 0 12px 28px rgba(31, 45, 36, 0.06);
}

.field-detail-records .field-empty {
  background: rgba(248, 250, 244, 0.96);
  color: var(--text);
  border: 1px dashed rgba(79, 124, 145, 0.2);
}

.field-detail-records {
  margin-top: 0;
  padding: 10px;
  background: linear-gradient(180deg, rgba(79, 124, 145, 0.05), rgba(255, 255, 255, 0.78));
  border: 1px solid rgba(79, 124, 145, 0.12);
}

.field-detail-records .field-activity-group-heading strong,
.field-detail-records .field-activity-top,
.field-detail-records .field-activity-sub,
.field-detail-records .field-activity-date {
  color: var(--text);
}

.field-detail-records .field-activity-group {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(79, 124, 145, 0.16);
}

.field-detail-records .field-activity-group summary {
  background: rgba(79, 124, 145, 0.05);
}

#field-add-bojo-btn {
  min-width: 0;
  padding-inline: 12px;
}

.field-activity-group[open] .field-activity-group-body-inner,
.field-activity-group.is-opening .field-activity-group-body-inner {
  opacity: 1;
  transform: none;
}

.field-activity-group.is-closing .field-activity-group-body-inner {
  opacity: 0;
  transform: translateY(-6px);
}

.field-activity-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.76);
}

.field-activity-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
}

.field-activity-amount {
  font-weight: 700;
}

.field-map-shell {
  position: relative;
  height: 100%;
  min-height: 0;
  padding: 0;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  overflow: hidden;
}

.field-map {
  height: 100%;
  min-height: 0;
  width: 100%;
  border-radius: inherit;
  border: 0;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(109, 141, 89, 0.08), rgba(255, 255, 255, 0.88));
}

.field-map.leaflet-container {
  font-family: var(--font-body);
}

.field-map .leaflet-control-container {
  font-family: var(--font-body);
}

.field-map .leaflet-top,
.field-map .leaflet-bottom {
  z-index: 500;
}

.field-map .leaflet-draw,
.field-map .leaflet-control-zoom {
  display: none !important;
}

body.is-bulk-workdocs-drawing .leaflet-draw-tooltip {
  display: none !important;
}

.field-map-controls {
  position: absolute;
  inset: 0;
  z-index: 650;
  pointer-events: none;
}

.field-map-stack {
  position: absolute;
  display: grid;
  gap: 12px;
  pointer-events: auto;
}

.field-map-stack--left {
  top: 26px;
  left: 26px;
  justify-items: start;
}

.field-map-stack--right {
  top: 26px;
  right: 26px;
  justify-items: end;
  width: fit-content;
  max-width: min(420px, calc(100% - 3rem));
  pointer-events: none;
}

.field-map-status {
  max-width: min(420px, 100%);
  padding: 11px 14px;
  border-radius: 16px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 24px rgba(25, 40, 31, 0.08);
  pointer-events: none;
}

.field-map-hint {
  max-width: min(420px, 100%);
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(193, 156, 88, 0.22);
  background: rgba(255, 247, 229, 0.94);
  color: #7b5a1b;
  box-shadow: 0 12px 24px rgba(25, 40, 31, 0.08);
  pointer-events: none;
  font-size: 0.9rem;
  line-height: 1.5;
}

.field-map-hint.is-loading {
  padding-block: 12px;
  background:
    linear-gradient(145deg, rgba(245, 252, 244, 0.98), rgba(255, 247, 229, 0.96));
  border-color: rgba(109, 141, 89, 0.26);
  color: #3d5631;
}

.field-map-hint-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 1.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.field-map-hint-loading .loading-spinner--mini {
  flex: 0 0 auto;
  width: 1.95rem;
}

.field-map-hint-loading > span:last-child {
  min-width: 0;
}

.field-map.is-lookup-busy {
  cursor: progress;
}

.field-map-actions {
  display: grid;
  gap: 12px;
  justify-items: end;
  pointer-events: auto;
}

.field-map-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  pointer-events: auto;
}

.field-map-group--zoom {
  display: grid;
  gap: 12px;
}

.field-map-stack--bottom-right {
  right: 26px;
  bottom: 56px;
  justify-items: end;
}

.field-map-stack--summary {
  left: 26px;
  bottom: 26px;
  justify-items: start;
  width: min(35rem, calc(100vw - 3rem));
  max-width: min(35rem, calc(100vw - 3rem));
}

.field-map-group--utility {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.field-base-switcher {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
  pointer-events: auto;
}

.field-base-toggle {
  position: relative;
}

.field-base-switcher.is-open .field-base-toggle {
  border-color: rgba(79, 124, 145, 0.4);
  background: rgba(79, 124, 145, 0.16);
  color: #365b74;
}

.field-base-menu {
  position: absolute;
  bottom: 54px;
  right: 0;
  z-index: 700;
  width: min(17.5rem, calc(100vw - 3rem));
  max-height: min(20rem, calc(100vh - 6rem));
  overflow: auto;
  padding: 10px;
  border-radius: 20px;
  border: 1px solid rgba(33, 77, 55, 0.16);
  background: rgba(247, 251, 244, 0.96);
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 36px rgba(25, 40, 31, 0.14);
  display: grid;
  gap: 8px;
}

.field-base-menu[hidden] {
  display: none !important;
}

.field-base-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(247, 251, 244, 0.96);
  color: #214d37;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.field-base-menu-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  flex: none;
}

.field-base-menu-item.is-active {
  border-color: rgba(79, 124, 145, 0.34);
  background: rgba(79, 124, 145, 0.16);
  color: #365b74;
}

.field-draw-switcher {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
}

.field-draw-menu {
  position: absolute;
  top: 0;
  left: calc(100% + 10px);
  z-index: 700;
  width: min(12rem, calc(100vw - 5rem));
  padding: 10px;
  border-radius: 20px;
  border: 1px solid rgba(33, 77, 55, 0.16);
  background: rgba(247, 251, 244, 0.96);
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 36px rgba(25, 40, 31, 0.14);
  display: grid;
  gap: 8px;
}

.field-draw-switcher.is-open .ghost.icon-button {
  border-color: rgba(79, 124, 145, 0.4);
  background: rgba(79, 124, 145, 0.16);
  color: #365b74;
}

.field-draw-switcher.is-auto-lookup-mode .ghost.icon-button {
  border-color: rgba(79, 124, 145, 0.4);
  background: rgba(79, 124, 145, 0.16);
  color: #365b74;
}

.field-draw-switcher.is-pin-placement-mode .ghost.icon-button {
  border-color: rgba(79, 124, 145, 0.4);
  background: rgba(79, 124, 145, 0.16);
  color: #365b74;
}

.field-draw-menu[hidden] {
  display: none !important;
}

.field-draw-menu-item {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(247, 251, 244, 0.96);
  color: #214d37;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.field-draw-menu-item.is-destructive {
  color: var(--danger);
}

.field-draw-menu-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  flex: none;
}

.field-draw-menu-item:hover {
  background: #fff;
  border-color: rgba(79, 124, 145, 0.24);
}

.field-draw-menu-item.is-destructive:hover {
  background: rgba(157, 77, 77, 0.08);
  border-color: rgba(157, 77, 77, 0.22);
}

.field-draw-menu-item[data-field-draw-action="edit-geometry"],
.field-draw-menu-item[data-field-draw-action="delete"] {
  display: none;
}

.field-draw-menu-item.is-active {
  background: rgba(79, 124, 145, 0.14);
  border-color: rgba(79, 124, 145, 0.34);
  color: #365b74;
}

.field-map-actions .ghost {
  background: rgba(247, 251, 244, 0.96);
  color: #214d37;
  border: 1px solid rgba(33, 77, 55, 0.16);
  box-shadow: 0 10px 20px rgba(25, 40, 31, 0.08);
}

.field-base-switcher .ghost.icon-button,
.field-map-stack--bottom-right .ghost.icon-button {
  background: rgba(247, 251, 244, 0.96);
  color: #214d37;
  border: 1px solid rgba(33, 77, 55, 0.16);
  box-shadow: 0 10px 20px rgba(25, 40, 31, 0.08);
}

.icon-button {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.field-map-actions .ghost.icon-button {
  width: 46px;
  height: 46px;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  transform: none;
}

.field-map-actions .ghost.icon-button.is-active {
  border-color: rgba(79, 124, 145, 0.4);
  background: rgba(79, 124, 145, 0.16);
  color: #365b74;
}

.field-map-stack--left .ghost.icon-button {
  background: rgba(247, 251, 244, 0.96);
  color: #214d37;
  border: 1px solid rgba(33, 77, 55, 0.16);
  box-shadow: 0 10px 20px rgba(25, 40, 31, 0.08);
}

#field-edit-geometry-btn.is-active {
  width: auto;
  height: auto;
  min-height: 46px;
  padding: 10px 16px;
  gap: 8px;
  justify-content: flex-start;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--accent), #567244);
  color: white;
  border-color: transparent;
  box-shadow: 0 14px 28px rgba(86, 114, 68, 0.26);
}

#field-edit-geometry-btn.is-active svg {
  width: 18px;
  height: 18px;
}

.field-base-switcher .ghost.icon-button.is-active,
.field-map-stack--bottom-right .ghost.icon-button.is-active {
  border-color: rgba(79, 124, 145, 0.34);
  background: rgba(79, 124, 145, 0.14);
  color: #365b74;
}

.field-detail-actions .icon-button {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 20px rgba(25, 40, 31, 0.08);
}

.field-layer-selected {
  animation: field-layer-pulse 1.8s ease-in-out infinite;
}

@keyframes field-layer-pulse {
  0% {
    opacity: 0.96;
    filter: drop-shadow(0 0 0 rgba(79, 124, 145, 0));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 12px rgba(79, 124, 145, 0.42));
  }
  100% {
    opacity: 0.96;
    filter: drop-shadow(0 0 0 rgba(79, 124, 145, 0));
  }
}

.field-selection-glow {
  animation: field-selection-glow 1.5s ease-in-out infinite;
}

@keyframes field-selection-glow {
  0% {
    stroke-opacity: 0.3;
    stroke-width: 8px;
    opacity: 0.7;
  }
  50% {
    stroke-opacity: 0.8;
    stroke-width: 12px;
    opacity: 1;
  }
  100% {
    stroke-opacity: 0.3;
    stroke-width: 8px;
    opacity: 0.7;
  }
}

.field-map .leaflet-editing-icon,
.field-map .leaflet-edit-marker {
  width: 16px !important;
  height: 16px !important;
  margin-left: -8px !important;
  margin-top: -8px !important;
  border: 2px solid #4f7c91 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 2px rgba(79, 124, 145, 0.18), 0 3px 10px rgba(25, 40, 31, 0.14) !important;
  opacity: 1 !important;
  z-index: 1200 !important;
  cursor: move;
}

.field-map .leaflet-editing-icon {
  animation: none !important;
}

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

.field-empty {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(31, 45, 36, 0.14);
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.field-detail-records .field-empty {
  margin-top: 10px;
}

.filter-bar {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.75rem 0.875rem;
  align-items: end;
  padding: 1rem 1.125rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.filter-bar label {
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow: visible;
}

.filter-bar span {
  font-size: 0.82rem;
  color: var(--muted);
}

.filter-bar input,
.filter-bar select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(31, 45, 36, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  color-scheme: light;
  outline: none;
}

.field-search-autocomplete {
  position: relative;
  min-width: 0;
}

.field-search-autocomplete input {
  width: 100%;
}

.field-name-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  gap: 4px;
  max-height: 240px;
  overflow: auto;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(31, 45, 36, 0.12);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 34px rgba(31, 45, 36, 0.16);
}

.field-name-suggestion-section {
  display: grid;
  gap: 4px;
}

.field-name-suggestion-section-label {
  padding: 4px 10px 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-name-suggestions[hidden] {
  display: none;
}

.field-name-suggestion {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.field-name-suggestion:hover,
.field-name-suggestion:focus-visible {
  background: rgba(109, 141, 89, 0.1);
  outline: none;
}

.field-name-suggestion strong {
  font-size: 0.92rem;
  line-height: 1.3;
}

.field-name-suggestion-kind {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(31, 111, 139, 0.12);
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.field-name-suggestion-meta {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.field-name-suggestion-empty {
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.filter-bar input:focus,
.filter-bar select:focus {
  border-color: rgba(109, 141, 89, 0.72);
  box-shadow: 0 0 0 4px rgba(109, 141, 89, 0.12);
}

.button-row.compact {
  align-self: end;
  justify-content: flex-end;
}

.field-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 29, 22, 0.42);
  backdrop-filter: blur(6px);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
  cursor: pointer;
}

.pin-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 29, 22, 0.42);
  backdrop-filter: blur(6px);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
  cursor: pointer;
}

.field-sheet[hidden] {
  display: none !important;
}

.pin-sheet[hidden] {
  display: none !important;
}

.field-sheet {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  bottom: 1.5rem;
  width: min(35rem, calc(100vw - 3rem));
  padding: 1.25rem;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  z-index: 3010;
  overflow: hidden;
  max-height: calc(100dvh - 3rem);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  opacity: 0;
  transform: translateY(1rem);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
  will-change: transform, opacity;
}

.pin-sheet {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  bottom: 1.5rem;
  width: min(35rem, calc(100vw - 3rem));
  padding: 1.25rem;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  z-index: 3010;
  overflow: hidden;
  max-height: calc(100dvh - 3rem);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  opacity: 0;
  transform: translateY(1rem);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
  will-change: transform, opacity;
}

body.is-field-sheet-open .field-sheet-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.is-pin-sheet-open .pin-sheet-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.is-field-sheet-open .field-sheet {
  opacity: 1;
  transform: translateY(0);
}

body.is-pin-sheet-open .pin-sheet {
  opacity: 1;
  transform: translateY(0);
}

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

.field-sheet-head h4 {
  margin: 0;
  font-family: inherit;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
}

.field-sheet-lead {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

#field-sheet-close.field-sheet-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 1.4rem;
  line-height: 1;
}

#field-sheet-close.field-sheet-close,
#pin-sheet-close.field-sheet-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 1.4rem;
  line-height: 1;
}

.field-sheet-form {
  margin-top: 0;
  align-self: stretch;
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding-bottom: 1.5rem;
}

.pin-sheet-form {
  margin-top: 0;
  align-self: stretch;
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding-bottom: 1.5rem;
}

body.is-pin-sheet-open .field-map-controls {
  z-index: 3020;
}

body.is-field-sheet-open .mobile-topbar,
body.is-pin-sheet-open .mobile-topbar,
body.is-entity-modal-open .mobile-topbar {
  display: none !important;
}

.pin-icon-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.25rem, 1fr));
  gap: 10px;
}

.pin-icon-option {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 12px 10px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  color: #fff;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.pin-icon-option:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 124, 145, 0.28);
  box-shadow: 0 10px 24px rgba(25, 40, 31, 0.08);
}

.pin-icon-option.is-active {
  border-color: rgba(79, 124, 145, 0.42);
  background: rgba(79, 124, 145, 0.08);
  box-shadow: 0 12px 30px rgba(79, 124, 145, 0.12);
}

.pin-icon-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.pin-icon-option__icon,
.pin-list-item__icon,
.pin-marker__body {
  color: #fff;
}

.pin-icon-option__icon {
  width: 2.9rem;
  height: 2.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.pin-icon-option__icon svg,
.pin-list-item__icon svg,
.pin-marker__body svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
  fill: currentColor;
  stroke: none;
}

.pin-icon-option__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.35;
}

.pin-marker-icon {
  background: transparent;
  border: 0;
}

.pin-marker {
  display: grid;
  place-items: center;
  width: 32px;
  height: 40px;
}

.pin-marker__body {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(25, 40, 31, 0.18);
}

.pin-marker.is-selected .pin-marker__body {
  transform: scale(1.08);
  box-shadow: 0 10px 22px rgba(25, 40, 31, 0.24);
}

.pin-list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.pin-list-item:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 124, 145, 0.28);
  box-shadow: 0 10px 24px rgba(25, 40, 31, 0.08);
}

.pin-list-item.is-selected {
  border-color: rgba(79, 124, 145, 0.42);
  box-shadow: 0 12px 30px rgba(79, 124, 145, 0.12);
}

.pin-list-item__icon {
  width: 2.6rem;
  height: 2.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.pin-list-item__title {
  font-weight: 700;
  min-width: 0;
}

.pin-list-item__memo {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.pin-popup {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.pin-popup__title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.pin-popup__memo {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  word-break: break-word;
}

.pin-popup__thumb img {
  display: block;
  width: 100%;
  border-radius: 14px;
  object-fit: cover;
}

.pin-popup__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.summary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.dashboard-visuals {
  --dashboard-chart-height: clamp(20rem, 26vw, 30rem);
  --dashboard-line-height: clamp(14rem, 16vw, 18rem);
  display: grid;
  grid-template-columns: minmax(20rem, 21.875rem) minmax(0, 1.35fr);
  grid-template-rows: var(--dashboard-chart-height) var(--dashboard-line-height);
  gap: 16px;
  align-items: stretch;
  min-height: calc(var(--dashboard-chart-height) + var(--dashboard-line-height) + 16px);
}

.summary-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.summary-card h4 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: var(--muted);
}

.summary-value {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
}

.summary-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.chart-card {
  padding: 20px;
  height: 100%;
  min-height: 0;
}

.chart-card--ring {
  display: grid;
  gap: 10px;
  align-content: start;
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-column: 1;
  grid-row: 1 / span 2;
  min-height: 0;
  overflow: hidden;
}

.chart-card--bars {
  display: grid;
  gap: 16px;
  align-content: start;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  grid-column: 2;
  grid-row: 1;
}

.chart-card--line {
  display: grid;
  gap: 16px;
  align-content: start;
  grid-template-rows: auto minmax(0, 1fr);
  grid-column: 2;
  grid-row: 2;
}

.chart-card--bars .bar-chart {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-height: none;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: auto;
  padding-right: 8px;
}

.chart-card--line .line-chart {
  height: 100%;
  min-height: 0;
}

.chart-card--line .line-chart svg {
  height: 100%;
  min-height: 0;
}

.chart-card--bars .bar-row {
  margin: 0;
  padding: 8px 10px;
  grid-template-columns: minmax(7.5rem, 1fr) minmax(0, 1fr) minmax(7rem, 8.5rem);
}

.chart-card--bars .bar-track {
  height: 14px;
  width: 100%;
  transition: width 700ms cubic-bezier(0.22, 1, 0.36, 1), opacity 240ms ease;
}

.chart-card--bars .bar-label strong {
  font-size: 0.92rem;
}

.chart-card--bars .bar-label span,
.chart-card--bars .bar-total,
.chart-card--bars .bar-balance {
  font-size: 0.78rem;
}

@media (min-width: 1640px) {
  .dashboard-visuals {
    grid-template-columns: minmax(340px, 380px) minmax(0, 1.45fr);
    grid-template-rows: var(--dashboard-chart-height) var(--dashboard-line-height);
    min-height: calc(var(--dashboard-chart-height) + var(--dashboard-line-height) + 16px);
  }

  .chart-card--ring {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .chart-card--bars {
    grid-column: 2;
    grid-row: 1;
  }

  .chart-card--line {
    grid-column: 2;
    grid-row: 2;
  }
}

.donut-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
}

.donut-chart {
  width: min(100%, 286px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--donut-gradient, rgba(109, 141, 89, 0.5) 0 100%));
  -webkit-mask: radial-gradient(circle at center, transparent 0 47%, #000 48%);
  mask: radial-gradient(circle at center, transparent 0 47%, #000 48%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
  transform-origin: center;
  will-change: transform, opacity;
}

.donut-chart.chart-sweep-in {
  animation: donut-sweep-in 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.donut-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 144px;
  height: 144px;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  text-align: center;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  padding: 26px 12px 10px;
}

.donut-center strong {
  display: block;
  font-size: clamp(0.92rem, 1vw, 1.12rem);
  line-height: 1.05;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  transform: translateY(2px);
}

.donut-center span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
  transform: translateY(5px);
}

.legend-list {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  overscroll-behavior: auto;
}

@media (min-width: 1120px) {
  .chart-card--ring .legend-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

.legend-group {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(31, 45, 36, 0.08);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 10px 18px rgba(31, 45, 36, 0.05);
  min-width: 0;
}

.legend-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(31, 45, 36, 0.08);
  cursor: help;
  flex-wrap: wrap;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.legend-group-head:hover {
  transform: translateY(-1px);
}

.legend-group-head .legend-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1 1 240px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.8);
}

.legend-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.legend-text strong,
.legend-text span {
  display: block;
}

.legend-text strong {
  font-size: 0.94rem;
}

.legend-text span {
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-word;
}

.legend-value {
  display: grid;
  justify-items: end;
  gap: 2px;
  white-space: nowrap;
  min-width: 0;
  flex: 0 0 auto;
}

.legend-value strong {
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.legend-value span {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.legend-sublist {
  display: grid;
  gap: 8px;
}

.legend-subitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(31, 45, 36, 0.06);
  cursor: help;
  flex-wrap: wrap;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.legend-subitem:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 18px rgba(31, 45, 36, 0.08);
}

.legend-subitem .legend-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  flex: 1 1 220px;
}

.legend-subitem .legend-swatch {
  width: 10px;
  height: 10px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.82);
}

.legend-subitem .legend-text strong {
  font-size: 0.88rem;
}

.legend-subitem .legend-text span {
  font-size: 0.76rem;
}

.legend-subitem .legend-value strong {
  font-size: 0.9rem;
}

.legend-subitem .legend-value span {
  font-size: 0.72rem;
}

.bar-chart {
  display: grid;
  gap: 10px;
}

.line-chart {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  padding: 14px 14px 10px;
  border-radius: 20px;
  border: 1px solid rgba(31, 45, 36, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78)),
    radial-gradient(circle at top right, rgba(109, 141, 89, 0.12), transparent 65%);
}

.line-chart svg {
  display: block;
  width: 100%;
  height: 240px;
}

.line-chart-grid {
  stroke: rgba(31, 45, 36, 0.08);
  stroke-dasharray: 4 8;
}

.line-chart-axis {
  stroke: rgba(31, 45, 36, 0.12);
  stroke-width: 1.2;
}

.line-chart-fill {
  fill: url(#line-chart-fill-gradient);
  will-change: opacity;
}

.line-chart-line {
  fill: none;
  stroke: #6d8d59;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 12px rgba(109, 141, 89, 0.12));
  will-change: stroke-dashoffset;
}

.line-chart-point {
  fill: #ffffff;
  stroke: #6d8d59;
  stroke-width: 3;
  cursor: help;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 180ms ease, transform 180ms ease, fill 180ms ease, stroke 180ms ease;
}

.line-chart-point:hover {
  fill: #6d8d59;
  stroke: #ffffff;
}

.line-chart-label,
.line-chart-value {
  font-size: 11px;
  fill: var(--muted);
}

.line-chart-axis-labels--x .line-chart-x-label {
  font-size: 10px;
  fill: var(--muted);
}

.line-chart-value {
  font-weight: 700;
  fill: var(--text);
}

.line-chart-empty {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: var(--muted);
  font-size: 0.92rem;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 1fr) minmax(0, 1fr) minmax(7rem, 8.5rem);
  gap: 10px;
  align-items: center;
  cursor: help;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: 16px;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.bar-row:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 18px rgba(31, 45, 36, 0.08);
}

.bar-label {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.bar-label strong {
  font-size: 0.92rem;
}

.bar-label span {
  font-size: 0.78rem;
  color: var(--muted);
}

.bar-track {
  position: relative;
  display: flex;
  overflow: hidden;
  height: 16px;
  border-radius: 999px;
  background: rgba(31, 45, 36, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.bar-segment {
  min-width: 4px;
}

.bar-segment.bojo {
  background: linear-gradient(90deg, #6d8d59, #4d6840);
}

.bar-segment.assistant-income {
  background: linear-gradient(90deg, #4f7c91, #3d6273);
}

.bar-segment.staff {
  background: linear-gradient(90deg, #c19c58, #a77b2a);
}

.bar-segment.expense {
  background: linear-gradient(90deg, #c95f5f, #a84949);
}

.bar-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: end;
  text-align: right;
  white-space: nowrap;
}

.bar-total {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bar-balance {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(31, 45, 36, 0.06);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@keyframes donut-sweep-in {
  0% {
    transform: rotate(-20deg) scale(0.92);
    opacity: 0.35;
  }

  60% {
    transform: rotate(4deg) scale(1.02);
    opacity: 1;
  }

  100% {
    transform: rotate(0deg) scale(1);
    opacity: 1;
  }
}

.bar-balance.positive {
  color: #4d6840;
  background: rgba(109, 141, 89, 0.12);
}

.bar-balance.negative {
  color: var(--danger);
  background: rgba(157, 77, 77, 0.12);
}

.chart {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.form-grid.one-column {
  grid-template-columns: minmax(0, 1fr);
}

.master-editor-shell {
  min-width: 0;
}

body.is-inline-master-editor-hidden .master-editor-shell {
  display: none !important;
}

body.is-entity-modal-open .master-editor-shell {
  display: none !important;
}

.editor {
  align-self: start;
  align-content: start;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
}

.audit-log-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  min-width: 0;
}

.audit-log-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.audit-log-card-header h4 {
  margin: 0;
  font-size: 1.02rem;
}

.audit-log-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.audit-log-card-note {
  color: var(--muted);
  font-size: 0.84rem;
}

.audit-log-table-card {
  min-width: 0;
}

.audit-log-table {
  min-width: 0;
  table-layout: fixed;
}

.audit-log-table th:nth-child(1),
.audit-log-table td:nth-child(1) {
  width: 10.25rem;
}

.audit-log-table th:nth-child(2),
.audit-log-table td:nth-child(2) {
  width: 8rem;
}

.audit-log-table th:nth-child(3),
.audit-log-table td:nth-child(3) {
  width: 6.25rem;
}

.audit-log-table th:nth-child(4),
.audit-log-table td:nth-child(4) {
  width: 12rem;
}

.audit-log-table td:nth-child(4) strong,
.audit-log-table td:nth-child(4) span {
  display: block;
}

.audit-log-summary {
  font-weight: 700;
  color: var(--text);
}

.audit-log-note {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.audit-log-changes {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.7rem;
  max-height: min(18rem, 32vh);
  overflow: auto;
  padding-right: 0.15rem;
  scrollbar-gutter: stable;
}

.audit-log-change {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  align-items: flex-start;
  padding: 0.55rem 0.7rem;
  border-radius: 0.8rem;
  background: rgba(109, 141, 89, 0.07);
  border: 1px solid rgba(31, 45, 36, 0.08);
}

.audit-log-change strong {
  flex: 0 0 auto;
  color: var(--text);
}

.audit-log-change span {
  flex: 1 1 16rem;
  min-width: 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.audit-log-change-accordion {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.7rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(31, 45, 36, 0.08);
  background: rgba(109, 141, 89, 0.04);
  overflow: hidden;
  min-width: 0;
}

.audit-log-change-accordion > summary,
.audit-log-change-accordion-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  margin: 0;
  min-width: 0;
}

.audit-log-change-accordion > summary::-webkit-details-marker {
  display: none;
}

.audit-log-change-accordion > summary::marker {
  content: "";
}

.audit-log-change-accordion-label {
  min-width: 0;
}

.audit-log-change-accordion-count {
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.audit-log-change-accordion-icon {
  margin-left: auto;
  color: var(--muted);
  transition: transform 180ms ease;
}

.audit-log-change-accordion[open] .audit-log-change-accordion-icon {
  transform: rotate(180deg);
}

.audit-log-filter-form.editor {
  display: grid;
  gap: 14px;
  padding: 14px 16px;
  border-color: rgba(31, 45, 36, 0.08);
  background: rgba(255, 255, 255, 0.58);
}

.audit-log-filter-row {
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
}

.audit-log-filter-actions {
  justify-content: flex-end;
}

.audit-log-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
}

.audit-log-pagination-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.record-updated-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1rem 0.35rem;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.record-updated-meta-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #64786c;
}

.record-updated-meta-value,
.record-updated-meta-actor {
  font-weight: 600;
  color: var(--text);
}

.record-updated-meta-divider {
  color: var(--muted);
}

.entity-history-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.72);
  min-width: 0;
}

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

.entity-history-head-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.entity-history-head h5 {
  margin: 0;
  font-size: 1rem;
}

.entity-history-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: right;
}

.entity-history-list {
  display: grid;
  gap: 10px;
}

.entity-history-item {
  display: grid;
  gap: 7px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(31, 45, 36, 0.08);
  background: rgba(255, 255, 255, 0.76);
}

.entity-history-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.entity-history-item-time {
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.entity-history-item-summary {
  font-weight: 700;
  color: var(--text);
}

.entity-history-item-meta,
.entity-history-note {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.entity-history-empty {
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px dashed rgba(31, 45, 36, 0.16);
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
}

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

.field-row--full {
  grid-template-columns: minmax(0, 1fr);
}

.settings-period-row {
  align-items: start;
}

.settings-fiscal-year-row.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.field-row > label {
  min-width: 0;
}

.field-color-field {
  grid-column: 1 / -1;
}

.field-color-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.field-color-control input[type="color"] {
  width: 100%;
  min-height: 52px;
  padding: 5px;
  cursor: pointer;
}

.field-row input,
.field-row select,
.field-row textarea {
  min-width: 0;
}

.field-weather-area-row {
  align-items: start;
}

.field-weather-area-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  align-content: start;
  justify-items: start;
  padding: 0.15rem 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  min-height: 0;
  align-self: start;
}

.field-weather-area-summary span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
}

.field-weather-area-summary strong {
  display: block;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 700;
  word-break: break-word;
}

.field-weather-area-summary::before {
  content: "JMA 予報コード";
  color: var(--muted);
  font-size: 0.82rem;
  grid-column: 1;
  grid-row: 1;
}

.field-weather-area-summary::after {
  content: attr(data-code);
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 700;
  grid-column: 1;
  grid-row: 2;
}

.field-weather-area-summary-item {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
}

.field-weather-area-summary-item span {
  color: var(--muted);
  font-size: 0.82rem;
}

.field-weather-area-summary-item strong {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 1rem;
  line-height: 1.35;
  min-width: 0;
}

/* Keep the edit form compact: code input on the left and area name on the right. */
.field-weather-area-summary {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 0.15rem 0 0;
  border: 0;
  background: transparent;
  min-height: 0;
}

.field-weather-area-summary::before,
.field-weather-area-summary::after {
  content: none;
  display: none;
}

.field-weather-area-summary-item {
  display: none;
}

.editor label.toggle-field {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 100%;
  padding: 6px 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  white-space: nowrap;
  transform: translateY(12px);
}

.editor label.toggle-field input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 48px;
  height: 28px;
  margin: 0;
  flex: 0 0 auto;
  border: 1px solid rgba(33, 77, 55, 0.24);
  border-radius: 999px;
  background: rgba(33, 77, 55, 0.12);
  position: relative;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.editor label.toggle-field input[type="checkbox"]::after {
  content: "";
  position: absolute;
  inset: 3px auto 3px 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 24, 17, 0.18);
  transition: transform 0.18s ease, background 0.18s ease;
}

.editor label.toggle-field input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--accent), #2f7a54);
  border-color: transparent;
}

.editor label.toggle-field input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}

.editor label.toggle-field input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(33, 77, 55, 0.28);
  outline-offset: 2px;
}

.editor label.toggle-field span {
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
}

#bojo-total_amount[data-mode="manual"] {
  background: rgba(255, 255, 255, 0.96);
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.entity-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2vw, 1.25rem);
}

.entity-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 29, 22, 0.42);
  backdrop-filter: blur(8px);
}

.entity-modal-panel {
  position: relative;
  z-index: 1;
  width: min(48rem, calc(100vw - 2rem));
  max-height: min(88dvh, 56rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(31, 45, 36, 0.12);
  border-radius: var(--radius-xl);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.entity-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.5rem) clamp(1rem, 2vw, 1.5rem) 0;
}

.entity-modal-head h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.entity-modal-lead {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.entity-modal-close {
  flex: 0 0 auto;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border-radius: 999px;
  font-size: 1.45rem;
  line-height: 1;
}

.entity-modal-body {
  min-height: 0;
  overflow: auto;
  padding: clamp(1rem, 2vw, 1.5rem);
}

.entity-modal .editor {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.field-workdocs-bulk-modal .entity-modal-panel {
  width: min(60rem, calc(100vw - 2rem));
}

.field-workdocs-bulk-modal .entity-modal-body {
  display: grid;
  gap: 0.95rem;
}

.field-workdocs-bulk-form {
  display: grid;
  gap: 0.95rem;
}

.field-workdocs-bulk-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.field-workdocs-bulk-summary-item {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(31, 45, 36, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.76);
}

.field-workdocs-bulk-summary-item span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field-workdocs-bulk-summary-item strong {
  font-size: 1.05rem;
  line-height: 1.35;
}

.field-workdocs-bulk-field-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.1rem 0 0.2rem;
}

.field-workdocs-bulk-field-list:empty::before {
  content: "選択した圃場を表示します";
  color: var(--muted);
  font-size: 0.9rem;
}

.field-workdocs-bulk-field-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(31, 45, 36, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.2;
}

.field-workdocs-bulk-chip-swatch {
  flex: 0 0 auto;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: var(--field-chip-color, var(--accent));
  box-shadow: 0 0 0 4px rgba(74, 124, 91, 0.12);
}

.field-workdocs-bulk-chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-workdocs-bulk-chip-area {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.field-workdocs-bulk-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.field-workdocs-bulk-modal textarea {
  min-height: 5.25rem;
  resize: vertical;
}

.delete-modal {
  position: fixed;
  inset: 0;
  z-index: 7000;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2vw, 1.25rem);
}

body.is-delete-modal-open .field-sheet,
body.is-delete-modal-open .pin-sheet {
  z-index: 3000;
}

.delete-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 29, 22, 0.58);
  backdrop-filter: blur(8px);
}

.delete-modal-panel {
  position: relative;
  z-index: 1;
  width: min(40rem, calc(100vw - 2rem));
  max-height: min(32rem, calc(100dvh - 2rem));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(31, 45, 36, 0.12);
  border-radius: var(--radius-xl);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.delete-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.35rem) clamp(1rem, 2vw, 1.35rem) 0;
}

.delete-modal-head h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.8vw, 1.55rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.delete-modal-lead {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.delete-modal-close {
  flex: 0 0 auto;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
  border-radius: 999px;
  font-size: 1.4rem;
  line-height: 1;
}

.delete-modal-body {
  min-height: 0;
  display: grid;
  gap: 0.8rem;
  padding: clamp(0.9rem, 2vw, 1.2rem);
  overflow: auto;
}

.delete-modal-card {
  display: grid;
  gap: 0.6rem;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(31, 45, 36, 0.1);
  background: rgba(255, 255, 255, 0.78);
}

.delete-modal-card-head {
  display: grid;
  gap: 0.4rem;
}

.delete-modal-label {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.delete-modal-card strong {
  font-size: 0.98rem;
  line-height: 1.5;
  word-break: break-word;
}

.delete-modal-detail-table {
  display: grid;
  gap: 0.25rem;
}

.delete-modal-detail-table-head,
.delete-modal-detail-row {
  display: grid;
  grid-template-columns: minmax(6rem, 7rem) minmax(0, 1fr);
  gap: 0.6rem;
  align-items: start;
}

.delete-modal-detail-table-head {
  padding: 0.1rem 0.1rem 0.25rem;
  border-bottom: 1px solid rgba(31, 45, 36, 0.1);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.delete-modal-detail-row {
  padding: 0.45rem 0.1rem;
  border-radius: 12px;
  border-bottom: 1px solid rgba(31, 45, 36, 0.06);
}

.delete-modal-detail-key {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.5;
}

.delete-modal-detail-value {
  min-width: 0;
  line-height: 1.5;
  word-break: break-word;
}

.delete-modal-detail-empty {
  padding: 0.2rem 0.1rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.delete-modal-actions {
  justify-content: flex-end;
}

.delete-modal-actions > button {
  flex: 1 1 10rem;
}

.delete-modal .primary.danger {
  background: linear-gradient(135deg, var(--danger), #7d3535);
  box-shadow: 0 14px 28px rgba(125, 53, 53, 0.26);
}

.delete-modal .primary.danger:hover {
  transform: translateY(-1px);
}

@media (min-width: 1024px) {
  .entity-modal {
    inset: 0;
    z-index: 3020;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    padding: 0.75rem;
  }

  .entity-modal-panel {
    position: relative;
    z-index: 1;
    width: min(44rem, calc(100vw - 1.5rem));
    height: auto;
    max-height: calc(100dvh - 1.5rem);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid rgba(31, 45, 36, 0.12);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    box-shadow: var(--shadow);
    transform: translateY(1.25rem);
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
  }

  .field-workdocs-bulk-modal .entity-modal-panel {
    width: min(60rem, calc(100vw - 1.5rem));
  }

  .entity-modal.is-open .entity-modal-panel {
    transform: translateY(0);
  }

  .entity-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(17, 29, 22, 0.42);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 240ms ease;
    cursor: pointer;
  }

  .entity-modal-body {
    min-height: 0;
    overflow: auto;
    padding: 0 1rem 1rem;
  }

  .entity-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1rem 0.75rem;
  }

  .entity-modal-head h4 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 2vw, 1.7rem);
    line-height: 1.15;
    letter-spacing: 0.01em;
  }

  .entity-modal-lead {
    margin: 0.45rem 0 0;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.6;
  }

  .entity-modal-close {
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
    border-radius: 999px;
    font-size: 1.45rem;
    line-height: 1;
  }

  body.is-filter-drawer-open,
  body.is-entity-modal-open {
    overflow: auto;
  }

  body.is-filter-drawer-open .filter-drawer,
  body.is-entity-modal-open .entity-modal {
    pointer-events: auto;
  }

  body.is-filter-drawer-open .filter-drawer-backdrop,
  body.is-entity-modal-open .entity-modal-backdrop {
    opacity: 1;
  }

  body.is-filter-drawer-open .filter-drawer-panel,
  body.is-entity-modal-open .entity-modal-panel {
    transform: translateY(0);
  }

  .entity-modal .editor {
    padding: 0;
    gap: 10px;
  }

  .entity-modal .field-row {
    gap: 10px;
  }

  .entity-modal .editor label {
    gap: 6px;
  }

  .entity-modal .editor span {
    font-size: 0.82rem;
  }

  .entity-modal .editor input,
  .entity-modal .editor select,
  .entity-modal .editor textarea {
    padding: 10px 12px;
  }

  .entity-modal .editor label.toggle-field {
    padding: 0;
    transform: none;
    min-height: 2.75rem;
  }

  .entity-modal .editor label.toggle-field input[type="checkbox"] {
    width: 44px;
    height: 26px;
  }

  .entity-modal .editor label.toggle-field input[type="checkbox"]::after {
    width: 18px;
    height: 18px;
  }

  .entity-modal .editor label.toggle-field input[type="checkbox"]:checked::after {
    transform: translateX(18px);
  }

  .entity-modal .button-row {
    gap: 8px;
  }

  .entity-modal .button-row > button {
    min-height: 2.75rem;
    padding: 11px 16px;
  }

  .delete-modal-panel {
    width: min(44rem, calc(100vw - 3rem));
    max-height: min(36rem, calc(100dvh - 2rem));
  }

  .delete-modal-head {
    padding: 0.9rem 1rem 0;
  }

  .delete-modal-body {
    padding: 0.85rem 1rem 0.95rem;
  }

  .delete-modal-card {
    gap: 0.55rem;
    padding: 0.8rem 0.9rem;
  }

  .delete-modal-detail-table-head,
  .delete-modal-detail-row {
    grid-template-columns: minmax(6.5rem, 7.5rem) minmax(0, 1fr);
  }
}

.table-card {
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 45rem;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(31, 45, 36, 0.08);
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.94);
  font-size: 0.83rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

tbody tr:hover {
  background: rgba(109, 141, 89, 0.05);
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-wrap: nowrap;
  min-width: 6.8rem;
  white-space: nowrap;
}

.workdocs-tab-table .table-actions {
  min-width: 9.8rem;
}

.table-actions-cell {
  display: grid;
  justify-items: end;
  gap: 0.2rem;
  width: 100%;
}

.table-actions-cell .record-updated-meta {
  margin-top: 0;
}

.table-action-button {
  width: 2.7rem;
  height: 2.7rem;
  flex: 0 0 auto;
  padding: 0;
  border-radius: 14px;
}

.table-action-button svg {
  width: 1.5rem;
  height: 1.5rem;
}

.table-action-button--pdf {
  color: #365b74;
  background: rgba(79, 124, 145, 0.12);
  border-color: rgba(79, 124, 145, 0.18);
}

#bojo-tbody td:last-child {
  white-space: normal;
}

#bojo-tbody .table-actions {
  justify-content: flex-end;
}

.categories-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.category-master-table,
.named-master-table {
  min-width: 0;
  table-layout: fixed;
}

.category-master-table th,
.category-master-table td,
.named-master-table th,
.named-master-table td {
  vertical-align: middle;
}

.category-master-table th:nth-child(1),
.category-master-table td:nth-child(1) {
  width: 4rem;
  text-align: center;
}

.category-master-table th:nth-child(2),
.category-master-table td:nth-child(2) {
  width: 6.875rem;
}

.category-master-table th:nth-child(3),
.category-master-table td:nth-child(3),
.named-master-table th:nth-child(2),
.named-master-table td:nth-child(2) {
  width: 6.875rem;
}

.category-master-table th:nth-child(4),
.category-master-table td:nth-child(4),
.named-master-table th:nth-child(3),
.named-master-table td:nth-child(3) {
  width: 10.5rem;
}

.category-master-table .category-order-cell {
  white-space: nowrap;
  text-align: center;
}

.category-master-table .drag-handle {
  margin-inline: auto;
}

.named-master-table th:nth-child(1),
.named-master-table td:nth-child(1) {
  width: 4rem;
  text-align: center;
}

.named-master-table th:nth-child(3),
.named-master-table td:nth-child(3) {
  width: 6.875rem;
}

.named-master-table th:nth-child(4),
.named-master-table td:nth-child(4) {
  width: 10.5rem;
}

.named-master-table .category-order-cell {
  white-space: nowrap;
  text-align: center;
}

.named-master-table .drag-handle {
  margin-inline: auto;
}

.category-sort-control {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.category-sort-control span {
  font-size: 0.82rem;
  color: var(--muted);
}

.category-sort-control select {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(31, 45, 36, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  outline: none;
}

.category-sort-control select:focus {
  border-color: rgba(109, 141, 89, 0.72);
  box-shadow: 0 0 0 4px rgba(109, 141, 89, 0.12);
}

.category-sort-note {
  color: var(--muted);
  font-size: 0.86rem;
  align-self: end;
}

.master-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  margin-top: 14px;
  border: 1px solid rgba(31, 45, 36, 0.08);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(248, 250, 244, 0.96), rgba(241, 245, 236, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.master-tab-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: transparent;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.master-tab-button:hover {
  background: rgba(109, 141, 89, 0.08);
  color: var(--text);
}

.master-tab-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(109, 141, 89, 0.16);
}

.master-tab-button.is-active {
  background: linear-gradient(135deg, rgba(109, 141, 89, 0.98), rgba(78, 121, 93, 0.96));
  color: #fff;
  box-shadow: 0 10px 20px rgba(79, 124, 89, 0.22);
  transform: translateY(-1px);
}

.master-tab-panels {
  margin-top: 18px;
}

.master-tab-panel[hidden] {
  display: none;
}

.master-tab-panel {
  min-width: 0;
}

.category-order-cell {
  white-space: nowrap;
}

.category-order-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(31, 45, 36, 0.12);
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  user-select: none;
  cursor: grab;
  flex: 0 0 auto;
  touch-action: none;
  padding: 0;
  line-height: 1;
}

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

.category-order-number {
  min-width: 3ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.categories-table {
  min-width: 0;
  table-layout: fixed;
}

.categories-table th,
.categories-table td {
  vertical-align: middle;
}

.categories-table th:nth-child(1),
.categories-table td:nth-child(1) {
  width: 12.5rem;
}

.categories-table th:nth-child(2),
.categories-table td:nth-child(2) {
  width: 6.875rem;
}

.categories-table th:nth-child(5),
.categories-table td:nth-child(5) {
  width: 5.875rem;
}

.categories-table th:nth-child(7),
.categories-table td:nth-child(7) {
  width: 7.25rem;
}

.categories-table th:nth-child(8),
.categories-table td:nth-child(8) {
  width: 14rem;
}

.categories-table th:nth-child(3),
.categories-table td:nth-child(3) {
  width: 10.5rem;
}

.category-row.can-drag {
  cursor: default;
}

.category-row.can-drag .drag-handle {
  color: var(--accent);
  border-color: rgba(109, 141, 89, 0.26);
  background: rgba(109, 141, 89, 0.1);
  cursor: grab;
}

.category-row.view-only .drag-handle {
  cursor: default;
  opacity: 0.5;
}

.category-row.is-dragging {
  opacity: 0.45;
}

.category-row.drop-before td {
  box-shadow: inset 0 2px 0 rgba(109, 141, 89, 0.9);
}

.category-row.drop-after td {
  box-shadow: inset 0 -2px 0 rgba(109, 141, 89, 0.9);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(109, 141, 89, 0.12);
  color: var(--accent);
}

.tag.off {
  background: rgba(157, 77, 77, 0.12);
  color: var(--danger);
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(24, 36, 28, 0.92);
  color: white;
  box-shadow: var(--shadow);
  z-index: 5000;
}

.toast.is-error {
  background: rgba(157, 77, 77, 0.94);
}

.chart-tooltip {
  position: fixed;
  z-index: 40;
  max-width: min(20rem, calc(100vw - 2rem));
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(24, 36, 28, 0.94);
  color: white;
  box-shadow: 0 14px 30px rgba(24, 36, 28, 0.24);
  backdrop-filter: blur(18px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 220ms cubic-bezier(0.22, 1, 0.36, 1), transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  white-space: pre-line;
  font-size: 0.88rem;
  line-height: 1.55;
}

.chart-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (max-width: 1199px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-visuals {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    min-height: 0;
  }

  .chart-card--ring,
  .chart-card--bars,
  .chart-card--line {
    grid-column: auto;
    grid-row: auto;
    height: auto;
  }

  .chart-card--bars .bar-chart {
    grid-template-columns: 1fr;
    max-height: min(46vh, 28rem);
    height: auto;
  }

  .chart-card--line .line-chart {
    height: auto;
  }

  .chart-card--line .line-chart svg {
    height: 15rem;
  }

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

  .toolbar-actions {
    width: auto;
  }

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

  .field-sheet {
    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;
    width: min(35rem, calc(100vw - 1.5rem));
    max-height: calc(100dvh - 1.5rem);
    padding: 1rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr);
    transform: translate(-50%, calc(-50% + 1.25rem));
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
  }

  body.is-field-sheet-open .field-sheet {
    transform: translate(-50%, -50%);
  }

  .pin-sheet {
    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;
    width: min(35rem, calc(100vw - 1.5rem));
    max-height: calc(100dvh - 1.5rem);
    padding: 1rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr);
    transform: translate(-50%, calc(-50% + 1.25rem));
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
  }

  body.is-pin-sheet-open .pin-sheet {
    transform: translate(-50%, -50%);
  }

  table {
    min-width: 40rem;
  }
}

@media (max-width: 1023px) {
  .workspace {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 58;
    display: block;
    border: 0;
    padding: 0;
    background: rgba(18, 27, 21, 0.42);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    width: min(20rem, 84vw);
    height: 100dvh;
    border-radius: 0 1.75rem 1.75rem 0;
    transform: translateX(-102%);
    transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-brand-toggle {
    display: none;
  }

  .workspace.is-sidebar-open .sidebar {
    transform: translateX(0);
  }

  .workspace.is-sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-topbar {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 50;
    display: block;
    align-items: center;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .mobile-menu-btn {
    z-index: 50;
  }

  .main {
    min-width: 0;
    padding-top: 4.25rem;
  }

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

  .dashboard-visuals {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    min-height: 0;
  }

  .chart-card--ring {
    grid-row: auto;
    grid-column: auto;
  }

  .chart-card--bars,
  .chart-card--line {
    grid-column: auto;
    grid-row: auto;
    height: auto;
  }

  .chart-card--bars .bar-chart {
    grid-template-columns: 1fr;
    max-height: min(46vh, 400px);
  }

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

  .toolbar-actions {
    width: auto;
  }

  .filter-launcher-slot {
    top: 0.9rem;
    right: 0.9rem;
  }

  .filter-drawer {
    justify-content: center;
    align-items: center;
    padding: 0.75rem;
  }

  .filter-drawer-panel {
    width: min(100vw - 1.5rem, 42rem);
    height: auto;
    max-height: calc(100dvh - 1.5rem);
    border: 1px solid rgba(31, 45, 36, 0.12);
    border-radius: 24px;
    transform: translateY(1.25rem);
    background: rgba(255, 255, 255, 0.9);
  }

  body.is-filter-drawer-open .filter-drawer-panel {
    transform: translateY(0);
  }

  .filter-drawer-head {
    padding: 1rem 1rem 0.75rem;
  }

  .filter-drawer-body {
    padding: 0 1rem 1rem;
  }

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

  .field-layout {
    grid-template-columns: 1fr;
  }

  .field-map-shell,
  .field-map {
    min-height: clamp(22rem, 48vh, 34rem);
  }

  .field-sheet {
    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;
    width: min(35rem, calc(100vw - 1.5rem));
    max-height: calc(100dvh - 1.5rem);
    padding: 1rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    transform: translate(-50%, calc(-50% + 1.25rem));
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
  }

  body.is-field-sheet-open .field-sheet {
    transform: translate(-50%, -50%);
  }

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

  table {
    min-width: 640px;
  }

  .field-detail-grid {
    grid-template-columns: 1fr;
  }

  .field-map-controls {
    inset: 0;
  }

  .field-map-stack--left {
    top: 0.75rem;
    left: 0.75rem;
  }

  .field-map-stack--right {
    top: 0.75rem;
    right: 0.75rem;
  }

  .field-map-stack--bottom-right {
    right: 0.75rem;
    bottom: 2.75rem;
  }

  .field-base-menu {
    top: 3.125rem;
    width: min(17.5rem, calc(100vw - 1.5rem));
  }

  .table-card {
    overflow: hidden;
  }

  .table-card table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .table-card thead {
    display: none;
  }

  .table-card tbody {
    display: grid;
    gap: 0.75rem;
  }

  .table-card tbody tr {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 1rem;
    border-radius: 1.125rem;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.86);
  }

  .table-card tbody td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    min-width: 0;
    padding: 0;
    border-bottom: 0;
    text-align: left;
  }

  .table-card tbody td::before {
    display: block;
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: normal;
    content: "";
  }

  #bojo-tbody td:nth-child(1)::before {
    content: "日付";
  }

  #bojo-tbody td:nth-child(2)::before {
    content: "顧客";
  }

  #bojo-tbody td:nth-child(3)::before {
    content: "場所";
  }

  #bojo-tbody td:nth-child(4)::before {
    content: "薬剤";
  }

  #bojo-tbody td:nth-child(5)::before {
    content: "面積";
  }

  #bojo-tbody td:nth-child(6)::before {
    content: "10a単価";
  }

  #bojo-tbody td:nth-child(7)::before {
    content: "合計";
  }

  #bojo-tbody td:nth-child(8)::before {
    content: "操作";
  }

  #staff-tbody td:nth-child(1)::before {
    content: "日付";
  }

  #staff-tbody td:nth-child(2)::before {
    content: "作業員";
  }

  #staff-tbody td:nth-child(3)::before {
    content: "日当";
  }

  #staff-tbody td:nth-child(4)::before {
    content: "手当";
  }

  #staff-tbody td:nth-child(5)::before {
    content: "合計";
  }

  #staff-tbody td:nth-child(6)::before {
    content: "操作";
  }

  #assistant_income-tbody td:nth-child(1)::before {
    content: "日付";
  }

  #assistant_income-tbody td:nth-child(2)::before {
    content: "補助員";
  }

  #assistant_income-tbody td:nth-child(3)::before {
    content: "内容";
  }

  #assistant_income-tbody td:nth-child(4)::before {
    content: "収益";
  }

  #assistant_income-tbody td:nth-child(5)::before {
    content: "操作";
  }

  #expense-tbody td:nth-child(1)::before {
    content: "日付";
  }

  #expense-tbody td:nth-child(2)::before {
    content: "品目";
  }

  #expense-tbody td:nth-child(3)::before {
    content: "カテゴリ";
  }

  #expense-tbody td:nth-child(4)::before {
    content: "金額";
  }

  #expense-tbody td:nth-child(5)::before {
    content: "操作";
  }

  #audit-log-tbody td:nth-child(1)::before {
    content: "時刻";
  }

  #audit-log-tbody td:nth-child(2)::before {
    content: "誰が";
  }

  #audit-log-tbody td:nth-child(3)::before {
    content: "操作";
  }

  #audit-log-tbody td:nth-child(4)::before {
    content: "対象";
  }

  #audit-log-tbody td:nth-child(5)::before {
    content: "内容";
  }

  #category-tbody td:nth-child(1)::before {
    content: "カテゴリ";
  }

  #category-tbody td:nth-child(2)::before {
    content: "状態";
  }

  #category-tbody td:nth-child(3)::before {
    content: "操作";
  }

  .audit-log-card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .audit-log-card-actions {
    justify-content: flex-start;
  }

  .audit-log-filter-row {
    grid-template-columns: 1fr 1fr;
  }

  .audit-log-filter-actions,
  .audit-log-pagination {
    justify-content: flex-start;
  }

  .entity-history-head {
    flex-direction: column;
    align-items: stretch;
  }

  .entity-history-head-actions {
    justify-items: start;
  }

  .table-card tbody tr > td[colspan] {
    display: block;
    text-align: center;
  }

  .table-card tbody tr > td[colspan]::before {
    content: none;
  }

  .table-actions {
    justify-content: flex-start;
  }

  .table-actions-cell {
    justify-items: start;
  }

  #bojo-tbody .table-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 767px) {
  .auth-screen,
  .workspace {
    padding: 1rem;
  }

  .auth-card,
  .hero,
  .panel {
    padding: 1.25rem;
  }

  .hero {
    flex-direction: column;
    align-items: start;
  }

  .field-row,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .chart-card--ring {
    grid-row: auto;
    grid-column: auto;
  }

  .chart-card--bars,
  .chart-card--line {
    grid-column: auto;
    grid-row: auto;
    height: auto;
  }

  .chart-card--bars .bar-chart {
    grid-template-columns: 1fr;
    max-height: min(52vh, 420px);
  }

  .editor label.toggle-field {
    padding: 4px 2px 0;
    transform: none;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .bar-meta {
    align-items: flex-start;
    text-align: left;
  }

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

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .filter-launcher-slot {
    top: 0.75rem;
    right: 0.75rem;
  }

  .filter-drawer {
    padding: 0.5rem;
  }

  .filter-drawer-panel {
    width: min(100vw - 1rem, 42rem);
    max-height: calc(100dvh - 1rem);
    border-radius: 24px;
    transform: translateY(1rem);
    background: rgba(255, 255, 255, 0.9);
  }

  .filter-drawer-head {
    padding: 0.95rem 0.95rem 0.7rem;
  }

  .filter-drawer-body {
    padding: 0 0.95rem 0.95rem;
  }

  .filter-drawer .filter-bar {
    grid-template-columns: 1fr;
  }

  .filter-drawer .button-row.compact {
    justify-content: flex-start;
  }

  .filter-drawer .button-row.compact .primary {
    width: 100%;
  }

  .toolbar-actions {
    width: 100%;
  }

  .section-actions {
    right: 0.85rem;
    bottom: 0.85rem;
  }

  .section-actions .create-launcher-button {
    width: 3.1rem;
    height: 3.1rem;
    min-width: 3.1rem;
  }

  .section-actions .create-launcher-button svg {
    width: 1.55rem;
    height: 1.55rem;
  }

  .entity-modal {
    padding: 0.5rem;
  }

  .entity-modal-panel {
    width: min(100vw - 1rem, 42rem);
    max-height: calc(100dvh - 1rem);
    border-radius: 24px;
  }

  .field-workdocs-bulk-modal .entity-modal-panel {
    width: min(100vw - 1rem, 48rem);
  }

  .entity-modal-head {
    padding: 1rem 1rem 0;
  }

  .entity-modal-body {
    padding: 1rem;
  }

  .entity-modal .button-row > button {
    flex: 1 1 0;
  }

  .entity-modal .button-row,
  .field-sheet .button-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .entity-modal .button-row > button,
  .field-sheet .button-row > button {
    width: 100%;
    min-height: 2.75rem;
    padding: 11px 16px;
  }

  .field-sheet .button-row > button:nth-child(3) {
    grid-column: 1 / -1;
  }

  .field-layout {
    grid-template-columns: 1fr;
  }

  .field-detail-grid {
    grid-template-columns: 1fr;
  }

  .field-map-shell,
  .field-map {
    min-height: clamp(20rem, 48vh, 32rem);
  }

  .field-map-controls {
    inset: 0;
  }

  .field-map-status {
    max-width: none;
  }

  .field-map-stack--left {
    top: 0.75rem;
    left: 0.75rem;
  }

  .field-map-stack--right {
    top: 0.75rem;
    right: 0.75rem;
  }

  .field-map-stack--bottom-right {
    right: 0.75rem;
    bottom: 2.75rem;
  }

  .field-base-menu {
    top: 50px;
    width: min(17.5rem, calc(100vw - 1.5rem));
  }

  .field-sheet {
    top: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    width: auto;
    max-height: calc(100dvh - 1.5rem);
    padding: 1rem;
    border-radius: 24px;
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr);
    transform: translateY(1rem);
  }

  body.is-field-sheet-open .field-sheet {
    transform: translateY(0);
  }

  .pin-sheet {
    top: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    width: auto;
    max-height: calc(100dvh - 1.5rem);
    padding: 1rem;
    border-radius: 24px;
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr);
    transform: translateY(1rem);
  }

  body.is-pin-sheet-open .pin-sheet {
    transform: translateY(0);
  }

  .field-color-control {
    grid-template-columns: 1fr;
  }

  .button-row.compact {
    justify-content: flex-start;
  }

  .button-row.compact .primary {
    width: 100%;
  }

  .sidebar {
    gap: 18px;
  }

  .page-summary__top,
  .page-summary__body {
    grid-template-columns: 1fr;
  }

  .page-summary__top {
    display: grid;
  }

  .page-summary__period,
  .page-summary__chips {
    justify-content: flex-start;
  }

  .page-summary__body {
    align-items: start;
  }

  table {
    min-width: 0;
  }
}

@media (min-width: 1200px) {
  .entity-modal {
    inset: 0;
    z-index: 3020;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
    padding: 0;
  }

  .entity-modal-panel {
    position: relative;
    z-index: 1;
    width: min(34rem, calc(100vw - 1.5rem));
    height: 100dvh;
    max-height: none;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border-left: 1px solid rgba(31, 45, 36, 0.12);
    border-radius: 24px 0 0 24px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    box-shadow: -28px 0 48px rgba(25, 40, 31, 0.2);
    transform: translateX(104%);
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
  }

  .field-workdocs-bulk-modal .entity-modal-panel {
    width: min(58rem, calc(100vw - 1.5rem));
  }

  .entity-modal.is-open .entity-modal-panel {
    transform: translateX(0);
  }

  body.is-entity-modal-open .entity-modal-panel {
    transform: translateX(0);
  }

  .entity-modal-head {
    padding: 1.1rem 1.1rem 0.85rem;
  }

  .entity-modal-body {
    padding: 0 1.1rem 1.1rem;
  }

  .field-sheet {
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(34rem, calc(100vw - 1.5rem));
    height: 100dvh;
    max-height: none;
    padding: 0;
    gap: 0;
    overflow: hidden;
    border-left: 1px solid rgba(31, 45, 36, 0.12);
    border-radius: 24px 0 0 24px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    box-shadow: -28px 0 48px rgba(25, 40, 31, 0.18);
    transform: translateX(104%);
    grid-template-rows: auto minmax(0, 1fr);
  }

  body.is-field-sheet-open .field-sheet {
    transform: translateX(0);
  }

  .field-sheet-head {
    padding: 1.1rem 1.1rem 0.85rem;
  }

  .field-sheet-form {
    align-self: stretch;
    height: 100%;
    min-height: 0;
    overflow: auto;
    padding: 0 1.1rem 1.5rem;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .pin-sheet {
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(34rem, calc(100vw - 1.5rem));
    height: 100dvh;
    max-height: none;
    padding: 0;
    gap: 0;
    overflow: hidden;
    border-left: 1px solid rgba(31, 45, 36, 0.12);
    border-radius: 24px 0 0 24px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    box-shadow: -28px 0 48px rgba(25, 40, 31, 0.18);
    transform: translateX(104%);
    grid-template-rows: auto minmax(0, 1fr);
  }

  body.is-pin-sheet-open .pin-sheet {
    transform: translateX(0);
  }

  .pin-sheet .field-sheet-head {
    padding: 1.1rem 1.1rem 0.85rem;
  }

  .pin-sheet-form {
    align-self: stretch;
    height: 100%;
    min-height: 0;
    overflow: auto;
    padding: 0 1.1rem 1.5rem;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body.is-delete-modal-open {
    overflow: auto;
  }

  .delete-modal {
    inset: 0;
    z-index: 3030;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
    padding: 0;
  }

  .delete-modal-panel {
    position: relative;
    z-index: 1;
    width: min(34rem, calc(100vw - 1.5rem));
    height: 100dvh;
    max-height: none;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border-left: 1px solid rgba(31, 45, 36, 0.12);
    border-radius: 24px 0 0 24px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    box-shadow: -28px 0 48px rgba(25, 40, 31, 0.2);
    transform: translateX(104%);
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
  }

  .delete-modal.is-open .delete-modal-panel,
  body.is-delete-modal-open .delete-modal-panel {
    transform: translateX(0);
  }

  .delete-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(17, 29, 22, 0.42);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 240ms ease;
    cursor: pointer;
  }

  body.is-delete-modal-open .delete-modal {
    pointer-events: auto;
  }

  body.is-delete-modal-open .delete-modal-backdrop {
    opacity: 1;
  }

  .delete-modal-head {
    padding: 1.1rem 1.1rem 0.85rem;
  }

  .delete-modal-body {
    padding: 0 1.1rem 1.1rem;
  }

  .delete-modal-body {
    align-content: start;
    grid-auto-rows: max-content;
  }

  .delete-modal-actions {
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: nowrap;
    width: 100%;
    align-self: start;
  }

  .delete-modal-actions > button {
    flex: 0 0 auto;
    width: auto;
    min-width: 6.25rem;
    min-height: 2.75rem;
    padding: 0.72rem 1.05rem;
  }

  .workspace {
    display: block;
    padding-left: calc(var(--sidebar-rail-width) + var(--page-gap));
    transition: padding-left 220ms ease;
  }

  .workspace.is-sidebar-expanded {
    padding-left: calc(var(--sidebar-width) + var(--page-gap));
  }

  .sidebar {
    position: fixed;
    top: var(--page-gutter);
    left: var(--page-gutter);
    z-index: 100;
    width: var(--sidebar-rail-width);
    justify-items: center;
    gap: 0.95rem;
    padding: 0.95rem 0.7rem 1rem;
    transition: width 220ms ease, padding 220ms ease, gap 220ms ease;
  }

  .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-height: 2.9rem;
    min-width: 0;
  }

  .brand-copy {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateX(-0.35rem);
    pointer-events: none;
    white-space: nowrap;
    transition: max-width 220ms ease, opacity 180ms ease, transform 220ms ease;
  }

  .brand-copy .eyebrow,
  .brand-copy h2 {
    white-space: nowrap;
  }

  .nav-btn,
  #logout-btn {
    overflow: hidden;
  }

  .nav-label,
  .button-label,
  .user-card-label,
  .user-card-name {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    max-width: 0;
    opacity: 0;
    transform: translateX(-0.3rem);
    transition: max-width 220ms ease, opacity 160ms ease, transform 220ms ease;
  }

  .nav {
    width: 100%;
    padding-right: 0;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .nav-btn {
    justify-content: center;
    gap: 0;
    width: 100%;
    min-height: 3rem;
    padding: 0 0.85rem;
    font-size: 0.92rem;
    border-radius: 16px;
  }

  .nav-btn .sidebar-icon,
  #logout-btn .sidebar-icon {
    width: 1.15rem;
    height: 1.15rem;
  }

  .sidebar-footer {
    width: 100%;
    justify-items: center;
    padding-top: 0.85rem;
  }

  .sidebar-footer .user-card {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    border-color: transparent;
    background: transparent;
    transform: translateY(-0.2rem);
    pointer-events: none;
    transition:
      max-height 220ms ease,
      opacity 160ms ease,
      transform 220ms ease,
      padding 220ms ease,
      border-color 220ms ease,
      background 220ms ease;
  }

  #logout-btn {
    width: 100%;
    min-height: 3rem;
    padding: 0 0.85rem;
    font-size: 0.92rem;
    gap: 0;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
  }

  #logout-btn:hover {
    background: rgba(255, 255, 255, 0.16);
  }

  .workspace.is-sidebar-expanded .sidebar {
    width: var(--sidebar-width);
    justify-items: stretch;
    gap: 0.95rem;
    padding: 0.95rem;
  }

  .workspace.is-sidebar-expanded .brand {
    justify-content: flex-start;
    gap: 0.7rem;
  }

  .workspace.is-sidebar-expanded .brand-copy {
    max-width: 10rem;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
  }

  .workspace.is-sidebar-expanded .sidebar-footer {
    justify-items: stretch;
  }

  .workspace.is-sidebar-expanded .sidebar-footer .user-card {
    max-height: 5.5rem;
    opacity: 1;
    padding: 14px;
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(0);
    pointer-events: auto;
    transition-delay: 170ms;
  }

  .workspace.is-sidebar-expanded .nav-label,
  .workspace.is-sidebar-expanded .button-label,
  .workspace.is-sidebar-expanded .user-card-label,
  .workspace.is-sidebar-expanded .user-card-name {
    max-width: 12rem;
    opacity: 1;
    transform: translateX(0);
    transition-delay: 170ms;
  }

  .workspace.is-sidebar-expanded .nav-btn {
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0 0.85rem;
  }

  .workspace.is-sidebar-expanded #logout-btn {
    justify-content: flex-start;
    gap: 0.6rem;
    padding: 0 0.85rem;
  }

  .field-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "map"
      "sidebar";
    gap: 1.25rem;
  }

  .field-map-card {
    grid-area: map;
  }

  .field-sidebar {
    grid-area: sidebar;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: stretch;
  }

  .field-list-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .field-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: clamp(24rem, 50vh, 34rem);
  }

  .field-map-shell,
  .field-map {
    min-height: clamp(30rem, 58vh, 48rem);
  }

}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-sidebar {
  inset: 1rem 1rem 1rem auto;
  width: min(31rem, 54vw);
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-panel-toolbar {
  display: grid;
  gap: 12px;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-card,
body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-shell,
body.is-fields-fullscreen .panel[data-panel="fields"] .field-map {
  height: 100%;
  min-height: 0;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-card {
  overflow: hidden;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-shell {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-map {
  border-radius: inherit;
  border: 0;
}

@media (max-width: 1023px) {
  body.is-fields-fullscreen .panel[data-panel="fields"] .field-sidebar {
    inset: auto 0.75rem 0.75rem 0.75rem;
    width: auto;
    grid-template-columns: 1fr;
    max-height: min(56dvh, calc(100dvh - 5rem));
    border-radius: 24px;
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-panel-toolbar .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  body.is-fields-fullscreen .panel[data-panel="fields"] .field-sidebar {
    grid-template-columns: 1fr;
    max-height: min(60dvh, calc(100dvh - 4.5rem));
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-panel-toolbar .filter-bar {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--left {
    left: calc(var(--sidebar-rail-width) + 1rem);
  }
}

body.is-fields-fullscreen,
body.is-fields-fullscreen.is-field-sheet-open {
  overflow: hidden;
}

body:has(.panel[data-panel="fields"].is-active) {
  overflow: hidden;
}

body:has(.panel[data-panel="fields"].is-active) .workspace {
  display: block;
  height: 100dvh;
  width: 100%;
  padding: 0;
  overflow: hidden;
}

body:has(.panel[data-panel="fields"].is-active) .main {
  width: 100%;
  max-width: none;
  min-height: 0;
}

body:has(.panel[data-panel="fields"].is-active) .panel[data-panel="fields"].is-active {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  z-index: 30;
}

body:has(.workspace.is-sidebar-expanded) .panel[data-panel="fields"].is-active {
  inset: 0;
}

body:has(.panel[data-panel="fields"].is-active) .field-layout {
  min-height: 0;
}

body:has(.panel[data-panel="fields"].is-active) .field-map-stack--left {
  left: calc(var(--sidebar-rail-width) + 1rem);
}

body:has(.workspace.is-sidebar-expanded) .field-map-stack--left {
  left: calc(var(--sidebar-width) + 1rem);
}

@media (max-width: 1023px) {
  body:has(.panel[data-panel="fields"].is-active) .workspace {
    display: block;
    padding: 0;
  }

  body:has(.panel[data-panel="fields"].is-active) .panel[data-panel="fields"].is-active {
    inset: 0;
  }

  body:has(.panel[data-panel="fields"].is-active) .field-panel-head,
  body:has(.panel[data-panel="fields"].is-active) .field-panel-toolbar,
  body:has(.panel[data-panel="fields"].is-active) .field-list-card {
    display: none;
  }

body:has(.panel[data-panel="fields"].is-active) .field-sidebar {
  inset: 1rem 1rem 1rem auto;
  width: min(31rem, 54vw);
    grid-template-columns: 1fr;
    max-height: calc(100dvh - 2rem);
    border-radius: 24px;
    padding: 14px;
  }

  body:has(.panel[data-panel="fields"].is-active) .field-panel-toolbar .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:has(.panel[data-panel="fields"].is-active) .field-detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body:has(.panel[data-panel="fields"].is-active) .field-detail-card {
    padding: 14px;
  }

}

@media (max-width: 767px) {
  body:has(.panel[data-panel="fields"].is-active) .field-sidebar {
    inset: auto 0.75rem 0.75rem 0.75rem;
    grid-template-columns: 1fr;
    max-height: min(44dvh, calc(100dvh - 4rem));
  }

  body:has(.panel[data-panel="fields"].is-active) .field-panel-toolbar .filter-bar {
    grid-template-columns: 1fr;
  }

  body:has(.panel[data-panel="fields"].is-active) .field-detail-grid {
    grid-template-columns: 1fr;
  }
}

body.is-fields-fullscreen .workspace,
body.is-fields-fullscreen .workspace.is-sidebar-expanded,
body:has(.panel[data-panel="fields"].is-active) .workspace {
  display: block;
  width: 100%;
  min-height: 100dvh;
  height: 100dvh;
  margin: 0;
  padding: 0 !important;
  padding-left: 0 !important;
  padding-inline-start: 0 !important;
  overflow: hidden;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-card,
body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-shell,
body.is-fields-fullscreen .panel[data-panel="fields"] .field-map {
  border-radius: 0;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--right,
body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--bottom-right {
  right: calc(min(31rem, 54vw) + 1rem);
}

@media (max-width: 767px) {
  body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--right,
  body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--bottom-right {
    right: 0.75rem;
  }
}

body.is-fields-fullscreen {
  --sidebar-current-width: calc(var(--sidebar-rail-width) + var(--page-gutter));
}

body.is-fields-fullscreen .workspace.is-sidebar-expanded {
  --sidebar-current-width: calc(var(--sidebar-width) + var(--page-gutter));
}

body.is-fields-fullscreen .workspace {
  --field-panel-current-width: 0px;
  --field-panel-current-height: 0px;
}

body.is-fields-fullscreen .panel[data-panel="fields"].is-active {
  --field-panel-current-width: 0px;
  --field-panel-current-height: 0px;
}

body.is-fields-fullscreen .filter-launcher-slot {
  display: none;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-controls {
  z-index: 1180;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack {
  transition:
    left 220ms ease,
    right 220ms ease,
    bottom 220ms ease,
    width 220ms ease,
    opacity 220ms ease,
    transform 220ms ease;
}

/* 地図上の絞り込み・パネルトグルボタン — 既存ボタンとスタイル統一 */
.field-filter-launcher-button,
.field-panel-toggle-button {
  background: rgba(247, 251, 244, 0.96);
  color: #214d37;
  border: 1px solid rgba(33, 77, 55, 0.16);
  box-shadow: 0 10px 20px rgba(25, 40, 31, 0.08);
}

.field-filter-launcher-button:hover,
.field-panel-toggle-button:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 12px 24px rgba(25, 40, 31, 0.12);
}

.field-filter-launcher-button.is-active,
.field-panel-toggle-button.is-active {
  border-color: rgba(79, 124, 145, 0.34);
  background: rgba(79, 124, 145, 0.14);
  color: #365b74;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--top {
  top: 1rem;
  left: calc(var(--sidebar-current-width) + 1rem);
  width: min(26rem, calc(100vw - var(--sidebar-current-width) - var(--field-panel-current-width) - 2rem));
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "search filter"
    "place place";
  align-items: start;
  gap: 8px;
  z-index: 1200;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--left {
  top: clamp(7.5rem, 15vh, 10rem);
  left: calc(var(--sidebar-current-width) + 1rem);
  z-index: 1185;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-search-autocomplete--map {
  grid-area: search;
  width: 100%;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-filter-launcher-button {
  grid-area: filter;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-search-autocomplete--map input {
  height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(31, 45, 36, 0.14);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 24px rgba(25, 40, 31, 0.08);
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--summary {
  left: calc(var(--sidebar-current-width) + 1rem);
  right: calc(var(--field-panel-current-width) + 5rem);
  bottom: 2rem;
  z-index: 1170;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--summary .page-summary--fields {
  display: block;
  width: 100%;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--summary .page-summary {
  padding: 12px 14px;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--summary .page-summary__body {
  grid-template-columns: 1fr;
  gap: 8px;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--summary .page-summary__amount-block {
  display: none;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--summary .page-summary__period,
body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--summary .page-summary__chips {
  justify-content: flex-start;
}

body.is-fields-fullscreen.is-field-panel-open .panel[data-panel="fields"] .field-map-stack--summary {
  display: none;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--right {
  top: 1rem;
  right: calc(var(--field-panel-current-width) + 1rem);
  z-index: 1180;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--bottom-right {
  right: calc(var(--field-panel-current-width) + 1rem);
  bottom: calc(var(--field-panel-current-height) + 3.5rem);
  z-index: 1180;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-panel-head {
  display: grid;
  gap: 8px;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-panel-head-copy h3 {
  font-size: 1.1rem;
  white-space: nowrap;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-panel-head-copy .eyebrow {
  display: none;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-panel-head-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-panel-close-button {
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  padding: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-sidebar {
  position: fixed;
  inset: var(--page-gutter) var(--page-gutter) var(--page-gutter) auto;
  width: min(31rem, 54vw);
  max-height: calc(100dvh - (var(--page-gutter) * 2));
  transform: translateX(calc(100% + var(--page-gutter)));
  opacity: 0;
  pointer-events: none;
  z-index: 1165;
  overflow: hidden;
  grid-template-rows: auto auto minmax(0, 1fr);
  transition:
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 220ms ease;
}

body.is-fields-fullscreen.is-field-panel-open .panel[data-panel="fields"] .field-sidebar {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

body.is-fields-fullscreen.is-field-panel-open .panel[data-panel="fields"].is-active {
  --field-panel-current-width: calc(min(31rem, 54vw) + var(--page-gutter));
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-panel-toolbar,
body.is-fields-fullscreen .panel[data-panel="fields"] .field-list-card,
body.is-fields-fullscreen .panel[data-panel="fields"] .field-detail-card {
  display: grid;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-list-card {
  min-height: 0;
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr);
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-list-card.is-compact {
  align-self: start;
  grid-template-rows: auto auto;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-list-card.is-compact .field-list {
  flex: 0 0 auto;
  overflow: visible;
  max-height: none;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-list {
  min-height: 0;
  max-height: none;
  overflow: auto;
  scrollbar-gutter: stable;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-detail-card {
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

body.is-field-panel-detail .panel[data-panel="fields"] .field-sidebar {
  grid-template-rows: auto minmax(0, 1fr);
}

body.is-field-panel-detail .panel[data-panel="fields"] .field-detail-card {
  grid-row: 2;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

@media (max-width: 1023px) {
  body.is-fields-fullscreen .workspace {
    --field-panel-current-width: 0px;
    --field-panel-current-height: min(50dvh, calc(100dvh - 4.5rem));
  }

  body.is-fields-fullscreen.is-field-panel-open .panel[data-panel="fields"].is-active {
    --field-panel-current-width: 0px;
    --field-panel-current-height: min(50dvh, calc(100dvh - 4.5rem));
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 1rem;
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--top,
  body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--left,
  body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--bottom-right {
    position: static;
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-sidebar {
    inset: auto 0.75rem 0.75rem 0.75rem;
    width: auto;
    max-height: var(--field-panel-current-height);
    transform: translateY(calc(100% + 0.75rem));
    border-radius: 24px 24px 20px 20px;
  }

  body.is-fields-fullscreen.is-field-panel-open .panel[data-panel="fields"] .field-sidebar {
    transform: translateY(0);
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--top {
    margin-left: 3.5rem;
    width: calc(100% - 3.5rem);
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--summary {
    right: calc(var(--field-panel-current-width) + 4.5rem);
    bottom: calc(var(--field-panel-current-height) + 2rem);
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--bottom-right {
    justify-items: start;
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-group--zoom,
  body.is-fields-fullscreen .panel[data-panel="fields"] #field-edit-geometry-btn,
  body.is-fields-fullscreen .panel[data-panel="fields"] #field-delete-map-btn {
    display: none;
  }

  body.is-fields-fullscreen.is-field-panel-open .panel[data-panel="fields"] .field-map-stack--summary,
  body.is-fields-fullscreen.is-field-panel-open .panel[data-panel="fields"] .field-map-stack--left,
  body.is-fields-fullscreen.is-field-panel-open .panel[data-panel="fields"] .field-map-stack--bottom-right {
    display: none;
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-panel-head {
    position: relative;
    padding-right: 3.5rem;
    gap: 4px;
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-panel-head-actions {
    gap: 6px;
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] #field-export-btn,
  body.is-fields-fullscreen .panel[data-panel="fields"] #field-import-btn {
    display: none;
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-panel-close-button {
    position: absolute;
    top: 0;
    right: 0;
    width: 3rem;
    height: 3rem;
    min-width: 3rem;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: none;
    z-index: 1;
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-panel-close-button > [aria-hidden="true"] {
    display: block;
    font-size: 1.4rem;
    font-weight: 900;
    line-height: 1;
    transform: none;
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-panel-toolbar .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  body.is-fields-fullscreen .workspace {
    --field-panel-current-height: calc(100dvh - 4.5rem);
  }

  body.is-fields-fullscreen.is-field-panel-open .panel[data-panel="fields"].is-active {
    --field-panel-current-width: 0px;
    --field-panel-current-height: calc(100dvh - 4.5rem);
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-sidebar {
    inset: auto 0.75rem 0.75rem 0.75rem;
    max-height: var(--field-panel-current-height);
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--summary {
    display: none !important;
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--top {
    margin-left: 3.5rem;
    width: calc(100% - 3.5rem);
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--summary .page-summary {
    padding: 10px 12px;
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--summary .page-summary__top {
    display: none;
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--summary {
    right: 4.5rem;
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-sidebar {
    inset: auto 0.75rem 0.75rem 0.75rem !important;
    height: var(--field-panel-current-height) !important;
    max-height: var(--field-panel-current-height) !important;
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-list-card.is-compact {
    align-self: stretch;
    grid-template-rows: auto minmax(0, 1fr);
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-list-card.is-compact .field-list {
    max-height: none;
    overflow-y: auto;
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--bottom-right {
    justify-items: start;
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-draw-menu {
    top: calc(100% + 10px);
    left: 0;
    width: min(14rem, calc(100vw - 1.5rem));
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-draw-menu-item[data-field-draw-action="edit-geometry"],
  body.is-fields-fullscreen .panel[data-panel="fields"] .field-draw-menu-item[data-field-draw-action="delete"] {
    display: inline-flex;
  }

  body.is-fields-fullscreen .panel[data-panel="fields"] .field-panel-toolbar .filter-bar {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1200px) {
  body.is-fields-fullscreen .panel[data-panel="fields"] .field-map-stack--left {
    top: clamp(4.5rem, 9vh, 7rem);
  }
}

.weather-time-card-pop svg,
.weather-weekly-pop svg {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.weather-forecast-wind-group {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 4px;
  width: 100%;
}

body.is-fields-fullscreen .panel[data-panel="fields"].is-active,
body:has(.panel[data-panel="fields"].is-active) .panel[data-panel="fields"].is-active {
  overflow: hidden;
  overflow: clip;
  overscroll-behavior-x: none;
}

body.is-fields-fullscreen .panel[data-panel="fields"] .field-sidebar,
body:has(.panel[data-panel="fields"].is-active) .panel[data-panel="fields"] .field-sidebar {
  contain: layout paint;
}

body.is-workdocs-page {
  overflow: auto;
}

body.is-workdocs-inline-open {
  overflow: hidden;
}

.workdocs-screen {
  position: relative;
  z-index: 1;
  min-height: 0;
  padding: clamp(1rem, 1.8vw, 1.5rem);
}

.workdocs-shell {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.workdocs-page {
  display: grid;
  gap: 1rem;
  padding-bottom: clamp(4rem, 6vw, 4.75rem);
}

.workdocs-page--inline {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: min(34rem, calc(100vw - 1.5rem));
  height: 100dvh;
  max-height: none;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  padding: 0;
  overflow: hidden;
  z-index: 3010;
  pointer-events: auto;
  border-left: 1px solid rgba(31, 45, 36, 0.12);
  border-radius: 24px 0 0 24px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  box-shadow: -28px 0 48px rgba(25, 40, 31, 0.18);
  transform: translateX(104%);
  opacity: 0;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
}

body.is-workdocs-inline-open .workdocs-inline-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.is-workdocs-inline-open .workdocs-inline-sheet.is-open {
  transform: translateX(0);
  opacity: 1;
}

.workdocs-inline-sheet-body {
  display: grid;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.workdocs-inline-sheet .workdocs-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
}

.workdocs-page--inline .workdocs-chooser {
  display: none;
}

.workdocs-page--inline .workdocs-field-card {
  display: none;
}

.workdocs-page.workdocs-page--inline .workdocs-panels {
  display: none;
}

.workdocs-page--picker {
  grid-template-rows: auto auto;
  align-content: start;
}

.workdocs-page--picker .workdocs-chooser {
  display: grid;
}

.workdocs-page--picker .workdocs-panels {
  display: none;
}

.workdocs-header {
  margin-bottom: clamp(1.25rem, 2vw, 2rem);
}

.workdocs-header--inline {
  margin-bottom: 0;
}

.workdocs-header-actions {
  display: grid;
  gap: 0.55rem;
  justify-items: end;
}

.workdocs-header-actions .panel-meta {
  text-align: right;
}

.workdocs-bulk-launcher-button {
  appearance: none;
  border: 1px solid rgba(79, 124, 89, 0.2);
  border-radius: 999px;
  padding: 0.78rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: linear-gradient(135deg, rgba(109, 141, 89, 0.16), rgba(255, 255, 255, 0.92));
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(25, 40, 31, 0.08);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.workdocs-bulk-launcher-button:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 124, 89, 0.32);
  box-shadow: 0 16px 28px rgba(25, 40, 31, 0.12);
}

.workdocs-bulk-launcher-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(109, 141, 89, 0.16), 0 12px 24px rgba(25, 40, 31, 0.08);
}

.workdocs-bulk-launcher-button svg {
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workdocs-bulk-launcher-button span {
  white-space: nowrap;
}

.workdocs-field-card,
.workdocs-chooser,
.workdocs-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.workdocs-field-card,
.workdocs-chooser {
  padding: 1rem;
}

.workdocs-field-card {
  display: grid;
  gap: 0.9rem;
}

.workdocs-page--inline .workdocs-field-summary,
.workdocs-page--inline .workdocs-list-card {
  display: none;
}

.workdocs-tabbed-surface {
  display: grid;
  gap: 1rem;
}

.workdocs-tabs-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem 1rem;
}

.workdocs-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(31, 45, 36, 0.08);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(248, 250, 244, 0.96), rgba(241, 245, 236, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.workdocs-tab-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: transparent;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.workdocs-tab-button:hover {
  background: rgba(109, 141, 89, 0.08);
  color: var(--text);
}

.workdocs-tab-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(109, 141, 89, 0.16);
}

.workdocs-tab-button.is-active {
  background: linear-gradient(135deg, rgba(109, 141, 89, 0.98), rgba(78, 121, 93, 0.96));
  color: #fff;
  box-shadow: 0 10px 20px rgba(79, 124, 89, 0.22);
  transform: translateY(-1px);
}

.workdocs-tab-button-count {
  min-width: 1.75rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
  text-align: center;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.workdocs-tab-button.is-active .workdocs-tab-button-count {
  background: rgba(255, 255, 255, 0.2);
}

.workdocs-tab-panels {
  display: grid;
  gap: 1rem;
}

.workdocs-tab-panel {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.workdocs-tab-panel[hidden] {
  display: none;
}

.workdocs-tab-panel-head {
  display: grid;
  gap: 0.35rem;
}

.workdocs-tab-panel-head h4 {
  margin: 0.1rem 0 0;
  font-size: 1.05rem;
}

.workdocs-tab-panel-head .muted {
  margin: 0.15rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.workdocs-tab-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.workdocs-filter-button,
.workdocs-create-button {
  width: 46px;
  height: 46px;
  padding: 0;
}

.workdocs-filter-button {
  background: rgba(247, 251, 244, 0.96);
  color: #214d37;
  border: 1px solid rgba(33, 77, 55, 0.16);
  box-shadow: 0 10px 20px rgba(25, 40, 31, 0.08);
}

.workdocs-filter-button:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 12px 24px rgba(25, 40, 31, 0.12);
}

.workdocs-filter-button.is-active {
  border-color: rgba(79, 124, 145, 0.34);
  background: rgba(79, 124, 145, 0.14);
  color: #365b74;
}

.workdocs-create-button {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #567244);
  box-shadow: 0 14px 28px rgba(86, 114, 68, 0.26), 0 8px 16px rgba(25, 40, 31, 0.08);
}

.workdocs-create-button:hover {
  transform: translateY(-1px);
}

.workdocs-create-button svg {
  fill: currentColor;
  stroke: none;
}

.workdocs-tab-filter {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  margin-top: -0.1rem;
}

.workdocs-tab-filter .button-row.compact {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.workdocs-tab-table {
  min-width: 0;
  overflow-x: auto;
}

.workdocs-day-group-row td {
  padding: 0;
  background: rgba(109, 141, 89, 0.06);
}

.workdocs-day-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
}

.workdocs-day-group-head-copy {
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}

.workdocs-day-group-head-copy strong {
  font-size: 0.95rem;
  line-height: 1.35;
}

.workdocs-day-group-head-copy span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.workdocs-tab-panel-note {
  margin-top: -0.15rem;
  font-size: 0.86rem;
}

.workdocs-records {
  display: grid;
  gap: 0.9rem;
}

.workdocs-records-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.workdocs-records-head h4 {
  margin: 0.1rem 0 0;
  font-size: 1.05rem;
}

.workdocs-records-head .muted {
  margin: 0.15rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.workdocs-records-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workdocs-panels .workdocs-list-card {
  display: none;
}

.workdocs-page--inline .workdocs-field-card {
  padding-block: 0.9rem 0.75rem;
}

.workdocs-field-select {
  display: block;
  width: min(100%, 34rem);
  min-width: 0;
  max-width: 100%;
  padding: 13px 44px 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(31, 45, 36, 0.14);
  background:
    rgba(255, 255, 255, 0.94)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23567144' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right 14px center / 14px 14px;
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  appearance: none;
  -webkit-appearance: none;
}

.workdocs-field-select:focus {
  border-color: rgba(109, 141, 89, 0.72);
  box-shadow: 0 0 0 4px rgba(109, 141, 89, 0.12);
}

.workdocs-field-summary {
  display: grid;
  gap: 0.85rem;
}

.workdocs-summary-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workdocs-summary-item {
  border-radius: var(--radius-md);
  background: rgba(109, 141, 89, 0.08);
  border: 1px solid rgba(109, 141, 89, 0.16);
  padding: 0.8rem 0.9rem;
  display: grid;
  gap: 0.2rem;
}

.workdocs-summary-item span {
  color: var(--muted);
  font-size: 0.84rem;
}

.workdocs-summary-item strong {
  font-size: 1rem;
  line-height: 1.4;
}

.workdocs-chooser {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.workdocs-choice {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius-lg) + 4px);
  background: rgba(255, 255, 255, 0.62);
  padding: 1rem 1rem 0.95rem;
  text-align: left;
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  align-items: center;
  gap: 0.9rem;
  box-shadow: 0 10px 28px rgba(25, 40, 31, 0.08);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.workdocs-choice:hover {
  transform: translateY(-1px);
  border-color: rgba(109, 141, 89, 0.36);
  box-shadow: 0 16px 34px rgba(25, 40, 31, 0.12);
}

.workdocs-choice.is-active {
  background: rgba(109, 141, 89, 0.14);
  border-color: rgba(109, 141, 89, 0.42);
}

.workdocs-choice-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(109, 141, 89, 0.14);
  color: var(--accent);
}

.workdocs-choice-icon svg {
  width: 1.35rem;
  height: 1.35rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workdocs-choice-copy {
  display: grid;
  gap: 0.2rem;
}

.workdocs-choice-copy strong {
  font-size: 1.02rem;
}

.workdocs-choice-copy span {
  color: var(--muted);
  font-size: 0.88rem;
}

.workdocs-choice-badge {
  align-self: start;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  background: rgba(31, 45, 36, 0.06);
  color: var(--muted);
  font-size: 0.76rem;
}

.workdocs-panels {
  display: none;
  gap: 1rem;
}

.workdocs-page--inline .workdocs-panels {
  display: none;
}

.workdocs-page.workdocs-page--inline[data-active-kind="plan"] .workdocs-panel--plan,
.workdocs-page.workdocs-page--inline[data-active-kind="report"] .workdocs-panel--report {
  display: contents;
}

.workdocs-page.workdocs-page--inline .workdocs-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.workdocs-panel {
  display: none;
  min-height: 0;
  overflow: hidden;
}

.workdocs-page[data-active-kind="choose"] .workdocs-panel {
  display: none;
}

.workdocs-page[data-active-kind="plan"] .workdocs-panel--plan,
.workdocs-page[data-active-kind="report"] .workdocs-panel--report {
  display: grid;
}

.workdocs-panel-inner {
  padding: 1rem;
  display: grid;
  gap: 1rem;
  min-height: 0;
}

.workdocs-panel-inner--inline {
  display: contents;
  padding: 0;
  gap: 0;
  height: auto;
  overflow: visible;
  grid-template-rows: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.workdocs-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.workdocs-panel-head h3 {
  margin: 0.1rem 0 0;
  font-size: 1.1rem;
}

.workdocs-panel-head p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.workdocs-form {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.75);
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
}

.workdocs-page--inline .workdocs-form {
  height: 100%;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 1.1rem 1.5rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.workdocs-form .field-row {
  align-items: start;
}

.workdocs-form textarea {
  min-height: 8rem;
}

.workdocs-plan-estimate {
  display: grid;
  gap: 0.4rem;
  border-radius: 1rem;
  border: 1px solid rgba(47, 79, 54, 0.16);
  background: linear-gradient(135deg, rgba(49, 105, 66, 0.12), rgba(255, 255, 255, 0.72));
  padding: 0.9rem 1rem;
}

.workdocs-plan-estimate__copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
}

.workdocs-plan-estimate__label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.workdocs-plan-estimate__value {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 800;
  color: var(--olive-900);
}

.workdocs-plan-estimate__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.workdocs-plan-estimate--inline {
  min-width: 0;
  align-self: stretch;
}

.workdocs-report-status {
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(31, 45, 36, 0.08);
  border-radius: 14px;
  background: rgba(31, 45, 36, 0.05);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.workdocs-report-status.is-warning {
  border-color: rgba(193, 156, 88, 0.3);
  background: rgba(193, 156, 88, 0.14);
  color: #7a581b;
}

.workdocs-report-weather-card,
.workdocs-report-response {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid rgba(31, 45, 36, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
}

.workdocs-report-weather-card {
  background: linear-gradient(180deg, rgba(109, 141, 89, 0.08), rgba(255, 255, 255, 0.8));
}

.workdocs-report-weather-card__head,
.workdocs-report-response__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.workdocs-report-weather-card__head h4,
.workdocs-report-response__head h4 {
  margin: 0.1rem 0 0;
  font-size: 1.05rem;
}

.workdocs-report-weather-card__badge,
.workdocs-report-response__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.workdocs-report-weather-card__badge {
  background: rgba(109, 141, 89, 0.14);
  color: #37603f;
}

.workdocs-report-response__badge {
  background: rgba(193, 156, 88, 0.16);
  color: #7a581b;
}

.workdocs-report-weather-card__grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workdocs-report-weather-card__item {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(31, 45, 36, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
}

.workdocs-report-weather-card__item span {
  color: var(--muted);
  font-size: 0.82rem;
}

.workdocs-report-weather-card__item strong {
  font-size: 0.97rem;
  line-height: 1.4;
  word-break: break-word;
}

.workdocs-report-weather-card__note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.workdocs-report-response {
  background: rgba(31, 45, 36, 0.03);
}

.workdocs-report-response__choices {
  display: grid;
  gap: 0.6rem;
}

.workdocs-report-response__choice {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  padding: 0.8rem 0.85rem;
  border: 1px solid rgba(31, 45, 36, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.workdocs-report-response__choice:hover {
  transform: translateY(-1px);
  border-color: rgba(109, 141, 89, 0.32);
}

.workdocs-report-response__choice input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.1rem 0 0;
  accent-color: var(--accent);
}

.workdocs-report-response__choice-copy {
  display: grid;
  gap: 0.15rem;
}

.workdocs-report-response__choice-copy strong {
  font-size: 0.95rem;
}

.workdocs-report-response__choice-copy span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.workdocs-report-response__other {
  display: grid;
  gap: 0.35rem;
}

.workdocs-report-response__other span {
  color: var(--muted);
  font-size: 0.84rem;
}

.workdocs-report-response__other textarea {
  min-height: 5.25rem;
}

.workdocs-report-response__preview {
  margin: 0;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(31, 45, 36, 0.14);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.field-row--toggle {
  grid-template-columns: minmax(0, 1fr);
}

.toggle-label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 100%;
  padding: 6px 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  white-space: nowrap;
  transform: translateY(12px);
}

.toggle-label input[type="checkbox"] {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid rgba(33, 77, 55, 0.24);
  border-radius: 999px;
  background: rgba(33, 77, 55, 0.12);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  inset: 3px auto 3px 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 24, 17, 0.18);
  transition: transform 0.18s ease, background 0.18s ease;
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch {
  background: linear-gradient(135deg, var(--accent), #2f7a54);
  border-color: transparent;
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch::after {
  transform: translateX(20px);
}

.toggle-label input[type="checkbox"]:focus-visible + .toggle-switch {
  outline: 2px solid rgba(33, 77, 55, 0.28);
  outline-offset: 2px;
}

.toggle-label > span:last-child {
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--text);
  line-height: 1.2;
}

.workdocs-list-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

.workdocs-list-empty {
  padding: 1rem;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .workdocs-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workdocs-records-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 920px) {
  .workdocs-header,
  .workdocs-chooser {
    grid-template-columns: 1fr;
  }

  .workdocs-header {
    display: grid;
  }

  .workdocs-header-actions {
    justify-items: start;
  }

  .workdocs-header-actions .panel-meta {
    text-align: left;
  }

  .workdocs-tabs {
    width: 100%;
  }

  .workdocs-tab-button {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
  }

  .workdocs-records-head {
    display: grid;
  }

  .workdocs-tab-panel-head {
    display: grid;
  }

  .workdocs-tab-filter {
    grid-template-columns: 1fr;
  }

  .workdocs-tab-filter .button-row.compact {
    grid-column: auto;
  }

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

  .workdocs-choice {
    grid-template-columns: 2.8rem 1fr;
  }

  .workdocs-choice-badge {
    justify-self: start;
    margin-top: 0.4rem;
  }

  .workdocs-report-weather-card__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toggle-label {
    white-space: normal;
    transform: none;
  }
}

@media (min-width: 1024px) {
  .workdocs-page .workdocs-panels {
    display: none;
  }
}

@media (max-width: 720px) {
  .workdocs-report-weather-card__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .workdocs-report-response__choice {
    grid-template-columns: 1.05rem minmax(0, 1fr);
  }
}

@media (max-width: 1023px) {
  .workdocs-page--inline,
  .workdocs-inline-sheet {
    top: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    width: auto;
    max-height: calc(100dvh - 1.5rem);
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(31, 45, 36, 0.12);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
    transform: translateY(1rem);
  }

  body.is-workdocs-inline-open .workdocs-inline-sheet.is-open {
    transform: translateY(0);
  }
}
