/* ==========================================================================
   Request Create — shared styles for the new Request Payment / Purchase
   Request create modals. Primary blue matches template --primary (#16558f).
   ========================================================================== */

:root {
    --rc-ink: #0f172a;
    --rc-text: #475569;
    --rc-muted: #64748b;
    --rc-faint: #94a3b8;
    --rc-line: #e2e8f0;
    --rc-line-soft: #eef2f7;
    --rc-surface: #ffffff;
    --rc-surface-alt: #f8fafc;
    --rc-blue: #16558f;
    --rc-blue-dark: #124672;
    --rc-blue-soft: #eef5fa;
    --rc-blue-line: #b7d0e4;
    --rc-blue-tint: #d4e5f2;
    --rc-green: #16a34a;
    --rc-green-dark: #15803d;
    --rc-green-soft: #f0fdf4;
    --rc-green-line: #bbf7d0;
    --rc-green-ink: #166534;
    --rc-amber-soft: #fff7ed;
    --rc-amber-ink: #9a3412;
    --rc-red: #dc2626;
    --rc-red-soft: #fef2f2;
    --rc-red-line: #fecaca;
}

/* --------------------------------------------------------------------------
   Dialog shell
   -------------------------------------------------------------------------- */

/* The global stylesheet forces p-dialog-content to overflow: hidden and the
   maximized-sub dialog to 100vh below 1366px, so both are restated here to keep
   this modal scrollable. */
.request-create-modal.p-dialog {
    display: flex;
    flex-direction: column;
}

.request-create-modal.p-dialog > .p-dialog-header,
.request-create-modal.p-dialog > .p-dialog-footer {
    flex: 0 0 auto;
}

.request-create-modal.p-dialog > .p-dialog-footer {
    padding: 0;
    background: #f5f5f5;
    border-top: 1px solid #e9ecef;
}

.rc-line-dialog.p-dialog,
.rc-new-item-dialog.p-dialog {
    overflow: hidden;
}

.rc-line-dialog.p-dialog > .p-dialog-footer,
.rc-new-item-dialog.p-dialog > .p-dialog-footer {
    padding: 0;
    margin: 0;
    border-top: 1px solid #e9ecef;
    background: #f5f5f5;
    overflow: hidden;
}

.rc-line-dialog .p-dialog-footer .rc-footer,
.rc-new-item-dialog .p-dialog-footer .rc-footer {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.request-create-modal.p-dialog > .p-dialog-content {
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: 0;
    overflow-x: hidden;
    overflow-y: auto !important;
}

.rc-body {
    display: grid;
    gap: 16px;
}

.rc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.rc-header__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    background: var(--rc-blue-soft);
    color: var(--rc-blue);
}

.rc-header__eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rc-blue);
}

.rc-header__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--rc-ink);
}

.rc-header__sub {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--rc-muted);
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.rc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 375px;
    gap: 16px;
    align-items: start;
}

.rc-main {
    display: grid;
    gap: 12px;
    min-width: 0;
    padding-top: 24px;
}

.rc-aside {
    position: sticky;
    top: 0;
    align-self: start;
    min-width: 0;
    max-height: calc(100vh - 12rem);
}

.rc-aside-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    max-height: calc(100vh - 12rem);
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Smart banner
   -------------------------------------------------------------------------- */

.rc-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--rc-blue-line);
    border-radius: 14px;
    background: linear-gradient(110deg, var(--rc-blue-soft), #f7fafc);
}

.rc-banner__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 999px;
    background: var(--rc-blue);
    color: #fff;
}

.rc-banner--done .rc-banner__icon {
    background: var(--rc-green);
}

.rc-banner strong {
    display: block;
    font-size: 13px;
    color: var(--rc-ink);
}

.rc-banner p {
    margin: 2px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--rc-text);
}

/* --------------------------------------------------------------------------
   Section card
   -------------------------------------------------------------------------- */

.rc-section {
    overflow: hidden;
    border: 1px solid var(--rc-line);
    border-radius: 14px;
    background: var(--rc-surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.rc-section--complete {
    border-color: var(--rc-green-line);
    background: linear-gradient(180deg, #f0fdf4 0%, var(--rc-surface) 42%);
    box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.06);
}

.rc-section--optional {
    border-color: var(--rc-line);
}

.rc-section__head {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.rc-section__head:hover {
    background: rgba(15, 23, 42, 0.02);
}

.rc-section--complete .rc-section__head:hover {
    background: rgba(22, 163, 74, 0.04);
}

.rc-section__number {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 11px;
    background: var(--rc-blue-soft);
    color: var(--rc-blue);
    font-size: 13px;
    font-weight: 800;
    transition: background 0.2s ease, color 0.2s ease;
}

.rc-section--complete .rc-section__number {
    background: #dcfce7;
    color: var(--rc-green-dark);
}

.rc-section__check {
    display: block;
}

.rc-section__label {
    flex: 1;
    min-width: 0;
}

.rc-section__title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--rc-ink);
}

.rc-section--complete .rc-section__title {
    color: #166534;
}

.rc-section__sub {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--rc-muted);
}

.rc-section__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1;
}

.rc-section__badge--done {
    background: var(--rc-green-soft);
    color: var(--rc-green-ink);
}

.rc-section__badge--optional {
    background: var(--rc-surface-alt);
    color: var(--rc-muted);
}

.rc-section__badge--pending {
    background: var(--rc-surface-alt);
    color: var(--rc-muted);
}

