/* Consistent round corners for editable fields and actionable buttons.
   Keep cards, panels and the outer "工程条件" frame unchanged. */
:root { --craftmate-input-radius: 9px; }

/* Catch all text-like controls, including login and overlay forms outside #app. */
:root :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]),
  select,
  textarea
) { border-radius: var(--craftmate-input-radius) !important; }

#app input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]),
#app select,
#app textarea,
#app .entry-choice-open,
#app .constraint-control,
.availability-overlay input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.availability-overlay select,
.availability-overlay textarea,
.entry-choice-overlay input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.entry-choice-overlay select,
.entry-choice-overlay textarea,
.task-time-sheet input[type="time"] {
  border-radius: var(--craftmate-input-radius) !important;
}

/* On iOS, the visible field frame must own the corner clipping. */
#app .constraint-control > input,
#app .constraint-control > select {
  border-radius: 0 !important;
}

.primary,
.secondary,
.icon-button,
.quick-option,
#app .entry-choice-open,
.task-followup-actions button,
.availability-actions button,
.entry-choice-list button,
.entry-choice-custom,
.craftmate-confirm-actions button {
  border-radius: var(--craftmate-input-radius) !important;
}

/* Replace unstyleable native OK/Cancel confirmations with app controls. */
.craftmate-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(0,0,0,.42);
}
.craftmate-confirm-dialog {
  box-sizing: border-box;
  width: min(440px,100%);
  max-height: 85dvh;
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 12px 40px rgba(0,0,0,.14);
}
.craftmate-confirm-dialog h2 { margin: 0 0 12px; font-size: 18px; font-weight: 600; }
.craftmate-confirm-message { margin: 0 0 20px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
.craftmate-confirm-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.craftmate-confirm-actions button { min-height: 46px; padding: 10px; border: 1px solid var(--line); border-radius: var(--craftmate-input-radius); background: #fff; color: var(--ink); font: inherit; cursor: pointer; }
.craftmate-confirm-actions button:hover { background: var(--soft); }
.craftmate-confirm-actions button:focus-visible { outline: 2px solid #777; outline-offset: 2px; }


/* Keep the task-list add action circular. */
#app .task-screen-actions .floating-add { border-radius: 50% !important; }
