:root {
  --paper: #f7f3ea;
  --paper-2: #fffaf1;
  --linen: #eee3d1;
  --sand: #dac9ad;
  --ink: #342519;
  --muted: #7b6b58;
  --coffee: #4c3320;
  --gold: #a9823b;
  --sage: #6f7f68;
  --clay: #af694e;
  --wine: #653a42;
  --line: rgba(82, 58, 35, 0.18);
  --shadow: 0 22px 60px rgba(53, 37, 20, 0.13);
  --soft-shadow: 0 10px 26px rgba(53, 37, 20, 0.09);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(175, 105, 78, 0.13), transparent 32%),
    radial-gradient(circle at 82% 80%, rgba(111, 127, 104, 0.16), transparent 34%),
    linear-gradient(135deg, #f8f4ea 0%, #efe1cb 54%, #e8d7bd 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

body.auth-checking .app-shell,
body.auth-locked .app-shell {
  visibility: hidden;
}

.auth-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 12%, rgba(175, 105, 78, 0.13), transparent 32%),
    radial-gradient(circle at 82% 80%, rgba(111, 127, 104, 0.16), transparent 34%),
    linear-gradient(135deg, #f8f4ea 0%, #efe1cb 54%, #e8d7bd 100%);
}

.auth-layer[hidden] {
  display: none;
}

.auth-card {
  width: min(360px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.94);
  box-shadow: var(--shadow);
}

.auth-card img {
  width: 140px;
  display: block;
  margin: 0 auto 8px;
}

.auth-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
}

.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  border-left: 1px solid var(--line);
  background: rgba(231, 217, 191, 0.76);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand-card {
  border: 1px solid rgba(82, 58, 35, 0.28);
  background: rgba(255, 250, 241, 0.72);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--soft-shadow);
}

.brand-card img {
  width: 100%;
  aspect-ratio: 1.2;
  object-fit: cover;
  display: block;
  border-radius: 4px;
  filter: sepia(0.12) contrast(0.96);
}

.side-nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--coffee);
  border-radius: var(--radius);
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 8px;
  text-align: right;
  transition: 160ms ease;
}

.nav-button:hover {
  border-color: rgba(82, 58, 35, 0.18);
  background: rgba(255, 250, 241, 0.45);
}

.nav-button.active {
  color: #fffaf1;
  border-color: rgba(169, 130, 59, 0.84);
  background: linear-gradient(135deg, #563a25, #362315);
  box-shadow: 0 8px 18px rgba(76, 51, 32, 0.28);
}

.nav-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 250, 241, 0.68);
  color: var(--coffee);
  font-size: 15px;
}

.nav-button.active .nav-icon {
  background: rgba(255, 250, 241, 0.16);
  color: #fffaf1;
}

.nav-count {
  min-width: 26px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 250, 241, 0.72);
  font-size: 12px;
}

.nav-button.active .nav-count {
  color: #fffaf1;
  background: rgba(255, 250, 241, 0.14);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px dashed var(--line);
  padding-top: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.spark {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(169, 130, 59, 0.5);
  border-radius: 50%;
  background:
    linear-gradient(45deg, transparent 44%, rgba(169, 130, 59, 0.8) 45% 55%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, rgba(169, 130, 59, 0.8) 45% 55%, transparent 56%),
    rgba(255, 250, 241, 0.48);
}

.sidebar-footer strong,
.sidebar-footer small {
  display: block;
}

.sidebar-footer small {
  color: var(--muted);
  margin-top: 3px;
}

.workspace {
  min-width: 0;
  padding: 24px 26px 34px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(230px, 0.8fr);
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.tool-button,
.manager-tab,
.tab-button {
  border: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.72);
  color: var(--coffee);
  border-radius: 999px;
  min-height: 38px;
  box-shadow: 0 5px 18px rgba(53, 37, 20, 0.06);
}

.icon-button {
  width: 38px;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.menu-toggle {
  display: none;
}

.search-box {
  width: min(420px, 100%);
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 250, 241, 0.72);
  box-shadow: var(--soft-shadow);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.manager-switch {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  background: rgba(255, 250, 241, 0.64);
  display: flex;
  gap: 4px;
  box-shadow: var(--soft-shadow);
}

.manager-tab {
  min-width: 86px;
  padding: 0 17px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.manager-tab.active {
  color: #fffaf1;
  background: linear-gradient(135deg, var(--coffee), #795b35);
}

.studio-title {
  text-align: left;
}

.studio-title span,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.studio-title h1 {
  margin: 2px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(28px, 3vw, 42px);
  color: var(--coffee);
}

.hero-band {
  min-height: 96px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 250, 241, 0.86), rgba(239, 227, 209, 0.7)),
    repeating-linear-gradient(90deg, rgba(82, 58, 35, 0.03) 0 1px, transparent 1px 14px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.hero-band h2,
.panel-head h3 {
  margin: 3px 0 0;
}

.hero-band h2 {
  font-size: clamp(28px, 3.4vw, 46px);
  font-weight: 650;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.62);
  padding: 9px 12px;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 4px rgba(111, 127, 104, 0.14);
}

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

.metric-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.78);
  padding: 15px;
  box-shadow: var(--soft-shadow);
  min-height: 108px;
}

.metric-card strong {
  display: block;
  font-size: 30px;
  line-height: 1;
  margin: 12px 0 8px;
  color: var(--coffee);
}

.metric-card small {
  color: var(--muted);
}

.metric-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(111, 127, 104, 0.14);
  color: #43533e;
  font-size: 12px;
}

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

