/* Branded form surfaces, popovers and validation; shared by every route. */
button,input,textarea,select { -webkit-appearance: none; appearance: none; font-family: var(--font); }
input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
[data-portal-kind][hidden] { display: none !important; }
.portal-control { display: inline-flex; align-items: center; justify-content: space-between; gap: 9px; cursor: pointer; text-align: left; color: var(--ink); font-size: var(--type-control); background: #f0f5fc; border: 1px solid #d6e1ef; border-radius: 9px; min-height: 37px; padding: 8px 12px; max-width: 100%; line-height: 1.4; }
.portal-control .control-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-control>svg { width: 16px; height: 16px; flex: 0 0 16px; color: #617388; }
.portal-control:hover { border-color: #9cb3c9; }
.portal-control[aria-expanded=true] { border-color: var(--red); box-shadow: 0 0 0 3px #e4f3ef; }
.portal-control:disabled { opacity: .55; cursor: default; }
.form-field .portal-control { width: 100%; min-height: 41px; border-radius: 10px; background: #f6f9fd; padding: 10px 12px; }
.form-field .portal-control.status-select,.portal-control.status-select { background: var(--nav-selected); border-color: var(--nav-line); color: var(--nav-ink); }
.portal-control.priority-select[data-value=high] { background: #fbe8ec; color: #a94358; }
.portal-control.priority-select[data-value=normal] { background: #fbefd9; color: #8a6229; }
.portal-control.priority-select[data-value=low] { background: #e3f4ee; color: #27775f; }
.portal-control.priority-select[data-value=none] { background: #f0f5fc; color: var(--muted); }
.task-list .portal-control { width: 100%; min-width: 0; min-height: 34px; height: 34px; border: 1px solid transparent; background: transparent; color: #596d86; border-radius: 6px; font-size: var(--type-control); padding: 4px; }
.task-list .portal-control:hover { background: #edf4fd; border-color: #dbe6f4; }
.task-list .portal-control.list-priority { padding: 4px 8px; }
.task-list .portal-control.list-priority.high { background: #fbe8ee; color: #aa465c; }
.task-list .portal-control.list-priority.normal { background: #fcf0dc; color: #896326; }
.task-list .portal-control.list-priority.low { background: #e0f4ec; color: #2a7964; }
.assignee-field .portal-control { flex: 1; }
.portal-popover { position: fixed; z-index: 90; overflow: auto; overscroll-behavior: contain; padding: 8px; border: 1px solid #cddbe9; border-radius: 12px; color: var(--ink); background: var(--surface); box-shadow: 0 12px 36px #23354826,0 2px 6px #2335480d; font-size: var(--type-control); scrollbar-width: thin; scrollbar-color: #b6c7d8 transparent; }
.control-popover-label { color: var(--muted); font-size: var(--type-caption); padding: 5px 9px 9px; }
.control-option-search { width: 100%; border: 1px solid #d6e1ef; background: #f5f9ff; border-radius: 7px; padding: 8px 10px; font-size: var(--type-control); color: var(--ink); margin-bottom: 6px; }
.control-options { outline: none; max-height: 260px; overflow: auto; overscroll-behavior: contain; }
.control-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 38px; padding: 9px 10px; border-radius: 7px; text-align: left; font-size: var(--type-control); line-height: 1.4; color: var(--ink); }
.control-option span { overflow-wrap: anywhere; }
.control-option svg { width: 16px; height: 16px; flex-shrink: 0; }
.control-option:hover,.control-option.keyboard-current { background: #edf4fc; }
.control-option[aria-selected=true] { color: var(--red-dark); background: var(--pink); font-weight: 600; }
.control-options:focus .keyboard-current { box-shadow: inset 0 0 0 1.5px var(--red); }
.control-no-results { padding: 12px 10px; font-size: var(--type-control); color: var(--muted); }
.calendar-header { display: flex; gap: 5px; align-items: center; margin-bottom: 10px; }
.calendar-header button { min-height: 34px; border-radius: 7px; }
.calendar-nav { display: flex; align-items: center; justify-content: center; width: 32px; flex-shrink: 0; }
.calendar-nav svg { width: 17px; height: 17px; }
.calendar-nav.next svg { transform: rotate(180deg); }
.calendar-period { flex: 1; display: flex; justify-content: center; align-items: center; gap: 6px; font-size: var(--type-body); font-weight: 600; }
.calendar-period svg { width: 13px; height: 13px; }
.calendar-header button:hover,.calendar-months button:hover { background: #edf4fc; }
.calendar-weekdays,.calendar-days { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 3px; }
.calendar-weekdays { color: var(--muted); font-size: var(--type-caption); text-align: center; padding-bottom: 6px; }
.calendar-days button { aspect-ratio: 1; min-height: 31px; border-radius: 7px; font-size: var(--type-control); font-variant-numeric: tabular-nums; text-align: center; }
.calendar-days button.outside-month { color: #75869a; }
.calendar-days button:hover { background: #e5eef9; }
.calendar-days button[aria-current=date] { box-shadow: inset 0 0 0 1px var(--red); color: var(--red-dark); }
.calendar-days button.is-selected,.calendar-months button.is-selected { background: var(--red); color: #fff; font-weight: 600; }
.calendar-days button:disabled,.calendar-footer button:disabled { opacity: .35; cursor: default; }
.calendar-months { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin: 10px 0; }
.calendar-months button { min-height: 37px; font-size: var(--type-control); border-radius: 7px; }
.calendar-input-row { border-top: 1px solid var(--line); margin-top: 11px; padding: 10px 3px 0; }
.calendar-input-row label { display: block; color: var(--muted); font-size: var(--type-caption); margin-bottom: 6px; }
.calendar-input-row>div { display: flex; gap: 6px; }
.calendar-input-row input { width: 100%; min-width: 0; background: #f5f9ff; border: 1px solid #ccdbea; color: var(--ink); border-radius: 7px; padding: 8px 10px; font-size: var(--type-control); font-variant-numeric: tabular-nums; }
.calendar-input-row button { display: flex; align-items: center; justify-content: center; background: var(--red); color: white; border-radius: 7px; width: 37px; flex-shrink: 0; }
.calendar-input-row button svg { width: 17px; height: 17px; }
#calendar-error { color: #a43b50; font-size: var(--type-caption); line-height: 1.4; margin-top: 5px; }
#calendar-error:empty { display: none; }
.calendar-footer { display: flex; justify-content: space-between; gap: 8px; padding: 7px 3px 0; }
.calendar-footer button { padding: 6px 8px; border-radius: 6px; font-size: var(--type-control); color: var(--red-dark); }
.calendar-footer button:hover { background: var(--pink); }
input[type=checkbox]:not(.task-completion),input[type=radio] { width: 18px; height: 18px; border: 1.5px solid #9eb2c7; border-radius: 5px; background: white; flex-shrink: 0; cursor: pointer; display: inline-grid; place-content: center; vertical-align: middle; }
input[type=checkbox]:not(.task-completion):checked,input[type=radio]:checked { background: var(--red); border-color: var(--red); }
input[type=checkbox]:not(.task-completion):checked:after { content: ''; width: 8px; height: 5px; border-left: 1.5px solid white; border-bottom: 1.5px solid white; transform: translateY(-1px) rotate(-45deg); }
input[type=radio] { border-radius: 50%; }
input[type=radio]:checked:after { content: ''; width: 6px; height: 6px; background: white; border-radius: 50%; }
input:focus-visible,textarea:focus-visible,button:focus-visible,summary:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
[aria-invalid=true] { border-color: #b94b5f !important; }
.has-form-error { flex-wrap: wrap; }
.form-error { flex-basis: 100%; order: 10; width: 100%; margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: #fbecef; color: #99344a; font-size: var(--type-control); line-height: 1.5; }
@media(max-width:700px) {
 .portal-popover { padding: 9px; }
 .control-option { min-height: 42px; }
 .form-field .portal-control { min-height: 44px; }
}
@media(prefers-reduced-motion:reduce) { .portal-control,.portal-popover { transition: none; } }