.rc-section__chevron {
    display: inline-flex;
    color: var(--rc-faint);
    transition: transform 0.2s ease;
}

.rc-section__chevron--open {
    transform: rotate(180deg);
}

.rc-section__body {
    display: grid;
    gap: 14px;
    padding: 0 16px 16px;
    border-top: 1px solid var(--rc-line-soft);
    animation: rc-reveal 0.16s ease-out;
    overflow: visible;
}

.rc-subhead {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 4px;
    border-top: 1px solid var(--rc-line-soft);
}

.rc-subhead:first-child {
    padding-top: 0;
    border-top: 0;
}

.rc-subhead strong {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--rc-faint);
}

.rc-subhead small {
    font-size: 12px;
    color: var(--rc-muted);
}

/* --------------------------------------------------------------------------
   Fields
   -------------------------------------------------------------------------- */

.rc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.rc-field {
    position: relative;
    min-width: 0;
    overflow: visible;
    z-index: 1;
}

.rc-field:has(> .rc-error) {
    z-index: 6;
}

.rc-field--full {
    grid-column: 1 / -1;
}

.rc-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--rc-text);
}

.rc-label__required {
    color: var(--rc-red);
}

.rc-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--rc-blue-soft);
    color: var(--rc-blue);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.rc-hint {
    margin: 6px 0 0;
    font-size: 11px;
    color: var(--rc-muted);
}

/* Match legacy account-payable .form-overlay .p-error speech-bubble */
.rc-error {
    position: absolute;
    left: 0;
    top: 2px;
    z-index: 12;
    margin: 0;
    padding: 1px 10px;
    line-height: 1.5em;
    font-size: 12px;
    font-weight: 400;
    color: #fff;
    border-radius: 2px;
    background: #ff5f5f;
    box-shadow: 0 2px 4px 0 #e8e8e8;
    white-space: nowrap;
    max-width: calc(100% - 4px);
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.rc-error:after {
    content: "";
    position: absolute;
    top: 100%;
    left: 16px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 8px;
    border-color: #ff5f5f transparent transparent;
}

.rc-error:empty {
    display: none;
}

.rc-field:has(> .rc-error) .p-dropdown,
.rc-field:has(> .rc-error) .p-dropdown.form-control,
.rc-field:has(> .rc-error) .p-inputtext,
.rc-field:has(> .rc-error) .p-inputnumber,
.rc-field:has(> .rc-error) .p-inputnumber .p-inputtext,
.rc-field:has(> .rc-error) .p-datepicker,
.rc-field:has(> .rc-error) .p-datepicker .p-inputtext,
.rc-field:has(> .rc-error) .form-control {
    border-color: #f44336 !important;
}

.rc-field:has(> .rc-error) .p-dropdown:not(.p-disabled):hover,
.rc-field:has(> .rc-error) .p-inputtext:hover,
.rc-field:has(> .rc-error) .form-control:hover {
    border-color: #f44336 !important;
}

/* Errors that sit under a block (terms / uploads), not over an input */
.rc-error.rc-error--block {
    position: relative;
    top: auto;
    left: auto;
    display: inline-block;
    margin-top: 8px;
    max-width: 100%;
    white-space: normal;
    pointer-events: auto;
}

.rc-upload:has(> .rc-error) .upload-container,
.rc-upload:has(> .rc-error) .app-upload,
.rc-upload:has(.rc-error) {
    border-color: #f44336;
}

/* --------------------------------------------------------------------------
   Toggle option cards
   -------------------------------------------------------------------------- */

.rc-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.rc-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--rc-line);
    border-radius: 12px;
    background: var(--rc-surface);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.rc-option:hover {
    border-color: #cbd5e1;
}

.rc-option--on {
    border-color: var(--rc-blue-line);
    background: var(--rc-blue-soft);
}

.rc-option__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 9px;
    background: var(--rc-surface-alt);
    color: var(--rc-muted);
}

.rc-option--on .rc-option__icon {
    background: var(--rc-blue-tint);
    color: var(--rc-blue);
}

.rc-option__text {
    min-width: 0;
}

.rc-option__text strong {
    display: block;
    font-size: 13px;
    color: var(--rc-ink);
}

.rc-option__text small {
    display: block;
    margin-top: 1px;
    font-size: 11px;
    color: var(--rc-muted);
}

/* --------------------------------------------------------------------------
   Item picker
   -------------------------------------------------------------------------- */

.rc-picker {
    display: grid;
    gap: 14px;
}

.rc-picker__toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.rc-picker__search {
    min-width: 0;
}

.rc-picker__search-box {
    position: relative;
}

.rc-picker__search-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    display: inline-flex;
    color: var(--rc-faint);
    transform: translateY(-50%);
    pointer-events: none;
}

.rc-picker__search-box .p-inputtext,
.rc-picker__search-box .form-control {
    padding-left: 2.35rem !important;
}

.rc-picker__new-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border: 1.5px solid var(--rc-blue);
    border-radius: 10px;
    background: #fff;
    color: var(--rc-blue);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.rc-picker__new-btn:hover {
    background: var(--rc-blue-soft);
}

.rc-picker__catalog {
    display: grid;
    gap: 10px;
}

.rc-picker__catalog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.rc-picker__catalog-head strong {
    font-size: 13px;
    font-weight: 700;
    color: var(--rc-ink);
}

.rc-picker__views {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--rc-line);
    border-radius: 10px;
    background: var(--rc-surface-alt);
}

.rc-picker__view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--rc-muted);
    cursor: pointer;
}