.primary-panel,
.insight-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.74);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  min-height: 76px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head.compact {
  min-height: auto;
}

.view-tools {
  display: flex;
  gap: 7px;
}

.tool-button,
.tab-button {
  padding: 0 14px;
}

.tool-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tool-button.active,
.tab-button.active,
.primary-action {
  color: #fffaf1;
  background: var(--coffee);
}

.primary-action {
  border-color: rgba(169, 130, 59, 0.55);
}

.tabs-row {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.records-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  scrollbar-color: rgba(76, 51, 32, 0.42) rgba(238, 227, 209, 0.6);
}

.records-table {
  width: max-content;
  border-collapse: collapse;
  min-width: 100%;
}

.records-table th,
.records-table td {
  border-bottom: 1px solid rgba(82, 58, 35, 0.12);
  padding: 13px 15px;
  text-align: right;
  vertical-align: middle;
  min-width: 150px;
  max-width: 260px;
  white-space: nowrap;
}

.records-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  background: rgba(238, 227, 209, 0.38);
}

.records-table tr:hover td {
  background: rgba(238, 227, 209, 0.23);
}

.pagination-controls {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 18px;
}

.pagination-summary {
  color: var(--muted);
  min-width: 190px;
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 999px;
  padding: 3px 10px;
  background: rgba(111, 127, 104, 0.14);
  color: #43533e;
  white-space: nowrap;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill.warn {
  background: rgba(169, 130, 59, 0.18);
  color: #765921;
}

.pill.stop {
  background: rgba(175, 105, 78, 0.18);
  color: #7c3d2d;
}

.pill.calm {
  background: rgba(101, 58, 66, 0.14);
  color: var(--wine);
}

.empty-state {
  min-height: 360px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 38px 20px;
}

.empty-illustration {
  width: 82px;
  height: 82px;
  margin: 0 auto 18px;
  border: 1px solid rgba(169, 130, 59, 0.36);
  border-radius: 50%;
  background:
    linear-gradient(45deg, transparent 42%, rgba(169, 130, 59, 0.8) 43% 57%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, rgba(169, 130, 59, 0.8) 43% 57%, transparent 58%),
    rgba(238, 227, 209, 0.78);
}

.empty-state h4 {
  margin: 0 0 6px;
  font-size: 20px;
}

.empty-state p {
  max-width: 430px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.65;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px 18px;
}

.record-card {
  border: 1px solid rgba(82, 58, 35, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.72);
  padding: 14px;
  min-height: 150px;
  box-shadow: 0 8px 18px rgba(53, 37, 20, 0.07);
}

.record-card h4 {
  margin: 0 0 10px;
  font-size: 18px;
}

.record-card-head {
  align-items: center;
  border-bottom: 1px dashed rgba(82, 58, 35, 0.14);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
}

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

.row-action {
  border: 1px solid rgba(76, 51, 32, 0.22);
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.82);
  color: var(--coffee);
  min-height: 30px;
  padding: 0 12px;
  white-space: nowrap;
}

.row-action:hover {
  background: rgba(238, 227, 209, 0.78);
}

.record-card dl {
  margin: 0;
  display: grid;
  gap: 7px;
}

.record-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px dashed rgba(82, 58, 35, 0.14);
  padding-bottom: 6px;
}

