/* Paper palette shared by the desk, create forms, and mobile navigation. */
.admin-shell, .quick-dialog:has([data-desk-note-editor], .create-choices) {
  --desk-canvas: #f5f1e8;
  --desk-paper: #fffcf6;
  --desk-ink: #282c25;
  --desk-muted: #5e6357;
  --desk-rule: #ddd6c8;
  --desk-outline: #8a8072;
  --desk-accent: #405c40;
  --desk-pressed: #2c452f;
  --desk-focus: #375d86;
  --desk-sand: #f3e7c6;
  --desk-sage: #e5ecdd;
}
.admin-shell:has(.paper-desk, .record-editor, .record-view, .record-list-panel, #office-contacts, #office-advisors, .follow-ups[data-mode="list"]), .quick-dialog:has([data-desk-note-editor], .create-choices) {
  --paper: var(--desk-canvas);
  --surface: var(--desk-paper);
  --surface-soft: var(--desk-canvas);
  --ink: var(--desk-ink);
  --muted: var(--desk-muted);
  --line: var(--desk-rule);
  --control-border: var(--desk-outline);
  --focus: var(--desk-focus);
  --green: var(--desk-accent);
  --green-dark: var(--desk-pressed);
  --mint: var(--desk-sage);
}

.admin-shell .admin-sidebar {
  background: var(--desk-paper);
  border-inline-end: 1px solid var(--desk-rule);
}
.admin-shell :is(.admin-brand, .admin-nav, .admin-public-link) { color: var(--desk-ink); }
.admin-shell :is(.admin-nav-label, .admin-nav-group-label, .admin-sidebar-note, .admin-brand small) {
  color: var(--desk-muted);
  border-color: var(--desk-rule);
}
.admin-shell :is(.admin-brand-mark, .admin-nav .ui-icon) { color: var(--desk-accent); }
.admin-shell .admin-brand-mark { border-color: var(--desk-outline); background: var(--desk-sage); }
.admin-shell .admin-nav:hover { background: var(--desk-canvas); }
.admin-shell .admin-nav.active {
  background: var(--desk-sage);
  border-color: transparent;
  box-shadow: inset -3px 0 var(--desk-accent);
  font-weight: 700;
}
.admin-shell .admin-mobile-menu nav { background: var(--desk-paper); border: 1px solid var(--desk-rule); }
.admin-mobile-nav { background: var(--desk-paper); }
.admin-shell:has(.paper-desk) :focus-visible,
.quick-dialog:has([data-desk-note-editor]) :focus-visible {
  outline: 3px solid var(--desk-focus);
  outline-offset: 2px;
}