.rc-picker__view--on {
    background: var(--rc-blue-soft);
    color: var(--rc-blue);
}

.rc-picker__results {
    max-height: 340px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 4px 2px 6px;
}

.rc-picker__results--grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: auto;
    align-items: stretch;
    align-content: start;
    column-gap: 8px;
    row-gap: 8px;
}

.rc-picker__results--grid > .rc-picker__card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto !important;
    min-height: 64px;
    align-self: stretch;
    align-items: flex-start;
    position: relative;
    padding: 10px;
    gap: 8px;
    border-radius: 10px;
}

.rc-picker__results--grid > .rc-picker__empty,
.rc-picker__results--grid > .p-skeleton {
    grid-column: 1 / -1;
    width: 100%;
}

.rc-picker__results--grid .rc-picker__dot {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 8px;
    font-size: 12px;
    margin-top: 1px;
}

.rc-picker__results--grid .rc-picker__add {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 7px;
    margin-top: 1px;
    align-self: flex-start;
}

.rc-picker__results--list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.rc-picker__results--list > .rc-picker__card {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    gap: 8px;
    border-radius: 8px;
    align-items: center;
}

.rc-picker__results--list .rc-picker__dot {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 6px;
    font-size: 10px;
}

.rc-picker__results--list .rc-picker__text {
    flex: 1 1 auto;
    text-align: left;
    overflow: visible;
}

.rc-picker__results--list .rc-picker__text strong {
    font-size: 12px;
    line-height: 1.3;
    text-align: left;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.rc-picker__results--list .rc-picker__add {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 6px;
    margin-top: 0;
    align-self: center;
}


.rc-picker__card {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    min-height: 64px;
    box-sizing: border-box;
    padding: 10px;
    overflow: visible;
    border: 1px solid var(--rc-line);
    border-radius: 10px;
    background: var(--rc-surface);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.rc-picker__card:hover {
    border-color: var(--rc-blue-line);
    background: var(--rc-blue-soft);
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.06);
}

.rc-picker__card--selected {
    border-color: var(--rc-green-line);
    background: #f0fdf4;
}

.rc-picker__dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    overflow: hidden;
}

.rc-picker__dot--photo {
    padding: 0;
    background: #eef2f7;
    color: transparent;
}

.rc-picker__dot-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rc-picker__text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: visible;
}

.rc-picker__text strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--rc-ink);
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-transform: uppercase;
}

.rc-picker__results--grid .rc-picker__text {
    text-align: left;
    display: block;
    padding-top: 1px;
}

.rc-picker__results--grid .rc-picker__text strong {
    white-space: normal;
    display: block;
    max-height: none;
    line-height: 1.3;
    text-align: left;
    overflow: visible;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.rc-picker__add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border: 1px solid var(--rc-blue-line);
    border-radius: 7px;
    background: #fff;
    color: var(--rc-blue);
}

.rc-picker__card:hover .rc-picker__add {
    background: var(--rc-blue-soft);
    border-color: var(--rc-blue);
}

.rc-picker__empty {
    grid-column: 1 / -1;
    padding: 22px 12px;
    color: var(--rc-muted);
    font-size: 12px;
    text-align: center;
}

.p-tooltip.rc-picker-name-tip .p-tooltip-text {
    max-width: min(320px, 80vw);
    white-space: normal;
    line-height: 1.35;
    text-transform: uppercase;
    word-break: break-word;
}

/* --------------------------------------------------------------------------
   Line items
   -------------------------------------------------------------------------- */

.rc-lines {
    display: grid;
    gap: 6px;
}

.rc-line {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) 88px minmax(0, 1fr) 40px 56px minmax(0, 1fr) 30px;
    gap: 8px;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid var(--rc-line);
    border-radius: 8px;
    background: var(--rc-surface);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.rc-line--free {
    background: var(--rc-amber-soft);
    border-color: #fde68a;
}

.rc-line__head {
    padding: 0 10px;
    color: var(--rc-faint);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 0;
    background: transparent;
}

.rc-line__caption {
    display: none;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--rc-faint);
}

.rc-line__name {
    font-size: 12px;
    font-weight: 600;
    color: var(--rc-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: uppercase;
}

.rc-line__cell--price {
    min-width: 0;
}

.rc-line__cell--free {
    display: flex;
    align-items: center;
    justify-content: center;
}

.rc-line .form-control,
.rc-line .p-inputtext,
.rc-line .p-dropdown,
.rc-line .p-inputnumber,
.rc-line .p-inputnumber-input {
    min-height: 30px !important;
    height: 30px !important;
}

.rc-line .p-dropdown .p-dropdown-label,
.rc-line .p-dropdown .p-inputtext,
.rc-line .p-inputnumber-input {
    font-size: 12px;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 30px;
}

.rc-line__free-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 30px;
    font-size: 12px;
    font-weight: 700;
    color: var(--rc-green-dark);
    text-align: center;
}

.rc-line__total {
    font-size: 12px;
    font-weight: 700;
    color: var(--rc-ink);
    text-align: right;
}

.rc-line__total--free {
    color: var(--rc-green-dark);
}

.rc-line__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--rc-red-line);
    border-radius: 6px;
    background: var(--rc-surface);
    color: var(--rc-red);
    cursor: pointer;
    transition: background 0.15s ease;
}

.rc-line__remove:hover {
    background: var(--rc-red-soft);
}