.record-card dt {
  color: var(--muted);
}

.record-card dd {
  margin: 0;
  text-align: left;
}

.record-card .attachment-row {
  align-items: flex-start;
}

.attachment-previews {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 260px;
  border-bottom: 0;
  padding-bottom: 0;
}

.attachment-thumb {
  width: 76px;
  margin: 0;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.attachment-thumb img {
  width: 76px;
  height: 58px;
  object-fit: cover;
  border: 1px solid rgba(82, 58, 35, 0.18);
  border-radius: 6px;
  background: rgba(255, 250, 241, 0.85);
  box-shadow: 0 5px 14px rgba(53, 37, 20, 0.08);
}

.attachment-thumb figcaption {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  min-height: 25px;
  border: 1px solid rgba(82, 58, 35, 0.18);
  border-radius: 999px;
  background: rgba(238, 227, 209, 0.48);
  color: var(--coffee);
  padding: 3px 9px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-panel {
  position: sticky;
  top: 18px;
}

.manager-card {
  margin: 16px;
  border: 1px solid rgba(82, 58, 35, 0.16);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(76, 51, 32, 0.94), rgba(101, 58, 66, 0.88));
  color: #fffaf1;
  padding: 16px;
}

.manager-card h4 {
  margin: 0 0 6px;
  font-size: 25px;
}

.manager-card p {
  margin: 0;
  color: rgba(255, 250, 241, 0.72);
}

.manager-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.manager-stats span {
  border: 1px solid rgba(255, 250, 241, 0.18);
  border-radius: var(--radius);
  padding: 8px;
  display: grid;
  gap: 5px;
}

.manager-stats strong {
  font-size: 22px;
}

.manager-stats small {
  color: rgba(255, 250, 241, 0.72);
}

.timeline {
  padding: 4px 16px 16px;
  display: grid;
  gap: 10px;
}

.timeline-item {
  border: 1px solid rgba(82, 58, 35, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.58);
  padding: 12px;
  display: grid;
  gap: 6px;
}

.timeline-item strong {
  font-size: 15px;
}

.timeline-item small {
  color: var(--muted);
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-layer[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(52, 37, 25, 0.38);
  backdrop-filter: blur(6px);
}

.record-modal {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  height: min(760px, calc(100vh - 44px));
  border: 1px solid rgba(82, 58, 35, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.96);
  box-shadow: 0 30px 90px rgba(35, 24, 14, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-head {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.modal-head h3 {
  margin: 3px 0 0;
  font-size: 24px;
}

.record-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.form-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 14px;
  padding: 18px;
}

.form-field {
  display: grid;
  align-self: start;
  gap: 7px;
}

.form-field span {
  color: var(--muted);
  font-size: 13px;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  border: 1px solid rgba(82, 58, 35, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
  outline: 0;
  padding: 10px 12px;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: rgba(169, 130, 59, 0.75);
  box-shadow: 0 0 0 3px rgba(169, 130, 59, 0.13);
}

.form-field textarea {
  resize: vertical;
}

.form-field input[readonly] {
  color: var(--muted);
  background: rgba(238, 227, 209, 0.52);
}

.field-type-multipleRecordLinks {
  min-width: 0;
}

.linked-record-picker {
  min-width: 0;
}

.linked-record-picker-shell {
  min-height: 42px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px 7px;
  border: 1px solid rgba(82, 58, 35, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.linked-record-picker:focus-within .linked-record-picker-shell {
  border-color: rgba(169, 130, 59, 0.75);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(169, 130, 59, 0.13);
}

.linked-record-chips {
  min-width: 0;
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 5px;
}

.linked-record-chip {
  max-width: 100%;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px 2px 3px;
  border: 1px solid rgba(151, 112, 53, 0.27);
  border-radius: 999px;
  background: rgba(225, 205, 172, 0.48);
}

.form-field .linked-record-chip-label {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linked-record-remove {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(82, 58, 35, 0.66);
  cursor: pointer;
  font: inherit;
  font-size: 17px;
  line-height: 1;
}

.linked-record-remove:hover,
.linked-record-remove:focus-visible {
  background: rgba(82, 58, 35, 0.1);
  color: var(--ink);
  outline: 0;
}

.linked-record-toggle {
  min-height: 30px;
  padding: 4px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #72552f;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
}

.linked-record-toggle:hover,
.linked-record-toggle:focus-visible,
.linked-record-toggle[aria-expanded="true"] {
  background: rgba(169, 130, 59, 0.11);
  color: #4f3922;
  outline: 0;
}

.linked-record-toggle:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.75;
}

.linked-record-popover {
  margin-top: 6px;
  padding: 7px;
  border: 1px solid rgba(82, 58, 35, 0.22);
  border-radius: 8px;
  background: rgba(255, 252, 246, 0.99);
  box-shadow: 0 12px 30px rgba(52, 37, 25, 0.13);
}

.linked-record-popover[hidden],
.linked-record-option[hidden],
.linked-record-empty[hidden] {
  display: none;
}

.form-field .linked-record-search {
  min-height: 36px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.linked-record-options {
  max-height: 176px;
  margin-top: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.linked-record-option {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: right;
}

.linked-record-option:hover,
.linked-record-option:focus-visible {
  background: rgba(225, 205, 172, 0.32);
  outline: 0;
}

.linked-record-option.selected {
  background: rgba(169, 130, 59, 0.13);
}

.form-field .linked-record-option span {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-field .linked-record-option-check {
  flex: 0 0 auto;
  color: #80612f;
  opacity: 0;
}

.linked-record-option.selected .linked-record-option-check {
  opacity: 1;
}

.linked-record-empty {
  margin: 9px 4px 3px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.form-error {
  grid-column: 1 / -1;
  border: 1px solid rgba(175, 105, 78, 0.38);
  border-radius: var(--radius);
  background: rgba(175, 105, 78, 0.12);
  color: #7c2e25;
  line-height: 1.5;
  padding: 10px 12px;
}

.field-type-multipleAttachments input[type="file"] {
  padding: 9px;
}

.form-actions {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.94);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
}

.form-action-group {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.danger-action {
  color: #7c2e25;
  border-color: rgba(175, 105, 78, 0.4);
  background: rgba(175, 105, 78, 0.12);
}

.danger-action:hover {
  background: rgba(175, 105, 78, 0.2);
}

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

  .sidebar {
    position: static;
    height: auto;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-card {
    display: none;
  }

  .side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sidebar-footer {
    display: none;
  }

  .content-grid,
  .topbar {
    grid-template-columns: 1fr;
  }

  .studio-title {
    text-align: right;
  }

  .insight-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  body.nav-open {
    overflow: hidden;
  }

  .workspace {
    padding: 16px;
  }

  .menu-toggle {
    display: grid;
    flex: 0 0 38px;
  }

  .sidebar {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 30;
    width: min(84vw, 320px);
    height: 100vh;
    transform: translateX(105%);
    transition: transform 180ms ease;
    overflow-y: auto;
    box-shadow: -18px 0 46px rgba(53, 37, 20, 0.18);
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .side-nav {
    grid-template-columns: 1fr;
  }

  .search-wrap {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .search-box {
    width: 100%;
    order: 3;
  }

  .topbar {
    gap: 12px;
  }

  .hero-band,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics-grid,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .manager-switch,
  .view-tools {
    width: 100%;
    overflow-x: auto;
  }

  .manager-tab,
  .tool-button {
    min-height: 44px;
  }

  .records-table th,
  .records-table td {
    padding: 11px 12px;
    white-space: nowrap;
  }

  .pagination-controls {
    flex-wrap: wrap;
    padding: 12px;
  }

  .pagination-summary {
    flex: 1 0 100%;
    order: -1;
  }

  .modal-layer {
    padding: max(9px, env(safe-area-inset-top)) max(9px, env(safe-area-inset-right)) max(9px, env(safe-area-inset-bottom)) max(9px, env(safe-area-inset-left));
  }

  .record-modal {
    width: 100%;
    min-width: 0;
    height: 100%;
    max-height: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
    padding: 14px;
    overscroll-behavior: contain;
  }

  .linked-record-picker-shell {
    min-height: 44px;
  }

  .linked-record-remove,
  .linked-record-toggle,
  .linked-record-option {
    min-height: 40px;
  }

  .linked-record-remove {
    width: 28px;
    height: 28px;
    min-height: 28px;
    flex-basis: 28px;
  }

  .linked-record-options {
    max-height: min(220px, 34vh);
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
    padding: 12px;
  }

  .form-action-group {
    width: 100%;
  }

  .form-action-group .tool-button,
  .form-actions .danger-action {
    flex: 1;
    min-width: 0;
  }
}
