/* Shared styles for the Therapist Toolkit generators (letter, note, superbill).
   Site-wide theme, nav, footer, panels and buttons live in ../assets/site.css.
   The layout utilities at the bottom only set border widths, so borders
   get a default style and color here. */

.tool-container {
    max-width: 840px;
}

:where(.tool-panel) *,
:where(.tool-panel) *::before,
:where(.tool-panel) *::after {
    box-sizing: border-box;
    border-width: 0;
    border-style: solid;
    border-color: var(--border-color);
}
.tool-panel hr {
    border-top-width: 1px;
}
/* Zero-specificity margin reset,
   so spacing utilities like mb-6 still win */
:where(.tool-panel) :where(h1, h2, h3, h4, h5, h6, p, ul, ol) {
    margin: 0;
}
.tool-panel textarea {
    resize: vertical;
}
.tool-panel .remove-accommodation {
    color: var(--danger);
    text-decoration: none;
}

/* --- Select2, themed with the site variables --- */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    min-height: 42px;
}
.select2-container--default .select2-selection--single {
    height: 42px !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-main) !important;
    line-height: 42px !important;
    padding-left: 0.75rem !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px !important;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--text-muted) !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    padding-left: 0.75rem !important;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
    line-height: 42px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--accent) !important;
    color: var(--accent-contrast) !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 0.2rem 0.5rem 0.2rem 1.5rem !important;
    margin-top: 0.4rem !important;
    margin-right: 0.4rem !important;
    line-height: 1;
    display: flex;
    align-items: center;
    position: relative;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--accent-contrast) !important;
    order: -1;
    margin-right: 5px;
    font-size: 0.8em;
    cursor: pointer;
    padding: 0;
    border: none !important;
    background: transparent !important;
}
.select2-container--default .select2-search--inline .select2-search__field {
    color: var(--text-main) !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    font-family: inherit;
    height: 28px;
    margin-top: 6px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    color: var(--text-main) !important;
    background-color: var(--bg-input) !important;
    border-color: var(--border-color) !important;
    font-family: inherit;
}
.select2-dropdown {
    background-color: var(--bg-dropdown) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
}
.select2-container--default .select2-results__option {
    color: var(--text-main) !important;
    padding: 0.5rem 0.75rem !important;
}
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--accent) !important;
    color: var(--accent-contrast) !important;
}
.select2-container--default .select2-results__option--selected,
.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: var(--bg-panel-hover) !important;
    color: var(--text-heading) !important;
}
.select2-container--default.select2-container--disabled .select2-selection--single,
.select2-container--default.select2-container--disabled .select2-selection--multiple {
    opacity: 0.6;
}
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default .select2-selection--single:focus {
    outline: 2px solid var(--accent) !important;
    outline-offset: 1px;
}

/* --- Layout utilities ---
   The small subset of Tailwind-style utility classes these generators use,
   defined locally so the tools don't depend on the Tailwind CDN. */
.hidden { display: none !important; }
.block { display: block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.relative { position: relative; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-x-4 { column-gap: 1rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

.w-full { width: 100%; }
.max-h-20 { max-height: 5rem; }
.min-h-\[50px\] { min-height: 50px; }

.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.pt-6 { padding-top: 1.5rem; }
.pb-6 { padding-bottom: 1.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.my-6 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-4 { margin-left: 1rem; }
.mr-1 { margin-right: 0.25rem; }

.border { border-width: 1px; }
.border-t { border-top-width: 1px; }
.border-b { border-bottom-width: 1px; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.whitespace-pre-wrap { white-space: pre-wrap; }