.rc-empty {
    display: grid;
    justify-items: center;
    gap: 4px;
    min-height: 88px;
    place-content: center;
    padding: 18px 14px;
    border: 1.5px dashed var(--rc-blue-line);
    border-radius: 12px;
    background: var(--rc-blue-soft);
    color: var(--rc-muted);
    font-size: 12px;
    text-align: center;
}

.rc-empty strong {
    font-size: 13px;
    color: var(--rc-ink);
}

/* --------------------------------------------------------------------------
   Terms
   -------------------------------------------------------------------------- */

.rc-terms-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.rc-stepper {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--rc-line);
    border-radius: 9px;
    background: var(--rc-surface);
}

.rc-stepper button {
    display: grid;
    width: 34px;
    height: 32px;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--rc-text);
    font-size: 15px;
    cursor: pointer;
}

.rc-stepper button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.rc-stepper span {
    display: grid;
    min-width: 36px;
    height: 32px;
    place-items: center;
    border-left: 1px solid var(--rc-line);
    border-right: 1px solid var(--rc-line);
    font-size: 13px;
    font-weight: 700;
    color: var(--rc-ink);
}

.rc-term {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    align-items: end;
    padding: 10px 12px;
    border: 1px solid var(--rc-line);
    border-radius: 12px;
    background: var(--rc-surface);
}

.rc-term__index {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    margin-bottom: 4px;
    border-radius: 8px;
    background: var(--rc-surface-alt);
    color: var(--rc-muted);
    font-size: 12px;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Uploads
   -------------------------------------------------------------------------- */

.rc-upload-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.rc-upload {
    display: grid;
    gap: 6px;
    justify-items: stretch;
    min-width: 0;
    padding: 10px;
    border: 1.5px dashed var(--rc-blue-line);
    border-radius: 12px;
    background: var(--rc-blue-soft);
    text-align: center;
}

.rc-upload__label {
    font-size: 12px;
    font-weight: 600;
    color: var(--rc-text);
}

/* app-upload sets a fixed px width/height on mount — force fluid fit inside
   the 3-column cards so the dashed box does not overflow the card. */
.rc-upload .upload-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-content: center;
}

.rc-upload .upload-container {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 20 / 13;
    min-height: 110px;
    box-sizing: border-box;
    padding: 1rem 0.5rem 2.1rem;
}

.rc-upload .camera-action-btn {
    right: 0.25rem !important;
    transform: none;
}

.rc-new-item-upload {
    display: flex;
    justify-content: center;
}

.rc-new-item-upload .upload-container {
    cursor: pointer !important;
}

/* --------------------------------------------------------------------------
   Attachments panel (new create modal only)
   -------------------------------------------------------------------------- */

.rc-attach {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid #e6ebf1;
    border-radius: 14px;
    background: #fff;
}

.rc-attach__head {
    display: grid;
    gap: 2px;
}

.rc-attach__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.rc-attach__sub {
    margin: 0;
    font-size: 12px;
    color: #94a3b8;
}

.rc-attach__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.rc-attach-card {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid #e6ebf1;
    border-radius: 12px;
    background: #fff;
}

.rc-attach-card__top {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.rc-attach-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rc-attach-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 999px;
}

.rc-attach-card__copy {
    min-width: 0;
}

.rc-attach-card__copy strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
}

.rc-attach-card__copy small {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: #94a3b8;
}

.rc-attach-card__badge {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.rc-attach-card__no {
    min-height: 34px;
    font-size: 12px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}

.rc-attach-card__zone {
    position: relative;
    min-width: 0;
    border-radius: 10px;
    overflow: hidden;
}

.rc-attach-hit {
    position: absolute;
    top: calc(50% - 34px);
    z-index: 4;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
}

.rc-attach-hit--capture {
    left: calc(50% - 41px);
}

.rc-attach-hit--upload {
    left: calc(50% + 5px);
}

.rc-attach-hit:hover {
    background: rgba(255, 255, 255, 0.35);
}

.rc-attach-card__zone:has(.img-preview-cont:not([style*="display: none"])) .rc-attach-hit,
.rc-attach-card__zone:has(video:not([style*="display: none"])) .rc-attach-hit,
.rc-attach-card__zone:has(.loader-container) .rc-attach-hit {
    display: none;
}

.rc-attach-card__zone .upload-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-content: center;
}

.rc-attach-card__zone .upload-container {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 120px;
    aspect-ratio: 16 / 10;
    box-sizing: border-box;
    border-style: dashed !important;
    border-width: 1.5px !important;
    border-radius: 10px !important;
    background: transparent !important;
    padding: 1rem 0.5rem 2rem;
}

.rc-attach-card__zone .upload-container > .icon {
    display: none;
}

.rc-attach-card__zone .upload-label {
    position: absolute;
    top: 50%;
    bottom: auto;
    left: 50%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: 3px;
    width: calc(100% - 20px);
    margin: 0;
    color: #475569;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.45;
    text-align: center;
    transform: translate(-50%, -50%);
}

