/* Papers Café: design tokens and base controls. Loaded before the editor's chrome stylesheets, which
   read these custom properties. A light, paper-and-coffee palette of our own. */
:root {
  --bg: #f3f1ed;
  --panel: #ffffff;
  --panel-2: #f6f4f0;
  --surface: #ffffff;
  --border: #d9d4cb;
  --line: #e6e1d8;
  --text: #22201c;
  --muted: #6f6a61;
  --accent: #2d6a5a;
  --accent-2: #8a5a3c;
  --ok: #2f7d4f;
  --warn: #b7791f;
  --err: #b42318;
  --danger: #b42318;
  --cafe-font: system-ui, -apple-system, "Noto Sans", "Noto Sans Hebrew", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 13px/1.4 var(--cafe-font);
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}
button, select, input, textarea { font: inherit; color: inherit; }
button {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  line-height: 1.3;
}
button:hover:not(:disabled) { background: var(--panel-2); border-color: #c4bdb1; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover:not(:disabled) { background: #245849; border-color: #245849; }
select, input[type="text"], input[type="email"], input[type="number"], input[type="search"], input:not([type]), textarea {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 6px;
}
select { cursor: pointer; }
.mc-hidden { display: none !important; }
.spacer { flex: 1 1 auto; }

/* Dialogs built by the editor with the modal classes. */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(34, 32, 28, .38);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.show, .modal-backdrop.opening { display: flex; }
.modal {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(34, 32, 28, .22);
  width: min(520px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 18px 20px 14px;
  direction: rtl;
}
html[dir="ltr"] .modal { direction: ltr; }
.modal h3 { margin: 0 0 12px; font-size: 16px; }
.modal-body { display: flex; flex-direction: column; gap: 10px; }
.modal-body label { display: flex; flex-direction: column; gap: 4px; }
.modal-body input[type="text"], .modal-body input[type="number"], .modal-body select { width: 100%; padding: 6px 8px; }
.modal-body .hint, .modal .hint { color: var(--muted); font-size: 12px; }
.modal-footer { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
dialog { color: var(--text); }
