/* Shared geometry for planner, dynamically mounted dialogs, Together and PiP.
   Important layered rules take priority over existing unlayered component rules. */
@layer ui-geometry {
  *, *::before, *::after {
    border-radius: 0 !important;
  }

  /* Controls soften slightly; panels and text fields keep their square edges. */
  button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"] {
    border-radius: 3px !important;
  }

  /* Palette delete controls keep their compact circular shape. */
  .palette-color-delete, .time-entry-color-delete {
    border-radius: 50% !important;
  }

  /* Schedule blocks remain square even when clickable buttons. */
  .day, .year-day,
  .timeline-block, .timeline-plan-block,
  .week-time-event, .week-all-day-bar, .timetable-block,
  .week-time-drop-preview, .week-time-create-preview {
    border-radius: 0 !important;
  }

  /* Circular indicators and clocks are intentional shapes, not rounded boxes. */
  .ring, .ring::before, .timer-card::after,
  .category-dot, .task-category-heading-dot, .routine-category-dot,
  .category-picker-swatch, .category-option-swatch, .task-menu-category-swatch,
  .palette-swatch, .palette-add, .habit-color-swatch,
  .stats-category-name::before, .week-todo-category-title::before,
  .week-now-line::before, .habit-report-name i,
  .habit-stamp, .habit-stamp-empty, .year-day-dots i,
  .together-status::before, input[type="radio"] {
    border-radius: 50% !important;
  }

  .habit-report-card .habit-stamp, .habit-report-card .habit-stamp-empty {
    border-radius: 0 !important;
  }

  input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 16px;
    height: 16px;
    min-width: 16px;
    flex-shrink: 0;
    box-sizing: border-box;
    border: 1px solid #aeb7c5 !important;
    background-color: #fff !important;
    background-image: none !important;
    background-position: center !important;
    background-size: 85% 85% !important;
    background-repeat: no-repeat !important;
    vertical-align: middle;
    cursor: pointer;
  }
  input.task-complete { width:22px!important;height:22px!important;min-width:22px!important;min-height:22px!important;padding:0!important;margin:0!important;border:1.5px solid #b8c0cc!important;border-radius:3px!important; }
  input.task-complete:checked { background-color:#8b95a5!important;border-color:#8b95a5!important;background-size:78% 78%!important; }
  /* All-day and deadline controls share the same compact square checkbox. */
  .all-day-row input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  input[type="checkbox"]:checked {
    background-color: var(--control-accent, #667085) !important;
    border-color: var(--control-accent, #667085) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8l3 3 7-7' fill='none' stroke='white' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E") !important;
  }
  input[type="checkbox"]:disabled {
    background-color: #eef0f3 !important;
    border-color: #d1d5db !important;
    cursor: not-allowed;
    opacity: .55;
  }
  input[type="checkbox"]:disabled:checked {
    background-color: #aeb7c5 !important;
  }
  input[type="checkbox"]:focus-visible {
    outline: 2px solid #7ba9d4;
    outline-offset: 3px;
  }
}