.rc-attach-card__zone .upload-label::before {
    content: "";
    display: block;
    order: 0;
    width: 82px;
    height: 36px;
    margin: 0 auto 5px;
    flex: 0 0 100%;
    pointer-events: none;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='82' height='36' viewBox='0 0 82 36'%3E%3Cg fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='21' cy='18' r='16'/%3E%3Cpath d='M14 14h3l2-3h4l2 3h3v10H14z'/%3E%3Ccircle cx='21' cy='19' r='3.5'/%3E%3Ccircle cx='61' cy='18' r='16'/%3E%3Cpath d='M55 22h-2a4 4 0 0 1-.4-8 7 7 0 0 1 13.5 1.5A3.5 3.5 0 0 1 66 22h-2'/%3E%3Cpath d='M61 24V14m0 0-4 4m4-4 4 4'/%3E%3C/g%3E%3C/svg%3E");
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: top center;
    -webkit-mask-size: 82px 36px;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='82' height='36' viewBox='0 0 82 36'%3E%3Cg fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='21' cy='18' r='16'/%3E%3Cpath d='M14 14h3l2-3h4l2 3h3v10H14z'/%3E%3Ccircle cx='21' cy='19' r='3.5'/%3E%3Ccircle cx='61' cy='18' r='16'/%3E%3Cpath d='M55 22h-2a4 4 0 0 1-.4-8 7 7 0 0 1 13.5 1.5A3.5 3.5 0 0 1 66 22h-2'/%3E%3Cpath d='M61 24V14m0 0-4 4m4-4 4 4'/%3E%3C/g%3E%3C/svg%3E");
    mask-repeat: no-repeat;
    mask-position: top center;
    mask-size: 82px 36px;
}

.rc-attach-card__zone .upload-label::after {
    content: "Drag and drop or click to";
    display: block;
    order: 1;
    width: 100%;
    color: #475569;
}

.rc-attach-card__zone .upload-label > .action {
    order: 2;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}

.rc-attach-card__zone .upload-label > span {
    order: 2;
    color: #64748b;
}

.rc-attach-card__zone .camera-action-btn {
    right: 0.2rem !important;
    transform: none;
}

.rc-attach-card__hint {
    margin: 0;
    font-size: 11px;
    color: #94a3b8;
}

.rc-attach-card--blue .rc-attach-card__icon {
    background: #dbeafe;
    color: #2563eb;
}

.rc-attach-card--blue .rc-attach-card__badge {
    background: #dbeafe;
    color: #2563eb;
}

.rc-attach-card--blue .rc-attach-card__zone .upload-container {
    border-color: #93c5fd !important;
    background: #eff6ff !important;
}

.rc-attach-card--blue .rc-attach-card__zone .upload-label .action {
    color: #2563eb;
}

.rc-attach-card--blue .rc-attach-card__zone .upload-label::before {
    color: #2563eb;
}

.rc-attach-card--green .rc-attach-card__icon {
    background: #dcfce7;
    color: #16a34a;
}

.rc-attach-card--green .rc-attach-card__badge {
    background: #dcfce7;
    color: #16a34a;
}

.rc-attach-card--green .rc-attach-card__zone .upload-container {
    border-color: #86efac !important;
    background: #f0fdf4 !important;
}

.rc-attach-card--green .rc-attach-card__zone .upload-label .action {
    color: #16a34a;
}

.rc-attach-card--green .rc-attach-card__zone .upload-label::before {
    color: #16a34a;
}

.rc-attach-card--purple .rc-attach-card__icon {
    background: #ede9fe;
    color: #7c3aed;
}

.rc-attach-card--purple .rc-attach-card__badge {
    background: #ede9fe;
    color: #7c3aed;
}

.rc-attach-card--purple .rc-attach-card__zone .upload-container {
    border-color: #c4b5fd !important;
    background: #f5f3ff !important;
}

.rc-attach-card--purple .rc-attach-card__zone .upload-label .action {
    color: #7c3aed;
}

.rc-attach-card--purple .rc-attach-card__zone .upload-label::before {
    color: #7c3aed;
}

.rc-attach-card--proof {
    border-color: #fecaca;
}

.rc-attach-card--proof .rc-attach-card__icon {
    background: #fee2e2;
    color: #dc2626;
}

.rc-attach-card--proof .rc-attach-card__badge--req {
    background: #fee2e2;
    color: #dc2626;
}

.rc-attach-card--proof .rc-attach-card__zone .upload-container {
    border-color: #fca5a5 !important;
    background: #fff1f2 !important;
}

.rc-attach-card--proof .rc-attach-card__zone .upload-label .action {
    color: #dc2626;
}

.rc-attach-card--proof .rc-attach-card__zone .upload-label::before {
    color: #dc2626;
}

.rc-attach__tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
}

.rc-attach__tip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-top: 1px;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    font-style: italic;
    line-height: 1;
}

.rc-attach__tip p {
    margin: 0;
    font-size: 12px;
    color: #475569;
    line-height: 1.4;
}

.rc-attach__tip strong {
    color: #1e293b;
}

/* --------------------------------------------------------------------------
   Summary
   -------------------------------------------------------------------------- */

.rc-summary {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--rc-line);
    border-radius: 16px;
    background: var(--rc-surface);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);
}

.rc-summary__head {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 12px;
    padding: 16px 16px 14px;
    border-bottom: 1px solid var(--rc-line-soft);
}

.rc-summary__head-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 12px;
    background: var(--rc-blue-soft);
    color: var(--rc-blue);
}

.rc-summary__head-text {
    flex: 1;
    min-width: 0;
}

.rc-summary__head strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--rc-ink);
}

.rc-summary__head small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--rc-muted);
}

.rc-summary__edit {
    padding: 5px 10px;
    border: 1px solid var(--rc-blue-line);
    border-radius: 8px;
    background: var(--rc-surface);
    color: var(--rc-blue);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease;
}

.rc-summary__edit:hover {
    background: var(--rc-blue-soft);
}