.desk-heading .desk-date { margin-inline-start: auto; text-align: end; }
.paper-desk .desk-heading h1:focus { outline: none; }
.desk-date, .desk-section-header p { margin: 0; color: var(--desk-muted); }
.desk-primary, .quick-dialog:has([data-desk-note-editor]) .quick-dialog-actions .button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--desk-accent);
  color: #fff;
  font-weight: 650;
}
.desk-primary:not(:disabled):hover, .quick-dialog:has([data-desk-note-editor]) .quick-dialog-actions .button-primary:hover { background: var(--desk-pressed); }
.desk-primary:not(:disabled):active { background: var(--desk-pressed); border-color: #fff; }
.desk-primary:disabled { background: var(--desk-rule); color: var(--desk-muted); cursor: default; }
.desk-primary .ui-icon { width: 20px; height: 20px; }
.desk-columns { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.desk-columns:has(.desk-alerts[hidden]),
.desk-columns:not(:has(.desk-notebook)),
body[data-enhance-nav="false"] .desk-columns { grid-template-columns: minmax(0, 1fr); }
.desk-work > .follow-ups, .desk-columns > .desk-alerts {
  min-width: 0;
  margin: 0;
  padding: clamp(16px, 2vw, 24px);
  border: 1px solid var(--desk-rule);
  border-radius: 12px;
  background: var(--desk-paper);
  box-shadow: none;
}
.desk-section-header h2 { margin: 0 0 4px; font-size: 1.2rem; }
.desk-section-header { padding-block-end: 12px; border-block-end: 1px solid var(--desk-rule); }
.desk-section-header p { font-size: .875rem; }
.desk-note-feedback:empty { margin: 0; }
.desk-note-feedback, .desk-empty { color: var(--desk-muted); }
.desk-note-list:not(:empty) { display: grid; gap: 10px; margin-block-start: 14px; }
.desk-note-group { margin: 6px 0 0; color: var(--desk-muted); font-size: .875rem; }
.desk-note {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--desk-outline);
  border-radius: 8px;
  background: var(--desk-canvas);
  color: var(--desk-ink);
  text-align: start;
  overflow-wrap: anywhere;
}
.desk-note[data-pinned="true"] { background: var(--desk-sand); }
.desk-note:hover { background: var(--desk-sage); }
.desk-note:active { border-color: var(--desk-pressed); }
.desk-note-preview {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  white-space: pre-line;
  line-height: 1.85;
}
.desk-columns .follow-up-filters select { min-height: 48px; border-color: var(--desk-outline); }
.desk-columns .follow-up-row { background: var(--desk-paper); color: var(--desk-ink); border-color: var(--desk-outline); }
.desk-columns .follow-up-row:hover { background: var(--desk-sage); }
.desk-columns .follow-up-row small { color: var(--desk-muted); }
.quick-dialog:has([data-desk-note-editor]) :is(textarea, input:not([type="checkbox"])) {
  border-color: var(--desk-outline);
  background: var(--desk-paper);
  color: var(--desk-ink);
}
.quick-dialog [data-desk-note-editor] { line-height: 1.85; }

@media (max-width: 980px) {
  .desk-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px), (hover: none) and (pointer: coarse) {
  .desk-primary { width: 100%; }
}

/* Record forms reuse the desk palette and keep the existing native form controls. */
.record-editor .entry-heading,
.record-editor .property-entry-card {
  max-width: 760px;
  margin-inline: auto;
}
.record-editor .entry-heading { min-height: 56px; }
.record-editor .entry-heading a { min-width: 48px; min-height: 48px; }
.record-editor .property-entry-card {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.record-editor .property-entry-form .property-grid { gap: 14px 12px; }
.record-editor .record-form-panel,
.record-editor .entry-more {
  min-width: 0;
  padding: clamp(12px, 2vw, 20px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.record-editor .record-form-panel h2 { margin: 0; }
.record-editor .record-form-panel > h2 + .property-grid { margin-block-start: 14px; }
.record-editor :is(.record-form-panel h2, .entry-more > summary, .deal-choice legend, .record-options legend) {
  padding-inline-start: 9px;
  border-inline-start: 3px solid var(--green);
  font-size: 1rem;
  font-weight: 700;
}
.record-editor .entry-more > summary { min-height: 48px; }
.record-editor .entry-more > summary::marker { color: var(--green); }
.record-editor .property-steps { gap: 8px; margin-block-end: 14px; }
.record-editor .property-steps li { padding: 8px; }
.record-editor .property-entry-form :is(input:not([type=checkbox], [type=radio], [type=file]), select, textarea) {
  min-height: 48px;
  font-size: 1rem;
  scroll-margin-block: 12px;
}
.record-editor .property-entry-form textarea { line-height: 1.8; }
.record-editor :is(.property-entry-actions button, .property-owner-search button, .entry-contact-search summary) { min-height: 48px; }
.record-editor .property-entry-actions .button-primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.record-editor .property-entry-actions .button-primary:not(:disabled):is(:hover, :active) {
  background: var(--green-dark);
}
.record-editor .property-entry-form .deal-choice label { min-height: 48px; background: var(--surface-soft); }
.record-editor .property-entry-form .deal-choice label:has(:checked) {
  color: #fff;
  background: var(--green);
  font-weight: 700;
}
.record-editor :is(.deal-choice, .entry-photo) label:has(:focus-visible),
.record-editor :is(a, button, summary):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.record-editor .entry-photo label { width: 104px; min-height: 88px; background: var(--surface-soft); }
.record-editor .entry-photo .ui-icon { width: 26px; height: 26px; color: var(--green); }

.property-entry-form .record-options { display: grid; gap: 8px; padding: 10px; }
.property-entry-form .record-options legend { padding-inline: 6px; font-weight: 700; }
.property-entry-form .record-option {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: var(--surface-soft);
  cursor: pointer;
}
.record-option > .ui-icon {
  width: 28px;
  height: 28px;
  padding: 4px;
  border-radius: 6px;
  background: var(--mint);
  color: var(--green-dark);
}
.record-option > input[type=checkbox] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}
.record-option-indicator {
  position: relative;
  width: 42px;
  height: 24px;
  border: 1px solid var(--control-border);
  border-radius: 99px;
  background: var(--surface);
}
.record-option-indicator::after {
  content: '';
  position: absolute;
  inset-block-start: 4px;
  inset-inline-start: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--control-border);
}
.record-option > input:checked + .record-option-indicator { background: var(--green); border-color: var(--green); }
.record-option > input:checked + .record-option-indicator::after { inset-inline-start: 22px; background: #fff; }
.property-entry-form .record-option:has(:checked) { background: var(--mint); }
.property-entry-form .record-option:has(:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (hover: hover) {
  .property-entry-form .record-option:not(:has(:disabled)):hover { border-color: var(--green); }
}
.property-entry-form .record-option:has(:disabled) { opacity: .65; cursor: not-allowed; }
@media (forced-colors: active) {
  .record-option-indicator::after { background: CanvasText; }
  .record-option > input:checked + .record-option-indicator::after { background: Highlight; }
}

.desk-remaining:not([hidden]) {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--green-dark);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.record-editor [data-contact-choices]:not(:empty) {
  display: grid;
  gap: 4px;
  max-height: 15rem;
  overflow-y: auto;
}
.record-editor [data-contact-picker] button {
  min-height: 48px;
  text-align: start;
  overflow-wrap: anywhere;
}
.record-editor .entry-money-reading {
  display: block;
  color: var(--muted);
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}
.record-editor .entry-money-reading:empty { display: none; }
.record-editor details.admin-card > summary { cursor: pointer; min-height: 48px; font-weight: 700; }
.record-view :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.desk-work { min-width: 0; }
.follow-ups:is([data-mode="dashboard"], [data-mode="list"]) .follow-up-list { gap: 0; }
.desk-work [data-follow-up-status]:empty { margin: 0; }
.desk-follow-up { display: grid; gap: 3px; padding-block-start: 10px; text-align: start; overflow-wrap: anywhere; }
.desk-follow-up + .desk-follow-up { border-block-start: 1px solid var(--desk-rule); }
.desk-follow-up > :is(span, small) { color: var(--desk-muted); font-size: .875rem; }
.desk-follow-up > .desk-late { color: #86551d; font-weight: 600; }
.desk-follow-up-actions { display: flex; gap: 4px 16px; flex-wrap: wrap; }
.desk-follow-up-actions :is(a, button) { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--desk-accent); text-decoration: none; font: inherit; cursor: pointer; }
.desk-notebook { margin-block-start: 8px; padding-inline: 12px; }
.desk-notebook [data-note-toggle] { display: none; }
.desk-notebook h2 { margin: 0; font-size: 1rem; line-height: 48px; color: var(--desk-accent); }
.desk-note-tools p, [data-match-alerts] { color: var(--desk-muted); }
.desk-note-tools button, [data-match-alerts] button { min-height: 44px; }
.desk-alerts h2 { margin: 0 0 12px; font-size: 17px; }
[data-match-alerts] a { display: grid; gap: 4px; padding-block: 12px; min-height: 48px; overflow-wrap: anywhere; }
[data-match-alerts] article + article { border-block-start: 1px solid var(--desk-rule); }
[data-match-alerts] strong { color: var(--desk-ink); }

.quick-dialog:has(.create-choices) { margin: auto auto 0; inset: auto 0 0; width: min(100%, 32rem); border-radius: 18px 18px 0 0; }
.quick-dialog:has(.create-choices) .quick-dialog-body { padding: 12px 16px max(12px, env(safe-area-inset-bottom)); }
.create-choices { display: grid; gap: 8px; }
.create-choices button { justify-content: start; gap: 14px; min-height: 58px; padding-inline: 16px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.create-choices .ui-icon { width: 24px; height: 24px; color: var(--green); }
.create-choices .create-note { min-height: 44px; background: transparent; border-color: transparent; color: var(--green-dark); }
@media (max-height: 440px) {
  .quick-dialog:has(.create-choices) .quick-dialog-header { padding-block: 4px; }
  .create-choices { gap: 4px; }
  .create-choices button { min-height: 44px; }
}