.rc-summary__rows {
    display: grid;
    flex: 1 1 auto;
    gap: 10px;
    min-height: 0;
    padding: 14px 16px 8px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.rc-summary__row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--rc-text);
}

.rc-summary__row-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--rc-blue-soft);
    color: var(--rc-blue);
}

.rc-summary__row-label {
    min-width: 0;
}

.rc-summary__row b {
    font-size: 13px;
    font-weight: 700;
    color: var(--rc-ink);
    text-align: right;
    white-space: nowrap;
}

.rc-summary__row--edit {
    grid-template-columns: 28px minmax(0, 1fr) 120px;
}

.rc-summary__reset {
    justify-self: start;
    grid-column: 2 / -1;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--rc-blue);
    font-size: 11px;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.rc-summary__divider {
    margin: 4px 16px 0;
    border-top: 1px dashed #cbd5e1;
}

.rc-summary__adjustments {
    display: grid;
    gap: 8px;
    padding: 12px 16px 14px;
}

.rc-adjustment {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto 30px;
    align-items: center;
    gap: 8px;
    padding: 10px 10px;
    border-radius: 10px;
    background: #f1f5f9;
    font-size: 12px;
    color: var(--rc-text);
}

.rc-adjustment__index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: var(--rc-blue-tint);
    color: var(--rc-blue);
    font-size: 11px;
    font-weight: 800;
}

.rc-adjustment__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: var(--rc-ink);
}

.rc-adjustment b {
    color: var(--rc-ink);
    white-space: nowrap;
}

.rc-adjustment__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: var(--rc-red-soft);
    color: var(--rc-red);
    cursor: pointer;
    transition: background 0.15s ease;
}

.rc-adjustment__remove:hover {
    background: #fee2e2;
}

.rc-summary__add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    padding: 8px 14px;
    border: 1.5px dashed var(--rc-blue-line);
    border-radius: 10px;
    background: transparent;
    color: var(--rc-blue);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.rc-summary__add:hover {
    background: var(--rc-blue-soft);
    border-color: var(--rc-blue);
}

.rc-summary__footer {
    flex: 0 0 auto;
    margin-top: auto;
}

.rc-net {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    background: linear-gradient(135deg, var(--rc-blue) 0%, var(--rc-blue-dark) 100%);
    color: #fff;
}

.rc-net__copy {
    min-width: 0;
}

.rc-net__copy strong {
    display: block;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: #fff;
}

.rc-net__copy small {
    display: none;
}

.rc-net b {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
    white-space: nowrap;
}

.rc-match {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--rc-amber-soft);
    color: var(--rc-amber-ink);
}

.rc-match--ok {
    background: #ecfdf3;
    color: #166534;
}

.rc-match--warn {
    background: var(--rc-amber-soft);
    color: var(--rc-amber-ink);
}

.rc-match__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
}

.rc-match--ok .rc-match__icon {
    background: #dcfce7;
    color: #16a34a;
}

.rc-match strong {
    display: block;
    font-size: 11px;
    font-weight: 700;
}

.rc-match small {
    display: block;
    margin-top: 1px;
    font-size: 11px;
    opacity: 0.9;
}

.rc-aside-panel > .rc-summary {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.rc-aside-panel > .rc-progress {
    flex: 0 0 auto;
}

.rc-progress {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--rc-blue-line);
    border-radius: 12px;
    background: var(--rc-blue-soft);
}

.rc-progress--ready {
    border-color: var(--rc-green-line);
    background: var(--rc-green-soft);
}

.rc-progress__top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.rc-progress__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 9px;
    background: #fff;
    color: var(--rc-blue);
}

.rc-progress--ready .rc-progress__icon {
    color: var(--rc-green-dark);
}

.rc-progress__copy {
    flex: 1;
    min-width: 0;
}

.rc-progress__copy strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: var(--rc-blue-dark);
}

.rc-progress--ready .rc-progress__copy strong {
    color: var(--rc-green-ink);
}

.rc-progress__copy small {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--rc-text);
}

.rc-progress__meter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.rc-progress__svg {
    display: block;
    width: 100%;
    height: 8px;
    overflow: visible;
}

.rc-progress__track {
    fill: rgba(255, 255, 255, 0.85);
}

.rc-progress__fill {
    transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.rc-progress__shine {
    pointer-events: none;
}

.rc-progress__pct {
    flex: 0 0 auto;
    min-width: 2.4em;
    color: var(--rc-blue-dark);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.rc-progress--ready .rc-progress__pct {
    color: var(--rc-green-ink);
}

/* --------------------------------------------------------------------------
   Mobile summary sheet — hidden on desktop
   -------------------------------------------------------------------------- */

.rc-sheet {
    display: none;
}

/* --------------------------------------------------------------------------
   Footer — matches legacy wizard (Cancel / Next) bar
   -------------------------------------------------------------------------- */

.rc-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    width: 100%;
    flex-wrap: wrap;
    padding: 0.5rem 1.5rem;
    background: #f5f5f5;
    box-sizing: border-box;
}

.rc-footer__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    flex-wrap: wrap;
}

.rc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 100px;
    min-height: 38px;
    margin: 0 0.2rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-transform: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.rc-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.rc-btn--ghost {
    background: #fff;
    border-color: #e9ecef;
    color: #495057;
}

.rc-btn--ghost:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #343a40;
}

.rc-btn--primary {
    background: var(--primary, var(--rc-blue));
    border-color: var(--primary, var(--rc-blue));
    color: #fff;
}

.rc-btn--primary:hover:not(:disabled) {
    background: var(--rc-blue-dark);
    border-color: var(--rc-blue-dark);
    color: #fff;
}

.rc-btn--success {
    background: var(--rc-green);
    border-color: var(--rc-green);
    color: #fff;
}

.rc-btn--success:hover:not(:disabled) {
    background: var(--rc-green-dark);
    border-color: var(--rc-green-dark);
}

/* --------------------------------------------------------------------------
   Review dialog
   -------------------------------------------------------------------------- */

.rc-review {
    display: grid;
    gap: 14px;
}

.rc-review__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.rc-review__cell {
    padding: 10px 12px;
    border: 1px solid var(--rc-line);
    border-radius: 10px;
    background: var(--rc-surface-alt);
}

.rc-review__cell small {
    display: block;
    font-size: 11px;
    color: var(--rc-muted);
}

.rc-review__cell strong {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    color: var(--rc-ink);
    word-break: break-word;
}

.rc-review__lines {
    display: grid;
    gap: 6px;
}

.rc-review__line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--rc-line-soft);
    font-size: 12px;
    color: var(--rc-text);
}

.rc-review__line strong {
    color: var(--rc-ink);
}

/* --------------------------------------------------------------------------
   Success state
   -------------------------------------------------------------------------- */

.rc-success {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 42px 20px;
    text-align: center;
}

.rc-success strong {
    font-size: 1.05rem;
    color: var(--rc-ink);
}

.rc-success small {
    font-size: 13px;
    color: var(--rc-muted);
}

/* --------------------------------------------------------------------------
   Create mode panel
   -------------------------------------------------------------------------- */

.rc-mode-panel {
    display: grid;
    gap: 8px;
    min-width: 268px;
}

.rc-mode-panel__title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--rc-faint);
}

.rc-mode {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--rc-line);
    border-radius: 12px;
    background: var(--rc-surface);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.rc-mode:hover {
    border-color: var(--rc-blue-line);
    background: var(--rc-blue-soft);
}

.rc-mode__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 10px;
    background: var(--rc-surface-alt);
    color: var(--rc-muted);
}

.rc-mode--new .rc-mode__icon {
    background: var(--rc-blue-tint);
    color: var(--rc-blue);
}

.rc-mode__text {
    flex: 1;
    min-width: 0;
}

.rc-mode__text strong {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--rc-ink);
}

.rc-mode__legacy {
    font-weight: 600;
    color: #ca8a04;
}

.rc-mode__text small {
    display: block;
    margin-top: 1px;
    font-size: 11px;
    color: var(--rc-muted);
}

.rc-mode__tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--rc-green-soft);
    color: var(--rc-green-ink);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   PrimeVue overrides scoped to this feature
   -------------------------------------------------------------------------- */

.request-create-modal .p-dropdown,
.request-create-modal .p-inputnumber,
.request-create-modal .p-calendar {
    width: 100%;
}

.request-create-modal .p-dropdown .p-dropdown-label,
.request-create-modal .p-dropdown .p-inputtext {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Animation
   -------------------------------------------------------------------------- */

@keyframes rc-reveal {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rc-draw {
    from {
        stroke-dashoffset: 32;
    }
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes rc-circle {
    from {
        stroke-dashoffset: 60;
    }
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes rc-ring {
    0% {
        transform: scale(0.9);
        opacity: 0.55;
    }
    70% {
        transform: scale(1.45);
        opacity: 0;
    }
    100% {
        transform: scale(1.45);
        opacity: 0;
    }
}

@keyframes rc-pop {
    0% {
        transform: scale(0.6);
    }
    60% {
        transform: scale(1.12);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes rc-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

.rc-anim-draw {
    stroke-dasharray: 32;
    animation: rc-draw 0.45s ease-out forwards;
}

.rc-anim-circle {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: rc-circle 0.4s ease-out forwards;
}

.rc-anim-pop {
    animation: rc-pop 0.32s ease-out;
    transform-origin: center;
}

.rc-anim-ring {
    transform-origin: center;
    animation: rc-ring 1.9s ease-out infinite;
}

.rc-anim-float {
    animation: rc-float 2.6s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Responsive — tablet and below
   -------------------------------------------------------------------------- */

@media (max-width: 980px) {
    /* Fixed horizontal padding so the sticky sheet can bleed to the edges. */
    .request-create-modal.p-dialog > .p-dialog-content {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-bottom: 0 !important;
    }

    .rc-layout {
        display: block;
    }

    .rc-main {
        padding-bottom: 8px;
    }

    /* Desktop sidebar is replaced by the sticky bottom sheet. */
    .rc-aside {
        display: none;
    }

    .rc-sheet {
        display: block;
        position: sticky;
        bottom: 0;
        z-index: 5;
        margin: 0 -1rem;
        border-top: 1px solid var(--rc-line);
        border-radius: 16px 16px 0 0;
        background: var(--rc-surface);
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.12);
    }

    .rc-sheet__bar {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 12px 16px;
        border: 0;
        border-radius: 16px 16px 0 0;
        background: linear-gradient(135deg, var(--rc-blue) 0%, var(--rc-blue-dark) 100%);
        color: #fff;
        text-align: left;
        cursor: pointer;
    }

    .rc-sheet__bar small {
        display: block;
        font-size: 11px;
        color: rgba(239, 246, 255, 0.82);
    }

    .rc-sheet__bar strong {
        display: block;
        font-size: 1.05rem;
        font-weight: 800;
    }

    .rc-sheet__flag {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        margin-left: auto;
        padding: 4px 9px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.12);
        font-size: 11px;
        font-weight: 700;
    }

    .rc-sheet__flag--ok {
        background: rgba(22, 163, 74, 0.28);
    }

    .rc-sheet__panel {
        max-height: 46vh;
        overflow-y: auto;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    }

    .rc-sheet__panel .rc-aside-panel {
        max-height: none;
        overflow: visible;
    }

    .rc-sheet__panel .rc-aside-panel > .rc-summary {
        max-height: none;
        overflow: visible;
    }

    .rc-sheet__panel .rc-summary {
        border: 0;
        border-radius: 0;
    }

    .rc-sheet__panel .rc-summary__head {
        padding-left: 0;
        padding-right: 0;
    }

    .rc-sheet__panel .rc-summary__rows {
        padding-left: 0;
        padding-right: 0;
    }

    .rc-sheet__panel .rc-net {
        display: none;
    }

    .rc-sheet__panel .rc-progress {
        margin-top: 8px;
    }

    .rc-footer {
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    }

    .request-create-modal.p-dialog > .p-dialog-footer .rc-footer,
    .rc-line-dialog .p-dialog-footer .rc-footer,
    .rc-new-item-dialog .p-dialog-footer .rc-footer {
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    }
}

/* --------------------------------------------------------------------------
   Responsive — phone
   -------------------------------------------------------------------------- */

@media (max-width: 720px) {
    .rc-grid,
    .rc-options,
    .rc-upload-grid,
    .rc-attach__grid,
    .rc-review__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .rc-picker__toolbar {
        grid-template-columns: minmax(0, 1fr);
    }

    .rc-picker__new-btn {
        width: 100%;
    }

    .rc-picker__results--grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .rc-section__head {
        gap: 10px;
        padding: 12px 14px;
    }

    .rc-section__body {
        padding: 0 14px 14px;
    }

    .rc-section__sub {
        display: none;
    }

    .rc-line__head {
        display: none;
    }

    .rc-line {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.7fr) minmax(0, 0.95fr) minmax(0, 0.9fr) 28px;
        grid-template-areas:
            "name name name name remove"
            "unit qty price total free";
        align-items: end;
        column-gap: 4px;
        row-gap: 8px;
        padding: 8px 8px 10px;
    }

    .rc-line__caption {
        display: block;
        margin-bottom: 2px;
        font-size: 9px;
        letter-spacing: 0.02em;
    }

    .rc-line__cell--name {
        grid-area: name;
        min-width: 0;
        padding-right: 2px;
    }

    .rc-line__name {
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        font-size: 11px;
        line-height: 1.3;
        word-break: break-word;
    }

    .rc-line__cell--unit {
        grid-area: unit;
        min-width: 0;
    }

    .rc-line__cell--qty {
        grid-area: qty;
        min-width: 0;
    }

    .rc-line__cell--price {
        grid-area: price;
        min-width: 0;
    }

    .rc-line__cell--total {
        grid-area: total;
        min-width: 0;
    }

    .rc-line__cell--free {
        grid-area: free;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        gap: 0;
        min-width: 0;
        padding-bottom: 4px;
    }

    .rc-line__cell--free .rc-line__caption {
        margin-bottom: 2px;
        text-align: center;
    }

    .rc-line .form-control,
    .rc-line .p-inputtext,
    .rc-line .p-dropdown,
    .rc-line .p-inputnumber,
    .rc-line .p-inputnumber-input {
        min-height: 28px !important;
        height: 28px !important;
    }

    .rc-line .p-dropdown .p-dropdown-label,
    .rc-line .p-dropdown .p-inputtext,
    .rc-line .p-inputnumber-input {
        font-size: 11px;
        padding-left: 4px !important;
        padding-right: 4px !important;
        line-height: 28px;
    }

    .rc-line .p-dropdown .p-dropdown-trigger {
        width: 1.6rem;
    }

    .rc-line__free-label {
        min-height: 28px;
        font-size: 10px;
    }

    .rc-line__total {
        display: flex;
        align-items: center;
        min-height: 28px;
        text-align: left;
        font-size: 11px;
        font-weight: 700;
        white-space: nowrap;
    }

    .rc-line__remove {
        grid-area: remove;
        justify-self: end;
        align-self: start;
        width: 24px;
        height: 24px;
    }

    .rc-term {
        grid-template-columns: minmax(0, 1fr);
    }

    .rc-term__index {
        margin-bottom: 0;
    }

    .rc-footer {
        flex-direction: column;
        align-items: stretch;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    }

    .request-create-modal.p-dialog > .p-dialog-footer .rc-footer,
    .rc-line-dialog .p-dialog-footer .rc-footer,
    .rc-new-item-dialog .p-dialog-footer .rc-footer {
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    }

    .rc-footer__actions {
        order: 1;
        margin-left: 0;
    }

    .rc-footer__actions .rc-btn {
        flex: 1;
        min-height: 44px;
    }

    .rc-mode-panel {
        min-width: 0;
    }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .rc-section__body,
    .rc-anim-draw,
    .rc-anim-circle,
    .rc-anim-pop,
    .rc-anim-ring,
    .rc-anim-float {
        animation: none !important;
    }

    .rc-anim-draw,
    .rc-anim-circle {
        stroke-dashoffset: 0;
    }

    .rc-progress__fill {
        transition: none;
    }

    .rc-progress__shine animate {
        display: none;
    }

    .rc-section__chevron {
        transition: none;
    }
}
